hedgewars/uTeams.pas
changeset 80 3c3dc6a148ca
parent 79 29b477319854
child 81 d74e0e914b50
equal deleted inserted replaced
79:29b477319854 80:3c3dc6a148ca
    81 function  TeamSize(p: PTeam): Longword;
    81 function  TeamSize(p: PTeam): Longword;
    82 procedure RecountTeamHealth(team: PTeam);
    82 procedure RecountTeamHealth(team: PTeam);
    83 procedure RestoreTeamsFromSave;
    83 procedure RestoreTeamsFromSave;
    84 
    84 
    85 implementation
    85 implementation
    86 uses uMisc, uStore, uWorld, uIO, uAI;
    86 uses uMisc, uStore, uWorld, uIO, uAI, uLocale;
    87 const MaxTeamHealth: integer = 0;
    87 const MaxTeamHealth: integer = 0;
    88 
    88 
    89 procedure FreeTeamsList; forward;
    89 procedure FreeTeamsList; forward;
    90 
    90 
    91 procedure SwitchHedgehog;
    91 procedure SwitchHedgehog;
   146 end;
   146 end;
   147 
   147 
   148 function AddTeam: PTeam;
   148 function AddTeam: PTeam;
   149 begin
   149 begin
   150 New(Result);
   150 New(Result);
   151 TryDo(Result <> nil, 'AddTean: Result = nil', true);
   151 TryDo(Result <> nil, 'AddTeam: Result = nil', true);
   152 FillChar(Result^, sizeof(TTeam), 0);
   152 FillChar(Result^, sizeof(TTeam), 0);
   153 Result.AttackBar:= 2;
   153 Result.AttackBar:= 2;
   154 if TeamsList = nil then TeamsList:= Result
   154 if TeamsList = nil then TeamsList:= Result
   155                    else begin
   155                    else begin
   156                         Result.Next:= TeamsList;
   156                         Result.Next:= TeamsList;
   232         while (CurAmmo <= cMaxSlotAmmoIndex) and (Ammo[CurSlot, CurAmmo].Count = 0) do inc(CurAmmo)
   232         while (CurAmmo <= cMaxSlotAmmoIndex) and (Ammo[CurSlot, CurAmmo].Count = 0) do inc(CurAmmo)
   233         end;
   233         end;
   234 
   234 
   235 with Ammo[CurSlot, CurAmmo] do
   235 with Ammo[CurSlot, CurAmmo] do
   236      begin
   236      begin
   237      s:= Ammoz[AmmoType].Name;
   237      s:= trammo[Ammoz[AmmoType].NameId];
   238      if Count <> AMMO_INFINITE then
   238      if Count <> AMMO_INFINITE then
   239         s:= s + ' (' + IntToStr(Count) + ')';
   239         s:= s + ' (' + IntToStr(Count) + ')';
   240      if (Propz and ammoprop_Timerable) <> 0 then
   240      if (Propz and ammoprop_Timerable) <> 0 then
   241         s:= s + ', ' + inttostr(Timer div 1000) + ' sec';
   241         s:= s + ', ' + inttostr(Timer div 1000) + ' sec';
   242      AddCaption(s, Team.Color, capgrpAmmoinfo);
   242      AddCaption(s, Team.Color, capgrpAmmoinfo);