share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Sun, 28 Jul 2013 17:16:35 +0300
branchspacecampaign
changeset 9386 808d38b2182c
parent 9384 557ae509547b
child 9388 790d4f7d57d1
permissions -rw-r--r--
map changes to let hog climb, checkpoint one after icegun,starting dialog
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
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    13
-- Add first checkpoint save if icegun is taken
9346
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
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    20
local campaignName = loc("A Space Adventure")
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    21
local missionName = loc("Ice planet, a frozen adventure!")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    22
local heroAtAntiFlyArea = false
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    23
local heroVisitedAntiFlyArea = false
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
    24
local heroAtFinaleStep = false
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    25
local iceGunTaken = false
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    26
local checkPointReached = 1 -- 1 is normal spawn
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    27
-- dialogs
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    28
local dialog01 = {}
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    29
-- mission objectives
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    30
local goals = {
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    31
	[dialog01] = {missionName, loc("Getting ready"), loc("Collect the icegun and get the device part from Thanta"), 1, 4500},
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    32
}
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    33
-- crates
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    34
local icegunY = 1950
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    35
local icegunX = 260
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    36
-- hogs
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    37
local hero = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    38
local ally = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    39
local bandit1 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    40
local bandit2 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    41
local bandit3 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    42
local bandit4 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    43
local bandit5 = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    44
-- teams
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    45
local teamA = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    46
local teamB = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    47
local teamC = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    48
local teamD = {}
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    49
-- hedgehogs values
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    50
hero.name = "Hog Solo"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    51
hero.x = 340
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    52
hero.y = 1840
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    53
hero.dead = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    54
ally.name = "Paul McHoggy"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    55
ally.x = 300
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    56
ally.y = 1840
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    57
bandit1.name = "Thanta"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    58
bandit1.x = 3240
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    59
bandit1.y = 1280
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    60
bandit2.name = "Billy Frost"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    61
bandit2.x = 1480
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    62
bandit2.y = 1990
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    63
bandit3.name = "Ice Jake"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    64
bandit3.x = 1860
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    65
bandit3.y = 1150
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    66
bandit4.name = "John Snow"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    67
bandit4.x = 3250
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    68
bandit4.y = 970
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    69
bandit5.name = "White Tee"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    70
bandit5.x = 3300
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    71
bandit5.y = 600
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    72
teamA.name = loc("Allies")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    73
teamA.color = tonumber("FF0000",16) -- red
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    74
teamB.name = loc("Frozen Bandits")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    75
teamB.color = tonumber("0033FF",16) -- blues
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    76
teamC.name = loc("Hog Solo")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    77
teamC.color = tonumber("38D61C",16) -- green
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    78
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    79
-------------- LuaAPI EVENT HANDLERS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    80
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    81
function onGameInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    82
	Seed = 1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    83
	--GameFlags = gfDisableWind
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    84
	TurnTime = 25000
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    85
	CaseFreq = 0
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    86
	MinesNum = 0
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    87
	MinesTime = 1
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    88
	Explosives = 0
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
    89
	Delay = 3
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    90
	Map = "ice01_map"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    91
	Theme = "Snow"
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    92
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    93
	-- Hog Solo
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    94
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    95
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    96
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    97
	HogTurnLeft(hero.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    98
	-- Ally
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
    99
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   100
	ally.gear = AddHog(ally.name, 0, 100, "tophats")
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   101
	AnimSetGearPosition(ally.gear, ally.x, ally.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   102
	-- Frozen Bandits
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   103
	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
   104
	bandit1.gear = AddHog(bandit1.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   105
	AnimSetGearPosition(bandit1.gear, bandit1.x, bandit1.y)	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   106
	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
   107
	bandit2.gear = AddHog(bandit2.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   108
	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
   109
	bandit3.gear = AddHog(bandit3.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   110
	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
   111
	bandit4.gear = AddHog(bandit4.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   112
	AnimSetGearPosition(bandit4.gear, bandit4.x, bandit4.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   113
	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
   114
	bandit5.gear = AddHog(bandit5.name, 1, 100, "tophats")
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   115
	AnimSetGearPosition(bandit5.gear, bandit5.x, bandit5.y)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   116
	HogTurnLeft(bandit5.gear, true)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   117
	
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   118
	-- get the check point
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   119
	if tonumber(GetCampaignVar("Ice01CheckPoint")) then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   120
		checkPointReached = tonumber(GetCampaignVar("Ice01CheckPoint"))
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   121
	end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   122
	
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   123
	if checkPointReached == 1 then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   124
		-- Start of the game
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   125
	elseif checkPointReached == 2 then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   126
		AnimSetGearPosition(hero.gear, 840, 1650)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   127
	end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   128
	
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   129
	AnimInit()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   130
	AnimationSetup()	
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 onGameStart()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   134
	AnimWait(hero.gear, 3000)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   135
	FollowGear(hero.gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   136
	
9384
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   137
	-- Add mines
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   138
	AddGear(1612, 940, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   139
	AddGear(1622, 945, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   140
	AddGear(1645, 950, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   141
	AddGear(1655, 960, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   142
	AddGear(1665, 965, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   143
	
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   144
	AddGear(1800, 1000, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   145
	AddGear(1810, 1005, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   146
	AddGear(1820, 1010, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   147
	AddGear(1830, 1015, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   148
	AddGear(1840, 1020, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   149
	
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   150
	AddGear(1900, 1020, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   151
	AddGear(1910, 1020, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   152
	AddGear(1920, 1020, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   153
	AddGear(1930, 1030, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   154
	AddGear(1940, 1040, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   155
	
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   156
	AddGear(2130, 1110, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   157
	AddGear(2140, 1120, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   158
	AddGear(2180, 1120, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   159
	AddGear(2200, 1130, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   160
	AddGear(2210, 1130, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   161
	
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   162
	local x=2300
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   163
	local step=0
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   164
	while x<3100 do
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   165
		AddGear(x, 1150, gtMine, 0, 0, 0, 0)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   166
		step = step + 1
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   167
		if step == 5 then
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   168
			step = 0
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   169
			x = x + math.random(100,300)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   170
		else
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   171
			x = x + math.random(10,30)
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   172
		end
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   173
	end
557ae509547b added mines to the ice planet01
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9346
diff changeset
   174
	
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   175
	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
   176
	AddEvent(onHeroFinalStep, {hero.gear}, heroFinalStep, {hero.gear}, 0)
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   177
	AddEvent(onAntiFlyArea, {hero.gear}, antiFlyArea, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   178
	AddEvent(onNonAntiFlyArea, {hero.gear}, nonAntiFlyArea, {hero.gear}, 1)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   179
	
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   180
	AddAmmo(hero.gear, amJetpack, 99)
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   181
	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
   182
	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
   183
	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
   184
	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
   185
	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
   186
	AddAmmo(bandit5.gear, amBazooka, 5)
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   187
	
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   188
	if checkPointReached == 1 then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   189
		AddAmmo(hero.gear, amBazooka, 1)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   190
		SpawnAmmoCrate(icegunX, icegunY, amIceGun)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   191
		AddEvent(onColumnCheckPoint, {hero.gear}, columnCheckPoint, {hero.gear}, 0)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   192
		AddEvent(onHeroAtIceGun, {hero.gear}, heroAtIceGun, {hero.gear}, 0)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   193
		AddAnim(dialog01)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   194
	elseif checkPointReached == 2 then		
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   195
		AddAmmo(hero.gear, amIceGun, 8)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   196
	end
9344
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
end
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 onNewTurn()		
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   201
	-- 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
   202
	if not heroVisitedAntiFlyArea and CurrentHedgehog ~= hero.gear then
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   203
		TurnTimeLeft = 0
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   204
	elseif not heroVisitedAntiFlyArea and CurrentHedgehog == hero.gear then
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   205
		TurnTimeLeft = -1
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   206
	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
   207
		AnimSwitchHog(hero.gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   208
		TurnTimeLeft = 0
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   209
	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
   210
		TurnTimeLeft = 0
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
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   213
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   214
function onGameTick()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   215
	AnimUnWait()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   216
	if ShowAnimation() == false then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   217
		return
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   218
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   219
	ExecuteAfterAnimations()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   220
	CheckEvents()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   221
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   222
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   223
function onAmmoStoreInit()
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   224
	SetAmmo(amIceGun, 0, 0, 0, 8)
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   225
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   226
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   227
function onGearDelete(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   228
	if gear == hero.gear then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   229
		hero.dead = true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   230
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   231
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   232
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   233
function onPrecise()
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   234
	if GameTime > 3000 then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   235
		SetAnimSkip(true)   
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   236
	end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   237
end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   238
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   239
-------------- EVENTS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   240
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   241
function onAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   242
	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
   243
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   244
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   245
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   246
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   247
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   248
function onNonAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   249
	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
   250
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   251
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   252
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   253
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   254
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   255
function onHeroDeath(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   256
	if hero.dead then
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   257
		return true
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   258
	end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   259
	return false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   260
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   261
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   262
function onHeroFinalStep(gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   263
	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
   264
		return true
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   265
	end
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   266
	return false
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   267
end
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   268
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   269
function onColumnCheckPoint(gear)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   270
	if not hero.dead and iceGunTaken and GetX(gear) < 870 and GetX(gear) > 850 and GetY(gear) > 1500 and StoppedGear(gear) then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   271
		return true
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   272
	end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   273
	return false
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   274
end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   275
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   276
function onHeroAtIceGun(gear)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   277
	if not hero.dead and GetX(gear) < icegunX+15 and GetX(gear) > icegunX-15 and GetY(gear) > icegunY-15 and GetY(gear) < icegunY+15 then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   278
		return true
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   279
	end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   280
	return false
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   281
end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   282
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   283
-------------- OUTCOMES ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   284
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   285
function antiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   286
	heroAtAntiFlyArea = true
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   287
	if TurnTimeLeft < -1 then
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   288
		heroVisitedAntiFlyArea = true
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   289
		TurnTimeLeft = 0	
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   290
		FollowGear(hero.gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   291
		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
   292
		AnimSwitchHog(bandit1.gear)	
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   293
		FollowGear(hero.gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   294
		TurnTimeLeft = 0
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   295
	else
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   296
		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
   297
	end
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   298
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   299
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   300
function nonAntiFlyArea(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   301
	heroAtAntiFlyArea = false
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   302
	AddAmmo(hero.gear, amJetpack, 99)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   303
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   304
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   305
function heroDeath(gear)
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   306
	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   307
	-- more custom stats
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   308
	EndGame()
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   309
end
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   310
9346
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   311
function heroFinalStep(gear)
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   312
	heroAtFinaleStep = true
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   313
end
1245c7636380 more changes, events and bots fighting - also map drawing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9344
diff changeset
   314
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   315
function columnCheckPoint(gear)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   316
	SaveCampaignVar("Ice01CheckPoint", "2")
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   317
	WriteLnToConsole("I AM HERE")
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   318
	AnimCaption(hero.gear, loc("Checkpoint reached!"), 5000)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   319
end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   320
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   321
function heroAtIceGun(gear)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   322
	iceGunTaken=true
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   323
end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   324
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   325
-------------- ANIMATIONS ------------------
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   326
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   327
function Skipanim(anim)
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   328
	if goals[anim] ~= nil then
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   329
		ShowMission(unpack(goals[anim]))
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   330
    end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   331
end
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   332
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   333
function AnimationSetup()
9386
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   334
	-- DIALOG 01 - Start, welcome to moon
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   335
	AddSkipFunction(dialog01, Skipanim, {dialog01})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   336
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   337
	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the ice planet, where ice rules..."), 5000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   338
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finaly you are here..."), SAY_SAY, 2000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   339
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   340
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Hi! Nice to meet you"), SAY_SAY, 3000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   341
	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   342
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Listen carefuly! The bandit leader, Thanta has recently found a very strange device"), SAY_SAY, 4000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   343
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("He doesn't know it but this device is a part of the antigravity device"), SAY_SAY, 2500}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   344
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 8000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   345
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Nice, then I should get the part as soon as possible!"), SAY_SAY, 4000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   346
	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   347
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Be careful, your gadgets won't work in the bandit area. You should get an ice gun"), SAY_SAY, 7000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   348
	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is one below us!"), SAY_SAY, 4000}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   349
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
808d38b2182c map changes to let hog climb, checkpoint one after icegun,starting dialog
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9384
diff changeset
   350
	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
9344
f8e7e9858a8c ice planet mission wip
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9340
diff changeset
   351
end