96 if (Gear^.Kind = gtHedgehog) and (((GameFlags and gfInfAttack) = 0) or ((Gear^.dX.QWordValue < _0_000004.QWordValue) |
96 if (Gear^.Kind = gtHedgehog) and (((GameFlags and gfInfAttack) = 0) or ((Gear^.dX.QWordValue < _0_000004.QWordValue) |
97 and (Gear^.dY.QWordValue < _0_000004.QWordValue))) then |
97 and (Gear^.dY.QWordValue < _0_000004.QWordValue))) then |
98 begin |
98 begin |
99 if (not isInMultiShoot) then |
99 if (not isInMultiShoot) then |
100 inc(Gear^.Damage, Gear^.Karma); |
100 inc(Gear^.Damage, Gear^.Karma); |
101 if (Gear^.Damage <> 0) and (not Gear^.Invulnerable) then |
101 if ((Gear^.Damage <> 0) and (not Gear^.Invulnerable)) then |
102 begin |
102 begin |
103 CheckNoDamage:= false; |
103 CheckNoDamage:= false; |
104 |
104 |
105 dmg:= Gear^.Damage; |
105 dmg:= Gear^.Damage; |
106 if Gear^.Health < dmg then |
106 if Gear^.Health < dmg then |
163 team:= Gear^.Hedgehog^.Team; |
163 team:= Gear^.Hedgehog^.Team; |
164 for i:= 0 to Pred(team^.HedgehogsNumber) do |
164 for i:= 0 to Pred(team^.HedgehogsNumber) do |
165 if (team^.Hedgehogs[i].Gear <> nil) and (not team^.Hedgehogs[i].King) |
165 if (team^.Hedgehogs[i].Gear <> nil) and (not team^.Hedgehogs[i].King) |
166 and (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage) then |
166 and (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage) then |
167 flag:= true; |
167 flag:= true; |
168 if not flag then |
168 if (not flag) then |
169 begin |
169 begin |
170 inc(tmp, 5); |
170 inc(tmp, 5); |
171 if (GameFlags and gfResetHealth) <> 0 then |
171 if (GameFlags and gfResetHealth) <> 0 then |
172 dec(Gear^.Hedgehog^.InitialHealth, 5) |
172 dec(Gear^.Hedgehog^.InitialHealth, 5) |
173 end |
173 end |
215 if curHandledGear^.Message and gmRemoveFromList <> 0 then |
215 if curHandledGear^.Message and gmRemoveFromList <> 0 then |
216 begin |
216 begin |
217 RemoveGearFromList(curHandledGear); |
217 RemoveGearFromList(curHandledGear); |
218 // since I can't think of any good reason this would ever be separate from a remove from list, going to keep it inside this block |
218 // since I can't think of any good reason this would ever be separate from a remove from list, going to keep it inside this block |
219 if curHandledGear^.Message and gmAddToList <> 0 then InsertGearToList(curHandledGear); |
219 if curHandledGear^.Message and gmAddToList <> 0 then InsertGearToList(curHandledGear); |
220 curHandledGear^.Message:= curHandledGear^.Message and (not (gmRemoveFromList or gmAddToList)) |
220 curHandledGear^.Message:= (curHandledGear^.Message and (not (gmRemoveFromList or gmAddToList))) |
221 end; |
221 end; |
222 if curHandledGear^.Active then |
222 if curHandledGear^.Active then |
223 begin |
223 begin |
224 if curHandledGear^.RenderTimer and (curHandledGear^.Timer > 500) and ((curHandledGear^.Timer mod 1000) = 0) then |
224 if curHandledGear^.RenderTimer and (curHandledGear^.Timer > 500) and ((curHandledGear^.Timer mod 1000) = 0) then |
225 begin |
225 begin |
330 AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState); |
330 AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState); |
331 playSound(sndSuddenDeath); |
331 playSound(sndSuddenDeath); |
332 StopMusic //No SDMusic for now |
332 StopMusic //No SDMusic for now |
333 //ChangeMusic(SDMusic) |
333 //ChangeMusic(SDMusic) |
334 end |
334 end |
335 else if (TotalRounds < cSuddenDTurns) and (not isInMultiShoot) then |
335 else if ((TotalRounds < cSuddenDTurns) and (not isInMultiShoot)) then |
336 begin |
336 begin |
337 i:= cSuddenDTurns - TotalRounds; |
337 i:= cSuddenDTurns - TotalRounds; |
338 s:= inttostr(i); |
338 s:= inttostr(i); |
339 if i = 1 then |
339 if i = 1 then |
340 AddCaption(trmsg[sidRoundSD], cWhiteColor, capgrpGameState) |
340 AddCaption(trmsg[sidRoundSD], cWhiteColor, capgrpGameState) |
402 and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then |
402 and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then |
403 begin |
403 begin |
404 CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstHHChooseTarget; |
404 CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstHHChooseTarget; |
405 isCursorVisible := true |
405 isCursorVisible := true |
406 end; |
406 end; |
407 CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and (not gstAttacked); |
407 CurrentHedgehog^.Gear^.State:= (CurrentHedgehog^.Gear^.State and (not gstAttacked)); |
408 end; |
408 end; |
409 if delay2 = 0 then |
409 if delay2 = 0 then |
410 begin |
410 begin |
411 if (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.State and gstAttacked = 0) |
411 if (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.State and gstAttacked = 0) |
412 and (CurAmmoGear = nil) then |
412 and (CurAmmoGear = nil) then |
700 |
700 |
701 DeleteCI(t); |
701 DeleteCI(t); |
702 t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX); |
702 t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX); |
703 t^.dY:= t^.dY + Gear^.dY * dmg * _0_01; |
703 t^.dY:= t^.dY + Gear^.dY * dmg * _0_01; |
704 t^.State:= t^.State or gstMoving; |
704 t^.State:= t^.State or gstMoving; |
705 if t^.Kind = gtKnife then t^.State:= t^.State and (not gstCollision); |
705 if t^.Kind = gtKnife then t^.State:= (t^.State and (not gstCollision)); |
706 t^.Active:= true; |
706 t^.Active:= true; |
707 FollowGear:= t |
707 FollowGear:= t |
708 end |
708 end |
709 end; |
709 end; |
710 gtGrave: begin |
710 gtGrave: begin |
811 else |
811 else |
812 Gear^.State:= Gear^.State or gstWinner; |
812 Gear^.State:= Gear^.State or gstWinner; |
813 if (Gear^.Kind = gtExplosives) and (Ammo^.Kind = gtBlowtorch) then |
813 if (Gear^.Kind = gtExplosives) and (Ammo^.Kind = gtBlowtorch) then |
814 begin |
814 begin |
815 if (Ammo^.Hedgehog^.Gear <> nil) then |
815 if (Ammo^.Hedgehog^.Gear <> nil) then |
816 Ammo^.Hedgehog^.Gear^.State:= Ammo^.Hedgehog^.Gear^.State and (not gstNotKickable); |
816 Ammo^.Hedgehog^.Gear^.State:= (Ammo^.Hedgehog^.Gear^.State and (not gstNotKickable)); |
817 ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch |
817 ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch |
818 end; |
818 end; |
819 |
819 |
820 if (Gear^.Kind = gtHedgehog) and Gear^.Hedgehog^.King then |
820 if (Gear^.Kind = gtHedgehog) and Gear^.Hedgehog^.King then |
821 begin |
821 begin |
831 if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then |
831 if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then |
832 begin |
832 begin |
833 Gear^.Active:= true; |
833 Gear^.Active:= true; |
834 DeleteCI(Gear); |
834 DeleteCI(Gear); |
835 Gear^.State:= Gear^.State or gstMoving; |
835 Gear^.State:= Gear^.State or gstMoving; |
836 if Gear^.Kind = gtKnife then Gear^.State:= Gear^.State and (not gstCollision); |
836 if Gear^.Kind = gtKnife then Gear^.State:= (Gear^.State and (not gstCollision)); |
837 // move the gear upwards a bit to throw it over tiny obstacles at start |
837 // move the gear upwards a bit to throw it over tiny obstacles at start |
838 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
838 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
839 begin |
839 begin |
840 if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX)) |
840 if (not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))) |
841 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
841 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
842 Gear^.Y:= Gear^.Y - _1; |
842 Gear^.Y:= Gear^.Y - _1; |
843 if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) |
843 if (not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX))) |
844 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
844 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
845 Gear^.Y:= Gear^.Y - _1; |
845 Gear^.Y:= Gear^.Y - _1; |
846 if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) |
846 if (not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX))) |
847 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
847 or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
848 Gear^.Y:= Gear^.Y - _1; |
848 Gear^.Y:= Gear^.Y - _1; |
849 end |
849 end |
850 end; |
850 end; |
851 |
851 |