hedgewars/uAmmos.pas
changeset 3935 5ca27a0e9a63
parent 3836 833c0f32e326
child 3939 e6fddcb04dc2
equal deleted inserted replaced
3933:1a873262f5dd 3935:5ca27a0e9a63
    45 function  GetAmmoEntry(var Hedgehog: THedgehog): PAmmo;
    45 function  GetAmmoEntry(var Hedgehog: THedgehog): PAmmo;
    46 
    46 
    47 var shoppa: boolean;
    47 var shoppa: boolean;
    48 
    48 
    49 implementation
    49 implementation
    50 uses uMisc, uGears, uWorld, uLocale, uConsole;
    50 uses uMisc, uGears, uWorld, uLocale, uConsole, uMobile;
    51 
    51 
    52 type TAmmoCounts = array[TAmmoType] of Longword;
    52 type TAmmoCounts = array[TAmmoType] of Longword;
    53 var StoresList: array[0..Pred(cMaxHHs)] of PHHAmmo;
    53 var StoresList: array[0..Pred(cMaxHHs)] of PHHAmmo;
    54     StoreCnt: Longword;
    54     StoreCnt: Longword;
    55     ammoLoadout, ammoProbability, ammoDelay, ammoReinforcement: shortstring;
    55     ammoLoadout, ammoProbability, ammoDelay, ammoReinforcement: shortstring;
   244                 begin
   244                 begin
   245                 PackAmmo(Ammo, Ammoz[AmmoType].Slot);
   245                 PackAmmo(Ammo, Ammoz[AmmoType].Slot);
   246                 SwitchNotHeldAmmo(Hedgehog)
   246                 SwitchNotHeldAmmo(Hedgehog)
   247                 end
   247                 end
   248             end
   248             end
   249     end
   249     end;
       
   250 perfExt_NewTurnBeginning;
   250 end;
   251 end;
   251 
   252 
   252 function  HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): boolean;
   253 function  HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): boolean;
   253 var slot, ami: LongInt;
   254 var slot, ami: LongInt;
   254 begin
   255 begin
   352         if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then
   353         if (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then
   353             ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0
   354             ShowCrosshair:= (Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0
   354         else
   355         else
   355             ShowCrosshair:= (Propz and ammoprop_NoCrosshair) = 0;
   356             ShowCrosshair:= (Propz and ammoprop_NoCrosshair) = 0;
   356         end
   357         end
   357     end
   358     end;
       
   359 perfExt_NewTurnBeginning;
   358 end;
   360 end;
   359 
   361 
   360 procedure SwitchNotHeldAmmo(var Hedgehog: THedgehog);
   362 procedure SwitchNotHeldAmmo(var Hedgehog: THedgehog);
   361 begin
   363 begin
   362 with Hedgehog do
   364 with Hedgehog do