share/hedgewars/Data/Missions/Training/ClimbHome.lua
branchqmlfrontend
changeset 12855 1b2b84315d27
parent 11843 01f88c3b7b66
parent 12854 28cb18c5e712
child 12856 95d903b976d0
equal deleted inserted replaced
11843:01f88c3b7b66 12855:1b2b84315d27
     1 HedgewarsScriptLoad("/Scripts/Locale.lua")
       
     2 
       
     3 local isSinglePlayer = true
       
     4 
       
     5 -- trying to allow random theme, but fixed theme objects...
       
     6 -- Also skip some ugly themes, or ones where the sky is "meh"
       
     7 --local themes = { "Art","Cake","City","EarthRise","Halloween","Olympics","Underwater","Bamboo","Castle","Compost","Eyes","Hell","Planes","Bath","Cave","CrazyMission","Freeway","Island","Sheep","Blox","Cheese","Deepspace","Fruit","Jungle","Snow","Brick","Christmas","Desert","Golf","Nature","Stage" }
       
     8 local themes = {"Christmas","Hell","Bamboo","City","Island","Bath","Compost","Jungle","Desert","Nature","Olympics","Brick","EarthRise","Sheep","Cake","Freeway","Snow","Castle","Fruit","Stage","Cave","Golf","Cheese","Halloween"}
       
     9 local showWaterStats = true -- uses the AI team to draw water height.
       
    10 local scaleGraph = true
       
    11 local totalHedgehogs = 0
       
    12 local HH = {}
       
    13 local teams = {}
       
    14 local dummyHog = nil
       
    15 
       
    16 
       
    17 function onGameInit()
       
    18     -- Ensure people get same map for same theme
       
    19     Theme = themes[GetRandom(#themes)+1]
       
    20     Seed = ClimbHome
       
    21     TurnTime = 999999999
       
    22     EnableGameFlags(gfOneClanMode)
       
    23     DisableGameFlags(gfBottomBorder+gfBorder)
       
    24     CaseFreq = 0
       
    25     Explosives = 0
       
    26     MineDudPercent = 0
       
    27     Map = "ClimbHome"
       
    28     AddTeam(loc("Lonely Hog"), 0xDD0000, "Simple", "Island", "Default")
       
    29     player = AddHog(loc("Climber"), 0, 1, "NoHat")
       
    30     if showWaterStats then
       
    31         AddTeam(" ", 0x545C9D, "Simple", "Island", "Default")
       
    32     elseif scaleGraph then
       
    33         AddTeam(" ", 0x050505, "Simple", "Island", "Default")
       
    34     end
       
    35     if showWaterStats or scaleGraph then
       
    36         dummyHog = AddHog(" ", 0, 1, "NoHat")
       
    37         HH[dummyHog] = nil
       
    38         totalHedgehogs = totalHedgehogs - 1
       
    39         SendStat(siClanHealth, tostring(32640), " ")
       
    40     end
       
    41 end