hedgewars/HHHandlers.inc
changeset 2221 ef52dae4130b
parent 2202 29508a2924c2
child 2223 e009fee03c96
equal deleted inserted replaced
2220:110266ba2ef7 2221:ef52dae4130b
    45 			end;
    45 			end;
    46 		until (Ammo^[slot, CurAmmo].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, CurAmmo].AmmoType].SkipTurns)
    46 		until (Ammo^[slot, CurAmmo].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, CurAmmo].AmmoType].SkipTurns)
    47 		end else
    47 		end else
    48 		begin
    48 		begin
    49 		i:= 0;
    49 		i:= 0;
    50 		// check whether there's ammo in slot
    50 		// check whether there is ammo in slot
    51 		while (i <= cMaxSlotAmmoIndex)
    51 		while (i <= cMaxSlotAmmoIndex)
    52 		  and ((Ammo^[slot, i].Count = 0)
    52 		  and ((Ammo^[slot, i].Count = 0)
    53 		       or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i);
    53 		       or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i);
    54 		
    54 		
    55 		if i <= cMaxSlotAmmoIndex then
    55 		if i <= cMaxSlotAmmoIndex then
    65 var t: LongInt;
    65 var t: LongInt;
    66     weap: TAmmoType;
    66     weap: TAmmoType;
    67 begin
    67 begin
    68 weap:= TAmmoType(Gear^.MsgParam);
    68 weap:= TAmmoType(Gear^.MsgParam);
    69 
    69 
    70 if PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then exit; // weapon isn't activated yet
    70 if PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then exit; // weapon is not activated yet
    71 
    71 
    72 Gear^.MsgParam:= Ammoz[weap].Slot;
    72 Gear^.MsgParam:= Ammoz[weap].Slot;
    73 
    73 
    74 t:= cMaxSlotAmmoIndex;
    74 t:= cMaxSlotAmmoIndex;
    75 
    75 
   574 	exit
   574 	exit
   575 	end;
   575 	end;
   576 
   576 
   577 if ((Gear^.State and gstMoving) <> 0)
   577 if ((Gear^.State and gstMoving) <> 0)
   578     or (StepTicks = cHHStepTicks)
   578     or (StepTicks = cHHStepTicks)
   579 	or (CurAmmoGear <> nil) then // we're moving
   579 	or (CurAmmoGear <> nil) then // we are moving
   580 	begin
   580 	begin
   581 	with PHedgehog(Gear^.Hedgehog)^ do
   581 	with PHedgehog(Gear^.Hedgehog)^ do
   582 		if (CurAmmoGear = nil)
   582 		if (CurAmmoGear = nil)
   583 		and (Gear^.dY > _0_39)
   583 		and (Gear^.dY > _0_39)
   584 		and (Ammo^[CurSlot, CurAmmo].AmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack;
   584 		and (Ammo^[CurSlot, CurAmmo].AmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack;