major rebalances

10s generator is too slow -- 10 seconds ago is an eternity in a shmup
and a player who has stopped firing should recover much faster. The
generator's max capacity is much lower and shield cost has been
rebalanced to match.

The Protron is much more expensive to fire, it was previously just
easy mode.

Shields now recover faster _once they start recovering_ (every second
if energy is available) but getting hit causes a "penalty cooldown"
that is much longer than the standard recovery interval. This behavior
is taken from Halo and basically every modern FPS that came after it;
it's unlike Tyrian, which had consistent shield recovery behavior.
But I think Halo's rule plays much better.
This commit is contained in:
Kistaro Windrider 2024-08-18 01:46:39 -07:00
parent cc3ed20f76
commit 965fc0d688
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -413,13 +413,12 @@ ship_m = {
shield = 0, shield = 0,
maxshield = 0, maxshield = 0,
shieldcost = 32767.9, shieldcost = 32767.9,
shieldcooldown = 0x0.00a0, shieldcooldown = 0x0.003c,--1s
shieldpenalty = 0x0.012c, --5s
-- default generator behavior: max_power = 120,
-- 10 seconds for a full charge power = 120,
max_power = 600, generator = 2, -- power gen per frame
power = 600,
generator = 1, -- power gen per frame
slip = true, -- most enemies slide slip = true, -- most enemies slide
@ -538,7 +537,7 @@ 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.shieldcooldown self.shield_refresh_ready = lframe + self.shieldpenalty
if self.shield >= dmg then if self.shield >= dmg then
self.shield -= dmg self.shield -= dmg
self:ow(true) self:ow(true)
@ -772,7 +771,7 @@ mknew(protron)
protron_gun = gun_base.new{ protron_gun = gun_base.new{
icon = 25, icon = 25,
enemy = false, enemy = false,
power = 35, power = 60,
cooldown = 0x0.000f, -- frames between shots cooldown = 0x0.000f, -- frames between shots
ammo = nil, ammo = nil,
maxammo = nil, maxammo = nil,
@ -876,8 +875,8 @@ player = ship_m.new{
maxhp = 3, -- player only; other ships never heal maxhp = 3, -- player only; other ships never heal
shield = 2, -- regenerates, using power shield = 2, -- regenerates, using power
maxshield = 2, maxshield = 2,
shieldcost = 300, -- power cost to refill shield shieldcost = 60, -- power cost to refill shield
generator = 1.5, -- 1 feels too slow generator = 2,
-- gun -- gun
main_gun = nil, -- assign at spawn time main_gun = nil, -- assign at spawn time
@ -1569,10 +1568,12 @@ shields - ship.shieldcost per
point of shields. shieldcooldown point of shields. shieldcooldown
is the interval between is the interval between
restoring shield points, which restoring shield points, which
is reset when a ship takes is reset to shieldpenalty when a
damage (regardless of whether ship takes damage (regardless of
that damage is stopped by the whether that damage is stopped
shield or not). by the shield or not).
shieldpenalty is much worse than
shieldcooldown (hALO shield).
therefore: therefore:
* damaged ships spend power * damaged ships spend power