Use the traditional winning sequence in Space Invasion again (killing off the losers)
authorWuzzy <almikes@aol.com>
Wed, 26 Apr 2017 02:28:13 +0200
changeset 12339 0bc8c5fcd08c
parent 12338 6bdabf67a012
child 12340 8f693d25be2f
Use the traditional winning sequence in Space Invasion again (killing off the losers)
share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Wed Apr 26 02:10:47 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Wed Apr 26 02:28:13 2017 +0200
@@ -740,20 +740,21 @@
 		statusText = loc("Status Update")
 		scoreText = loc("Team scores:")
 	end
+	local displayTime
+	if roundNumber >= roundLimit then
+		displayTime = 20000
+	else
+		displayTime = 1
+	end
 	ShowMission(	loc("Space Invasion"),
 			statusText,
 			string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "| " .. "|" ..
-			scoreText .. " |" ..entireC, 4, 1)
+			scoreText .. " |" ..entireC, 4, displayTime)
 
 	if roundNumber >= roundLimit then
 		local winnerTeam = teamStats[1].name
-		local victorySoundPlayed = false
 		for i = 0, (numhhs-1) do
 			if GetHogTeamName(hhs[i]) == winnerTeam then
-				if not victorySoundPlayer then
-					PlaySound(sndVictory, hhs[i])
-					victorySoundPlayed = true
-				end
 				SetState(hhs[i], bor(GetState(hhs[i]), gstWinner))
 			end
 		end
@@ -898,11 +899,19 @@
 			end
 		end
 
+		-- Kill off all the losers
+		for i = 0, (numhhs-1) do
+			if GetHogClan(hhs[i]) ~= bestClan then
+				SetEffect(hhs[i], heResurrectable, 0)
+				SetHealth(hhs[i],0)
+			end
+		end
+
+		-- Game over
 		gameOver = true
 		EndTurn(true)
 		TimeLeft = 0
 		SendStat(siGraphTitle, "Score graph")
-		EndGame()
 	end
 end
 
@@ -1228,6 +1237,9 @@
 end
 
 function onGameStart()
+	SendGameResultOff()
+	SendRankingStatsOff()
+	SendAchievementsStatsOff()
 	SendHealthStatsOff()
 
 	ShowMission	(