hedgewars/uAmmos.pas
changeset 13454 794dcf69a5aa
parent 12733 353cb2ce6f9c
child 13455 38814954a248
equal deleted inserted replaced
13453:8f746b6a477c 13454:794dcf69a5aa
    77     end;
    77     end;
    78 AmmoMenuInvalidated:= true;
    78 AmmoMenuInvalidated:= true;
    79 end;
    79 end;
    80 
    80 
    81 procedure AddAmmoStore;
    81 procedure AddAmmoStore;
    82 const probability: array [0..8] of LongWord = (0,20,30,60,100,200,400,600,800);
       
    83 var cnt: Longword;
    82 var cnt: Longword;
    84     a: TAmmoType;
    83     a: TAmmoType;
    85     ammos: TAmmoCounts;
    84     ammos: TAmmoCounts;
    86     newAmmos: TAmmoArray;
    85     newAmmos: TAmmoArray;
    87 begin
    86 begin
    97 
    96 
    98 for a:= Low(TAmmoType) to High(TAmmoType) do
    97 for a:= Low(TAmmoType) to High(TAmmoType) do
    99     begin
    98     begin
   100     if a <> amNothing then
    99     if a <> amNothing then
   101         begin
   100         begin
   102         Ammoz[a].Probability:= probability[byte(ammoProbability[ord(a)]) - byte('0')];
   101         Ammoz[a].Probability:= probabilityLevels[byte(ammoProbability[ord(a)]) - byte('0')];
   103         Ammoz[a].SkipTurns:= (byte(ammoDelay[ord(a)]) - byte('0'));
   102         Ammoz[a].SkipTurns:= (byte(ammoDelay[ord(a)]) - byte('0'));
   104         Ammoz[a].NumberInCase:= (byte(ammoReinforcement[ord(a)]) - byte('0'));
   103         Ammoz[a].NumberInCase:= (byte(ammoReinforcement[ord(a)]) - byte('0'));
   105         cnt:= byte(ammoLoadout[ord(a)]) - byte('0');
   104         cnt:= byte(ammoLoadout[ord(a)]) - byte('0');
   106         // avoid things we already have infinite number
   105         // avoid things we already have infinite number
   107         if cnt = 9 then
   106         if cnt = 9 then