share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Fri, 05 Jul 2013 04:32:39 +0300
branchspacecampaign
changeset 9312 f6bec1cfbfbd
parent 9310 1469147c110f
child 9314 b7ee054888f8
permissions -rw-r--r--
progress on the main moon mission
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
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    11
-- Fix some glitches when gaining control on animations
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    12
-- Continue with the rest :P
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    13
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    14
HedgewarsScriptLoad("/Scripts/Locale.lua")
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    15
HedgewarsScriptLoad("/Scripts/Animate.lua")
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    16
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    17
----------------- VARIABLES --------------------
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    18
-- globals
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    19
local campaignName = loc("A Space Adventure")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    20
local missionName = loc("Moon, stop for fuels!")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    21
-- dialogs
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    22
local dialog01 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    23
local dialog02 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    24
-- mission objectives
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    25
local goals = {
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    26
	[dialog01] = {missionName, loc("Getting ready"), loc("Go to the upper platform and get the weapons in the crates!"), 1, 4500},
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    27
	[dialog02] = {missionName, loc("Prepare to fight"), loc("Go down and save these PAoTH hogs!"), 1, 5000}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    28
}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    29
-- crates
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    30
local weaponsY = 100
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    31
local bazookaX = 70
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    32
local parachuteX = 110
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    33
local grenadeX = 160
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    34
local deserteagleX = 200
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    35
local torchblowX = 3270
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    36
-- hogs
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    37
local hero = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    38
local paoth1 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    39
local paoth2 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    40
local paoth3 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    41
local paoth4 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    42
local professor = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    43
local minion1 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    44
local minion2 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    45
local minion3 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    46
local minion4 = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    47
-- teams
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    48
local teamA = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    49
local teamB = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    50
local teamC = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    51
local teamD = {}
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    52
-- hedgehogs values
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    53
hero.name = "Hog Solo"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    54
hero.x = 1380
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    55
hero.y = 1750
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    56
paoth1.name = "Joe"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    57
paoth1.x = 1430
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    58
paoth1.y = 1750
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    59
paoth2.name = "Bruce"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    60
paoth2.x = 3760
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    61
paoth2.y = 1800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    62
paoth3.name = "Helena"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    63
paoth3.x = 3800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    64
paoth3.y = 1800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    65
paoth4.name = "Boris"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    66
paoth4.x = 3860
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    67
paoth4.y = 1800
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    68
professor.name = "Pr.Hogevil"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    69
professor.x = 3710
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    70
professor.y = 1650
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    71
minion1.name = "Minion"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    72
minion1.x = 2460
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    73
minion1.y = 1450
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    74
minion2.name = "Minion"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    75
minion2.x = 2450
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    76
minion2.y = 1900
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    77
minion3.name = "Minion"
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    78
minion3.x = 3500
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    79
minion3.y = 1750
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    80
teamA.name = loc("PAoTH")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    81
teamA.color = tonumber("FF0000",16) -- red
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    82
teamB.name = loc("Minions")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    83
teamB.color = tonumber("0033FF",16) -- blue
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    84
teamC.name = loc("Professor")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    85
teamC.color = tonumber("0033FF",16) -- blue
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    86
teamD.name = loc("Hog Solo")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    87
teamD.color = tonumber("38D61C",16) -- green
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    88
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    89
-------------- LuaAPI EVENT HANDLERS ------------------
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    90
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    91
function onGameInit()
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    92
	Seed = 1
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    93
	GameFlags = gfInfAttack + gfSolidLand + gfDisableWind 
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    94
	TurnTime = 45000
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    95
	CaseFreq = 0
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    96
	MinesNum = 0
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    97
	MinesTime = 3000
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
    98
	Explosives = 0
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
    99
	Delay = 5 
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   100
	Map = "moon01_map"
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   101
	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
   102
	-- Hog Solo
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   103
	AddTeam(teamD.name, teamD.color, "Bone", "Island", "HillBilly", "cm_birdy")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   104
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   105
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   106
	-- PAoTH
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   107
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   108
	paoth1.gear = AddHog(paoth1.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   109
	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   110
	HogTurnLeft(paoth1.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   111
	paoth2.gear = AddHog(paoth2.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   112
	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   113
	HogTurnLeft(paoth2.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   114
	paoth3.gear = AddHog(paoth3.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   115
	AnimSetGearPosition(paoth3.gear, paoth3.x, paoth3.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   116
	HogTurnLeft(paoth3.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   117
	paoth4.gear = AddHog(paoth4.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   118
	AnimSetGearPosition(paoth4.gear, paoth4.x, paoth4.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   119
	HogTurnLeft(paoth4.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   120
	-- Professor
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   121
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   122
	professor.gear = AddHog(professor.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   123
	AnimSetGearPosition(professor.gear, professor.x, professor.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   124
	HogTurnLeft(professor.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   125
	-- Minions
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   126
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   127
	minion1.gear = AddHog(minion1.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   128
	AnimSetGearPosition(minion1.gear, minion1.x, minion1.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   129
	HogTurnLeft(minion1.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   130
	minion2.gear = AddHog(minion2.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   131
	AnimSetGearPosition(minion2.gear, minion2.x, minion2.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   132
	HogTurnLeft(minion2.gear, true)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   133
	minion3.gear = AddHog(minion3.name, 0, 100, "war_desertgrenadier1")
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   134
	AnimSetGearPosition(minion3.gear, minion3.x, minion3.y)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   135
	HogTurnLeft(minion3.gear, true)	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   136
	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   137
	AnimInit()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   138
	AnimationSetup()	
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   139
end
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   140
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   141
function onGameStart()
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   142
	-- wait for the first turn to start
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   143
	AnimWait(hero.gear, 3000)
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   144
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   145
	FollowGear(hero.gear)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   146
	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   147
	ShowMission(campaignName, missionName, loc("Hog Solo has to refuel his saucer.")..
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   148
	"|"..loc("Rescue the imprisoned PAoTH team and get your fuels!"), -amSkip, 0)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   149
	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   150
	AddAmmo(hero.gear, amRope, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   151
	SpawnAmmoCrate(bazookaX, weaponsY, amBazooka)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   152
	SpawnAmmoCrate(parachuteX, weaponsY, amParachute)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   153
	SpawnAmmoCrate(grenadeX, weaponsY, amGrenade)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   154
	SpawnAmmoCrate(deserteagleX, weaponsY, amDEagle)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   155
	
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   156
	AddEvent(onWeaponsPlatform, {hero.gear}, weaponsPlatform, {hero.gear}, 0)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   157
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   158
	AddAnim(dialog01)
9310
1469147c110f moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9308
diff changeset
   159
end
9312
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   160
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   161
function onAmmoStoreInit()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   162
	SetAmmo(amBazooka, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   163
	SetAmmo(amParachute, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   164
	SetAmmo(amGrenade, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   165
	SetAmmo(amDEagle, 0, 0, 0, 2)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   166
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   167
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   168
function onGameTick()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   169
	AnimUnWait()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   170
	if ShowAnimation() == false then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   171
		return
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   172
	end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   173
	ExecuteAfterAnimations()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   174
	CheckEvents()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   175
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   176
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   177
function onPrecise()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   178
	if GameTime > 3000 then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   179
		SetAnimSkip(true)   
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   180
	end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   181
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   182
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   183
-------------- EVENTS ------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   184
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   185
function onWeaponsPlatform(gear)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   186
	if GetX(gear) > bazookaX-200 and GetX(gear) < deserteagleX+400  and GetY(gear) < weaponsY+150 and StoppedGear(gear) then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   187
		return true
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   188
	end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   189
	return false
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   190
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   191
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   192
-------------- OUTCOMES ------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   193
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   194
function weaponsPlatform(gear)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   195
	AddAnim(dialog02)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   196
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   197
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   198
-------------- ANIMATIONS ------------------
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   199
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   200
function Skipanim(anim)
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   201
	if goals[anim] ~= nil then
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   202
		ShowMission(unpack(goals[anim]))
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   203
    end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   204
end
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   205
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   206
function AnimationSetup()
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   207
	-- DIALOG 01 - Start, welcome to moon
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   208
	AddSkipFunction(dialog01, Skipanim, {dialog01})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   209
	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
   210
	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
   211
	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
   212
	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
   213
	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
   214
	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
   215
	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
   216
	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
   217
	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
   218
	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
   219
	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
   220
	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
   221
	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   222
	-- DIALOG 02 - To the weapons platform
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   223
	AddSkipFunction(dialog02, Skipanim, {dialog02})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   224
	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
   225
	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
   226
	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
   227
	table.insert(dialog02, {func = AnimSwitchHog, args = {hero.gear}})
f6bec1cfbfbd progress on the main moon mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   228
end