share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Fri, 02 Aug 2013 22:19:36 +0300
branchspacecampaign
changeset 9455 4bf3fac0e49d
child 9457 934f4d8370f1
permissions -rw-r--r--
added iceplanet sidequest map and stub lua
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- Hero has to pass as fast as possible inside the
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     4
-- rings as in the runner mode
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
HedgewarsScriptLoad("/Scripts/Locale.lua")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
HedgewarsScriptLoad("/Scripts/Animate.lua")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
----------------- VARIABLES --------------------
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    10
-- globals
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    11
local campaignName = loc("A Space Adventure")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
local missionName = loc("Ice planet, a frozen adventure!")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
local heroAtAntiFlyArea = false
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    14
local heroVisitedAntiFlyArea = false
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
local heroAtFinalStep = false
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
local iceGunTaken = false
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    17
local checkPointReached = 1 -- 1 is normal spawn
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    18
-- dialogs
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    19
local dialog01 = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    20
local dialog02 = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    21
-- mission objectives
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    22
local goals = {
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    23
	[dialog01] = {missionName, loc("Getting ready"), loc("Collect the icegun and get the device part from Thanta"), 1, 4500},
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
-- crates
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
local icegunY = 1950
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
local icegunX = 260
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    28
-- hogs
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    29
local hero = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    30
local ally = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    31
-- teams
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    32
local teamA = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    33
local teamB = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    34
local teamC = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    35
-- hedgehogs values
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    36
hero.name = "Hog Solo"
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    37
hero.x = 450
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    38
hero.y = 200
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    39
hero.dead = false
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    40
ally.name = "Paul McHoggy"
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    41
ally.x = 512
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    42
ally.y = 200
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
teamA.name = loc("Hog Solo")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    44
teamA.color = tonumber("38D61C",16) -- green
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    45
teamB.name = loc("Allies")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    46
teamB.color = tonumber("FF0000",16) -- red
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    47
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
-------------- LuaAPI EVENT HANDLERS ------------------
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
function onGameInit()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
	Seed = 1
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
	TurnTime = 25000
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
	CaseFreq = 0
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    54
	MinesNum = 0
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    55
	MinesTime = 1
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    56
	Explosives = 0
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    57
	Delay = 3
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
	Map = "ice02_map"
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    59
	Theme = "Snow"
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
	-- Hog Solo
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    62
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    63
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    64
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    65
	HogTurnLeft(hero.gear, true)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
	-- Ally
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
	ally.gear = AddHog(ally.name, 0, 100, "tophats")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    69
	AnimSetGearPosition(ally.gear, ally.x, ally.y)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
	AnimInit()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
	--AnimationSetup()	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
end
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
function onGameStart()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
	AnimWait(hero.gear, 3000)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
	FollowGear(hero.gear)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
	AddAmmo(hero.gear, amJetpack, 99)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
	SendHealthStatsOff()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
end