hedgewars/uTeams.pas
changeset 498 9c8b385dc9a1
parent 393 db01cc79f278
child 534 92fb2b0d5117
equal deleted inserted replaced
497:adf1aee202c6 498:9c8b385dc9a1
   102 TurnTimeLeft:= 0;
   102 TurnTimeLeft:= 0;
   103 if AliveCount = 0 then
   103 if AliveCount = 0 then
   104    begin // draw
   104    begin // draw
   105    AddCaption(trmsg[sidDraw], $FFFFFF, capgrpGameState);
   105    AddCaption(trmsg[sidDraw], $FFFFFF, capgrpGameState);
   106    SendStat(siGameResult, trmsg[sidDraw]);
   106    SendStat(siGameResult, trmsg[sidDraw]);
   107    AddGear(0, 0, gtATFinishGame, 0, 0, 0, 2000)
   107    AddGear(0, 0, gtATFinishGame, 0, _0, _0, 2000)
   108    end else // win
   108    end else // win
   109    begin
   109    begin
   110    s:= Format(trmsg[sidWinner], AliveTeam^.TeamName);
   110    s:= Format(trmsg[sidWinner], AliveTeam^.TeamName);
   111    AddCaption(s, $FFFFFF, capgrpGameState);
   111    AddCaption(s, $FFFFFF, capgrpGameState);
   112    SendStat(siGameResult, s);
   112    SendStat(siGameResult, s);
   113    AddGear(0, 0, gtATFinishGame, 0, 0, 0, 2000)
   113    AddGear(0, 0, gtATFinishGame, 0, _0, _0, 2000)
   114    end;
   114    end;
   115 SendStats
   115 SendStats
   116 end;
   116 end;
   117 
   117 
   118 procedure SwitchHedgehog;
   118 procedure SwitchHedgehog;
   156      FollowGear:= Gear
   156      FollowGear:= Gear
   157      end;
   157      end;
   158 ResetKbd;
   158 ResetKbd;
   159 
   159 
   160 cWindSpeed:= rndSign(GetRandom * cMaxWindSpeed);
   160 cWindSpeed:= rndSign(GetRandom * cMaxWindSpeed);
   161 g:= AddGear(0, 0, gtATSmoothWindCh, 0, 0, 0, 1);
   161 g:= AddGear(0, 0, gtATSmoothWindCh, 0, _0, _0, 1);
   162 g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
   162 g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
   163 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}
   163 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}
   164 ApplyAmmoChanges(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   164 ApplyAmmoChanges(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   165 if CurrentTeam^.ExtDriven then SetDefaultBinds
   165 if CurrentTeam^.ExtDriven then SetDefaultBinds
   166                           else SetBinds(CurrentTeam^.Binds);
   166                           else SetBinds(CurrentTeam^.Binds);
   295         MaxTeamHealth:= TeamHealthBarWidth;
   295         MaxTeamHealth:= TeamHealthBarWidth;
   296         RecountAllTeamsHealth;
   296         RecountAllTeamsHealth;
   297         end else TeamHealthBarWidth:= (TeamHealthBarWidth * cTeamHealthWidth) div MaxTeamHealth
   297         end else TeamHealthBarWidth:= (TeamHealthBarWidth * cTeamHealthWidth) div MaxTeamHealth
   298      end;
   298      end;
   299 // FIXME: at the game init, gtTeamHealthSorters are created for each team, and they work simultaneously
   299 // FIXME: at the game init, gtTeamHealthSorters are created for each team, and they work simultaneously
   300 AddGear(0, 0, gtTeamHealthSorter, 0, 0, 0, 0)
   300 AddGear(0, 0, gtTeamHealthSorter, 0, _0, _0, 0)
   301 end;
   301 end;
   302 
   302 
   303 procedure RestoreTeamsFromSave;
   303 procedure RestoreTeamsFromSave;
   304 var p: PTeam;
   304 var p: PTeam;
   305 begin
   305 begin