hedgewars/uTeams.pas
changeset 12579 0411e04cf12a
parent 12410 8b971d8944d6
child 12919 0f02dd1ff4c9
child 13245 195208deff1d
equal deleted inserted replaced
12578:5b23c42ef150 12579:0411e04cf12a
    85         if SendGameResultOn then
    85         if SendGameResultOn then
    86             SendStat(siGameResult, shortstring(trmsg[sidDraw]));
    86             SendStat(siGameResult, shortstring(trmsg[sidDraw]));
    87         AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000);
    87         AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000);
    88         end
    88         end
    89     else // win
    89     else // win
       
    90         begin
    90         with AliveClan^ do
    91         with AliveClan^ do
    91             begin
    92             begin
    92             ts:= ansistring(Teams[0]^.TeamName);
    93             ts:= ansistring(Teams[0]^.TeamName);
    93             if TeamsNumber = 1 then // team wins
    94             if TeamsNumber = 1 then // team wins
    94                 begin
    95                 begin
    95                 s:= FormatA(trmsg[sidWinner], ts);
    96                 s:= FormatA(trmsg[sidWinner], ts);
    96                 cap:= FormatA(GetEventString(eidRoundWin), ts);
    97                 cap:= FormatA(GetEventString(eidRoundWin), ts);
       
    98                 AddCaption(cap, cWhiteColor, capgrpGameState);
    97                 end
    99                 end
    98             else // clan wins
   100             else // clan wins
    99                 // FIXME: Clan needs a different message
       
   100                 begin
   101                 begin
   101                 s:= FormatA(trmsg[sidWinner], ts);
   102                 s:= '';
   102                 cap:= FormatA(GetEventString(eidRoundWin), ts);
   103                 for j:= 0 to Pred(TeamsNumber) do
       
   104                     begin
       
   105                     (*
       
   106                     Currently, the game result string is just the victory
       
   107                     string concatenated multiple times. This assumes that
       
   108                     sidWinner is a complete sentence.
       
   109                     This might not work well for some languages.
       
   110 
       
   111                     FIXME/TODO: Add event strings for 2, 3, 4 and >4 teams winning.
       
   112                                  This requires FormatA to work with multiple parameters. *)
       
   113                     ts:= Teams[j]^.TeamName;
       
   114                     s:= s + ' ' + FormatA(trmsg[sidWinner], ts);
       
   115 
       
   116                     // FIXME: Show victory captions one-by-one, not all at once
       
   117                     cap:= FormatA(GetEventString(eidRoundWin), ts);
       
   118                     AddCaption(cap, cWhiteColor, capgrpGameState);
       
   119                     end;
   103                 end;
   120                 end;
   104 
   121 
   105             for j:= 0 to Pred(TeamsNumber) do
   122             for j:= 0 to Pred(TeamsNumber) do
   106                 with Teams[j]^ do
   123                 with Teams[j]^ do
   107                     for i:= 0 to cMaxHHIndex do
   124                     for i:= 0 to cMaxHHIndex do
   110                                 Gear^.State:= gstWinner;
   127                                 Gear^.State:= gstWinner;
   111             if Flawless then
   128             if Flawless then
   112                 AddVoice(sndFlawless, Teams[0]^.voicepack)
   129                 AddVoice(sndFlawless, Teams[0]^.voicepack)
   113             else
   130             else
   114                 AddVoice(sndVictory, Teams[0]^.voicepack);
   131                 AddVoice(sndVictory, Teams[0]^.voicepack);
   115 
       
   116             AddCaption(cap, cWhiteColor, capgrpGameState);
       
   117             if SendGameResultOn then
       
   118                 SendStat(siGameResult, shortstring(s));
       
   119             AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000)
       
   120             end;
   132             end;
       
   133 
       
   134         if SendGameResultOn then
       
   135             SendStat(siGameResult, shortstring(s));
       
   136         AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000)
       
   137         end;
   121     SendStats;
   138     SendStats;
   122     end;
   139     end;
   123 TeamsGameOver:= true;
   140 TeamsGameOver:= true;
   124 GameOver:= true
   141 GameOver:= true
   125 end;
   142 end;