share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua
changeset 11892 0526a26ddd6e
parent 11692 68eddcdc9f26
child 11952 63988f36debf
equal deleted inserted replaced
11891:d79621bcb709 11892:0526a26ddd6e
   186 
   186 
   187 function heroWin(gear)
   187 function heroWin(gear)
   188 	saveBonus(3, 4)
   188 	saveBonus(3, 4)
   189 	SendStat(siGameResult, loc("Congratulations, you won!"))
   189 	SendStat(siGameResult, loc("Congratulations, you won!"))
   190 	SendStat(siCustomAchievement, string.format(loc("You completed the mission in %d rounds."), TotalRounds))
   190 	SendStat(siCustomAchievement, string.format(loc("You completed the mission in %d rounds."), TotalRounds))
       
   191 	local record = tonumber(GetCampaignVar("FastestSpecialistsKill"))
       
   192 	if record ~= nil and TotalRounds >= record then
       
   193 		SendStat(siCustomAchievement, string.format(loc("Your fastest victory so far: %d rounds"), record))
       
   194 	end
       
   195 	if record == nil or TotalRounds < record then
       
   196 		SaveCampaignVar("FastestSpecialistsKill", tostring(TotalRounds))
       
   197 		if record ~= nil then
       
   198 			SendStat(siCustomAchievement, loc("This is a new personal best, congratulations!"))
       
   199 		end
       
   200 	end
   191 	SendStat(siCustomAchievement, loc("The next 4 times you play the \"The last encounter\" mission you'll get 20 more hit points and a laser sight."))
   201 	SendStat(siCustomAchievement, loc("The next 4 times you play the \"The last encounter\" mission you'll get 20 more hit points and a laser sight."))
   192 	SendStat(siPlayerKills,'1',teamA.name)
   202 	SendStat(siPlayerKills,'1',teamA.name)
   193 	EndGame()
   203 	EndGame()
   194 end
   204 end
   195 
   205