# HG changeset patch # User nemo # Date 1286743900 14400 # Node ID 4c4c0a2507cca836ffa970a7299b5cb936b200f9 # Parent 24daa33a31149407adf0c39db0fce3b1dda36c2d Add the standard delay (1.25 seconds) between attacks on inf attack mode, as well as checks for damage and win. There is probably some better way to do this. Weapons still need fixing. diff -r 24daa33a3114 -r 4c4c0a2507cc hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Sun Oct 10 22:32:01 2010 +0200 +++ b/hedgewars/HHHandlers.inc Sun Oct 10 16:51:40 2010 -0400 @@ -327,9 +327,9 @@ if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) = 0) and ((GameFlags and gfInfAttack) = 0) then begin TurnTimeLeft:= Ammoz[CurAmmoType].TimeAfterTurn; - State:= State or gstAttacked end - else ApplyAmmoChanges(CurrentHedgehog^) + else ApplyAmmoChanges(CurrentHedgehog^); + if (GameFlags and gfInfAttack) <> 0 then State:= State or gstAttacked; end; end else diff -r 24daa33a3114 -r 4c4c0a2507cc hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Oct 10 22:32:01 2010 +0200 +++ b/hedgewars/uGears.pas Sun Oct 10 16:51:40 2010 -0400 @@ -696,6 +696,7 @@ procedure ProcessGears; const delay: LongWord = 0; + delay2: LongWord = 0; step: (stDelay, stChDmg, stSweep, stTurnReact, stAfterDelay, stChWin, stWater, stChWin2, stHealth, stSpawn, stNTurn) = stDelay; @@ -841,6 +842,20 @@ end; step:= Low(step) end; + end +else if ((GameFlags and gfInfAttack) <> 0) then + begin + if delay2 = 0 then + delay2:= cInactDelay + else + dec(delay2); + + if delay2 = 0 then + begin + if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked; + CheckNoDamage; + CheckForWin + end end; if TurnTimeLeft > 0 then