share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua
changeset 14590 c5f18710a184
parent 14578 50f511588635
child 14648 be8af70adf2c
equal deleted inserted replaced
14587:164ec37e9e4b 14590:c5f18710a184
    90 function GameOverMan()
    90 function GameOverMan()
    91 	StopMusicSound(sndRideOfTheValkyries)
    91 	StopMusicSound(sndRideOfTheValkyries)
    92 	valkyriesTimer = -1
    92 	valkyriesTimer = -1
    93 	missionWon = false
    93 	missionWon = false
    94 	ProtectEnemies()
    94 	ProtectEnemies()
    95 	ShowMission(loc("Rope-knocking Challenge"), loc("Challenge over!"), loc("Oh no! Just try again!"), -amSkip, 0)
       
    96 	SendStat(siGameResult, loc("Challenge over!"))
    95 	SendStat(siGameResult, loc("Challenge over!"))
    97 	local score = GetKillScore()
    96 	local score = GetKillScore()
    98 	SendStat(siCustomAchievement, string.format(loc("You have killed %d of 16 hedgehogs (+%d points)."), hogsKilled, score))
    97 	SendStat(siCustomAchievement, string.format(loc("You have killed %d of 16 hedgehogs (+%d points)."), hogsKilled, score))
    99 	SendStat(siPointType, "!POINTS")
    98 	SendStat(siPointType, "!POINTS")
   100 	SendStat(siPlayerKills, tostring(score), playerTeamName)
    99 	SendStat(siPlayerKills, tostring(score), playerTeamName)
   101 	PlaySound(sndHellish)
       
   102 
   100 
   103 	-- Update highscore
   101 	-- Update highscore
   104 	updateChallengeRecord("Highscore", score)
   102 	updateChallengeRecord("Highscore", score)
   105 
   103 
   106 	EndGame()
   104 	EndGame()
   251 
   249 
   252 		if not missionEndHandled then
   250 		if not missionEndHandled then
   253 			if missionWon == true then
   251 			if missionWon == true then
   254 				SaveMissionVar("Won", "true")
   252 				SaveMissionVar("Won", "true")
   255 				AddCaption(loc("Victory!"), capcolDefault, capgrpGameState)
   253 				AddCaption(loc("Victory!"), capcolDefault, capgrpGameState)
   256 			else
       
   257 				AddCaption(loc("Challenge over!"), capcolDefault, capgrpGameState)
       
   258 			end
   254 			end
   259 			missionEndHandled = true
   255 			missionEndHandled = true
   260 		end
   256 		end
   261 
   257 
   262 	end
   258 	end