equal
deleted
inserted
replaced
151 SetHealth(hhs[i],0) |
151 SetHealth(hhs[i],0) |
152 end |
152 end |
153 end |
153 end |
154 end |
154 end |
155 if CurrentHedgehog ~= nil then |
155 if CurrentHedgehog ~= nil then |
156 AddCaption(string.format(loc("Victory for %s!"), GetHogTeamName(CurrentHedgehog)), 0xFFFFFFFF, capgrpGameState) |
156 AddCaption(string.format(loc("Victory for %s!"), GetHogTeamName(CurrentHedgehog)), capcolDefault, capgrpGameState) |
157 updateScores() |
157 updateScores() |
158 end |
158 end |
159 |
159 |
160 -- Calculate team rankings |
160 -- Calculate team rankings |
161 |
161 |
200 if (GetHogClan(CurrentHedgehog) == flagClan) and (thiefClan ~= nil) and (fIsMissing[flagClan] == false) then |
200 if (GetHogClan(CurrentHedgehog) == flagClan) and (thiefClan ~= nil) and (fIsMissing[flagClan] == false) then |
201 |
201 |
202 fIsMissing[thiefClan] = false |
202 fIsMissing[thiefClan] = false |
203 fNeedsRespawn[thiefClan] = true |
203 fNeedsRespawn[thiefClan] = true |
204 fCaptures[flagClan] = fCaptures[flagClan] +1 |
204 fCaptures[flagClan] = fCaptures[flagClan] +1 |
205 AddCaption(string.format(loc("%s has scored!"), GetHogName(CurrentHedgehog)), 0xFFFFFFFF, capgrpGameState) |
205 AddCaption(string.format(loc("%s has scored!"), GetHogName(CurrentHedgehog)), capcolDefault, capgrpGameState) |
206 updateScores() |
206 updateScores() |
207 PlaySound(sndHomerun) |
207 PlaySound(sndHomerun) |
208 fThief[thiefClan] = nil -- player no longer has the enemy flag |
208 fThief[thiefClan] = nil -- player no longer has the enemy flag |
209 fThiefFlag[flagClan] = nil |
209 fThiefFlag[flagClan] = nil |
210 |
210 |
223 DeleteVisualGear(fGear[flagClan]) |
223 DeleteVisualGear(fGear[flagClan]) |
224 fGear[flagClan] = nil -- the flag has now disappeared |
224 fGear[flagClan] = nil -- the flag has now disappeared |
225 |
225 |
226 fNeedsRespawn[flagClan] = true |
226 fNeedsRespawn[flagClan] = true |
227 HandleRespawns() -- this will set fIsMissing[flagClan] to false :) |
227 HandleRespawns() -- this will set fIsMissing[flagClan] to false :) |
228 AddCaption(loc("Flag returned!"), 0xFFFFFFFF, capgrpMessage2) |
228 AddCaption(loc("Flag returned!"), capcolDefault, capgrpMessage2) |
229 |
229 |
230 --if the player is taking the enemy flag (not possible if already holding a flag) |
230 --if the player is taking the enemy flag (not possible if already holding a flag) |
231 elseif GetHogClan(CurrentHedgehog) ~= flagClan and (thiefClan == nil) then |
231 elseif GetHogClan(CurrentHedgehog) ~= flagClan and (thiefClan == nil) then |
232 |
232 |
233 DeleteVisualGear(fGear[flagClan]) |
233 DeleteVisualGear(fGear[flagClan]) |
240 fThief[flagClan] = hhs[i] |
240 fThief[flagClan] = hhs[i] |
241 fThiefFlag[flagClan] = flagClan |
241 fThiefFlag[flagClan] = flagClan |
242 end |
242 end |
243 end |
243 end |
244 end |
244 end |
245 AddCaption(loc("Flag captured!"), 0xFFFFFFFF, capgrpMessage2) |
245 AddCaption(loc("Flag captured!"), capcolDefault, capgrpMessage2) |
246 |
246 |
247 end |
247 end |
248 |
248 |
249 end |
249 end |
250 |
250 |
280 fGearX[i] = fSpawnX[i] |
280 fGearX[i] = fSpawnX[i] |
281 fGearY[i] = fSpawnY[i] |
281 fGearY[i] = fSpawnY[i] |
282 |
282 |
283 fNeedsRespawn[i] = false |
283 fNeedsRespawn[i] = false |
284 fIsMissing[i] = false -- new, this should solve problems of a respawned flag being "returned" when a player tries to score |
284 fIsMissing[i] = false -- new, this should solve problems of a respawned flag being "returned" when a player tries to score |
285 AddCaption(loc("Flag respawned!"), 0xFFFFFFFF, capgrpMessage2) |
285 AddCaption(loc("Flag respawned!"), capcolDefault, capgrpMessage2) |
286 end |
286 end |
287 |
287 |
288 end |
288 end |
289 |
289 |
290 end |
290 end |
410 end |
410 end |
411 |
411 |
412 function StartTheGame() |
412 function StartTheGame() |
413 |
413 |
414 gameStarted = true |
414 gameStarted = true |
415 AddCaption(loc("Game Started!"), 0xFFFFFFFF, capgrpGameState) |
415 AddCaption(loc("Game Started!"), capcolDefault, capgrpGameState) |
416 |
416 |
417 for i = 0, ClansCount-1 do |
417 for i = 0, ClansCount-1 do |
418 |
418 |
419 fGear[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
419 fGear[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
420 fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
420 fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |