share/hedgewars/Data/Maps/TrophyRace/map.lua
changeset 9411 d95ac9992529
parent 9409 6564baf7dedf
child 9657 2d8cae3c0855
equal deleted inserted replaced
9409:6564baf7dedf 9411:d95ac9992529
    29 -- active hog reached the goal?
    29 -- active hog reached the goal?
    30 local reached = false
    30 local reached = false
    31 
    31 
    32 -- hog with best time
    32 -- hog with best time
    33 local besthog = nil
    33 local besthog = nil
       
    34 local besthogteam = ""
    34 
    35 
    35 -- hog with worst time (per round)
    36 -- hog with worst time (per round)
    36 local worsthog = nil
    37 local worsthog = nil
    37 
    38 
    38 -- best time
    39 -- best time
   110 			end
   111 			end
   111 			
   112 			
   112 			if ttime < besttime then
   113 			if ttime < besttime then
   113 				besttime = ttime
   114 				besttime = ttime
   114 				besthog = CurrentHedgehog
   115 				besthog = CurrentHedgehog
       
   116                 besthogteam = GetHogTeamName(besthog)
   115 				hscore = hscore .. loc("NEW fastest lap: ")
   117 				hscore = hscore .. loc("NEW fastest lap: ")
   116 			else
   118 			else
   117 				hscore = hscore .. loc("Fastest lap: ")
   119 				hscore = hscore .. loc("Fastest lap: ")
   118 			end
   120 			end
   119 			if ttime > worsttime then
   121 			if ttime > worsttime then
   163 --	end
   165 --	end
   164 --end
   166 --end
   165 
   167 
   166 function onAchievementsDeclaration()
   168 function onAchievementsDeclaration()
   167     if besthog ~= nil then
   169     if besthog ~= nil then
   168       DeclareAchievement("rope race", GetHogTeamName(besthog), "TrophyRace", besttime)
   170       DeclareAchievement("rope race", besthogteam, "TrophyRace", besttime)
   169     end
   171     end
   170 end
   172 end