hedgewars/uTeams.pas
changeset 2758 033aa644578f
parent 2747 7889a3a9724f
child 2762 2fbc8d35eb52
equal deleted inserted replaced
2757:8dbfe782218c 2758:033aa644578f
   304 procedure InitTeams;
   304 procedure InitTeams;
   305 var i, t: LongInt;
   305 var i, t: LongInt;
   306     th: LongInt;
   306     th: LongInt;
   307 begin
   307 begin
   308 
   308 
   309 // Some initial King buffs
       
   310 if (GameFlags and gfKing) <> 0 then
       
   311    for i:= 0 to Pred(ClansCount) do 
       
   312       begin
       
   313       with ClansArray[i]^.Teams[0]^.Hedgehogs[0] do
       
   314          begin
       
   315          King:= true;
       
   316          Hat:= 'crown';
       
   317          Gear^.Health:= hwRound(int2hwFloat(Gear^.Health)*_1_5);
       
   318          end
       
   319       end;
       
   320 
       
   321 for t:= 0 to Pred(TeamsCount) do
   309 for t:= 0 to Pred(TeamsCount) do
   322    with TeamsArray[t]^ do
   310    with TeamsArray[t]^ do
   323       begin
   311       begin
   324       if (not ExtDriven) and (Hedgehogs[0].BotLevel = 0) then
   312       if (not ExtDriven) and (Hedgehogs[0].BotLevel = 0) then
   325           LocalClan:= Clan^.ClanIndex + 1;
   313           LocalClan:= Clan^.ClanIndex + 1;
   326       th:= 0;
   314       th:= 0;
       
   315       // Some initial King buffs
       
   316       if (GameFlags and gfKing) <> 0 then
       
   317           begin
       
   318           Hedgehogs[0].King:= true;
       
   319           Hedgehogs[0].Hat:= 'crown';
       
   320           inc(Hedgehogs[0].Gear^.Health, hwRound(int2hwFloat(Hedgehogs[0].Gear^.Health)*_1_5))
       
   321           end;
   327       for i:= 0 to cMaxHHIndex do
   322       for i:= 0 to cMaxHHIndex do
   328           if Hedgehogs[i].Gear <> nil then
   323           if Hedgehogs[i].Gear <> nil then
   329              inc(th, Hedgehogs[i].Gear^.Health);
   324              inc(th, Hedgehogs[i].Gear^.Health);
   330       if th > MaxTeamHealth then MaxTeamHealth:= th;
   325       if th > MaxTeamHealth then MaxTeamHealth:= th;
   331       end;
   326       end;