Compare commits
2 Commits
2cebea663f
...
cb2d24c9d0
Author | SHA1 | Date | |
---|---|---|---|
cb2d24c9d0 | |||
67603f8496 |
@ -1038,10 +1038,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
|
||||||
@ -1068,6 +1068,75 @@ 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=[[ armor
|
||||||
|
|
||||||
|
+2 hp]],
|
||||||
|
action=function()
|
||||||
|
self.maxhp += 2
|
||||||
|
self.hp += 2
|
||||||
|
end,
|
||||||
|
},{
|
||||||
|
icon=52,
|
||||||
|
hdr="shield",
|
||||||
|
body=[[ capacity
|
||||||
|
|
||||||
|
+1 hp]],
|
||||||
|
action=function()
|
||||||
|
self.maxshield += 1
|
||||||
|
self.shield += 1
|
||||||
|
end,
|
||||||
|
},{
|
||||||
|
icon=1,
|
||||||
|
hdr="thrusters",
|
||||||
|
body=[[performance
|
||||||
|
|
||||||
|
move faster,
|
||||||
|
steer faster]],
|
||||||
|
action=function()
|
||||||
|
--maxspd thrust drag
|
||||||
|
self.maxspd += 0.5
|
||||||
|
self.thrust += 0.0625
|
||||||
|
self.drag += 0.03125
|
||||||
|
end,
|
||||||
|
}}
|
||||||
|
|
||||||
|
if cdr > 0 then
|
||||||
|
add(ret, {
|
||||||
|
icon = 6,
|
||||||
|
hdr = "shield",
|
||||||
|
body=[[charge rate
|
||||||
|
|
||||||
|
]] .. tostr(ceil(100 * cdr / self.shieldcooldown)) .. "% faster",
|
||||||
|
action = function()
|
||||||
|
self.shieldcooldown -= cdr
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if pr > 0 then
|
||||||
|
add(ret, {
|
||||||
|
icon = 6,
|
||||||
|
hdr = "shield",
|
||||||
|
body=[[disruption
|
||||||
|
|
||||||
|
]] .. 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
|
||||||
@ -1633,7 +1702,7 @@ end
|
|||||||
-- 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
|
||||||
@ -1705,18 +1774,8 @@ end
|
|||||||
|
|
||||||
-- ordinary upgrades
|
-- ordinary upgrades
|
||||||
function small_opts()
|
function small_opts()
|
||||||
return {{
|
-- todo: include gun opts
|
||||||
icon=1,
|
return pick(primary_ship:small_upgrade_opts(), 2)
|
||||||
hdr="placeholder",
|
|
||||||
body="placeholder",
|
|
||||||
action = function() end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon=1,
|
|
||||||
hdr="placeholder",
|
|
||||||
body="placeholder",
|
|
||||||
action = function() end,
|
|
||||||
}}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-->8
|
-->8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user