51 var GameOver: boolean; |
51 var GameOver: boolean; |
52 NextClan: boolean; |
52 NextClan: boolean; |
53 |
53 |
54 function CheckForWin: boolean; |
54 function CheckForWin: boolean; |
55 var AliveClan: PClan; |
55 var AliveClan: PClan; |
56 s: shortstring; |
56 s, ts: ansistring; |
57 t, AliveCount, i, j: LongInt; |
57 t, AliveCount, i, j: LongInt; |
58 begin |
58 begin |
59 CheckForWin:= false; |
59 CheckForWin:= false; |
60 AliveCount:= 0; |
60 AliveCount:= 0; |
61 for t:= 0 to Pred(ClansCount) do |
61 for t:= 0 to Pred(ClansCount) do |
79 if not GameOver then |
79 if not GameOver then |
80 begin |
80 begin |
81 if AliveCount = 0 then |
81 if AliveCount = 0 then |
82 begin // draw |
82 begin // draw |
83 AddCaption(trmsg[sidDraw], cWhiteColor, capgrpGameState); |
83 AddCaption(trmsg[sidDraw], cWhiteColor, capgrpGameState); |
84 SendStat(siGameResult, trmsg[sidDraw]); |
84 SendStat(siGameResult, shortstring(trmsg[sidDraw])); |
85 AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) |
85 AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) |
86 end |
86 end |
87 else // win |
87 else // win |
88 with AliveClan^ do |
88 with AliveClan^ do |
89 begin |
89 begin |
|
90 ts:= ansistring(Teams[0]^.TeamName); |
90 if TeamsNumber = 1 then |
91 if TeamsNumber = 1 then |
91 s:= Format(shortstring(trmsg[sidWinner]), Teams[0]^.TeamName) // team wins |
92 s:= FormatA(trmsg[sidWinner], ts) // team wins |
92 else |
93 else |
93 s:= Format(shortstring(trmsg[sidWinner]), Teams[0]^.TeamName); // clan wins |
94 s:= FormatA(trmsg[sidWinner], ts); // clan wins |
94 |
95 |
95 for j:= 0 to Pred(TeamsNumber) do |
96 for j:= 0 to Pred(TeamsNumber) do |
96 with Teams[j]^ do |
97 with Teams[j]^ do |
97 for i:= 0 to cMaxHHIndex do |
98 for i:= 0 to cMaxHHIndex do |
98 with Hedgehogs[i] do |
99 with Hedgehogs[i] do |
102 AddVoice(sndFlawless, Teams[0]^.voicepack) |
103 AddVoice(sndFlawless, Teams[0]^.voicepack) |
103 else |
104 else |
104 AddVoice(sndVictory, Teams[0]^.voicepack); |
105 AddVoice(sndVictory, Teams[0]^.voicepack); |
105 |
106 |
106 AddCaption(s, cWhiteColor, capgrpGameState); |
107 AddCaption(s, cWhiteColor, capgrpGameState); |
107 SendStat(siGameResult, s); |
108 SendStat(siGameResult, shortstring(s)); |
108 AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) |
109 AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) |
109 end; |
110 end; |
110 SendStats; |
111 SendStats; |
111 end; |
112 end; |
112 GameOver:= true |
113 GameOver:= true |
332 GetRandom(2); // needed to avoid extdriven desync |
333 GetRandom(2); // needed to avoid extdriven desync |
333 AddVoice(sndYesSir, CurrentTeam^.voicepack); |
334 AddVoice(sndYesSir, CurrentTeam^.voicepack); |
334 end; |
335 end; |
335 if cHedgehogTurnTime < 1000000 then |
336 if cHedgehogTurnTime < 1000000 then |
336 ReadyTimeLeft:= cReadyDelay; |
337 ReadyTimeLeft:= cReadyDelay; |
337 AddCaption(Format(shortstring(trmsg[sidReady]), CurrentTeam^.TeamName), cWhiteColor, capgrpGameState) |
338 s:= ansistring(CurrentTeam^.TeamName); |
|
339 AddCaption(FormatA(trmsg[sidReady], s), cWhiteColor, capgrpGameState) |
338 end |
340 end |
339 else |
341 else |
340 begin |
342 begin |
341 if TurnTimeLeft > 0 then |
343 if TurnTimeLeft > 0 then |
342 begin |
344 begin |