share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Thu, 18 Jul 2013 23:37:01 +0300
branchspacecampaign
changeset 9344 f8e7e9858a8c
parent 9340 23e40ec30afc
child 9346 1245c7636380
permissions -rw-r--r--
ice planet mission wip
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     1
------------------- ABOUT ----------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     2
--
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     3
-- In this cold planet hero seeks for a part of the
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     4
-- antigravity device. He has to capture Icy Pit who
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     5
-- knows where the device is hidden. Hero will be
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     6
-- able to use only the ice gun for this mission.
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     7
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     8
HedgewarsScriptLoad("/Scripts/Locale.lua")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
     9
HedgewarsScriptLoad("/Scripts/Animate.lua")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    10
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    11
----------------- VARIABLES --------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    12
-- globals
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    13
local heroAtAntiFlyArea = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    14
-- crates
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    15
local icegunY = 1950
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    16
local icegunX = 260
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    17
-- hogs
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    18
local hero = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    19
local ally = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    20
local bandit1 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    21
local bandit2 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    22
local bandit3 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    23
local bandit4 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    24
local bandit5 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    25
-- teams
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    26
local teamA = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    27
local teamB = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    28
local teamC = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    29
local teamD = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    30
-- hedgehogs values
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    31
hero.name = "Hog Solo"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    32
hero.x = 340
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    33
hero.y = 1840
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    34
hero.dead = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    35
ally.name = "Paul McHoggy"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    36
ally.x = 300
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    37
ally.y = 1840
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    38
bandit1.name = "Thanta"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    39
bandit1.x = 3240
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    40
bandit1.y = 1280
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    41
bandit2.name = "Billy Frost"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    42
bandit2.x = 1480
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    43
bandit2.y = 1990
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    44
bandit3.name = "Ice Jake"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    45
bandit3.x = 1860
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    46
bandit3.y = 1150
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    47
bandit4.name = "John Snow"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    48
bandit4.x = 3250
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    49
bandit4.y = 970
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    50
bandit5.name = "White Tee"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    51
bandit5.x = 3300
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    52
bandit5.y = 600
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    53
teamA.name = loc("Allies")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    54
teamA.color = tonumber("FF0000",16) -- red
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    55
teamB.name = loc("Frozen Bandits")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    56
teamB.color = tonumber("0033FF",16) -- blues
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    57
teamC.name = loc("Hog Solo")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    58
teamC.color = tonumber("38D61C",16) -- green
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    59
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    60
-------------- LuaAPI EVENT HANDLERS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    61
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    62
function onGameInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    63
	Seed = 1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    64
	--GameFlags = gfDisableWind
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    65
	TurnTime = 25000
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    66
	CaseFreq = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    67
	MinesNum = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    68
	MinesTime = 3000
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    69
	Explosives = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    70
	Delay = 5 
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    71
	Map = "ice01_map"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    72
	Theme = "Snow"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    73
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    74
	-- Hog Solo
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    75
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    76
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    77
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    78
	HogTurnLeft(hero.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    79
	-- Ally
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    80
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    81
	ally.gear = AddHog(ally.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    82
	AnimSetGearPosition(ally.gear, ally.x, ally.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    83
	-- Frozen Bandits
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    84
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    85
	bandit1.gear = AddHog(bandit1.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    86
	AnimSetGearPosition(bandit1.gear, bandit1.x, bandit1.y)	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    87
	HogTurnLeft(bandit1.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    88
	bandit2.gear = AddHog(bandit2.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    89
	AnimSetGearPosition(bandit2.gear, bandit2.x, bandit2.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    90
	bandit3.gear = AddHog(bandit3.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    91
	AnimSetGearPosition(bandit3.gear, bandit3.x, bandit3.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    92
	bandit4.gear = AddHog(bandit4.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    93
	AnimSetGearPosition(bandit4.gear, bandit4.x, bandit4.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    94
	HogTurnLeft(bandit4.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    95
	bandit5.gear = AddHog(bandit5.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    96
	AnimSetGearPosition(bandit5.gear, bandit5.x, bandit5.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    97
	HogTurnLeft(bandit5.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    98
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    99
	AnimInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   100
	AnimationSetup()	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   101
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   102
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   103
function onGameStart()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   104
	AnimWait(hero.gear, 3000)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   105
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   106
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   107
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   108
	AddEvent(onAntiFlyArea, {hero.gear}, antiFlyArea, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   109
	AddEvent(onNonAntiFlyArea, {hero.gear}, nonAntiFlyArea, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   110
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   111
	AddAmmo(hero.gear, amJetpack, 99)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   112
	AddAmmo(hero.gear, amBazooka, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   113
	SpawnAmmoCrate(icegunX, icegunY, amIceGun)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   114
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   115
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   116
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   117
function onNewTurn()		
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   118
	-- rounds start if hero got his weapons or got near the enemies
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   119
	if not heroAtAntiFlyArea and CurrentHedgehog ~= hero.gear then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   120
	WriteLnToConsole(" IF 1")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   121
		TurnTimeLeft = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   122
	elseif not heroAtAntiFlyArea and CurrentHedgehog == hero.gear then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   123
	WriteLnToConsole(" IF 2")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   124
		TurnTimeLeft = -1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   125
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   126
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   127
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   128
function onGameTick()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   129
	AnimUnWait()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   130
	if ShowAnimation() == false then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   131
		return
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   132
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   133
	ExecuteAfterAnimations()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   134
	CheckEvents()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   135
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   136
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   137
function onAmmoStoreInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   138
	SetAmmo(amIceGun, 0, 0, 0, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   139
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   140
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   141
function onGearDelete(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   142
	if gear == hero.gear then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   143
		hero.dead = true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   144
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   145
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   146
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   147
-------------- EVENTS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   148
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   149
function onAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   150
	if not hero.dead and (GetX(gear) > 860 or GetY(gear) < 1400) and not heroAtAntiFlyArea then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   151
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   152
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   153
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   154
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   155
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   156
function onNonAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   157
	if not hero.dead and (GetX(gear) < 860 and GetY(gear) > 1400) and heroAtAntiFlyArea then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   158
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   159
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   160
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   161
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   162
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   163
function onHeroDeath(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   164
	if hero.dead then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   165
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   166
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   167
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   168
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   169
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   170
-------------- OUTCOMES ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   171
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   172
function antiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   173
	heroAtAntiFlyArea = true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   174
	TurnTimeLeft = 0	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   175
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   176
	AddAmmo(hero.gear, amJetpack, 0)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   177
	AnimSwitchHog(bandit1.gear)	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   178
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   179
	TurnTimeLeft = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   180
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   181
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   182
function nonAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   183
	heroAtAntiFlyArea = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   184
	TurnTimeLeft = 0	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   185
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   186
	AddAmmo(hero.gear, amJetpack, 99)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   187
	AnimSwitchHog(bandit1.gear)	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   188
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   189
	TurnTimeLeft = 0	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   190
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   191
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   192
function heroDeath(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   193
	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   194
	-- more custom stats
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   195
	EndGame()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   196
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   197
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   198
-------------- ANIMATIONS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   199
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   200
function AnimationSetup()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   201
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   202
end