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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10413
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     1
HedgewarsScriptLoad("/Scripts/Locale.lua")
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     2
11889
c8979eeb73fa Fix ClimbHome mission bugs (broken teams, broken graph)
Wuzzy <almikes@aol.com>
parents: 11067
diff changeset
     3
isSinglePlayer = true
10413
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     4
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     5
-- trying to allow random theme, but fixed theme objects...
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     6
-- Also skip some ugly themes, or ones where the sky is "meh"
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     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" }
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
     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"}
11067
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
     9
local totalHedgehogs = 0
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    10
local HH = {}
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    11
local teams = {}
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    12
local dummyHog = nil
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    13
10413
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    14
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    15
function onGameInit()
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    16
    -- Ensure people get same map for same theme
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    17
    Theme = themes[GetRandom(#themes)+1]
15501
5a30396f8fb2 ClimbHome: Change misleading Seed assignment to nil value
Wuzzy <Wuzzy2@mail.ru>
parents: 14480
diff changeset
    18
    Seed = ""
13750
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13664
diff changeset
    19
    TurnTime = MAX_TURN_TIME
10413
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    20
    EnableGameFlags(gfOneClanMode)
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    21
    DisableGameFlags(gfBottomBorder+gfBorder)
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    22
    CaseFreq = 0
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    23
    Explosives = 0
11067
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    24
    MineDudPercent = 0
10413
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    25
    Map = "ClimbHome"
14480
208359558642 Use player-chosen team identity for training and a few challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 13750
diff changeset
    26
    AddMissionTeam(-1)
208359558642 Use player-chosen team identity for training and a few challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 13750
diff changeset
    27
    player = AddMissionHog(1)
11067
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    28
    if showWaterStats then
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    29
        dummyHog = AddHog(" ", 0, 1, "NoHat")
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    30
        HH[dummyHog] = nil
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    31
        totalHedgehogs = totalHedgehogs - 1
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    32
        SendStat(siClanHealth, tostring(32640), " ")
c632b47b8ff0 Trying to get these scripts to behave properly, still WIP though.
nemo
parents: 10581
diff changeset
    33
    end
10413
afd746a538ef climb home training/multiplayer
nemo
parents:
diff changeset
    34
end