share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Wed, 31 Jul 2013 22:52:35 +0300
branchspacecampaign
changeset 9422 85b17f344c97
parent 9420 27aff3a11822
child 9424 9a150b7862e9
permissions -rw-r--r--
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- In the desert planet Hero will have to explore
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     4
-- the dunes below the surface and find the hidden
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
-- crates. It is told that one crate contains the
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
-- lost part.
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
     8
-- TODO
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
     9
-- maybe use same name in missionName and frontend mission name..
9416
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    10
-- in this map I have to track the weapons the player has in checkpoints
9422
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    11
-- GENRAL NOTE: change hats :D
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
HedgewarsScriptLoad("/Scripts/Locale.lua")
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    14
HedgewarsScriptLoad("/Scripts/Animate.lua")
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
----------------- VARIABLES --------------------
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    17
-- globals
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    18
local campaignName = loc("A Space Adventure")
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    19
local missionName = loc("Desert planet, lost in sand!")
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    20
local checkPointReached = 1 -- 1 is normal spawn
9422
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    21
-- dialogs
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    22
local dialog01 = {}
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    23
-- mission objectives
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    24
local goals = {
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    25
	[dialog01] = {missionName, loc("Getting ready"), loc("The part is hidden in one of the crates! Go and get it!"), 1, 4500},
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
    26
}
9416
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    27
-- crates
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    28
local btorch1Y = 60
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    29
local btorch1X = 2700
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    30
local btorch2Y = 1800
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    31
local btorch2X = 1010
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    32
local rope1Y = 970
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    33
local rope1X = 3200
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    34
local rope2Y = 1900
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    35
local rope2X = 680
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    36
local rope3Y = 1850
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    37
local rope3X = 2460
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    38
local portalY = 480
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    39
local portalX = 1465
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    40
local constructY = 1630
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
    41
local constructX = 3350
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    42
-- hogs
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
local hero = {}
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    44
local ally = {}
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    45
local smuggler1 = {}
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    46
local smuggler2 = {}
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    47
local smuggler3 = {}
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
-- teams
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
local teamA = {}
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
local teamB = {}
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
local teamC = {}
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
-- hedgehogs values
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
hero.name = "Hog Solo"
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    54
hero.x = 1740
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    55
hero.y = 40
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    56
hero.dead = false
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    57
ally.name = "Chief Sandologist"
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    58
ally.x = 1660
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    59
ally.y = 40
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    60
smuggler1.name = "Sanndy"
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    61
smuggler1.x = 320
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    62
smuggler1.y = 235
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    63
smuggler2.name = "Spike"
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    64
smuggler2.x = 736
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    65
smuggler2.y = 860
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    66
smuggler3.name = "Sandstorm"
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    67
smuggler3.x = 1940
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    68
smuggler3.y = 1625
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    69
teamA.name = loc("PAotH")
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    70
teamA.color = tonumber("FF0000",16) -- red
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    71
teamB.name = loc("Smugglers")
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
teamB.color = tonumber("0033FF",16) -- blues
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
teamC.name = loc("Hog Solo")
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
teamC.color = tonumber("38D61C",16) -- green
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
-------------- LuaAPI EVENT HANDLERS ------------------
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
function onGameInit()
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
	Seed = 1
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
	TurnTime = 25000
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
	CaseFreq = 0
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
	MinesNum = 0
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    83
	MinesTime = 1
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    84
	Explosives = 0
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    85
	Delay = 3
9418
6e0831e42e12 added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9416
diff changeset
    86
	HealthCaseAmount = 30
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	Map = "desert01_map"
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    88
	Theme = "Desert"
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    89
	
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    90
	-- Hog Solo
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    91
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    92
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    93
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    94
	HogTurnLeft(hero.gear, true)
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    95
	-- PAotH undercover scientist and chief Sandologist
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    96
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    97
	ally.gear = AddHog(ally.name, 0, 100, "war_desertgrenadier1")
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    98
	AnimSetGearPosition(ally.gear, ally.x, ally.y)
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
    99
	-- Smugglers
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   100
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   101
	smuggler1.gear = AddHog(smuggler1.name, 1, 120, "tophats")
9412
b4717f50846e oops, hogs placing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9410
diff changeset
   102
	AnimSetGearPosition(smuggler1.gear, smuggler1.x, smuggler1.y)
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   103
	smuggler2.gear = AddHog(smuggler2.name, 1, 120, "tophats")
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   104
	AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y)	
9412
b4717f50846e oops, hogs placing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9410
diff changeset
   105
	smuggler3.gear = AddHog(smuggler3.name, 1, 120, "tophats")
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   106
	AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y)	
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   107
	
9422
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   108
	AnimInit()
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   109
	AnimationSetup()	
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   110
end
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   111
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   112
function onGameStart()
9422
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   113
	AnimWait(hero.gear, 3000)
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   114
	FollowGear(hero.gear)
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   115
	
9408
6b3613a61fb8 finally, desert's main mission mao seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9404
diff changeset
   116
	AddAmmo(hero.gear, amRope, 10)
9416
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   117
	
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   118
	-- spawn crates	
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   119
	SpawnAmmoCrate(btorch1X, btorch1Y, amBlowTorch)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   120
	SpawnAmmoCrate(btorch2X, btorch2Y, amBlowTorch)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   121
	SpawnAmmoCrate(rope1X, rope1Y, amRope)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   122
	SpawnAmmoCrate(rope2X, rope2Y, amRope)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   123
	SpawnAmmoCrate(rope3X, rope3Y, amRope)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   124
	SpawnAmmoCrate(portalX, portalY, amPortalGun)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   125
	SpawnAmmoCrate(constructX, constructY, amConstruction)
9418
6e0831e42e12 added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9416
diff changeset
   126
	
6e0831e42e12 added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9416
diff changeset
   127
	SpawnHealthCrate(3300, 970)
9420
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   128
	
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   129
	-- adding mines - BOOM!
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   130
	AddGear(1280, 460, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   131
	AddGear(270, 460, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   132
	AddGear(3460, 60, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   133
	AddGear(3500, 240, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   134
	AddGear(3410, 670, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   135
	AddGear(3450, 720, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   136
	
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   137
	local x = 800
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   138
	while x < 1650 do
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   139
		AddGear(x, 900, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   140
		x = x + math.random(8,20)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   141
	end
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   142
	x = 1890
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   143
	while x < 2988 do
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   144
		AddGear(x, 760, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   145
		x = x + math.random(8,20)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   146
	end
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   147
	x = 2480
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   148
	while x < 3300 do
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   149
		AddGear(x, 1450, gtMine, 0, 0, 0, 0)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   150
		x = x + math.random(8,20)
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   151
	end
27aff3a11822 mines added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9418
diff changeset
   152
	
9422
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   153
	AddAnim(dialog01)
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   154
end
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   155
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   156
function onGameTick()
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   157
	AnimUnWait()
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   158
	if ShowAnimation() == false then
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   159
		return
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   160
	end
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   161
	ExecuteAfterAnimations()
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   162
	CheckEvents()
9416
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   163
end
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   164
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   165
function onAmmoStoreInit()
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   166
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   167
	SetAmmo(amRope, 0, 0, 0, 1)
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   168
	SetAmmo(amPortalGun, 0, 0, 0, 1)	
8d0054adf0c6 added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9412
diff changeset
   169
	SetAmmo(amConstruction, 0, 0, 0, 1)
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   170
end
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   171
9410
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   172
function onGearDelete(gear)
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   173
	if gear == hero.gear then
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   174
		hero.dead = true
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   175
	end
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   176
end
92a0b74ed740 added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9408
diff changeset
   177
9422
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   178
function onPrecise()
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   179
	if GameTime > 3000 then
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   180
		SetAnimSkip(true)   
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   181
	end
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   182
end
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   183
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   184
-------------- ANIMATIONS ------------------
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   185
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   186
function Skipanim(anim)
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   187
	if goals[anim] ~= nil then
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   188
		ShowMission(unpack(goals[anim]))
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   189
    end
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   190
end
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   191
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   192
function AnimationSetup()
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   193
	-- DIALOG 01 - Start, getting info about the device
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   194
	AddSkipFunction(dialog01, Skipanim, {dialog01})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   195
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   196
	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the planet of sand, you have to double check your moves..."), 5000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   197
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finaly you are here..."), SAY_SAY, 2000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   198
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   199
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me in such a short notice!"), SAY_SAY, 3000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   200
	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   201
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for M!"), SAY_SAY, 4000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   202
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now listen carefully! Below us there are tunnels that have been created naturally over the years"), SAY_SAY, 4000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   203
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("I have heared the local tribes saying that many years ago some PAotH scientists were dumping their waste here"), SAY_SAY, 5000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   204
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("M confimed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   205
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   206
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware though! Many smugglers come often to explore these tunnels and scavage whatever valuable item they can find"), SAY_SAY, 5000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   207
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to take your valuables!"), SAY_SAY, 4000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   208
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   209
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   210
	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   211
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   212
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   213
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   214
	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
85b17f344c97 first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9420
diff changeset
   215
end