share/hedgewars/Data/Maps/ClimbHome/map.lua
changeset 11889 c8979eeb73fa
parent 11635 2a53e219bc1a
child 12077 ce3860c82c8b
equal deleted inserted replaced
11888:618d99523933 11889:c8979eeb73fa
    33 local jokeAwardNavy = nil
    33 local jokeAwardNavy = nil
    34 local jokeAwardSpeed = nil
    34 local jokeAwardSpeed = nil
    35 local jokeAwardDamage = nil
    35 local jokeAwardDamage = nil
    36 local recordBroken = false
    36 local recordBroken = false
    37 local ready = false
    37 local ready = false
    38 local showWaterStats = false -- uses the AI team to draw water height.
       
    39 local scaleGraph = false
       
    40 local dummyHog = nil
    38 local dummyHog = nil
    41 local dummySkip = 0
    39 local dummySkip = 0
    42 local baseWaterSpeed = 2
    40 local baseWaterSpeed = 2
    43 local waterSpeed = 0
    41 local waterSpeed = 0
    44 local waterAccel = 0
    42 local waterAccel = 0
    78     DisableGameFlags(gfBottomBorder+gfBorder)
    76     DisableGameFlags(gfBottomBorder+gfBorder)
    79     --This reduced startup time by only about 15% and looked ugly
    77     --This reduced startup time by only about 15% and looked ugly
    80     --EnableGameFlags(gfDisableLandObjects) 
    78     --EnableGameFlags(gfDisableLandObjects) 
    81     -- force seed instead.  Some themes will still be easier, but at least you won't luck out on the same theme
    79     -- force seed instead.  Some themes will still be easier, but at least you won't luck out on the same theme
    82     Seed = ClimbHome
    80     Seed = ClimbHome
    83     if showWaterStats then
       
    84         AddTeam(" ", 0x545C9D, "Simple", "Island", "Default")
       
    85     elseif scaleGraph then
       
    86         AddTeam(" ", 0x050505, "Simple", "Island", "Default")
       
    87     end
       
    88     if showWaterStats or scaleGraph then
       
    89         dummyHog = AddHog(" ", 0, 1, "NoHat")
       
    90         HH[dummyHog] = nil
       
    91         totalHedgehogs = totalHedgehogs - 1
       
    92         teams[GetHogTeamName(dummyHog)] = nil
       
    93         SendStat(siClanHealth, tostring(32640), " ")
       
    94     end
       
    95 end
    81 end
    96 
    82 
    97 function onGearAdd(gear)
    83 function onGearAdd(gear)
    98     if GetGearType(gear) == gtHedgehog then
    84     if GetGearType(gear) == gtHedgehog then
    99         HH[gear] = 1
    85         HH[gear] = 1
   116         HH[gear] = nil
   102         HH[gear] = nil
   117     end
   103     end
   118 end
   104 end
   119 
   105 
   120 function onGameStart()
   106 function onGameStart()
   121     if showWaterStats or scaleGraph then
       
   122         DeleteGear(dummyHog)
       
   123     end
       
   124     --SetClanColor(ClansCount-1, 0x0000ffff) appears to be broken
   107     --SetClanColor(ClansCount-1, 0x0000ffff) appears to be broken
   125     SendHealthStatsOff()
   108     SendHealthStatsOff()
   126     ShowMission(loc("Climb Home"),
   109     ShowMission(loc("Climb Home"),
   127                 loc("Rope to safety"),
   110                 loc("Rope to safety"),
   128                 loc("You are far from home, and the water is rising, climb up as high as you can!|Your score will be based on your height."),
   111                 loc("You are far from home, and the water is rising, climb up as high as you can!|Your score will be based on your height."),
   404                     onAchievementsDeclaration()
   387                     onAchievementsDeclaration()
   405                 end
   388                 end
   406             end
   389             end
   407 
   390 
   408         if GameTime % 500 == 0 then
   391         if GameTime % 500 == 0 then
   409             --if isSinglePlayer and MaxHeight < 32000 and WaterRise == nil then
   392             if not isSinglePlayer then
   410             --    WaterRise = AddGear(0,0,gtWaterUp, 0, 0, 0, 0)
   393 	        for t,i in pairs(teams) do
   411             --end
   394                     if currTeam == t then
   412             if showWaterStats == true then
   395                         SendStat(siClanHealth, tostring(getActualHeight(y)), t)
   413 	        SendStat(siClanHealth, tostring(getActualHeight(WaterLine)), " ")
   396                     else
   414             end
   397                         SendStat(siClanHealth, '0', t)
   415 	    for t,i in pairs(teams) do
   398                     end
   416                 if currTeam == t then
   399                 end
   417                     SendStat(siClanHealth, tostring(getActualHeight(y)), t)
   400             elseif CurrentHedgehog ~= nil then
   418                 else
   401                 SendStat(siClanHealth, tostring(getActualHeight(y)), GetHogTeamName(CurrentHedgehog))
   419                     SendStat(siClanHealth, '0', t)
       
   420                 end
       
   421             end
   402             end
   422     
   403     
   423             -- play taunts
   404             -- play taunts
   424             if not YouWon and not YouLost then
   405             if not YouWon and not YouLost then
   425                 local nooDistance = 500
   406                 local nooDistance = 500
   637     table.sort(ranking, comp)
   618     table.sort(ranking, comp)
   638 
   619 
   639     local winner = ranking[#ranking]
   620     local winner = ranking[#ranking]
   640     local loser = ranking[1]
   621     local loser = ranking[1]
   641     SendStat(siGameResult, string.format(loc("%s wins!"), winner.name))
   622     SendStat(siGameResult, string.format(loc("%s wins!"), winner.name))
   642     SendStat(siGraphTitle, string.format(loc("Team’s best heights per round")))
   623     SendStat(siGraphTitle, string.format(loc("Height over time")))
   643     
   624     
   644     if winner.score < 1500 then
   625     if winner.score < 1500 then
   645         SendStat(siCustomAchievement, string.format(loc("This round’s award for ultimate disappointment goes to: Everyone!")))
   626         SendStat(siCustomAchievement, string.format(loc("This round’s award for ultimate disappointment goes to: Everyone!")))
   646     else
   627     else
   647         if winner.score > 30000 then text = loc("%s (%s) reached for the sky and beyond with a height of %d!")
   628         if winner.score > 30000 then text = loc("%s (%s) reached for the sky and beyond with a height of %d!")