462 table.sort(teamsSorted, function(team1, team2) return getTeamValue(team1, "Score") < getTeamValue(team2, "Score") end) |
464 table.sort(teamsSorted, function(team1, team2) return getTeamValue(team1, "Score") < getTeamValue(team2, "Score") end) |
463 for i=TeamsCount, 1, -1 do |
465 for i=TeamsCount, 1, -1 do |
464 SendStat(siPointType, loc("point(s)")) |
466 SendStat(siPointType, loc("point(s)")) |
465 SendStat(siPlayerKills, getTeamValue(teamsSorted[i], "Score"), teamsSorted[i]) |
467 SendStat(siPlayerKills, getTeamValue(teamsSorted[i], "Score"), teamsSorted[i]) |
466 end |
468 end |
467 |
|
468 AddCaption(string.format(loc("%s wins!"), winTeam), 0xFFFFFFFF, capgrpGameState ) |
|
469 SendStat(siGameResult, string.format("%s wins!", winTeam)) |
|
470 |
469 |
471 ShowMission( loc("Mutant"), |
470 ShowMission( loc("Mutant"), |
472 loc("Final result"), |
471 loc("Final result"), |
473 string.format(loc("Winner: %s"), winTeam) .. "| |" .. loc("Scores:") .. " |" .. |
472 string.format(loc("Winner: %s"), winTeam) .. "| |" .. loc("Scores:") .. " |" .. |
474 showScore, 0, 15000) |
473 showScore, 0, 15000) |
749 teams[TeamsCount - 1] = nil |
748 teams[TeamsCount - 1] = nil |
750 TeamsCount = TeamsCount - 1 |
749 TeamsCount = TeamsCount - 1 |
751 end |
750 end |
752 AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
751 AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
753 trackDeletion(gear) |
752 trackDeletion(gear) |
754 |
|
755 -- End game properly when only the winner remains |
|
756 if gameOver and numhhs == 1 then |
|
757 EndGame() |
|
758 end |
|
759 elseif GetGearType(gear) == gtCase then |
753 elseif GetGearType(gear) == gtCase then |
760 -- Check if a crate has been collected |
754 -- Check if a crate has been collected |
761 if band(GetGearMessage(gear), gmDestroy) ~= 0 and CurrentHedgehog ~= nil then |
755 if band(GetGearMessage(gear), gmDestroy) ~= 0 and CurrentHedgehog ~= nil then |
762 -- Update crate collection achievement |
756 -- Update crate collection achievement |
763 increaseTeamValue(GetHogTeamName(CurrentHedgehog), "Crates") |
757 increaseTeamValue(GetHogTeamName(CurrentHedgehog), "Crates") |