hedgewars/uTeams.pas
changeset 2855 7e6adeb57427
parent 2826 fbcfc86ef477
child 2856 cc70797a0b75
equal deleted inserted replaced
2854:7aac108149d9 2855:7e6adeb57427
    96     CurrentHedgehog: PHedgehog;
    96     CurrentHedgehog: PHedgehog;
    97     TeamsArray: array[0..Pred(cMaxTeams)] of PTeam;
    97     TeamsArray: array[0..Pred(cMaxTeams)] of PTeam;
    98     TeamsCount: Longword;
    98     TeamsCount: Longword;
    99     ClansArray: array[0..Pred(cMaxTeams)] of PClan;
    99     ClansArray: array[0..Pred(cMaxTeams)] of PClan;
   100     ClansCount: Longword;
   100     ClansCount: Longword;
   101     LocalClan: Longword;  // first non-bot, non-extdriven clan
   101     LocalClan: Longword;  // last non-bot, non-extdriven clan
       
   102     LocalAmmo: Longword;  // last non-bot, non-extdriven clan's first team's ammo index
   102     CurMinAngle, CurMaxAngle: Longword;
   103     CurMinAngle, CurMaxAngle: Longword;
   103 
   104 
   104 procedure init_uTeams;
   105 procedure init_uTeams;
   105 procedure free_uTeams;
   106 procedure free_uTeams;
   106 function  AddTeam(TeamColor: Longword): PTeam;
   107 function  AddTeam(TeamColor: Longword): PTeam;
   345 
   346 
   346 for t:= 0 to Pred(TeamsCount) do
   347 for t:= 0 to Pred(TeamsCount) do
   347    with TeamsArray[t]^ do
   348    with TeamsArray[t]^ do
   348       begin
   349       begin
   349       if (not ExtDriven) and (Hedgehogs[0].BotLevel = 0) then
   350       if (not ExtDriven) and (Hedgehogs[0].BotLevel = 0) then
       
   351           begin
   350           LocalClan:= Clan^.ClanIndex + 1;
   352           LocalClan:= Clan^.ClanIndex + 1;
       
   353           LocalAmmo:= Hedgehogs[0].AmmoStore
       
   354           end;
   351       th:= 0;
   355       th:= 0;
   352       for i:= 0 to cMaxHHIndex do
   356       for i:= 0 to cMaxHHIndex do
   353           if Hedgehogs[i].Gear <> nil then
   357           if Hedgehogs[i].Gear <> nil then
   354              inc(th, Hedgehogs[i].Gear^.Health);
   358              inc(th, Hedgehogs[i].Gear^.Health);
   355       if th > MaxTeamHealth then MaxTeamHealth:= th;
   359       if th > MaxTeamHealth then MaxTeamHealth:= th;