22 begin |
22 begin |
23 slot:= Gear^.MsgParam; |
23 slot:= Gear^.MsgParam; |
24 |
24 |
25 with PHedgehog(Gear^.Hedgehog)^ do |
25 with PHedgehog(Gear^.Hedgehog)^ do |
26 begin |
26 begin |
|
27 Gear^.Message:= Gear^.Message and not gm_Slot; |
|
28 |
27 if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) |
29 if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) |
28 or (AttacksNum > 0) |
30 or (AttacksNum > 0) |
29 or ((Gear^.State and gstHHDriven) = 0) then exit; |
31 or ((Gear^.State and gstHHDriven) = 0) then exit; |
30 |
32 |
31 Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump or gm_Slot); |
33 Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump); |
32 |
34 |
33 if CurSlot = slot then |
35 if CurSlot = slot then |
34 begin |
36 begin |
35 i:= 0; |
37 i:= 0; |
36 repeat |
38 repeat |
210 begin |
212 begin |
211 with CurrentHedgehog^.Gear^, |
213 with CurrentHedgehog^.Gear^, |
212 CurrentHedgehog^ do |
214 CurrentHedgehog^ do |
213 begin |
215 begin |
214 State:= State and not gstAttacking; |
216 State:= State and not gstAttacking; |
215 if ((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_Utility) = 0 then |
217 if ((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_Utility) = 0 then |
216 begin |
218 begin |
217 Inc(AttacksNum); |
219 Inc(AttacksNum); |
218 if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= AttacksNum) or |
220 if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= AttacksNum) or |
219 ((GameFlags and gfMultiWeapon) <> 0) then |
221 ((GameFlags and gfMultiWeapon) <> 0) then |
220 isInMultiShoot:= true |
222 isInMultiShoot:= true |
221 else |
223 else |
222 begin |
224 begin |
223 TurnTimeLeft:= Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType].TimeAfterTurn; |
225 TurnTimeLeft:= Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType].TimeAfterTurn; |
224 State:= State or gstAttacked; |
226 State:= State or gstAttacked; |
225 OnUsedAmmo(CurrentHedgehog^); |
227 OnUsedAmmo(CurrentHedgehog^); |
226 end; |
228 end; |
227 end |
229 end |
228 else |
230 else |
229 begin |
231 begin |
230 OnUsedAmmo(CurrentHedgehog^); |
232 OnUsedAmmo(CurrentHedgehog^); |
231 ApplyAmmoChanges(CurrentHedgehog^); |
233 ApplyAmmoChanges(CurrentHedgehog^); |
232 end; |
234 end; |
233 AttackBar:= 0; |
235 AttackBar:= 0; |
234 end |
236 end |
235 end; |
237 end; |
236 |
238 |
237 //////////////////////////////////////////////////////////////////////////////// |
239 //////////////////////////////////////////////////////////////////////////////// |