10 Commits

Author SHA1 Message Date
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

View File

@ -730,14 +730,14 @@ function gun_base:ammo_upgrade_opt()
return { return {
icon=self.icon, icon=self.icon,
hdr=self.hdr, hdr=self.hdr,
body=[[----------AMMO body=[[--------AMMO
more shots more shots
before you before you
run out. run out.
is: ]]..tostr(a)..[[ is: ]]..tostr(a)..[[
add: ]]..tostr(x)..[[ add: ]]..tostr(x)..[[
---------- ----------
total: ]]..tostr(a+x), total: ]]..tostr(a+x),
action=function() action=function()
@ -754,20 +754,20 @@ function gun_base:rate_upgrade_opt()
return { return {
icon=self.icon, icon=self.icon,
hdr=self.hdr, hdr=self.hdr,
body=[[----------RATE body=[[--------RATE
reduce delay reduce delay
between shots between each
in frames. shot when
firing.
fractions is: ]]..tostr(c)..[[f
add up across minus: ]]..tostr(c-newc)..[[f
upgrades.
is: ]]..tostr(c)..[[
minus: ]]..tostr(c-newc)..[[
---------- ----------
total: ]]..tostr(newc), total: ]]..tostr(newc)..[[f
remainder:
]]..sub(tostr(newc-rawnewc),0,5),
action=function() action=function()
self.cooldown=newc>>16 self.cooldown=newc>>16
self.cd_remainder=newc-rawnewc self.cd_remainder=newc-rawnewc
@ -916,10 +916,12 @@ blast_gun = mknew(gun_base.new{
maxammo = 5, maxammo = 5,
munition = 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
@ -988,9 +990,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
@ -1049,9 +1053,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
@ -1142,7 +1147,11 @@ function player:small_upgrade_opts()
local ret = {{ local ret = {{
icon=53, icon=53,
hdr="hull", hdr="hull",
body=[[ armor body=[[--------SHIP
survive more
unshielded
hits.
+2 hp]], +2 hp]],
action=function() action=function()
@ -1151,8 +1160,13 @@ function player:small_upgrade_opts()
end, end,
},{ },{
icon=52, icon=52,
hdr="shield", hdr="capacity",
body=[[ capacity body=[[------SHIELD
shield can
absorb more
hits before
recharging.
+1 hp]], +1 hp]],
action=function() action=function()
@ -1162,10 +1176,11 @@ function player:small_upgrade_opts()
},{ },{
icon=1, icon=1,
hdr="thrusters", hdr="thrusters",
body=[[performance body=[[--------SHIP
move faster, move faster,
steer faster]], steer more
sharply.]],
action=function() action=function()
--maxspd thrust drag --maxspd thrust drag
self.maxspd += 0.5 self.maxspd += 0.5
@ -1174,22 +1189,29 @@ steer faster]],
end, end,
},{ },{
icon=20, icon=20,
hdr="hull", hdr="magnet",
body=[[ magnet body=[[--------SHIP
pick up xp pick up xp
from further from further
away]], away.]],
action=function () action=function ()
self.magnet += 2 self.magnet += 2
end, end,
}} },
self.main_gun:rate_upgrade_opt(),
}
if cdr > 0 then if cdr > 0 then
add(ret, { add(ret, {
icon = 6, icon = 6,
hdr = "shield", hdr = "recharge",
body=[[charge rate body=[[------SHIELD
shield will
recharge at
a faster
pace.
]] .. tostr(ceil(100 * cdr / self.shieldcooldown)) .. "% faster", ]] .. tostr(ceil(100 * cdr / self.shieldcooldown)) .. "% faster",
action = function() action = function()
@ -1201,8 +1223,15 @@ from further
if pr > 0 then if pr > 0 then
add(ret, { add(ret, {
icon = 6, icon = 6,
hdr = "shield", hdr = "recovery",
body=[[disruption body=[[------SHIELD
reduce the
delay after
a hit before
shield will
start to
recharge.
]] .. tostr(ceil(100 * pr / self.shieldpenalty)) .. "% shorter", ]] .. tostr(ceil(100 * pr / self.shieldpenalty)) .. "% shorter",
action = function() action = function()
@ -1863,7 +1892,12 @@ end
-- ordinary upgrades -- ordinary upgrades
function small_opts() function small_opts()
-- todo: include gun opts -- todo: include gun opts
return pick(primary_ship:small_upgrade_opts(), 2) if(not primary_ship.special_guns) return pick(primary_ship:small_upgrade_opts(), 2)
local opts = {rnd(primary_ship:small_upgrade_opts())}
for g in all(primary_ship.special_guns) do
add(opts, rnd(g:small_upgrade_opts()))
end
return pick(opts, 2)
end end
-->8 -->8
@ -1872,7 +1906,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
@ -1887,7 +1921,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
@ -1919,7 +1953,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)
@ -1955,9 +1989,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()
@ -1977,6 +2011,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