hedgewars/HHHandlers.inc
changeset 5136 948da1e50205
parent 5038 c77241027071
child 5137 b6140f35735f
equal deleted inserted replaced
5134:97827ad5c904 5136:948da1e50205
    88                or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i);
    88                or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i);
    89 
    89 
    90         if i <= cMaxSlotAmmoIndex then ammoidx:= i
    90         if i <= cMaxSlotAmmoIndex then ammoidx:= i
    91         else ammoidx:= -1
    91         else ammoidx:= -1
    92         end;
    92         end;
    93         if ammoidx >= 0 then 
    93         if ammoidx >= 0 then CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
    94             begin
       
    95             CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
       
    96             if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then
       
    97                 ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0
       
    98             else
       
    99                 ShowCrosshair:= (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0;
       
   100             end
       
   101     end
    94     end
   102 end;
    95 end;
   103 
    96 
   104 procedure HHSetWeapon(HHGear: PGear);
    97 procedure HHSetWeapon(HHGear: PGear);
   105 var t: LongInt;
    98 var t: LongInt;
   388             OnUsedAmmo(CurrentHedgehog^);
   381             OnUsedAmmo(CurrentHedgehog^);
   389             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and ((GameFlags and gfInfAttack) = 0) then
   382             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and ((GameFlags and gfInfAttack) = 0) then
   390                 begin
   383                 begin
   391                 if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
   384                 if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
   392                 TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
   385                 TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
   393                 if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then
       
   394                     ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0
       
   395                 else ShowCrosshair:= false;
       
   396                 end;
   386                 end;
   397             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then State:= State or gstAttacked;
   387             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then State:= State or gstAttacked;
   398             if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then ApplyAmmoChanges(CurrentHedgehog^)
   388             if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then ApplyAmmoChanges(CurrentHedgehog^)
   399             end;
   389             end;
   400         end
   390         end