share/hedgewars/Data/Maps/ClimbHome/map.lua
changeset 11628 515d2d38ab8b
parent 11620 d5b205f00ac7
child 11632 221691bede23
equal deleted inserted replaced
11626:968bff2534ca 11628:515d2d38ab8b
   388                     SendStat(siCustomAchievement, string.format(loc("%s bravely climbed up to a dizzy height of %d to reach home."),loc(GetHogName(CurrentHedgehog)), getActualHeight(RecordHeight)))
   388                     SendStat(siCustomAchievement, string.format(loc("%s bravely climbed up to a dizzy height of %d to reach home."),loc(GetHogName(CurrentHedgehog)), getActualHeight(RecordHeight)))
   389                     SendStat(siPointType, loc("seconds"))
   389                     SendStat(siPointType, loc("seconds"))
   390                     SendStat(siPlayerKills, tostring(roundedFinishTime), loc(GetHogTeamName(CurrentHedgehog)))
   390                     SendStat(siPlayerKills, tostring(roundedFinishTime), loc(GetHogTeamName(CurrentHedgehog)))
   391 
   391 
   392                     EndGame()
   392                     EndGame()
       
   393                     onAchievementsDeclaration()
   393                     YouWon = true
   394                     YouWon = true
   394                 end
   395                 end
   395             elseif distanceFromWater < 0 and not YouLost then
   396             elseif distanceFromWater < 0 and not YouLost then
   396                 makeMultiPlayerLoserStat(CurrentHedgehog)
   397                 makeMultiPlayerLoserStat(CurrentHedgehog)
   397                 deadHedgehogs = deadHedgehogs + 1
   398                 deadHedgehogs = deadHedgehogs + 1
   398                 YouLost = true
   399                 YouLost = true
   399                 if deadHedgehogs >= totalHedgehogs then
   400                 if deadHedgehogs >= totalHedgehogs then
   400                     makeFinalMultiPlayerStats()
   401                     makeFinalMultiPlayerStats()
   401                     EndGame()
   402                     EndGame()
       
   403                     onAchievementsDeclaration()
   402                 end
   404                 end
   403             end
   405             end
   404 
   406 
   405         if GameTime % 500 == 0 then
   407         if GameTime % 500 == 0 then
   406             --if isSinglePlayer and MaxHeight < 32000 and WaterRise == nil then
   408             --if isSinglePlayer and MaxHeight < 32000 and WaterRise == nil then
   548         else
   550         else
   549             deadHedgehogs = deadHedgehogs + 1
   551             deadHedgehogs = deadHedgehogs + 1
   550             if deadHedgehogs >= totalHedgehogs then
   552             if deadHedgehogs >= totalHedgehogs then
   551                 makeFinalMultiPlayerStats()
   553                 makeFinalMultiPlayerStats()
   552                 EndGame()
   554                 EndGame()
       
   555                 onAchievementsDeclaration()
   553             end
   556             end
   554             makeMultiPlayerLoserStat(gear)
   557             makeMultiPlayerLoserStat(gear)
   555         end
   558         end
   556         YouLost = true
   559         YouLost = true
   557     end
   560     end
   596         SendStat(siCustomAchievement, string.format(text, RecordHeightHogName))
   599         SendStat(siCustomAchievement, string.format(text, RecordHeightHogName))
   597     end
   600     end
   598     SendStat(siPointType, loc("points"))
   601     SendStat(siPointType, loc("points"))
   599     SendStat(siPlayerKills, actualHeight, loc(GetHogTeamName(CurrentHedgehog)))
   602     SendStat(siPlayerKills, actualHeight, loc(GetHogTeamName(CurrentHedgehog)))
   600     EndGame()
   603     EndGame()
       
   604     onAchievementsDeclaration()
   601 end
   605 end
   602 
   606 
   603 function makeMultiPlayerLoserStat(gear)
   607 function makeMultiPlayerLoserStat(gear)
   604     local teamName = GetHogTeamName(gear)
   608     local teamName = GetHogTeamName(gear)
   605     local actualHeight = getActualHeight(MaxHeight)
   609     local actualHeight = getActualHeight(MaxHeight)