29 Commits

Author SHA1 Message Date
928e7f7418 prototype flotilla loader 2025-05-31 20:39:07 -07:00
2439fda068 ship prototype tweaks 2025-05-31 20:38:59 -07:00
d13290f438 placeholder flotilla ships 2025-05-31 19:03:38 -07:00
e3a2810f0a Prototype a flotilla template. 2025-05-25 21:03:51 -07:00
3764063b20 abandon "offset" sprites, use "row tier" sprites 2025-05-25 20:49:27 -07:00
90f6df2922 flotilla notes and sprites 2025-05-25 19:11:44 -07:00
b7c3e6ee92 adjust menu renderer 2025-05-03 17:26:48 -07:00
c91e5f4bd1 shorten RATE message
not enough room to describe "fractions add up" -- maybe I can just fit
in the "remainder" to hint that it will be considered in future
upgrades?
2025-05-03 17:19:33 -07:00
ea2ddadb15 oops, method call syntax is special 2025-05-03 17:12:20 -07:00
9333c03bf3 add main gun rate upgrade to ship pool 2025-05-03 17:11:47 -07:00
1b45bd3dc3 fix rate formatting 2025-05-03 17:11:35 -07:00
71a7351d77 oops, miscalculated box width 2025-05-03 17:04:29 -07:00
80bb848468 options work better when I return them 2025-05-03 16:51:59 -07:00
b227844d12 Restyle ship stat upgrades. 2025-05-03 16:48:18 -07:00
ce14d03669 offer gun upgrades 2025-05-03 16:38:39 -07:00
ccd2c64103 update gun pick description style 2025-05-03 16:38:26 -07:00
e5b8a30cb6 cooldown reduction prototype
I decided to keep cooldown in the same unit as the frame counter,
because the extra math when calculating an upgrade is going to happen
much less frequently than actual cooldown checks and calculations, so
leaving the upgrade logic as the less efficient path seems like the
more appropriate choice.
2025-05-03 16:28:54 -07:00
7ed305d2d9 Ammo quantity upgrade prototype
Not yet tested. Will crash until I also get rate_upgrade_opt up.
2025-05-03 16:06:16 -07:00
288b7f64c8 tinker with blip colors, go back to level+1
with the current testing level, level + 1 is necessary to comfortably
get a weapon before the Wall O' Block shows up
2025-01-26 22:32:17 -08:00
aea2a8c481 red blip when shield exhausted 2025-01-26 22:27:14 -08:00
9b24f10c23 inline ow, simplify blip, no shield piercing
* any amount of shielding prevents all HP damage
* when shields are sent to 0, orange blip
* all blips are 3 frames

considering a "shimmy" animation for start of shield recovery. maybe later
2025-01-26 22:25:06 -08:00
511c18f90e remove offset when choosing category of upgrade 2025-01-26 22:15:03 -08:00
142810ee2d scatter xp drops more 2025-01-26 22:11:02 -08:00
50beae1852 don't attract xp when dead 2025-01-26 22:08:16 -08:00
9c95fc1784 suck! suck! suck! suck! suck! suck! suck! suck! 2025-01-26 21:00:39 -08:00
cb2d24c9d0 thrust performance is now also an option 2025-01-26 20:38:31 -08:00
67603f8496 start of normal ship upgrades
todo: thrust upgrade
2025-01-26 20:21:06 -08:00
2cebea663f make stat modifications actually work 2025-01-26 13:14:59 -08:00
eed7b6af87 unique bullet base instances
peel off new copies of ammo when using a new gun so we can upgrade it without screwing up the base stats
2025-01-26 13:07:43 -08:00

View File

@ -126,8 +126,7 @@ end
function _init() function _init()
mode = game_mode mode = game_mode
init_blip_pals() init_blip_pals()
wipe_level() wipe_game() -- redundant?
primary_ship.main_gun = zap_gun_p.new() -- redundant?
load_level(example_level_csv) load_level(example_level_csv)
game_state = game game_state = game
pal(2,129) pal(2,129)
@ -157,7 +156,7 @@ function init_hpcols()
hpcols = hpcols_lut[min(primary_ship.maxhp,6)] hpcols = hpcols_lut[min(primary_ship.maxhp,6)]
end end
function wipe_level() function wipe_game()
xpwhoosh = nil xpwhoosh = nil
primary_ship = player.new() primary_ship = player.new()
init_hpcols() init_hpcols()
@ -170,6 +169,8 @@ function wipe_level()
intangibles_bg = linked_list.new() intangibles_bg = linked_list.new()
events = linked_list.new() events = linked_list.new()
new_events = linked_list.new() new_events = linked_list.new()
primary_ship.main_gun = zap_gun_p.new()
primary_ship.main_gun:peel()
end end
function _update60() function _update60()
@ -465,6 +466,14 @@ end
-->8 -->8
--ship behavior --ship behavior
-- generic full sprite hurtbox
box8 = {
x_off = 0,
y_off = 1,
width = 8,
height = 8
}
scrollrate = 0.25 --in px/frame scrollrate = 0.25 --in px/frame
ship_m = mknew{ ship_m = mknew{
@ -502,14 +511,14 @@ function ship_m:die()
-- overage XP, min 100 -- overage XP, min 100
spawn_xp_at(cx, cy, 0, xp-0x0.018f) spawn_xp_at(cx, cy, 0, xp-0x0.018f)
xp = 0x0.018f -- dec 399 xp = 0x0.018f -- dec 399
z += 1 z += 2
end end
-- 100, 25, 5, 1 -- 100, 25, 5, 1
for gsz in all{0x0.0064, 0x0.0019, 0x0.0005, 0x0.0001} do for gsz in all{0x0.0064, 0x0.0019, 0x0.0005, 0x0.0001} do
while xp >= gsz do while xp >= gsz do
spawn_xp_at(cx, cy, z, gsz) spawn_xp_at(cx, cy, z, gsz)
xp -= gsz xp -= gsz
z += 1 z += 2
end end
end end
end end
@ -611,30 +620,25 @@ end
function ship_m:hitsomething(dmg) function ship_m:hitsomething(dmg)
if (dmg <= 0) return false if (dmg <= 0) return false
self.shield_refresh_ready = lframe + self.shieldpenalty self.shield_refresh_ready = lframe + self.shieldpenalty
if self.shield >= dmg then if self.shield > 0 then
self.shield -= dmg self.shield -= dmg
self:ow(true) if self.shield > 0 then
blip(self,12)
else
self.shield = 0
blip(self,7)
end
return false return false
end end
dmg -= self.shield
self.shield = 0
self.hp -= dmg self.hp -= dmg
if self.hp < 0 then if self.hp < 0 then
self:die() self:die()
return true return true
end end
self:ow(false) blip(self, self.friendly and 8 or 7)
return false return false
end end
function ship_m:ow(shielded)
if (shielded) then
blip(self,12,3)
return
end
blip(self, 7, 3)
end
function ship_m:refresh_shield() function ship_m:refresh_shield()
if (self.shield >= self.maxshield) return if (self.shield >= self.maxshield) return
if (lframe < self.shield_refresh_ready) return if (lframe < self.shield_refresh_ready) return
@ -680,7 +684,13 @@ bullet_base = mknew{ }
gun_base = mknew{ gun_base = mknew{
shoot_ready = -32768, shoot_ready = -32768,
icon = 20 icon = 20,
ammobonus = 1,
-- fractional frames of
-- cooldown reduction from
-- upgrades, not yet applied
cd_remainder = 0,
} }
-- gun_base subtypes are -- gun_base subtypes are
@ -689,6 +699,7 @@ gun_base = mknew{
-- themselves to the player -- themselves to the player
function gun_base:action() function gun_base:action()
local item = self.new() local item = self.new()
item:peel()
item.ammo = item.maxammo item.ammo = item.maxammo
if not primary_ship.special_guns then if not primary_ship.special_guns then
primary_ship.special_guns = {item} primary_ship.special_guns = {item}
@ -697,6 +708,81 @@ function gun_base:action()
end end
end end
-- make shot type unique so
-- stat modifications do not
-- damage base data
function gun_base:peel()
self.munition = mknew(self.munition.new())
end
-- default firing behavior:
-- single shot
function gun_base:actually_shoot(x, y)
self.munition.new{}:spawn_at(x, y)
end
-- upgrade
function gun_base:small_upgrade_opts()
local ret = {
self:ammo_upgrade_opt(),
self:rate_upgrade_opt(),
}
local s = self.special_upgrade_opt
if (s) add(ret, s(self))
return ret
end
function gun_base:ammo_upgrade_opt()
local a=self.maxammo
local x=a\10+self.ammobonus
return {
icon=self.icon,
hdr=self.hdr,
body=[[--------AMMO
more shots
before you
run out.
is: ]]..tostr(a)..[[
add: ]]..tostr(x)..[[
----------
total: ]]..tostr(a+x),
action=function()
self.maxammo+=x
self.ammo+=x
end,
}
end
function gun_base:rate_upgrade_opt()
local c=self.cooldown<<16
local rawnewc=0.85*(c-self.cd_remainder)
local newc=ceil(rawnewc)
return {
icon=self.icon,
hdr=self.hdr,
body=[[--------RATE
reduce delay
between each
shot when
firing.
is: ]]..tostr(c)..[[f
minus: ]]..tostr(c-newc)..[[f
----------
total: ]]..tostr(newc)..[[f
remainder:
]]..sub(tostr(newc-rawnewc),0,5),
action=function()
self.cooldown=newc>>16
self.cd_remainder=newc-rawnewc
end,
}
end
function bullet_base:hitship(_) function bullet_base:hitship(_)
self:die() self:die()
return true return true
@ -720,14 +806,6 @@ function bullet_base:draw()
spr(self.sprite, self.x, self.y, self.width, self.height) spr(self.sprite, self.x, self.y, self.width, self.height)
end end
-- An `actually_shoot` factory
-- for trivial guns
function spawn_one(t)
return function(gun, x, y)
t.new{}:spawn_at(x, y)
end
end
function bullet_base:spawn_at(x, y) function bullet_base:spawn_at(x, y)
self.x = x - self.x_off self.x = x - self.x_off
self.y = y - self.y_off self.y = y - self.y_off
@ -780,11 +858,12 @@ zap_p = mknew(zap_e.new{
zap_gun_e = mknew(gun_base.new{ zap_gun_e = mknew(gun_base.new{
cooldown = 0x0.0020, -- frames between shots cooldown = 0x0.0020, -- frames between shots
actually_shoot = spawn_one(zap_e), munition = zap_e,
}) })
zap_gun_p = mknew(zap_gun_e.new{ zap_gun_p = mknew(zap_gun_e.new{
actually_shoot = spawn_one(zap_p), icon = 19,
munition = zap_p,
hdr = "mAIN gUN", hdr = "mAIN gUN",
}) })
@ -843,12 +922,14 @@ blast_gun = mknew(gun_base.new{
cooldown = 0x0.0078, -- 120 frames between shots cooldown = 0x0.0078, -- 120 frames between shots
ammo = 5, ammo = 5,
maxammo = 5, maxammo = 5,
actually_shoot = spawn_one(blast), munition = blast,
hdr = "bLASTER", hdr = "bLASTER",
body= [[plasma orb body= [[---------GUN
plasma orb
cuts through cuts through
enemies. enemies.
slow. slow.
ammo: 5 ammo: 5
rate: 1/2sec rate: 1/2sec
@ -917,9 +998,11 @@ protron_gun_p = mknew(protron_gun_e.new{
maxammo = 20, maxammo = 20,
cooldown = 0x0.0018, cooldown = 0x0.0018,
hdr = "pROTRON", hdr = "pROTRON",
body = [[spray shots body = [[---------GUN
in a dense
arc. spray shots
in a dense
arc.
ammo: 20 ammo: 20
rate: 2/sec rate: 2/sec
@ -978,9 +1061,10 @@ vulcan_gun_p = mknew(vulcan_gun_e.new{
munition=vulcan_p, munition=vulcan_p,
maxammo = 100, maxammo = 100,
hdr = "vULCAN", hdr = "vULCAN",
body = [[rapid fire body = [[---------GUN
in a v
shape. rapidly fire
in a v.
ammo: 100 ammo: 100
rate: 20/sec rate: 20/sec
@ -995,6 +1079,7 @@ firespark = split"9, 8, 2, 5, 1"
smokespark = split"13, 13, 5, 5" smokespark = split"13, 13, 5, 5"
player = mknew(ship_m.new{ player = mknew(ship_m.new{
friendly=true,
--shape --shape
sprite = 1, --index of ship sprite sprite = 1, --index of ship sprite
size = 1, --all ships are square; how many 8x8 sprites? size = 1, --all ships are square; how many 8x8 sprites?
@ -1019,6 +1104,7 @@ player = mknew(ship_m.new{
xptarget = 0x0.0004, xptarget = 0x0.0004,
last_xp_frame = 0, last_xp_frame = 0,
level = 1, level = 1,
magnet = 10,
-- gun -- gun
main_gun = nil, -- assign at spawn time main_gun = nil, -- assign at spawn time
@ -1031,10 +1117,10 @@ player = mknew(ship_m.new{
y=96, y=96,
xmomentum = 0, xmomentum = 0,
ymomentum = 0, ymomentum = 0,
maxspd = 2.5, -- momentum cap maxspd = 1.5, -- momentum cap
thrust = 0.25, -- momentum added from button thrust = 0.1875, -- momentum added from button
ymin = 0, ymax = 120, -- stay on screen ymin = 0, ymax = 120, -- stay on screen
drag = 0.125, -- momentum lost per frame drag = 0.0625, -- momentum lost per frame
slip = false, -- does not slide down screen slip = false, -- does not slide down screen
act = function(self) -- fetch buttons act = function(self) -- fetch buttons
local b,th = btn(),self.thrust local b,th = btn(),self.thrust
@ -1061,6 +1147,110 @@ player = mknew(ship_m.new{
end, end,
}) })
function player:small_upgrade_opts()
local cdr, pr = (self.shieldcooldown - 0x0.000f) / 8, (self.shieldpenalty - 0x0.003c) / 9
if (cdr == 0 and self.shieldcooldown > 0x0.000f) cdr = 0x0.0001
if (pr == 0 and self.shieldpenalty > 0x0.003c) pr = 0x0.0001
local ret = {{
icon=53,
hdr="hull",
body=[[--------SHIP
survive more
unshielded
hits.
+2 hp]],
action=function()
self.maxhp += 2
self.hp += 2
end,
},{
icon=52,
hdr="capacity",
body=[[------SHIELD
shield can
absorb more
hits before
recharging.
+1 hp]],
action=function()
self.maxshield += 1
self.shield += 1
end,
},{
icon=1,
hdr="thrusters",
body=[[--------SHIP
move faster,
steer more
sharply.]],
action=function()
--maxspd thrust drag
self.maxspd += 0.5
self.thrust += 0.0625
self.drag += 0.03125
end,
},{
icon=20,
hdr="magnet",
body=[[--------SHIP
pick up xp
from further
away.]],
action=function ()
self.magnet += 2
end,
},
self.main_gun:rate_upgrade_opt(),
}
if cdr > 0 then
add(ret, {
icon = 6,
hdr = "recharge",
body=[[------SHIELD
shield will
recharge at
a faster
pace.
]] .. tostr(ceil(100 * cdr / self.shieldcooldown)) .. "% faster",
action = function()
self.shieldcooldown -= cdr
end
})
end
if pr > 0 then
add(ret, {
icon = 6,
hdr = "recovery",
body=[[------SHIELD
reduce the
delay after
a hit before
shield will
start to
recharge.
]] .. tostr(ceil(100 * pr / self.shieldpenalty)) .. "% shorter",
action = function()
self.shieldpenalty -= pr
end
})
end
return ret
end
frownie = mknew(ship_m.new{ frownie = mknew(ship_m.new{
--shape --shape
sprite = 3, --index of ship sprite sprite = 3, --index of ship sprite
@ -1165,7 +1355,6 @@ chasey = mknew(ship_m.new{
end end
}) })
-- todo: use constraints
function chasey:act() function chasey:act()
self.xmin = max(primary_ship.x-8, 0) self.xmin = max(primary_ship.x-8, 0)
self.xmax = min(primary_ship.x + 8, 112 - 8*self.size) self.xmax = min(primary_ship.x + 8, 112 - 8*self.size)
@ -1203,6 +1392,53 @@ xl_chasey=mknew(chasey.new{
end, end,
}) })
-- flotilla ships
ship_f = mknew(ship_m.new{
-- sprite required
size = 1,
hurt = box8,
-- no sparks
hp = 0.5,
xp = 0x0.0001,
maxspd = 3,
thrust = 0.1,
drag = 0.05,
slip = false,
act = function(self)
local wx,wy=self.want_x,self.want_y
self.xmin,self.xmax,self.ymin,self.ymax = wx,wx,wy,wy
return 0,0,false,false
end,
})
ship_mook = mknew(ship_f.new{
sprite=103
})
ship_defender = mknew(ship_f.new{
sprite=105,
hp = 2.5,
xp = 0x0.0003,
})
ship_turret = mknew(ship_f.new{
sprite=106,
xp = 0x0.0002,
})
ship_skirmisher = mknew(ship_f.new{
sprite=107,
xp = 0x0.0004,
spark = smokespark,
sparkodds = 4,
})
function rnd_spawn_loc()
local x,y = flr(rnd(304)), flr(rnd(32))
if (x<184) return x-40,-y-8
if (x<244) return -y-8,x-184
return 112+y, x-244
end
-->8 -->8
-- collisions -- collisions
@ -1267,6 +1503,108 @@ function collider:get_collisions(item)
end end
return found return found
end end
-->8
-- flotillas
-- a template for a wave, read
-- from the map. each ship can
-- alternate between "attack"
-- and "formation" modes, like
-- galaxian or galaga. ships
-- with different roles have
-- different rules for becoming
-- aggressive, but aggression
-- ramps up during the wave.
-- flotilla placeholders are
-- defined by sprite flags.
-- see obsidian vault for
-- full docs.
flotilla = mknew{
use_var = 0x0001,
opt_odds = split"0.5,0.5,0.5,0.5",
init=function(this)
this.ship_bases={
[0]=mknew(ship_mook.new{ship_t=0}),
[1]=mknew(ship_mook.new{ship_t=1}),
[4]=mknew(ship_defender.new{ship_t=4}),
[5]=mknew(ship_defender.new{ship_t=5}),
[8]=mknew(ship_turret.new{ship_t=8}),
[9]=mknew(ship_turret.new{ship_t=9}),
[12]=mknew(ship_skirmisher.new{ship_t=12}),
[13]=mknew(ship_skirmisher.new{ship_t=13}),
}
end,
}
function flotilla:load(ulc_cx, ulc_cy, lvl)
local rows,cy,uv,counts={},ulc_cy,self.use_var+0xc840,{
[0]=0,
[1]=0,
[4]=0,
[5]=0,
[8]=0,
[9]=0,
[12]=0,
[13]=0,
}
repeat
local row,cx,opt,f = {},ulc_cx,{},0
for i,v in ipairs(self.opt_odds) do
opt[i*4-4]=rnd()<v
end
repeat
f=fget(mget(cx, cy))
-- bits 0x03: control mark or ship?
local mode = f&0x03
if mode==2 then
-- bits 0x0c: ship class
local ship_t = f&0x0c
-- bit 0x20: optional?
if f&0x20 == 0 or opt[ship_t] then
-- bit 0x10: alternate ship?
-- increment ship id if
-- alternate is requested
-- and we allow alternates
-- for this type of ship
ship_t+=(uv>>ship_t&0x1)&(f&0x10>>4)
add(row, self.ship_bases[ship_t]:new{column=cx-ulc_cx})
end
end
until mode==1
-- mode 1: end of line control mark
-- bits 0x18: what size flotilla is this row used for?
if (f&0x18)>>3 <= lvl then
-- keep the row; count it
for s in all(row) do
counts[s.ship_t] += 1
end
add(rows, row)
end
-- control mark bit 0x04: end of flotilla
until f&0x04 == 1
self.rows=rows
self:statisfy(counts)
end
function flotilla:statisfy(counts)
-- TODO: now that we know how
-- many ships of each kind
-- exist, build ships to match
-- difficulty target
--
-- no difficulty model is yet
-- implemented, though, so
-- just use base ships only
-- for this prototype
end
function flotilla:update()
-- TODO: assign new want_x, want_y to everyone who isn't dead
end
-->8 -->8
-- level and event system -- level and event system
@ -1471,6 +1809,18 @@ function multi(times, interval, fnm, ...)
end} end}
end end
function demo_spawn_f(ttn)
local spx,spy=rnd_spawn_loc()
local s = _ENV[ttn].new{
x = spx,
y = spy,
want_x = 8 + rnd(96),
want_y = 8 + rnd(64)
}
eships:push_back(s)
return s
end
-- then convert sample_level to csv. -- then convert sample_level to csv.
-- spawn_spec_gun_at and spawn_main_gun_at will need parsed forms. -- spawn_spec_gun_at and spawn_main_gun_at will need parsed forms.
-- the boss also needs to be reachable, but one-off is fine. -- the boss also needs to be reachable, but one-off is fine.
@ -1478,10 +1828,14 @@ end
-- where offset,eol is a special case. -- where offset,eol is a special case.
example_level_csv=[[1,spawn_frownie example_level_csv=[[1,spawn_frownie
60,spawn_vulcan_chasey 20,demo_spawn_f,ship_mook
61,spawn_blocky 25,demo_spawn_f,ship_defender
85,spawn_spewy 30,demo_spawn_f,ship_turret
115,spawn_spewy 35,demo_spawn_f,ship_skirmisher
80,spawn_vulcan_chasey
81,spawn_blocky
100,spawn_spewy
125,spawn_spewy
130,spawn_frownie 130,spawn_frownie
145,spawn_frownie 145,spawn_frownie
180,spawn_spewy 180,spawn_spewy
@ -1536,10 +1890,10 @@ function init_blip_pals()
end end
end end
function blip(obj, col, frames) function blip(obj, col)
obj.fx_pal = blip_pals[col] obj.fx_pal = blip_pals[col]
if (obj.___fx_pal_event) obj.___fx_pal_event:abort() if (obj.___fx_pal_event) obj.___fx_pal_event:abort()
events:push_back(blip_fx.new{frames=frames, obj=obj}) events:push_back(blip_fx.new{frames=3, obj=obj})
end end
bossspark = split"7,7,10,10,9,9,9,8,8,8,2,2,5,5" bossspark = split"7,7,10,10,9,9,9,8,8,8,2,2,5,5"
@ -1622,11 +1976,22 @@ function xp_gem:draw()
) )
end end
function xp_gem:move()
if not primary_ship.dead and abs(self.x + 1 - primary_ship.x - primary_ship.hurt.x_off) <= primary_ship.magnet and abs(self.y + 1 - primary_ship.y - primary_ship.hurt.y_off) <= primary_ship.magnet then
if (self.x < primary_ship.x + 3) self.x += 1
if (self.x > primary_ship.x + 5) self.x -= 1
if (self.y < primary_ship.y + 3) self.y += 1
if (self.y > primary_ship.y + 5) self.y -= 1
end
return bullet_base.move(self)
end
-- todo: "magnetic" behavior -- todo: "magnetic" behavior
-- when near player ship -- when near player ship
function xp_gem:hitship(ship) function xp_gem:hitship(ship)
if (ship ~= primary_ship) return false if (ship ~= primary_ship or primary_ship.dead) return false
primary_ship.xp += self.val primary_ship.xp += self.val
primary_ship.last_xp_frame = lframe primary_ship.last_xp_frame = lframe
return true return true
@ -1698,18 +2063,13 @@ end
-- ordinary upgrades -- ordinary upgrades
function small_opts() function small_opts()
return {{ -- todo: include gun opts
icon=1, if(not primary_ship.special_guns) return pick(primary_ship:small_upgrade_opts(), 2)
hdr="placeholder", local opts = {rnd(primary_ship:small_upgrade_opts())}
body="placeholder", for g in all(primary_ship.special_guns) do
action = function() end, add(opts, rnd(g:small_upgrade_opts()))
}, end
{ return pick(opts, 2)
icon=1,
hdr="placeholder",
body="placeholder",
action = function() end,
}}
end end
-->8 -->8
@ -1718,7 +2078,7 @@ end
rearm_mode = mknew{ rearm_mode = mknew{
sel=1, sel=1,
bfm=1, bfm=1,
crt_frm = 1, crt_frm = 0,
pos=-1, pos=-1,
init=function(this) init=function(this)
poke(0x5f5c, 255) --no btnp repeat poke(0x5f5c, 255) --no btnp repeat
@ -1733,7 +2093,7 @@ function rearm_mode:glow_box(x0, y0, x1, y1, c, cf)
i -= 1 i -= 1
rect(x0+i,y0+i,x1-i,y1-i,v) rect(x0+i,y0+i,x1-i,y1-i,v)
end end
fillp(crt[self.crt_frm&0xff]) fillp(crt[1+(self.crt_frm&7)])
rectfill(x0+4, y0+4, x1-4, y1-4, cf) rectfill(x0+4, y0+4, x1-4, y1-4, cf)
fillp() fillp()
end end
@ -1765,7 +2125,7 @@ end
function rearm_mode:draw_option(id) function rearm_mode:draw_option(id)
local rec = self.options[id] local rec = self.options[id]
self:glow_box(0,0,55,100,self:frame_col(self.sel == id),1) self:glow_box(0,0,55,101,self:frame_col(self.sel == id),1)
spr(rec.icon,5, 5) spr(rec.icon,5, 5)
print(rec.hdr, 13, 8, 7) print(rec.hdr, 13, 8, 7)
print(rec.body, 5, 15, 6) print(rec.body, 5, 15, 6)
@ -1801,9 +2161,9 @@ function rearm_mode:draw()
camera(frac * -128 + (1-frac) * -56, 0) camera(frac * -128 + (1-frac) * -56, 0)
self:draw_option(2) self:draw_option(2)
camera(0, -28 * frac) camera(0, -28 * frac)
self:glow_box(0,101,111,127,self:frame_col(self.sel < 0),1) self:glow_box(0,102,111,127,self:frame_col(self.sel < 0),1)
spr(96,15,107,4,2) spr(96,15,107,4,2)
print("full ammo\nfull shield\n+50% health",54, 106, 6) print("full ammo\nfull shield\n+50% health",54, 107, 6)
end end
function rearm_mode:update_pos() function rearm_mode:update_pos()
@ -1823,6 +2183,7 @@ function rearm_mode:update_pos()
end end
function rearm_mode:update() function rearm_mode:update()
self.crt_frm+=0.25
self:update_pos() self:update_pos()
if self.pos > 1 then if self.pos > 1 then
mode = game_mode mode = game_mode
@ -1877,14 +2238,14 @@ __gfx__
0070070065666765000000000ddddd100b33355009444220c000000c03333350b7000000a800000008888820048488203bbaabb3288aa8820000000000000000 0070070065666765000000000ddddd100b33355009444220c000000c03333350b7000000a800000008888820048488203bbaabb3288aa8820000000000000000
000000006506506500000000001111000b0b5050090920200c0000c00055550037000000a2000000008882000048420003bbbb30028888200000000000000000 000000006506506500000000001111000b0b5050090920200c0000c00055550037000000a2000000008882000048420003bbbb30028888200000000000000000
00000000650000650000000000000000000b50000009200000c0cc00000000003b00000082000000000820000008200000333300002222000000000000000000 00000000650000650000000000000000000b50000009200000c0cc00000000003b00000082000000000820000008200000333300002222000000000000000000
00000000000650000006500000000000b000000b80000000700000000bb0000008800000000000000009200000000000cccccccd000650000000000000000000 0000000000065000000650000003b0000070070080000000700000000bb0000008800000000000000009200000000000cccccccd000650000000000000000000
0000000000675000000765000000000000bbbb0080000000b0000000b76300008a920000000000009009200200000000c111111d006765000000000000000000 000000000067500000076500000370000005500080000000b0000000b76300008a920000000000009009200200000000c111111d006765000000000000000000
00000000006d6500006d6500000000000b0000b09000000030000000b663000089920000000550009994444200000000c111111d006d65000000000000000000 00000000006d6500006d6500000b7000700660079000000030000000b663000089920000000550009994444200000000c111111d006d65000000000000000000
00000000067c6650067c6650000000000b0bb0b0a000000030000000033000000220000000576d009446544200000000c111111d067c66500000000000000000 00000000067c6650067c6650000b7000056ccd50a000000030000000033000000220000000576d009446544200000000c111111d067c66500000000000000000
00000000067d6650067d6650000000000b0bb0b00000000000000000000000000000000000566d009244442200000000c111111d067d66500000000000000000 00000000067d6650067d6650000b7000056ccd500000000000000000000000000000000000566d009244442200000000c111111d067d66500000000000000000
000000005666657576667650000000000b0000b000000000000000000000000000000000000dd0009092220200000000c111111d656667650000000000000000 000000005666657576667650000b7000700dd00700000000000000000000000000000000000dd0009092220200000000c111111d656667650000000000000000
0000000056565066665656500000000000bbbb0000000000000000000000000000000000000000000090020000000000c111111d650650650000000000000000 000000005656506666565650000370000005500000000000000000000000000000000000000000000090020000000000c111111d650650650000000000000000
00000000565000566500065000000000b000000b000000000000000000000000000000000000000000a00a0000000000cddddddd650000650000000000000000 0000000056500056650006500003b00000700700000000000000000000000000000000000000000000a00a0000000000cddddddd650000650000000000000000
060007000600070006600770766c777c0000000000a0008000000000000000000000000000000000000000000000000000000000000000000000000000000000 060007000600070006600770766c777c0000000000a0008000000000000000000000000000000000000000000000000000000000000000000000000000000000
6cd07cd06cd07cd06ccd7ccd6ccd7ccd000000000090008000000000000000000000000000000000000000000000000000000000000000000000000000000000 6cd07cd06cd07cd06ccd7ccd6ccd7ccd000000000090008000000000000000000000000000000000000000000000000000000000000000000000000000000000
0d000d006cd07cd06ccd7ccd6ccd7ccd0000000000800a0000000000000000000000000000000000000000000000000000000000000000000000000000000000 0d000d006cd07cd06ccd7ccd6ccd7ccd0000000000800a0000000000000000000000000000000000000000000000000000000000000000000000000000000000
@ -1917,21 +2278,21 @@ cddddddddddd0000cddddddddddd0000cddddddddddd0000cddddddddddd0000cddddddddddd0000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
04444400044444440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 044444000444444400000000000000000000000000000000000000000000000000000000000000000000000000000000000bb000000aa0000009900000088000
447777700477777a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 447777700477777a0000000000000000000000000000000000000000000666000077700008888800000ab00006000060000bb000000aa0000009900000088000
477aaa7a0477aaaa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 477aaa7a0477aaaa0000000000000000000000000000000000000000006ddd5007fff70008eeee20000ab00006c006d0000bb000000aa0000009900000088000
47a0047a047a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a0047a047a0000000000000000000000000000000000000000000006dd7d5007ffff4008eeee200aaabbb006ccccd0000bb000000aa0000009900000088000
47a0447a047a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a0447a047a0000000000000000000000000000000000000000000006d7dd5007ffff4008eeee200bbb333006ccccd0000bb000000aa0000009900000088000
47a4477a047a44400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a4477a047a4440000000000000000000000000000000000000000006ddd500004fff4008eeee20000b300006d00cd0000bb000000aa0000009900000088000
477777a00477777a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 477777a00477777a0000000000000000000000000000000000000000005550000004440002222200000b30000d0000d0000bb000000aa0000009900000088000
477770000422aaaa2222000200000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 477770000422aaaa22220002000002000000000000000000000000000000000000000000000000000000000000000000000bb000000aa0000009900000088000
47a77700022ee0002eeee002e00022e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a77700022ee0002eeee002e00022e00000000000000000000000000000000000000000000000000000000000000000000bb000000aa0000009900000088000
47a4777002ea2e002e002e02ee022ee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a4777002ea2e002e002e02ee022ee00000000000000000000000000005600000474000028282000004b000060000000bbbbbb00aaaaaa00999999008888880
47a0477a22ea2e002e002e02e2e2e2e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a0477a22ea2e002e002e02e2e2e2e0000000000000000000000000005d0d0004f0f400080e0e00000a000000c000d00b0000b00a0000a00900009008000080
47a0047a2e2222e02e222e02e02e02e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a0047a2e2222e02e222e02e02e02e000000000000000000000000005d07050070f0f2002e0e02004a0b0b0060c0c000b0bb0b00a0aa0a00909909008088080
47a0047a2eeeeeea2eeee002e02e02e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 47a0047a2eeeeeea2eeee002e02e02e000000000000000000000000006070d1004f0f040080e0e000b0b035000c0c0d00b0bb0b00a0aa0a00909909008088080
0aa000aa2e7aa2ea2e00e002e02e02e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0aa000aa2e7aa2ea2e00e002e02e02e000000000000000000000000000d0d100002f0f2002e0e0200000300006000c000b0000b00a0000a00900009008000080
000000002e0002e02e002e02e02e02e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000002e0002e02e002e02e02e02e0000000000000000000000000000510000002420002020200000b5000000000d00bbbbbb00aaaaaa00999999008888880
000000000e0000e00e000e00e00e00e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000e0000e00e000e00e00e00e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__label__ __label__
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007777777777777777 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007777777777777777
@ -2063,3 +2424,12 @@ __label__
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007666666666666665 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007666666666666665
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007555555555555555 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007555555555555555
__gff__
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000212060a0e01091119000000000000002232363a3e050d151d
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__map__
00006b6b00006f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
7b6a00006a7b6e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
7778686878776c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6767777767676c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
7877676777787d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000