share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Fri, 19 Jul 2013 04:51:08 +0300
branchspacecampaign
changeset 9346 1245c7636380
parent 9344 f8e7e9858a8c
child 9384 557ae509547b
permissions -rw-r--r--
more changes, events and bots fighting - also map drawing corrections
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
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
     8
-- TODO
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
     9
-- alter map so hero may climb to the higher place
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    10
-- maybe use rope challenge to go there
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    11
-- add checkpoints
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    12
-- fix the stats
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    13
-- add mines to the higher place/final stage
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    14
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    15
HedgewarsScriptLoad("/Scripts/Locale.lua")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    16
HedgewarsScriptLoad("/Scripts/Animate.lua")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    17
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    18
----------------- VARIABLES --------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    19
-- globals
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    20
local heroAtAntiFlyArea = false
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    21
local heroVisitedAntiFlyArea = false
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    22
local heroAtFinaleStep = false
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    23
-- crates
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    24
local icegunY = 1950
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    25
local icegunX = 260
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    26
-- hogs
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    27
local hero = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    28
local ally = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    29
local bandit1 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    30
local bandit2 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    31
local bandit3 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    32
local bandit4 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    33
local bandit5 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    34
-- teams
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    35
local teamA = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    36
local teamB = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    37
local teamC = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    38
local teamD = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    39
-- hedgehogs values
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    40
hero.name = "Hog Solo"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    41
hero.x = 340
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    42
hero.y = 1840
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    43
hero.dead = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    44
ally.name = "Paul McHoggy"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    45
ally.x = 300
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    46
ally.y = 1840
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    47
bandit1.name = "Thanta"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    48
bandit1.x = 3240
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    49
bandit1.y = 1280
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    50
bandit2.name = "Billy Frost"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    51
bandit2.x = 1480
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    52
bandit2.y = 1990
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    53
bandit3.name = "Ice Jake"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    54
bandit3.x = 1860
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    55
bandit3.y = 1150
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    56
bandit4.name = "John Snow"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    57
bandit4.x = 3250
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    58
bandit4.y = 970
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    59
bandit5.name = "White Tee"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    60
bandit5.x = 3300
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    61
bandit5.y = 600
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    62
teamA.name = loc("Allies")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    63
teamA.color = tonumber("FF0000",16) -- red
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    64
teamB.name = loc("Frozen Bandits")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    65
teamB.color = tonumber("0033FF",16) -- blues
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    66
teamC.name = loc("Hog Solo")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    67
teamC.color = tonumber("38D61C",16) -- green
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    68
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    69
-------------- LuaAPI EVENT HANDLERS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    70
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    71
function onGameInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    72
	Seed = 1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    73
	--GameFlags = gfDisableWind
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    74
	TurnTime = 25000
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    75
	CaseFreq = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    76
	MinesNum = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    77
	MinesTime = 3000
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    78
	Explosives = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    79
	Delay = 5 
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    80
	Map = "ice01_map"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    81
	Theme = "Snow"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    82
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    83
	-- Hog Solo
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    84
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    85
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    86
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    87
	HogTurnLeft(hero.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    88
	-- Ally
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    89
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    90
	ally.gear = AddHog(ally.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    91
	AnimSetGearPosition(ally.gear, ally.x, ally.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    92
	-- Frozen Bandits
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    93
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    94
	bandit1.gear = AddHog(bandit1.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    95
	AnimSetGearPosition(bandit1.gear, bandit1.x, bandit1.y)	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    96
	HogTurnLeft(bandit1.gear, true)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    97
	bandit2.gear = AddHog(bandit2.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    98
	AnimSetGearPosition(bandit2.gear, bandit2.x, bandit2.y)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    99
	bandit3.gear = AddHog(bandit3.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   100
	AnimSetGearPosition(bandit3.gear, bandit3.x, bandit3.y)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   101
	bandit4.gear = AddHog(bandit4.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   102
	AnimSetGearPosition(bandit4.gear, bandit4.x, bandit4.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   103
	HogTurnLeft(bandit4.gear, true)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   104
	bandit5.gear = AddHog(bandit5.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   105
	AnimSetGearPosition(bandit5.gear, bandit5.x, bandit5.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   106
	HogTurnLeft(bandit5.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   107
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   108
	AnimInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   109
	AnimationSetup()	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   110
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   111
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   112
function onGameStart()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   113
	AnimWait(hero.gear, 3000)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   114
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   115
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   116
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 1)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   117
	AddEvent(onHeroFinalStep, {hero.gear}, heroFinalStep, {hero.gear}, 0)
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   118
	AddEvent(onAntiFlyArea, {hero.gear}, antiFlyArea, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   119
	AddEvent(onNonAntiFlyArea, {hero.gear}, nonAntiFlyArea, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   120
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   121
	AddAmmo(hero.gear, amJetpack, 99)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   122
	AddAmmo(hero.gear, amBazooka, 1)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   123
	AddAmmo(bandit1.gear, amBazooka, 5)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   124
	AddAmmo(bandit2.gear, amBazooka, 4)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   125
	AddAmmo(bandit3.gear, amMine, 2)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   126
	AddAmmo(bandit3.gear, amGrenade, 3)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   127
	AddAmmo(bandit4.gear, amBazooka, 5)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   128
	AddAmmo(bandit5.gear, amBazooka, 5)
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   129
	SpawnAmmoCrate(icegunX, icegunY, amIceGun)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   130
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   131
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   132
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   133
function onNewTurn()		
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   134
	-- round has to start if hero goes near the column
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   135
	if not heroVisitedAntiFlyArea and CurrentHedgehog ~= hero.gear then
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   136
		TurnTimeLeft = 0
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   137
	elseif not heroVisitedAntiFlyArea and CurrentHedgehog == hero.gear then
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   138
		TurnTimeLeft = -1
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   139
	elseif not heroAtFinaleStep and (CurrentHedgehog == bandit1.gear or CurrentHedgehog == bandit4.gear or CurrentHedgehog == bandit5.gear) then		
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   140
		AnimSwitchHog(hero.gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   141
		TurnTimeLeft = 0
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   142
	elseif CurrentHedgehog == ally.gear then
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   143
		TurnTimeLeft = 0
9344
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
function onGameTick()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   148
	AnimUnWait()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   149
	if ShowAnimation() == false then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   150
		return
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   151
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   152
	ExecuteAfterAnimations()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   153
	CheckEvents()
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 onAmmoStoreInit()
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   157
	SetAmmo(amIceGun, 0, 0, 0, 8)
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   158
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   159
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   160
function onGearDelete(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   161
	if gear == hero.gear then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   162
		hero.dead = true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   163
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   164
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   165
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   166
-------------- EVENTS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   167
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   168
function onAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   169
	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
   170
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   171
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   172
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   173
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   174
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   175
function onNonAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   176
	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
   177
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   178
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   179
	return false
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 onHeroDeath(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   183
	if hero.dead then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   184
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   185
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   186
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   187
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   188
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   189
function onHeroFinalStep(gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   190
	if not hero.dead and GetY(gear) < 900 and GetX(gear) > 1400 then
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   191
		return true
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   192
	end
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   193
	return false
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   194
end
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   195
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   196
-------------- OUTCOMES ------------------
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
function antiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   199
	heroAtAntiFlyArea = true
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   200
	if TurnTimeLeft < -1 then
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   201
		heroVisitedAntiFlyArea = true
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   202
		TurnTimeLeft = 0	
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   203
		FollowGear(hero.gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   204
		AddAmmo(hero.gear, amJetpack, 0)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   205
		AnimSwitchHog(bandit1.gear)	
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   206
		FollowGear(hero.gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   207
		TurnTimeLeft = 0
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   208
	else
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   209
		AddAmmo(hero.gear, amJetpack, 0)	
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   210
	end
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   211
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   212
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   213
function nonAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   214
	heroAtAntiFlyArea = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   215
	AddAmmo(hero.gear, amJetpack, 99)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   216
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   217
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   218
function heroDeath(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   219
	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   220
	-- more custom stats
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   221
	EndGame()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   222
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   223
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   224
function heroFinalStep(gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   225
	heroAtFinaleStep = true
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   226
end
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   227
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   228
-------------- ANIMATIONS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   229
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   230
function AnimationSetup()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   231
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   232
end