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:
		| @@ -612,30 +612,25 @@ end | ||||
| function ship_m:hitsomething(dmg) | ||||
|  if (dmg <= 0) return false | ||||
|  self.shield_refresh_ready = lframe + self.shieldpenalty | ||||
|  if self.shield >= dmg then | ||||
|  if self.shield > 0 then | ||||
|   self.shield -= dmg | ||||
|   self:ow(true) | ||||
|   if self.shield > 0 then | ||||
|    blip(self,12) | ||||
|   else | ||||
|    self.shield = 0 | ||||
|    blip(self,9) | ||||
|   end | ||||
|   return false | ||||
|  end  | ||||
|  dmg -= self.shield | ||||
|  self.shield = 0 | ||||
|  self.hp -= dmg | ||||
|  if self.hp < 0 then | ||||
|   self:die() | ||||
|   return true | ||||
|  end | ||||
|  self:ow(false) | ||||
|  blip(self, 7) | ||||
|  return false | ||||
| 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() | ||||
|  if (self.shield >= self.maxshield) return | ||||
|  if (lframe < self.shield_refresh_ready) return | ||||
| @@ -1625,10 +1620,10 @@ function init_blip_pals() | ||||
|  end | ||||
| end | ||||
|  | ||||
| function blip(obj, col, frames) | ||||
| function blip(obj, col) | ||||
|  obj.fx_pal = blip_pals[col] | ||||
|  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 | ||||
|  | ||||
| bossspark = split"7,7,10,10,9,9,9,8,8,8,2,2,5,5" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user