5204 |
5204 |
5205 //////////////////////////////////////////////////////////////////////////////// |
5205 //////////////////////////////////////////////////////////////////////////////// |
5206 procedure doStepHammer(Gear: PGear); |
5206 procedure doStepHammer(Gear: PGear); |
5207 var HHGear, tmp, tmp2: PGear; |
5207 var HHGear, tmp, tmp2: PGear; |
5208 t: PGearArray; |
5208 t: PGearArray; |
5209 i: LongInt; |
5209 i, dmg, d: LongInt; |
5210 begin |
5210 begin |
5211 HHGear:= Gear^.Hedgehog^.Gear; |
5211 HHGear:= Gear^.Hedgehog^.Gear; |
5212 HHGear^.State:= HHGear^.State or gstNoDamage; |
5212 HHGear^.State:= HHGear^.State or gstNoDamage; |
5213 DeleteCI(HHGear); |
5213 DeleteCI(HHGear); |
5214 |
5214 |
5225 if (tmp^.State and gstNoDamage) = 0 then |
5225 if (tmp^.State and gstNoDamage) = 0 then |
5226 if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then |
5226 if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then |
5227 begin |
5227 begin |
5228 //tmp^.State:= tmp^.State or gstFlatened; |
5228 //tmp^.State:= tmp^.State or gstFlatened; |
5229 if (tmp^.Kind <> gtHedgehog) or (tmp^.Hedgehog^.Effects[heInvulnerable] = 0) then |
5229 if (tmp^.Kind <> gtHedgehog) or (tmp^.Hedgehog^.Effects[heInvulnerable] = 0) then |
5230 ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown); |
5230 begin |
|
5231 // do 1/2 current hp worth of damage if extra damage is enabled (1/3 damage if not) |
|
5232 if cDamageModifier > _1 then |
|
5233 d:= 2 |
|
5234 else |
|
5235 d:= 3; |
|
5236 // base damage on remaining health |
|
5237 dmg:= (tmp^.Health - tmp^.Damage); |
|
5238 if dmg > 0 then |
|
5239 begin |
|
5240 // always round up |
|
5241 if dmg mod d > 0 then |
|
5242 dmg:= dmg div d + 1 |
|
5243 else |
|
5244 dmg:= dmg div d; |
|
5245 |
|
5246 ApplyDamage(tmp, CurrentHedgehog, dmg, dsUnknown); |
|
5247 end; |
|
5248 end; |
5231 //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3); |
5249 //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3); |
5232 tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0); |
5250 tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0); |
5233 tmp2^.LinkedGear:= tmp; |
5251 tmp2^.LinkedGear:= tmp; |
5234 SetAllToActive |
5252 SetAllToActive |
5235 end |
5253 end |