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
This commit is contained in:
Kistaro Windrider 2025-01-26 22:25:06 -08:00
parent 511c18f90e
commit 9b24f10c23
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -612,30 +612,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,9)
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, 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
@ -1625,10 +1620,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"