share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Thu, 22 Aug 2013 03:21:30 +0300
branchspacecampaign
changeset 9560 5872edd6864e
parent 9558 455f1260ef43
child 9562 241ffe433c3d
permissions -rw-r--r--
event in case hero dies
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9558
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- This is the mission to acquire the last part.
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     4
-- This mission is the cameo of Professor Hogevil
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
-- who has took hostages H and Dr. Cornelius.
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
-- Hog Solo has to defeat him and his thugs.
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
HedgewarsScriptLoad("/Scripts/Locale.lua")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
HedgewarsScriptLoad("/Scripts/Animate.lua")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    10
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    11
----------------- VARIABLES --------------------
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
-- globals
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
local campaignName = loc("A Space Adventure")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    14
local missionName = loc("Desert planet, lost in sand!")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
-- dialogs
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
-- missions objectives
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    17
-- crates
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    18
local portalCrate = {x = 1520, y = 1950}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    19
local cakeCrate = {x = 325, y = 1500}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    20
-- hogs
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    21
local hero = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    22
local paoth1 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    23
local paoth2 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
local professor = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
local thug1 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
local thug2 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
local thug3 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    28
local thug4 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    29
local thug5 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    30
local thug6 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    31
local thug7 = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    32
local thugs = { thug1, thug2, thug3, thug4, thug5, thug6, thug7 }
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    33
-- teams
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    34
local teamA = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    35
local teamB = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    36
local teamC = {}
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    37
-- hedgehogs values
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    38
hero.name = "Hog Solo"
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    39
hero.x = 520
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    40
hero.y = 845
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    41
hero.dead = false
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    42
paoth1.name = "H"
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
paoth1.x = 3730
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    44
paoth1.y = 1480
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    45
paoth2.name = "Dr. Cornelius"
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    46
paoth2.x = 3800
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    47
paoth2.y = 1480
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
professor.name = "Prof. Hogevil"
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
professor.x = 3630
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
professor.y = 1480
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
professor.dead = false
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
thug1.x = 1265
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
thug1.y = 1400
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    54
thug1.health = 100
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    55
thug2.x = 2035
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    56
thug2.y = 1320
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    57
thug2.health = 100
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
thug3.x = 1980
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    59
thug3.y = 815
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
thug3.health = 35
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
thug3.turnLeft = true
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    62
thug4.x = 2830
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    63
thug4.y = 1960
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    64
thug4.health = 80
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    65
thug5.x = 2890
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
thug5.y = 1960
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
thug5.health = 80
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
thug6.x = 2940
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    69
thug6.y = 1960
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
thug6.health = 80
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
thug7.x = 2990
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
thug7.y = 1960
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
thug7.health = 80
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
teamA.name = loc("Hog Solo")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
teamA.color = tonumber("38D61C",16) -- green
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
teamB.name = loc("PAotH")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
teamB.color = tonumber("FF0000",16) -- red
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
teamC.name = loc("Professor")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
teamC.color = tonumber("0033FF",16) -- blue
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
-------------- LuaAPI EVENT HANDLERS ------------------
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    83
function onGameInit()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    84
	Seed = 1
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    85
	TurnTime = 25000
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    86
	CaseFreq = 0
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	MinesNum = 3
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    88
	MinesTime = 1500
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    89
	Explosives = 2
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    90
	Delay = 3
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    91
	SuddenDeathTurns = 100
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    92
	Map = "death01_map"
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    93
	Theme = "Hell"
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    94
	
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    95
	-- Hog Solo
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    96
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    97
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    98
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    99
	-- PAotH
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   100
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   101
	paoth1.gear = AddHog(paoth1.name, 0, 100, "war_desertgrenadier1")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   102
	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   103
	HogTurnLeft(paoth1.gear, true)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   104
	paoth2.gear = AddHog(paoth2.name, 0, 100, "war_desertgrenadier1")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   105
	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   106
	HogTurnLeft(paoth2.gear, true)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   107
	-- Professor and Thugs
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   108
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   109
	professor.gear = AddHog(professor.name, 0, 300, "war_desertgrenadier1")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   110
	AnimSetGearPosition(professor.gear, professor.x, professor.y)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   111
	HogTurnLeft(professor.gear, true)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   112
	for i=1,table.getn(thugs) do
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   113
		thugs[i].gear = AddHog("thug #"..i, 1, thugs[i].health, "war_desertgrenadier1")
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   114
		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   115
		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   116
	end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   117
	
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   118
	AnimInit()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   119
	--AnimationSetup()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   120
end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   121
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   122
function onGameStart()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   123
	AnimWait(hero.gear, 3000)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   124
	FollowGear(hero.gear)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   125
	
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   126
	-- add crates
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   127
	SpawnAmmoCrate(portalCrate.x, portalCrate.y, amPortalGun)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   128
	SpawnAmmoCrate(cakeCrate.x, cakeCrate.y, amCake)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   129
	-- add explosives
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   130
	AddGear(1900, 850, gtExplosives, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   131
	AddGear(1900, 800, gtExplosives, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   132
	AddGear(1900, 750, gtExplosives, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   133
	AddGear(1900, 710, gtExplosives, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   134
	-- add mines
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   135
	AddGear(3520, 1650, gtMine, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   136
	AddGear(3480, 1680, gtMine, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   137
	AddGear(3440, 1690, gtMine, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   138
	AddGear(3400, 1710, gtMine, 0, 0, 0, 0)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   139
	-- add girders
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   140
	PlaceGirder(3770, 1370, 4)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   141
	PlaceGirder(3700, 1460, 6)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   142
	PlaceGirder(3840, 1460, 6)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   143
	
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   144
	-- add ammo
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   145
	-- hero ammo
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   146
	AddAmmo(hero.gear, amRope, 2)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   147
	AddAmmo(hero.gear, amBazooka, 3)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   148
	AddAmmo(hero.gear, amParachute, 1)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   149
	AddAmmo(hero.gear, amGrenade, 6)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   150
	AddAmmo(hero.gear, amDEagle, 4)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   151
	-- evil ammo
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   152
	AddAmmo(professor.gear, amRope, 4)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   153
	AddAmmo(professor.gear, amBazooka, 8)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   154
	AddAmmo(professor.gear, amSwitch, 100)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   155
	AddAmmo(professor.gear, amGrenade, 8)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   156
	AddAmmo(professor.gear, amDEagle, 8)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   157
	
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   158
	SendHealthStatsOff()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   159
end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   160
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   161
function onNewTurn()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   162
	if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   163
		TurnTimeLeft = 0
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   164
	end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   165
end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   166
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   167
function onGameTick()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   168
	AnimUnWait()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   169
	if ShowAnimation() == false then
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   170
		return
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   171
	end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   172
	ExecuteAfterAnimations()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   173
	CheckEvents()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   174
end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   175
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   176
function onAmmoStoreInit()
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   177
	SetAmmo(amCake, 0, 0, 0, 1)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   178
	SetAmmo(amPortalGun, 0, 0, 0, 1)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   179
end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   180
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   181
function onGearDelete(gear)
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   182
	if gear == hero.gear then
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   183
		hero.dead = true
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   184
	elseif gear == professor.gear then
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   185
		professor.dead = true
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   186
	end
455f1260ef43 forgotten file and death planet map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   187
end
9560
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   188
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   189
function onPrecise()
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   190
	if GameTime > 3000 then
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   191
		SetAnimSkip(true)   
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   192
	end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   193
end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   194
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   195
-------------- EVENTS ------------------
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   196
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   197
function onHeroDeath(gear)
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   198
	if hero.dead then
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   199
		return true
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   200
	end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   201
	return false
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   202
end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   203
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   204
-------------- ACTIONS ------------------
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   205
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   206
function heroDeath(gear)
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   207
	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   208
	SendStat('siCustomAchievement', loc("To win the game you have to eliminate your enemies")) --11
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   209
	SendStat('siPlayerKills','1',teamC.name)
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   210
	SendStat('siPlayerKills','0',teamA.name)
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   211
	EndGame()
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   212
end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   213
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   214
-------------- ANIMATIONS ------------------
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   215
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   216
function Skipanim(anim)
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   217
	if goals[anim] ~= nil then
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   218
		ShowMission(unpack(goals[anim]))
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   219
    end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   220
end
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   221
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   222
function AnimationSetup()
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   223
	-- TODO ADD DIALOGS
5872edd6864e event in case hero dies
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9558
diff changeset
   224
end