hedgewars/uTeams.pas
changeset 304 8096e69e839e
parent 295 8834f3cb620e
child 306 7b61834edcf6
equal deleted inserted replaced
303:1659c4aad5ab 304:8096e69e839e
    54              AttackBar: LongWord;
    54              AttackBar: LongWord;
    55              end;
    55              end;
    56 
    56 
    57 var CurrentTeam: PTeam = nil;
    57 var CurrentTeam: PTeam = nil;
    58     TeamsList: PTeam = nil;
    58     TeamsList: PTeam = nil;
       
    59     CurMinAngle, CurMaxAngle: Longword;
    59 
    60 
    60 function AddTeam: PTeam;
    61 function AddTeam: PTeam;
    61 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
    62 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
    62 procedure SwitchHedgehog;
    63 procedure SwitchHedgehog;
    63 procedure InitTeams;
    64 procedure InitTeams;
   230         while (CurSlot <= cMaxSlotIndex) and (Ammo[CurSlot, CurAmmo].Count = 0) do inc(CurSlot)
   231         while (CurSlot <= cMaxSlotIndex) and (Ammo[CurSlot, CurAmmo].Count = 0) do inc(CurSlot)
   231         end;
   232         end;
   232 
   233 
   233 with Ammo[CurSlot, CurAmmo] do
   234 with Ammo[CurSlot, CurAmmo] do
   234      begin
   235      begin
       
   236      CurMinAngle:= Ammoz[AmmoType].minAngle;
       
   237      if Ammoz[AmmoType].maxAngle <> 0 then CurMaxAngle:= Ammoz[AmmoType].maxAngle
       
   238                                       else CurMaxAngle:= cMaxAngle;
       
   239      with Hedgehog.Gear^ do
       
   240         begin
       
   241         if Angle < CurMinAngle then Angle:= CurMinAngle;
       
   242         if Angle > CurMaxAngle then Angle:= CurMaxAngle;
       
   243         end;
       
   244         
   235      s:= trammo[Ammoz[AmmoType].NameId];
   245      s:= trammo[Ammoz[AmmoType].NameId];
   236      if Count <> AMMO_INFINITE then
   246      if Count <> AMMO_INFINITE then
   237         s:= s + ' (' + IntToStr(Count) + ')';
   247         s:= s + ' (' + IntToStr(Count) + ')';
   238      if (Propz and ammoprop_Timerable) <> 0 then
   248      if (Propz and ammoprop_Timerable) <> 0 then
   239         s:= s + ', ' + inttostr(Timer div 1000) + ' ' + trammo[sidSeconds];
   249         s:= s + ', ' + inttostr(Timer div 1000) + ' ' + trammo[sidSeconds];