share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
changeset 15970 a803428704fd
parent 15964 d18261ddac4a
equal deleted inserted replaced
15969:9128bb16aaf5 15970:a803428704fd
    30 -----------------------------
    30 -----------------------------
    31 
    31 
    32 HedgewarsScriptLoad("/Scripts/Locale.lua")
    32 HedgewarsScriptLoad("/Scripts/Locale.lua")
    33 HedgewarsScriptLoad("/Scripts/OfficialChallenges.lua")
    33 HedgewarsScriptLoad("/Scripts/OfficialChallenges.lua")
    34 HedgewarsScriptLoad("/Scripts/Params.lua")
    34 HedgewarsScriptLoad("/Scripts/Params.lua")
       
    35 HedgewarsScriptLoad("/Scripts/Utils.lua")
    35 
    36 
    36 ------------------
    37 ------------------
    37 -- Got Variables?
    38 -- Got Variables?
    38 ------------------
    39 ------------------
    39 
    40 
   506                 end
   507                 end
   507 
   508 
   508 		local roundDraw = false
   509 		local roundDraw = false
   509 		if #clanScores >= 2 and clanScores[1].score == clanScores[2].score and clanScores[1].score ~= MAX_TURN_TIME then
   510 		if #clanScores >= 2 and clanScores[1].score == clanScores[2].score and clanScores[1].score ~= MAX_TURN_TIME then
   510 			roundDraw = true
   511 			roundDraw = true
   511                         SendStat(siGameResult, loc("Round draw"))
   512                         SendStat(siGameResult, GetEngineString("TMsgStrId", sidDraw))
   512                         SendStat(siCustomAchievement, loc("The teams are tied for the fastest time."))
   513                         SendStat(siCustomAchievement, loc("The teams are tied for the fastest time."))
   513                 elseif #sortedTeams >= 1 then
   514                 elseif #sortedTeams >= 1 then
   514                         SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name))
   515                         SendStat(siGameResult, formatEngineString(GetEngineString("TMsgStrId", sidWinner), sortedTeams[1].name))
   515                         SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000)))
   516                         SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000)))
   516                         for i=1,#unfinishedArray do
   517                         for i=1,#unfinishedArray do
   517                                  SendStat(siCustomAchievement, unfinishedArray[i])
   518                                  SendStat(siCustomAchievement, unfinishedArray[i])
   518                         end
   519                         end
   519                 else
   520                 else
   520 			roundDraw = true
   521 			roundDraw = true
   521                         SendStat(siGameResult, loc("Round draw"))
   522                         SendStat(siGameResult, GetEngineString("TMsgStrId", sidDraw))
   522                         SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!"))
   523                         SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!"))
   523                         if specialPointsCount > 0 then
   524                         if specialPointsCount > 0 then
   524                                 SendStat(siCustomAchievement, loc("Maybe you should try an easier map next time."))
   525                                 SendStat(siCustomAchievement, loc("Maybe you should try an easier map next time."))
   525                         else
   526                         else
   526                                 SendStat(siCustomAchievement, loc("Maybe you should try easier waypoints next time."))
   527                                 SendStat(siCustomAchievement, loc("Maybe you should try easier waypoints next time."))