share/hedgewars/Data/Missions/Challenge/ClimbHome.lua
author Wuzzy <Wuzzy2@mail.ru>
Mon, 03 Sep 2018 12:46:57 +0200
changeset 13750 110d6c1e817f
parent 13664 85506d95977d
child 14480 208359558642
permissions -rw-r--r--
Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH These globals did not exist in 0.9.24, so this change is safe.

HedgewarsScriptLoad("/Scripts/Locale.lua")

isSinglePlayer = true

-- trying to allow random theme, but fixed theme objects...
-- Also skip some ugly themes, or ones where the sky is "meh"
--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" }
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"}
local totalHedgehogs = 0
local HH = {}
local teams = {}
local dummyHog = nil


function onGameInit()
    -- Ensure people get same map for same theme
    Theme = themes[GetRandom(#themes)+1]
    Seed = ClimbHome
    TurnTime = MAX_TURN_TIME
    EnableGameFlags(gfOneClanMode)
    DisableGameFlags(gfBottomBorder+gfBorder)
    CaseFreq = 0
    Explosives = 0
    MineDudPercent = 0
    Map = "ClimbHome"
    AddTeam(loc("Lonely Hog"), -1, "bubble", "Island", "Default")
    player = AddHog(loc("Climber"), 0, 1, "NoHat")
    if showWaterStats then
        dummyHog = AddHog(" ", 0, 1, "NoHat")
        HH[dummyHog] = nil
        totalHedgehogs = totalHedgehogs - 1
        SendStat(siClanHealth, tostring(32640), " ")
    end
end