116 ts[j] := Teams[j]^.TeamName; |
120 ts[j] := Teams[j]^.TeamName; |
117 end; |
121 end; |
118 |
122 |
119 // Write victory message for caption and stats page |
123 // Write victory message for caption and stats page |
120 if (TeamsNumber = cMaxTeams) or (TeamsCount = TeamsNumber) then |
124 if (TeamsNumber = cMaxTeams) or (TeamsCount = TeamsNumber) then |
|
125 begin |
121 // No enemies for some reason … Everyone wins!!1! |
126 // No enemies for some reason … Everyone wins!!1! |
122 s:= trmsg[sidWinnerAll] |
127 s:= trmsg[sidWinnerAll]; |
|
128 allWin:= true; |
|
129 end |
123 else if (TeamsNumber >= 2) and (TeamsNumber < cMaxTeams) then |
130 else if (TeamsNumber >= 2) and (TeamsNumber < cMaxTeams) then |
124 // List all winning teams in a list |
131 // List all winning teams in a list |
125 s:= FormatA(trmsg[TMsgStrId(Ord(sidWinner2) + (TeamsNumber - 2))], ts); |
132 if (TeamsNumber = 2) then |
|
133 s:= FormatA(trmsg[TMsgStrId(sidWinner2)], ts[0], ts[1]) |
|
134 else if (TeamsNumber = 3) then |
|
135 s:= FormatA(trmsg[TMsgStrId(sidWinner3)], ts[0], ts[1], ts[2]) |
|
136 else if (TeamsNumber = 4) then |
|
137 s:= FormatA(trmsg[TMsgStrId(sidWinner4)], ts[0], ts[1], ts[2], ts[3]) |
|
138 else if (TeamsNumber = 5) then |
|
139 s:= FormatA(trmsg[TMsgStrId(sidWinner5)], ts[0], ts[1], ts[2], ts[3], ts[4]) |
|
140 else if (TeamsNumber = 6) then |
|
141 s:= FormatA(trmsg[TMsgStrId(sidWinner6)], ts[0], ts[1], ts[2], ts[3], ts[4], ts[5]) |
|
142 else if (TeamsNumber = 7) then |
|
143 s:= FormatA(trmsg[TMsgStrId(sidWinner7)], ts[0], ts[1], ts[2], ts[3], ts[4], ts[5], ts[6]); |
126 |
144 |
127 // The winner caption is the same as the stats message and not randomized |
145 // The winner caption is the same as the stats message and not randomized |
128 cap:= s; |
146 cap:= s; |
129 AddCaption(cap, capcolDefault, capgrpGameState); |
147 AddCaption(cap, capcolDefault, capgrpGameState); |
130 // TODO (maybe): Show victory animation/captions per-team instead of all winners at once? |
148 // TODO (maybe): Show victory animation/captions per-team instead of all winners at once? |
131 end; |
149 end; |
132 |
150 |
|
151 // Enable winner state for winning hogs and move camera to a winning hedgehog |
|
152 winCamera:= false; |
133 for j:= 0 to Pred(TeamsNumber) do |
153 for j:= 0 to Pred(TeamsNumber) do |
134 with Teams[j]^ do |
154 with Teams[j]^ do |
135 for i:= 0 to cMaxHHIndex do |
155 for i:= 0 to cMaxHHIndex do |
136 with Hedgehogs[i] do |
156 with Hedgehogs[i] do |
137 if (Gear <> nil) then |
157 if (Gear <> nil) then |
|
158 begin |
|
159 if (not winCamera) then |
|
160 begin |
|
161 FollowGear:= Gear; |
|
162 winCamera:= true; |
|
163 end; |
138 Gear^.State:= gstWinner; |
164 Gear^.State:= gstWinner; |
|
165 end; |
139 if Flawless then |
166 if Flawless then |
140 AddVoice(sndFlawless, Teams[0]^.voicepack) |
167 AddVoice(sndFlawless, Teams[0]^.voicepack) |
141 else |
168 else |
142 AddVoice(sndVictory, Teams[0]^.voicepack); |
169 AddVoice(sndVictory, Teams[0]^.voicepack); |
143 end; |
170 end; |
144 |
171 |
145 if SendGameResultOn then |
172 if SendGameResultOn then |
146 SendStat(siGameResult, shortstring(s)); |
173 SendStat(siGameResult, shortstring(s)); |
|
174 if allWin and SendAchievementsStatsOn then |
|
175 SendStat(siEverAfter, ''); |
147 AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) |
176 AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000) |
148 end; |
177 end; |
149 SendStats; |
178 SendStats; |
150 end; |
179 end; |
151 TeamsGameOver:= true; |
180 TeamsGameOver:= true; |