share/hedgewars/Data/Missions/Challenge/ClimbHome.lua
author Wuzzy <Wuzzy2@mail.ru>
Sat, 02 Nov 2019 13:01:28 +0100
changeset 15501 5a30396f8fb2
parent 14480 208359558642
child 15502 ad9fe7dc2ff7
permissions -rw-r--r--
ClimbHome: Change misleading Seed assignment to nil value This was "Seed = ClimbHome", but ClimbHome was a nil value. This code still worked as the engine interpreted the nil value as empty string. But it can be very misleading. This changeset makes the Seed assignment more explicit by assigning the empty string directly. The compability has been tested.

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 = ""
    TurnTime = MAX_TURN_TIME
    EnableGameFlags(gfOneClanMode)
    DisableGameFlags(gfBottomBorder+gfBorder)
    CaseFreq = 0
    Explosives = 0
    MineDudPercent = 0
    Map = "ClimbHome"
    AddMissionTeam(-1)
    player = AddMissionHog(1)
    if showWaterStats then
        dummyHog = AddHog(" ", 0, 1, "NoHat")
        HH[dummyHog] = nil
        totalHedgehogs = totalHedgehogs - 1
        SendStat(siClanHealth, tostring(32640), " ")
    end
end