share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 13643 690cc84e9fd6
parent 13580 dc4ce9f486b0
child 13680 a2f0cb003d7d
equal deleted inserted replaced
13642:3d14950641a4 13643:690cc84e9fd6
   553 	local statusText, scoreText
   553 	local statusText, scoreText
   554 	if roundNumber >= roundLimit then
   554 	if roundNumber >= roundLimit then
   555 		statusText = loc("Game over!")
   555 		statusText = loc("Game over!")
   556 		scoreText = loc("Final team scores:")
   556 		scoreText = loc("Final team scores:")
   557 	else
   557 	else
   558 		AddCaption(string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit), 0xFFFFFFFF, capgrpMessage)
   558 		AddCaption(string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit), capcolDefault, capgrpMessage)
   559 		return
   559 		return
   560 	end
   560 	end
   561 	local displayTime
   561 	local displayTime
   562 	if roundNumber >= roundLimit then
   562 	if roundNumber >= roundLimit then
   563 		displayTime = 20000
   563 		displayTime = 20000
   574 		for i = 0, (numhhs-1) do
   574 		for i = 0, (numhhs-1) do
   575 			if GetHogTeamName(hhs[i]) == winnerTeam then
   575 			if GetHogTeamName(hhs[i]) == winnerTeam then
   576 				SetState(hhs[i], bor(GetState(hhs[i]), gstWinner))
   576 				SetState(hhs[i], bor(GetState(hhs[i]), gstWinner))
   577 			end
   577 			end
   578 		end
   578 		end
   579 		AddCaption(string.format(loc("%s wins!"), winnerTeam), 0xFFFFFFFF, capgrpGameState)
   579 		AddCaption(string.format(loc("%s wins!"), winnerTeam), capcolDefault, capgrpGameState)
   580 		SendStat(siGameResult, string.format(loc("%s wins!"), winnerTeam))
   580 		SendStat(siGameResult, string.format(loc("%s wins!"), winnerTeam))
   581 
   581 
   582 		for i = 1, TeamsCount do
   582 		for i = 1, TeamsCount do
   583 			SendStat(siPointType, loc("points"))
   583 			SendStat(siPointType, loc("points"))
   584 			SendStat(siPlayerKills, tostring(teamStats[i].score), teamStats[i].name)
   584 			SendStat(siPlayerKills, tostring(teamStats[i].score), teamStats[i].name)
  1277 			TimeLeft = 0
  1277 			TimeLeft = 0
  1278 		end
  1278 		end
  1279 
  1279 
  1280 		if (TimeLeft == 0) then
  1280 		if (TimeLeft == 0) then
  1281 			if PlayerIsFine() then
  1281 			if PlayerIsFine() then
  1282 				AddCaption(loc("Time's up!"), 0xFFFFFFFF, capgrpGameState)
  1282 				AddCaption(loc("Time's up!"), capcolDefault, capgrpGameState)
  1283 			end
  1283 			end
  1284 			if (stopMovement == false) then	--time to stop the player
  1284 			if (stopMovement == false) then	--time to stop the player
  1285 				stopMovement = true
  1285 				stopMovement = true
  1286 				boosterOn = false
  1286 				boosterOn = false
  1287 				beam = false
  1287 				beam = false
  1850 
  1850 
  1851 	playerIsFine = false
  1851 	playerIsFine = false
  1852 	FailGraphics()
  1852 	FailGraphics()
  1853 
  1853 
  1854 	if not kamikaze then
  1854 	if not kamikaze then
  1855 		AddCaption(loc("GOTCHA!"), 0xFFFFFFFF, capgrpGameState)
  1855 		AddCaption(loc("GOTCHA!"), capcolDefault, capgrpGameState)
  1856 		PlaySound(sndHellish)
  1856 		PlaySound(sndHellish)
  1857 	end
  1857 	end
  1858 
  1858 
  1859 	targetHit = true
  1859 	targetHit = true
  1860 
  1860