share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Thu, 11 Jul 2013 04:00:11 +0300
branchspacecampaign
changeset 9326 689f591aa226
parent 9324 98368198a75d
child 9330 b6483dc78feb
permissions -rw-r--r--
added saved hero health between missions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     1
------------------- ABOUT ----------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     2
--
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     3
-- This is the first stop of hero's journey.
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     4
-- Here he'll get fuels to continue traveling.
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     5
-- However, the PAoTH allies of the hero have
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     6
-- been taken hostages by professor Hogevil.
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     7
-- So hero has to get whatever available equipement
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     8
-- there is and rescue them.
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
     9
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    10
-- TODO
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    11
-- Fix some glitches when gaining control on animations, on skip I get control of the talking hog
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
    12
-- Round time after check point 2
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
    13
-- Check if enemy weapons are good
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    14
-- Stats
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    15
-- check points
9320
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
    16
-- add a dialog at the end and second event if all minions are dead
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    17
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    18
HedgewarsScriptLoad("/Scripts/Locale.lua")
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    19
HedgewarsScriptLoad("/Scripts/Animate.lua")
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    20
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    21
----------------- VARIABLES --------------------
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    22
-- globals
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    23
local campaignName = loc("A Space Adventure")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    24
local missionName = loc("Moon, stop for fuels!")
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
    25
local weaponsAcquired = false
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    26
local battleZoneReached = false
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
    27
local checkPointReached = 1 -- 1 is start of the game
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    28
-- dialogs
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    29
local dialog01 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    30
local dialog02 = {}
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
    31
local dialog03 = {}
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    32
local dialog04 = {}
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    33
-- mission objectives
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    34
local goals = {
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    35
	[dialog01] = {missionName, loc("Getting ready"), loc("Go to the upper platform and get the weapons in the crates!"), 1, 4500},
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
    36
	[dialog02] = {missionName, loc("Prepare to fight"), loc("Go down and save these PAoTH hogs!"), 1, 5000},
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    37
	[dialog03] = {missionName, loc("The fight begins!"), loc("Neutralize your enemies and be careful!"), 1, 5000},
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    38
	[dialog04] = dialog03
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    39
}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    40
-- crates
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    41
local weaponsY = 100
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    42
local bazookaX = 70
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    43
local parachuteX = 110
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    44
local grenadeX = 160
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    45
local deserteagleX = 200
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    46
-- hogs
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    47
local hero = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    48
local paoth1 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    49
local paoth2 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    50
local paoth3 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    51
local paoth4 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    52
local professor = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    53
local minion1 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    54
local minion2 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    55
local minion3 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    56
local minion4 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    57
-- teams
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    58
local teamA = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    59
local teamB = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    60
local teamC = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    61
local teamD = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    62
-- hedgehogs values
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    63
hero.name = "Hog Solo"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    64
hero.x = 1380
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    65
hero.y = 1750
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
    66
hero.dead = false
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    67
paoth1.name = "Joe"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    68
paoth1.x = 1430
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    69
paoth1.y = 1750
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    70
paoth2.name = "Bruce"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    71
paoth2.x = 3760
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    72
paoth2.y = 1800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    73
paoth3.name = "Helena"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    74
paoth3.x = 3800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    75
paoth3.y = 1800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    76
paoth4.name = "Boris"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    77
paoth4.x = 3860
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    78
paoth4.y = 1800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    79
professor.name = "Pr.Hogevil"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    80
professor.x = 3710
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    81
professor.y = 1650
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    82
professor.dead = false
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
    83
professor.health = 100
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    84
minion1.name = "Minion"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    85
minion1.x = 2460
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    86
minion1.y = 1450
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    87
minion2.name = "Minion"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    88
minion2.x = 2450
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    89
minion2.y = 1900
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    90
minion3.name = "Minion"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    91
minion3.x = 3500
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    92
minion3.y = 1750
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    93
teamA.name = loc("PAoTH")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    94
teamA.color = tonumber("FF0000",16) -- red
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    95
teamB.name = loc("Minions")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    96
teamB.color = tonumber("0033FF",16) -- blue
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    97
teamC.name = loc("Professor")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    98
teamC.color = tonumber("0033FF",16) -- blue
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    99
teamD.name = loc("Hog Solo")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   100
teamD.color = tonumber("38D61C",16) -- green
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   101
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   102
-------------- LuaAPI EVENT HANDLERS ------------------
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   103
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   104
function onGameInit()
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   105
	Seed = 1
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   106
	GameFlags = gfSolidLand + gfDisableWind
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   107
	TurnTime = 45000
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   108
	CaseFreq = 0
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   109
	MinesNum = 0
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   110
	MinesTime = 3000
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   111
	Explosives = 0
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   112
	Delay = 5 
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   113
	Map = "moon01_map"
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   114
	Theme = "Cheese" -- Because ofc moon is made of cheese :)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   115
	-- Hog Solo
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   116
	AddTeam(teamD.name, teamD.color, "Bone", "Island", "HillBilly", "cm_birdy")
9326
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   117
	if GetCampaignVar("HeroHealth") then
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   118
		hero.gear = AddHog(hero.name, 0, tonumber(GetCampaignVar("HeroHealth")), "war_desertgrenadier1")
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   119
	else
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   120
		hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   121
	end
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   122
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   123
	-- PAoTH
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   124
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   125
	paoth1.gear = AddHog(paoth1.name, 0, 100, "scif_2001O")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   126
	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   127
	HogTurnLeft(paoth1.gear, true)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   128
	paoth2.gear = AddHog(paoth2.name, 0, 100, "scif_2001Y")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   129
	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   130
	HogTurnLeft(paoth2.gear, true)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   131
	paoth3.gear = AddHog(paoth3.name, 0, 100, "hair_purple")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   132
	AnimSetGearPosition(paoth3.gear, paoth3.x, paoth3.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   133
	HogTurnLeft(paoth3.gear, true)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   134
	paoth4.gear = AddHog(paoth4.name, 0, 100, "scif_2001Y")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   135
	AnimSetGearPosition(paoth4.gear, paoth4.x, paoth4.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   136
	HogTurnLeft(paoth4.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   137
	-- Professor
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   138
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   139
	professor.gear = AddHog(professor.name, 0, 100, "tophats")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   140
	AnimSetGearPosition(professor.gear, professor.x, professor.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   141
	HogTurnLeft(professor.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   142
	-- Minions
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   143
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   144
	minion1.gear = AddHog(minion1.name, 1, 100, "Gasmask")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   145
	AnimSetGearPosition(minion1.gear, minion1.x, minion1.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   146
	HogTurnLeft(minion1.gear, true)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   147
	minion2.gear = AddHog(minion2.name, 1, 100, "Gasmask")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   148
	AnimSetGearPosition(minion2.gear, minion2.x, minion2.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   149
	HogTurnLeft(minion2.gear, true)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   150
	minion3.gear = AddHog(minion3.name, 1, 100, "Gasmask")
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   151
	AnimSetGearPosition(minion3.gear, minion3.x, minion3.y)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   152
	HogTurnLeft(minion3.gear, true)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   153
	
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   154
	-- get the check point
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   155
	if tonumber(GetCampaignVar("Moon01CheckPoint")) then
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   156
		checkPointReached = tonumber(GetCampaignVar("Moon01CheckPoint"))
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   157
	end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   158
	
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   159
	if checkPointReached == 1 then
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   160
		-- Start of the game
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   161
	elseif checkPointReached == 2 then
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   162
		AnimSetGearPosition(hero.gear, parachuteX, weaponsY)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   163
	end
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   164
	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   165
	AnimInit()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   166
	AnimationSetup()	
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   167
end
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   168
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   169
function onGameStart()
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   170
	-- wait for the first turn to start
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   171
	AnimWait(hero.gear, 3000)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   172
	FollowGear(hero.gear)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   173
	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   174
	ShowMission(campaignName, missionName, loc("Hog Solo has to refuel his saucer.")..
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   175
	"|"..loc("Rescue the imprisoned PAoTH team and get your fuels!"), -amSkip, 0)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   176
	
9322
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   177
	AddAmmo(minion1.gear, amDEagle, 10)
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   178
	AddAmmo(minion2.gear, amDEagle, 10)
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   179
	AddAmmo(minion3.gear, amDEagle, 10)
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   180
	AddAmmo(minion1.gear, amBazooka, 2)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   181
	AddAmmo(minion2.gear, amBazooka, 2)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   182
	AddAmmo(minion3.gear, amBazooka, 2)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   183
	AddAmmo(minion1.gear, amGrenade, 2)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   184
	AddAmmo(minion2.gear, amGrenade, 2)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   185
	AddAmmo(minion3.gear, amGrenade, 2)
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   186
	
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   187
	-- check for death has to go first
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   188
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   189
	AddEvent(onProfessorDeath, {professor.gear}, professorDeath, {professor.gear}, 0)
9324
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   190
	AddEvent(onMinionsDeath, {professor.gear}, minionsDeath, {professor.gear}, 0)
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   191
	AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0)
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   192
	AddEvent(onProfessorHit, {professor.gear}, professorHit, {professor.gear}, 1)
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   193
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   194
	if checkPointReached == 1 then
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   195
		AddAmmo(hero.gear, amRope, 2)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   196
		SpawnAmmoCrate(bazookaX, weaponsY, amBazooka)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   197
		SpawnAmmoCrate(parachuteX, weaponsY, amParachute)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   198
		SpawnAmmoCrate(grenadeX, weaponsY, amGrenade)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   199
		SpawnAmmoCrate(deserteagleX, weaponsY, amDEagle)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   200
		AddEvent(onWeaponsPlatform, {hero.gear}, weaponsPlatform, {hero.gear}, 0)
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   201
		TurnTimeLeft = 0
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   202
		AddAnim(dialog01)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   203
	elseif checkPointReached == 2 then	
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   204
		AddAmmo(hero.gear, amBazooka, 2)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   205
		AddAmmo(hero.gear, amParachute, 2)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   206
		AddAmmo(hero.gear, amGrenade, 2)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   207
		AddAmmo(hero.gear, amDEagle, 2)
9326
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   208
		SetWind(60)		
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   209
		GameFlags = bor(GameFlags,gfDisableWind)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   210
		weaponsAcquired = true
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   211
		TurnTimeLeft = 0
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   212
		AddAnim(dialog02)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   213
	end
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   214
end
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   215
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   216
function onAmmoStoreInit()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   217
	SetAmmo(amBazooka, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   218
	SetAmmo(amParachute, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   219
	SetAmmo(amGrenade, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   220
	SetAmmo(amDEagle, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   221
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   222
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   223
function onGameTick()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   224
	AnimUnWait()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   225
	if ShowAnimation() == false then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   226
		return
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   227
	end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   228
	ExecuteAfterAnimations()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   229
	CheckEvents()
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   230
	if CurrentHedgehog ~= hero.gear and not battleZone then
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   231
		TurnTimeLeft = 0
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   232
	end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   233
end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   234
9320
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   235
function onNewTurn()		
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   236
	-- rounds start if hero got his weapons or got near the enemies
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   237
	if not weaponsAcquired and not battleZoneReached and CurrentHedgehog ~= hero.gear then
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   238
		TurnTimeLeft = 0
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   239
	elseif not weaponsAcquired and not battleZoneReached and CurrentHedgehog == hero.gear then
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   240
		TurnTimeLeft = -1
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   241
	elseif CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   242
		or CurrentHedgehog == paoth3.gear or CurrentHedgehog == paoth4.gear then
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   243
		TurnTimeLeft = 0
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   244
	elseif CurrentHedgehog == professor.gear then
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   245
		AnimSwitchHog(hero.gear)
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   246
		TurnTimeLeft = 0
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   247
	end
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   248
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   249
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   250
function onPrecise()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   251
	if GameTime > 3000 then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   252
		SetAnimSkip(true)   
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   253
	end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   254
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   255
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   256
function onGearDelete(gear)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   257
	if gear == hero.gear then
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   258
		hero.dead = true
9320
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   259
	elseif gear == professor.gear then
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   260
		professor.dead = true
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   261
	end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   262
end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   263
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   264
-------------- EVENTS ------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   265
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   266
function onWeaponsPlatform(gear)
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   267
	if not hero.dead and GetX(gear) > bazookaX-200 and GetX(gear) < deserteagleX+400  
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   268
		and GetY(gear) < weaponsY+150 and StoppedGear(gear) then
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   269
		return true
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   270
	end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   271
	return false
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   272
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   273
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   274
function onHeroDeath(gear)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   275
	if hero.dead then
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   276
		return true
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   277
	end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   278
	return false
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   279
end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   280
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   281
function onBattleZone(gear)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   282
	if not hero.dead and GetX(gear) > 1900 and StoppedGear(gear) then
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   283
		return true
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   284
	end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   285
	return false
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   286
end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   287
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   288
function onProfessorHit(gear)
9320
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   289
	if GetHealth(gear) then
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   290
		if CurrentHedgehog ~= hero.gear and GetHealth(gear) < professor.health then
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   291
			professor.health = GetHealth(gear)
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   292
			return true
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   293
		elseif GetHealth(gear) < professor.health then
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   294
			professor.health = GetHealth(gear)
1845b420cb5d game ends when professor dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9318
diff changeset
   295
		end
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   296
	end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   297
	return false
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   298
end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   299
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   300
function onProfessorDeath(gear)
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   301
	if professor.dead then
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   302
		return true
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   303
	end
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   304
	return false
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   305
end
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   306
9322
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   307
function onMinionsDeath(gear)
9324
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   308
	if not (GetHealth(minion1.gear) or GetHealth(minion2.gear) or GetHealth(minion3.gear)) then
9322
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   309
		return true
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   310
	end
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   311
	return false
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   312
end
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   313
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   314
-------------- OUTCOMES ------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   315
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   316
function weaponsPlatform(gear)	
9326
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   317
	SaveCampaignVar("Moon01CheckPoint", "2")	
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   318
	SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   319
	TurnTimeLeft = 0
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   320
	weaponsAqcuired = true
9326
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9324
diff changeset
   321
	SetWind(60)		
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   322
	GameFlags = bor(GameFlags,gfDisableWind)
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   323
	AddAnim(dialog02)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   324
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   325
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   326
function heroDeath(gear)
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   327
	-- do stats stuff here
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   328
	EndGame()
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   329
end
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   330
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   331
function battleZone(gear)
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   332
	TurnTimeLeft = 0
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   333
	battleZoneReached = true
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   334
	if weaponsAqcuired then
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   335
		AddAnim(dialog04)
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   336
	else
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   337
		AddAnim(dialog03)
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   338
	end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   339
end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   340
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   341
function professorHit(gear)
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   342
	if currentHedgehog ~= hero.gear then
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   343
		AnimSay(professor.gear,loc("Don't hit me you fools!"), SAY_SHOUT, 2000)
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   344
	end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   345
end
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   346
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   347
function professorDeath(gear)
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   348
	-- do stats stuff here
9324
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   349
	if GetHealth(minion1.gear) then
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   350
		AnimSay(minion1.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   351
	elseif GetHealth(minion2.gear) then
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   352
		AnimSay(minion2.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   353
	elseif GetHealth(minion3.gear) then
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   354
		AnimSay(minion3.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   355
	end
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   356
	ParseCommand("teamgone " .. teamB.name)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   357
	AnimCaption(hero.gear, loc("Congrats! You made them run away!"), 6000)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   358
	AnimWait(hero.gear,5000)
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   359
	EndGame()
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   360
end
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   361
9322
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   362
function minionsDeath(gear)
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   363
	-- do staffs here
9324
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   364
	AnimSay(professor.gear, loc("I may lost that battle, but I haven't lost the war yet!"), SAY_SHOUT, 6000)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   365
	ParseCommand("teamgone " .. teamC.name)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   366
	AnimCaption(hero.gear, loc("Congrats! You won!"), 6000)
98368198a75d added slot for starting campaign by clicking the image and some events in moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9322
diff changeset
   367
	AnimWait(hero.gear,5000)	
9322
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   368
	EndGame()
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   369
end
18cbaf1436c7 event to endgame when minions killed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9320
diff changeset
   370
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   371
-------------- ANIMATIONS ------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   372
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   373
function Skipanim(anim)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   374
	if goals[anim] ~= nil then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   375
		ShowMission(unpack(goals[anim]))
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   376
    end
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   377
    if anim == dialog03 then
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   378
		startCombat()
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   379
	else
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   380
		AnimSwitchHog(hero.gear)
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   381
	end
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   382
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   383
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   384
function AnimationSetup()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   385
	-- DIALOG 01 - Start, welcome to moon
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   386
	AddSkipFunction(dialog01, Skipanim, {dialog01})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   387
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   388
	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near PAoTH base at moon..."),  4000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   389
	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("Hey Hog Solo! Finaly you have come..."), SAY_SAY, 2000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   390
	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("It seems that Professor Hogevil learned for your arrival!"), SAY_SAY, 4000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   391
	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("Now he have captured the rest of the PAoTH team and awaits to capture you!"), SAY_SAY, 5000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   392
	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("We have to hurry! Are you armed?"), SAY_SAY, 4300}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   393
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   394
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("No, I am afraid I had to travel light"), SAY_SAY, 2500}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   395
	table.insert(dialog01, {func = AnimWait, args = {paoth1.gear, 500}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   396
	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("Ok, then you have to go and take some of the waepons we have hidden in case of an emergency!"), SAY_SAY, 7000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   397
	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("They are up there! Take that rope and hurry!"), SAY_SAY, 7000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   398
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Ehm... ok..."), SAY_SAY, 2500}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   399
	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   400
	-- DIALOG 02 - To the weapons platform
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   401
	AddSkipFunction(dialog02, Skipanim, {dialog02})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   402
	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("Checkpoint reached!"),  4000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   403
	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("I've made it! YEAAAAAH!"), SAY_SHOUT, 4000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   404
	table.insert(dialog02, {func = AnimSay, args = {paoth1.gear, loc("Nice! Now hurry up and get down! You have to rescue my friends!"), SAY_SHOUT, 7000}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   405
	table.insert(dialog02, {func = AnimSwitchHog, args = {hero.gear}})
9316
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   406
	-- DIALOG 03 - Hero spotted and has no weapons
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   407
	AddSkipFunction(dialog03, Skipanim, {dialog03})
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   408
	table.insert(dialog03, {func = AnimCaption, args = {hero.gear, loc("Get ready to fight!"), 4000}})
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   409
	table.insert(dialog03, {func = AnimSay, args = {minion1.gear, loc("Look boss! There is the target!"), SAY_SHOUT, 4000}})
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   410
	table.insert(dialog03, {func = AnimSay, args = {professor.gear, loc("Prepare for battle!"), SAY_SHOUT, 4000}})
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   411
	table.insert(dialog03, {func = AnimSay, args = {hero.gear, loc("Oops, I've been spotted and I have no weapons! I am doomed!"), SAY_THINK, 4000}})
213b4267db81 more moon code, most things work ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9314
diff changeset
   412
	table.insert(dialog03, {func = startCombat, args = {hero.gear}})
9318
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   413
	-- DIALOG 04 - Hero spotted and *HAS* weapons
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   414
	AddSkipFunction(dialog04, Skipanim, {dialog04})
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   415
	table.insert(dialog04, {func = AnimCaption, args = {hero.gear, loc("Get ready to fight!"), 4000}})
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   416
	table.insert(dialog04, {func = AnimSay, args = {minion1.gear, loc("Look boss! There is the target!"), SAY_SHOUT, 4000}})
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   417
	table.insert(dialog04, {func = AnimSay, args = {professor.gear, loc("Prepare for battle!"), SAY_SHOUT, 4000}})
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   418
	table.insert(dialog04, {func = AnimSay, args = {hero.gear, loc("Here we go!"), SAY_THINK, 4000}})
413dd0eab399 moar event handlers and fixes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9316
diff changeset
   419
	table.insert(dialog04, {func = startCombat, args = {hero.gear}})
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   420
end
9314
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   421
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   422
------------------- custom "animation" functions --------------------------
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   423
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   424
function startCombat()
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   425
	-- use this so guard2 will gain control
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   426
	AnimSwitchHog(minion3.gear)
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   427
	TurnTimeLeft = 0
b7ee054888f8 more progress on the moon main mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9312
diff changeset
   428
end