author | Wuzzy <almikes@aol.com> |
Fri, 29 Sep 2017 03:41:30 +0200 | |
changeset 12591 | 7510fe66bfbb |
parent 12582 | e2b5c6e805e8 |
child 12592 | 0b27d8b4f8e7 |
permissions | -rw-r--r-- |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
1 |
------------------- ABOUT ---------------------- |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
2 |
-- |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
3 |
-- Hero has been surrounded my some space villains |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
4 |
-- He has to defeat them in order to escape |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
5 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
6 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
7 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
8 |
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
9 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
10 |
----------------- VARIABLES -------------------- |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
-- globals |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
local missionName = loc("Killing the specialists") |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
13 |
local challengeObjectives = loc("Use your available weapons in order to eliminate the enemies.").."|".. |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
14 |
loc("Each time you play this missions enemy hogs will play in a random order.").."|".. |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
15 |
loc("At the start of the game each enemy hog has only the weapon that he is named after.").."|".. |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
16 |
loc("A random hedgehog will inherit the weapons of his deceased team-mates.").."|".. |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
17 |
loc("If you kill a hedgehog with the respective weapon your health points will be set to 100.").."|".. |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
18 |
loc("If you injure a hedgehog you'll get 35% of the damage dealt.").."|".. |
12094
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
19 |
loc("Every time you kill an enemy hog your ammo will get reset next turn.").."|".. |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
20 |
loc("The rope won't get reset.") |
9602
a8ed4853963e
dialogs with objectives added
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9601
diff
changeset
|
21 |
-- mission objectives |
a8ed4853963e
dialogs with objectives added
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9601
diff
changeset
|
22 |
local goals = { |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
23 |
["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 35000}, |
9602
a8ed4853963e
dialogs with objectives added
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9601
diff
changeset
|
24 |
} |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
25 |
-- hogs |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
26 |
local hero = { |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
27 |
name = loc("Hog Solo"), |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
28 |
x = 850, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
29 |
y = 460, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
30 |
mortarAmmo = 2, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
31 |
firepunchAmmo = 1, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
32 |
deagleAmmo = 4, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
33 |
bazookaAmmo = 2, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
34 |
grenadeAmmo = 4, |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
35 |
} |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
36 |
local enemies = { |
12570
392f90c79b78
ASA, death02: Use GetAmmoName for the enemy hog names
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
37 |
{ name = GetAmmoName(amMortar), x = 1890, y = 520, weapon = amMortar, additionalWeapons = {}}, |
392f90c79b78
ASA, death02: Use GetAmmoName for the enemy hog names
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
38 |
{ name = GetAmmoName(amDEagle), x = 1390, y = 790, weapon = amDEagle, additionalWeapons = {}}, |
392f90c79b78
ASA, death02: Use GetAmmoName for the enemy hog names
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
39 |
{ name = GetAmmoName(amGrenade), x = 186, y = 48, weapon = amGrenade, additionalWeapons = {}}, |
392f90c79b78
ASA, death02: Use GetAmmoName for the enemy hog names
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
40 |
{ name = GetAmmoName(amFirePunch), x = 330, y = 270, weapon = amFirePunch, additionalWeapons = {}}, |
392f90c79b78
ASA, death02: Use GetAmmoName for the enemy hog names
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
41 |
{ name = GetAmmoName(amBazooka), x = 1950, y = 150, weapon = amBazooka, additionalWeapons = {}}, |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
42 |
} |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
43 |
-- teams |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
44 |
local teamA = { |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
45 |
name = loc("Hog Solo"), |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
46 |
color = tonumber("38D61C",16) -- green |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
47 |
} |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
48 |
local teamB = { |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
49 |
name = loc("5 Deadly Hogs"), |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
50 |
color = tonumber("FF0000",16) -- red |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
51 |
} |
12094
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
52 |
-- After hero killed an enemy, his weapons will be reset in the next round |
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
53 |
local heroWeaponResetPending = false |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
54 |
local battleStarted = false |
12582
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
55 |
local firstTurn = true |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
56 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
57 |
-------------- LuaAPI EVENT HANDLERS ------------------ |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
58 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
59 |
function onGameInit() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
60 |
Seed = 1 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
61 |
TurnTime = 25000 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
62 |
CaseFreq = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
63 |
MinesNum = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
64 |
MinesTime = 1 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
65 |
Explosives = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
66 |
Map = "death02_map" |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
67 |
Theme = "Hell" |
12473
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12094
diff
changeset
|
68 |
-- Disable Sudden Death |
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12094
diff
changeset
|
69 |
WaterRise = 0 |
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12094
diff
changeset
|
70 |
HealthDecrease = 0 |
9758 | 71 |
|
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
72 |
-- Hog Solo |
12591
7510fe66bfbb
Change graves of teams in missions for greater variety
Wuzzy <almikes@aol.com>
parents:
12582
diff
changeset
|
73 |
AddTeam(teamA.name, teamA.color, "Simple", "Island", "HillBilly", "hedgewars") |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
74 |
hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1") |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
75 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
76 |
-- enemies |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
77 |
shuffleHogs(enemies) |
12591
7510fe66bfbb
Change graves of teams in missions for greater variety
Wuzzy <almikes@aol.com>
parents:
12582
diff
changeset
|
78 |
AddTeam(teamB.name, teamB.color, "skull", "Island", "HillBilly", "cm_skull") |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
79 |
for i=1,table.getn(enemies) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
80 |
enemies[i].gear = AddHog(enemies[i].name, 1, 100, "war_desertgrenadier1") |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
81 |
AnimSetGearPosition(enemies[i].gear, enemies[i].x, enemies[i].y) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
end |
9758 | 83 |
|
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
84 |
initCheckpoint("death02") |
9758 | 85 |
|
12582
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
86 |
AnimInit() |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
88 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
89 |
function onGameStart() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
90 |
AnimWait(hero.gear, 3000) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
FollowGear(hero.gear) |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
92 |
ShowMission(unpack(goals["init"])) |
9758 | 93 |
|
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
94 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
95 |
AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
96 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
97 |
--hero ammo |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
98 |
AddAmmo(hero.gear, amSkip, 100) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
99 |
AddAmmo(hero.gear, amRope, 2) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
100 |
refreshHeroAmmo() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
101 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
102 |
SendHealthStatsOff() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
103 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
104 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
105 |
function onNewTurn() |
12582
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
106 |
battleStarted = true |
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
107 |
if firstTurn then |
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
108 |
-- Generous ready time in first turn to more time to read the mission panel |
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
109 |
ReadyTimeLeft = 35000 |
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
110 |
firstTurn = false |
e2b5c6e805e8
A Space Adventure: Remove or shorten intro sequences of side missions
Wuzzy <almikes@aol.com>
parents:
12580
diff
changeset
|
111 |
end |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
112 |
if CurrentHedgehog ~= hero.gear then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
113 |
enemyWeapons() |
12094
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
114 |
elseif heroWeaponResetPending then |
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
115 |
refreshHeroAmmo() |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
116 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
117 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
118 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
119 |
function onGearDelete(gear) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
120 |
if isHog(gear) then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
121 |
SetHealth(hero.gear, 100) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
122 |
local deadHog = getHog(gear) |
9603
47b8edc799f5
changed some left amDynamite to amMortar
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9602
diff
changeset
|
123 |
if deadHog.weapon == amMortar then |
47b8edc799f5
changed some left amDynamite to amMortar
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9602
diff
changeset
|
124 |
hero.mortarAmmo = 0 |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
125 |
elseif deadHog.weapon == amFirePunch then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
126 |
hero.firepunchAmmo = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
127 |
elseif deadHog.weapon == amDEagle then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
128 |
hero.deagleAmmo = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
129 |
elseif deadHog.weapon == amBazooka then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
130 |
hero.bazookaAmmo = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
131 |
elseif deadHog.weapon == amGrenade then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
132 |
hero.grenadeAmmo = 0 |
9758 | 133 |
end |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
134 |
local randomHog = GetRandom(table.getn(enemies))+1 |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
135 |
while not GetHealth(enemies[randomHog].gear) do |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
136 |
randomHog = GetRandom(table.getn(enemies))+1 |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
137 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
138 |
table.insert(enemies[randomHog].additionalWeapons, deadHog.weapon) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
139 |
for i=1,table.getn(deadHog.additionalWeapons) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
140 |
table.insert(enemies[randomHog].additionalWeapons, deadHog.additionalWeapons[i]) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
141 |
end |
12094
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
142 |
heroWeaponResetPending = true |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
143 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
144 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
145 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
146 |
function onGearDamage(gear, damage) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
147 |
if isHog(gear) and GetHealth(hero.gear) then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
148 |
SetHealth(hero.gear, GetHealth(hero.gear) + damage/3) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
149 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
150 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
151 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
152 |
function onGameTick() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
153 |
AnimUnWait() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
154 |
if ShowAnimation() == false then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
155 |
return |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
156 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
157 |
ExecuteAfterAnimations() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
158 |
CheckEvents() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
159 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
160 |
|
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
161 |
-- Hide mission panel when player does anything |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
162 |
function hideMissionOnAction() |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
163 |
if battleStarted then |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
164 |
HideMission() |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
165 |
end |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
166 |
end |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
167 |
|
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
168 |
onHogAttack = hideMissionOnAction |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
169 |
onAttack = hideMissionOnAction |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
170 |
onSlot = hideMissionOnAction |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12570
diff
changeset
|
171 |
onSetWeapon = hideMissionOnAction |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
172 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
173 |
-------------- EVENTS ------------------ |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
174 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
175 |
function onHeroDeath(gear) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
176 |
if not GetHealth(hero.gear) then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
177 |
return true |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
178 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
179 |
return false |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
180 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
181 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
182 |
function onHeroWin(gear) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
183 |
local allDead = true |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
184 |
for i=1,table.getn(enemies) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
185 |
if GetHealth(enemies[i].gear) then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
186 |
allDead = false |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
187 |
break |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
188 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
189 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
190 |
return allDead |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
191 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
192 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
193 |
-------------- ACTIONS ------------------ |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
194 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
195 |
function heroDeath(gear) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9631
diff
changeset
|
196 |
SendStat(siGameResult, loc("Hog Solo lost, try again!")) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
197 |
SendStat(siCustomAchievement, loc("You have to eliminate all the enemies.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
198 |
SendStat(siCustomAchievement, loc("Read the challenge objectives from within the mission for more details.")) |
12543
952afc3d2df2
Show correct kill counts in all ASA missions (fixes #147)
Wuzzy <almikes@aol.com>
parents:
12473
diff
changeset
|
199 |
sendSimpleTeamRankings({teamB.name, teamA.name}) |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
200 |
EndGame() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
201 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
202 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
203 |
function heroWin(gear) |
9630 | 204 |
saveBonus(3, 4) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9631
diff
changeset
|
205 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
206 |
SendStat(siCustomAchievement, string.format(loc("You completed the mission in %d rounds."), TotalRounds)) |
11897
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
207 |
local record = tonumber(GetCampaignVar("FastestSpecialistsKill")) |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
208 |
if record ~= nil and TotalRounds >= record then |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
209 |
SendStat(siCustomAchievement, string.format(loc("Your fastest victory so far: %d rounds"), record)) |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
210 |
end |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
211 |
if record == nil or TotalRounds < record then |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
212 |
SaveCampaignVar("FastestSpecialistsKill", tostring(TotalRounds)) |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
213 |
if record ~= nil then |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
214 |
SendStat(siCustomAchievement, loc("This is a new personal best, congratulations!")) |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
215 |
end |
0526a26ddd6e
Save fastest rounds in Killing the specialists and Precise shooting missions
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
216 |
end |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
217 |
SendStat(siCustomAchievement, loc("The next 4 times you play the \"The last encounter\" mission you'll get 20 more hit points and a laser sight.")) |
12543
952afc3d2df2
Show correct kill counts in all ASA missions (fixes #147)
Wuzzy <almikes@aol.com>
parents:
12473
diff
changeset
|
218 |
sendSimpleTeamRankings({teamA.name, teamB.name}) |
11957
63988f36debf
Save mission success for A Space Adventure missions
Wuzzy <almikes@aol.com>
parents:
11897
diff
changeset
|
219 |
SaveCampaignVar("Mission11Won", "true") |
11970
72be38f6d0c0
Complete space campaign's spacetrip mission if all main+side missions are completed
Wuzzy <almikes@aol.com>
parents:
11957
diff
changeset
|
220 |
checkAllMissionsCompleted() |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
221 |
EndGame() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
222 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
223 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
224 |
------------ Other Functions ------------------- |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
225 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
226 |
function shuffleHogs(hogs) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
227 |
local hogsNumber = table.getn(hogs) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
228 |
for i=1,hogsNumber do |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
229 |
local randomHog = GetRandom(hogsNumber) + 1 |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
230 |
hogs[i], hogs[randomHog] = hogs[randomHog], hogs[i] |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
231 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
232 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
233 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
234 |
function refreshHeroAmmo() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
235 |
local extraAmmo = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
236 |
if getAliveEnemiesCount() == 1 then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
237 |
extraAmmo = 2 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
238 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
239 |
AddAmmo(hero.gear, amMortar, hero.mortarAmmo + extraAmmo) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
240 |
AddAmmo(hero.gear, amFirePunch, hero.firepunchAmmo + extraAmmo) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
241 |
AddAmmo(hero.gear, amDEagle, hero.deagleAmmo + extraAmmo) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
242 |
AddAmmo(hero.gear, amBazooka, hero.bazookaAmmo + extraAmmo) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
243 |
AddAmmo(hero.gear, amGrenade, hero.grenadeAmmo + extraAmmo) |
12094
0183b4c448bf
Fix Killing the Specialists giving you a free turn after killing Desert Eagle with a desert eagle with shot 1-3
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
244 |
heroWeaponResetPending = false |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
245 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
246 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
247 |
function enemyWeapons() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
248 |
for i=1,table.getn(enemies) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
249 |
if GetHealth(enemies[i].gear) and enemies[i].gear == CurrentHedgehog then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
250 |
AddAmmo(enemies[i].gear, amMortar, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
251 |
AddAmmo(enemies[i].gear, amFirePunch, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
252 |
AddAmmo(enemies[i].gear, amDEagle, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
253 |
AddAmmo(enemies[i].gear, amBazooka, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
254 |
AddAmmo(enemies[i].gear, amGrenade, 0) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
255 |
AddAmmo(enemies[i].gear, enemies[i].weapon, 1) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
256 |
for w=1,table.getn(enemies[i].additionalWeapons) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
257 |
AddAmmo(enemies[i].gear, enemies[i].additionalWeapons[w], 1) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
258 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
259 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
260 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
261 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
262 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
263 |
function isHog(gear) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
264 |
local hog = false |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
265 |
for i=1,table.getn(enemies) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
266 |
if gear == enemies[i].gear then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
267 |
hog = true |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
268 |
break |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
269 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
270 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
271 |
return hog |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
272 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
273 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
274 |
function getHog(gear) |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
275 |
for i=1,table.getn(enemies) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
276 |
if gear == enemies[i].gear then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
277 |
return enemies[i] |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
278 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
279 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
280 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
281 |
|
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
282 |
function getAliveEnemiesCount() |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
283 |
local count = 0 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
284 |
for i=1,table.getn(enemies) do |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
285 |
if GetHealth(enemies[i].gear) then |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
286 |
count = count + 1 |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
287 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
288 |
end |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
289 |
return count |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
290 |
end |