author | Wuzzy <almikes@aol.com> |
Wed, 23 Nov 2016 23:54:55 +0100 | |
changeset 12049 | 030464f34d47 |
parent 11976 | d5dabb71d6bf |
child 12088 | 1da37e2ba6fd |
permissions | -rw-r--r-- |
9527 | 1 |
------------------- ABOUT ---------------------- |
2 |
-- |
|
3 |
-- In this adventure hero gets the lost part with |
|
4 |
-- the help of the green bananas hogs. |
|
5 |
||
6 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
|
7 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
|
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
8 |
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
9527 | 9 |
|
10 |
----------------- VARIABLES -------------------- |
|
11 |
-- globals |
|
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
12 |
local missionName = loc("Getting to the device") |
9527 | 13 |
local inBattle = false |
9529 | 14 |
local tookPartInBattle = false |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
15 |
local previousHog = -1 |
9548 | 16 |
local checkPointReached = 1 -- 1 is normal spawn |
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
17 |
local permitCaptainLimeDeath = false |
9527 | 18 |
-- dialogs |
19 |
local dialog01 = {} |
|
20 |
local dialog02 = {} |
|
21 |
local dialog03 = {} |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
22 |
local dialog04 = {} |
9527 | 23 |
-- mission objectives |
24 |
local goals = { |
|
9758 | 25 |
[dialog01] = {missionName, loc("Exploring the tunnel"), loc("Search for the device with the help of the other hedgehogs ").."|"..loc("Hog Solo has to reach the last crates"), 1, 4000}, |
26 |
[dialog02] = {missionName, loc("Exploring the tunnel"), loc("Explore the tunnel with the other hedgehogs and search for the device").."|"..loc("Hog Solo has to reach the last crates"), 1, 4000}, |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
27 |
[dialog03] = {missionName, loc("Return to the Surface"), loc("Go to the surface!").."|"..loc("Attack Captain Lime before he attacks back"), 1, 4000}, |
9758 | 28 |
[dialog04] = {missionName, loc("Return to the Surface"), loc("Go to the surface!").."|"..loc("Attack the assassins before they attack back"), 1, 4000}, |
9527 | 29 |
} |
9542 | 30 |
-- crates |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
31 |
local eagleCrate = {name = amDEagle, x = 1680, y = 1650} |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
32 |
local girderCrate = {name = amGirder, x = 1680, y = 1160} |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
33 |
local ropeCrate = {name = amRope, x = 1400, y = 1870} |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
34 |
local weaponCrate = { x = 1360, y = 1870} |
9527 | 35 |
-- hogs |
36 |
local hero = {} |
|
37 |
local green1 = {} |
|
38 |
local green2 = {} |
|
39 |
local green3 = {} |
|
40 |
-- teams |
|
41 |
local teamA = {} |
|
42 |
local teamB = {} |
|
43 |
local teamC = {} |
|
44 |
-- hedgehogs values |
|
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
45 |
hero.name = loc("Hog Solo") |
9527 | 46 |
hero.x = 1200 |
47 |
hero.y = 820 |
|
48 |
hero.dead = false |
|
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
49 |
green1.name = loc("Captain Lime") |
9527 | 50 |
green1.x = 1050 |
51 |
green1.y = 820 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
52 |
green1.dead = false |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
53 |
green2.name = loc("Mister Pear") |
9527 | 54 |
green2.x = 1350 |
55 |
green2.y = 820 |
|
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
56 |
green3.name = loc("Lady Mango") |
9527 | 57 |
green3.x = 1450 |
58 |
green3.y = 820 |
|
59 |
local redHedgehogs = { |
|
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
60 |
{ name = loc("Poisonous Apple") }, |
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
61 |
{ name = loc("Dark Strawberry") }, |
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
62 |
{ name = loc("Watermelon Heart") }, |
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
63 |
{ name = loc("Deadly Grape") } |
9527 | 64 |
} |
65 |
teamA.name = loc("Hog Solo and GB") |
|
66 |
teamA.color = tonumber("38D61C",16) -- green |
|
67 |
teamB.name = loc("Captain Lime") |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
68 |
teamB.color = tonumber("38D61D",16) -- greenish |
9831 | 69 |
teamC.name = loc("Fruit Assassins") |
9527 | 70 |
teamC.color = tonumber("FF0000",16) -- red |
71 |
||
72 |
function onGameInit() |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
73 |
GameFlags = gfDisableWind |
9527 | 74 |
Seed = 1 |
75 |
TurnTime = 20000 |
|
76 |
CaseFreq = 0 |
|
77 |
MinesNum = 0 |
|
78 |
MinesTime = 1 |
|
79 |
Explosives = 0 |
|
80 |
Delay = 3 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
81 |
SuddenDeathTurns = 200 |
9527 | 82 |
Map = "fruit02_map" |
83 |
Theme = "Fruit" |
|
9758 | 84 |
|
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
85 |
-- load checkpoints, problem getting the campaign variable |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
86 |
local health = 100 |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
87 |
checkPointReached = initCheckpoint("fruit02") |
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
88 |
if checkPointReached ~= 1 then |
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
89 |
loadHogsPositions() |
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
90 |
health = tonumber(GetCampaignVar("HeroHealth")) |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
91 |
end |
9758 | 92 |
|
9527 | 93 |
-- Hog Solo and Green Bananas |
12049
030464f34d47
Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents:
11976
diff
changeset
|
94 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "hedgehog") |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
95 |
hero.gear = AddHog(hero.name, 0, health, "war_desertgrenadier1") |
9527 | 96 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
9758 | 97 |
HogTurnLeft(hero.gear, true) |
9629 | 98 |
green2.gear = AddHog(green2.name, 0, 100, "war_britmedic") |
9527 | 99 |
AnimSetGearPosition(green2.gear, green2.x, green2.y) |
100 |
HogTurnLeft(green2.gear, true) |
|
9629 | 101 |
green3.gear = AddHog(green3.name, 0, 100, "hair_red") |
9527 | 102 |
AnimSetGearPosition(green3.gear, green3.x, green3.y) |
103 |
HogTurnLeft(green3.gear, true) |
|
104 |
-- Captain Lime |
|
12049
030464f34d47
Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents:
11976
diff
changeset
|
105 |
AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "congo-brazzaville") |
9629 | 106 |
green1.human = AddHog(green1.name, 0, 100, "war_desertofficer") |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
107 |
AnimSetGearPosition(green1.human, green1.x, green1.y) |
9629 | 108 |
green1.bot = AddHog(green1.name, 1, 100, "war_desertofficer") |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
109 |
AnimSetGearPosition(green1.bot, green1.x, green1.y) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
110 |
green1.gear = green1.human |
9831 | 111 |
-- Fruit Assassins |
9629 | 112 |
local assasinsHats = { "NinjaFull", "NinjaStraight", "NinjaTriangle" } |
12049
030464f34d47
Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents:
11976
diff
changeset
|
113 |
AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_scout") |
9527 | 114 |
for i=1,table.getn(redHedgehogs) do |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9782
diff
changeset
|
115 |
redHedgehogs[i].gear = AddHog(redHedgehogs[i].name, 1, 100, assasinsHats[GetRandom(3)+1]) |
9527 | 116 |
AnimSetGearPosition(redHedgehogs[i].gear, 2010 + 50*i, 630) |
117 |
end |
|
118 |
||
119 |
AnimInit() |
|
9758 | 120 |
AnimationSetup() |
9527 | 121 |
end |
122 |
||
123 |
function onGameStart() |
|
124 |
AnimWait(hero.gear, 3000) |
|
125 |
FollowGear(hero.gear) |
|
9758 | 126 |
|
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
127 |
if GetCampaignVar("Fruit01JoinedBattle") and GetCampaignVar("Fruit01JoinedBattle") == "true" then |
9529 | 128 |
tookPartInBattle = true |
129 |
end |
|
9758 | 130 |
|
9527 | 131 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
132 |
AddEvent(onDeviceCrates, {hero.gear}, deviceCrates, {hero.gear}, 0) |
9758 | 133 |
|
9527 | 134 |
-- Hog Solo and GB weapons |
135 |
AddAmmo(hero.gear, amSwitch, 100) |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
136 |
-- Captain Lime weapons |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
137 |
AddAmmo(green1.bot, amBazooka, 6) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
138 |
AddAmmo(green1.bot, amGrenade, 6) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
139 |
AddAmmo(green1.bot, amDEagle, 2) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
140 |
HideHog(green1.bot) |
9831 | 141 |
-- Assassins weapons |
9527 | 142 |
AddAmmo(redHedgehogs[1].gear, amBazooka, 6) |
143 |
AddAmmo(redHedgehogs[1].gear, amGrenade, 6) |
|
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
144 |
AddAmmo(redHedgehogs[1].bot, amDEagle, 6) |
9527 | 145 |
for i=1,table.getn(redHedgehogs) do |
146 |
HideHog(redHedgehogs[i].gear) |
|
147 |
end |
|
9758 | 148 |
|
9527 | 149 |
-- explosives |
150 |
-- I wanted to use FindPlace but doesn't accept height values... |
|
151 |
local x1 = 950 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
152 |
local x2 = 1306 |
9527 | 153 |
local y1 = 1210 |
154 |
local y2 = 1620 |
|
155 |
while true do |
|
156 |
if y2<y1 then |
|
157 |
break |
|
158 |
end |
|
159 |
if x2<x1 then |
|
160 |
x2 = 1305 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
161 |
y2 = y2 - 50 |
9527 | 162 |
end |
163 |
if not TestRectForObstacle(x2+25, y2+25, x2-25, y2-25, true) then |
|
164 |
AddGear(x2, y2, gtExplosives, 0, 0, 0, 0) |
|
165 |
end |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
166 |
x2 = x2 - 25 |
9527 | 167 |
end |
168 |
AddGear(3128, 1680, gtExplosives, 0, 0, 0, 0) |
|
9758 | 169 |
|
9527 | 170 |
--mines |
171 |
AddGear(3135, 1680, gtMine, 0, 0, 0, 0) |
|
172 |
AddGear(3145, 1680, gtMine, 0, 0, 0, 0) |
|
173 |
AddGear(3155, 1680, gtMine, 0, 0, 0, 0) |
|
174 |
AddGear(3165, 1680, gtMine, 0, 0, 0, 0) |
|
175 |
AddGear(3175, 1680, gtMine, 0, 0, 0, 0) |
|
176 |
AddGear(3115, 1680, gtMine, 0, 0, 0, 0) |
|
177 |
AddGear(3105, 1680, gtMine, 0, 0, 0, 0) |
|
178 |
AddGear(3095, 1680, gtMine, 0, 0, 0, 0) |
|
179 |
AddGear(3085, 1680, gtMine, 0, 0, 0, 0) |
|
9758 | 180 |
AddGear(3075, 1680, gtMine, 0, 0, 0, 0) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
181 |
|
9548 | 182 |
if checkPointReached == 1 then |
183 |
AddAmmo(hero.gear, amFirePunch, 3) |
|
184 |
AddEvent(onCheckPoint1, {hero.gear}, checkPoint1, {hero.gear}, 0) |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
185 |
AddEvent(onCheckPoint2, {hero.gear}, checkPoint2, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
186 |
AddEvent(onCheckPoint3, {hero.gear}, checkPoint3, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
187 |
AddEvent(onCheckPoint4, {hero.gear}, checkPoint4, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
188 |
if tookPartInBattle then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
189 |
AddAnim(dialog01) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
190 |
else |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
191 |
AddAnim(dialog02) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
192 |
end |
9548 | 193 |
elseif checkPointReached == 2 then |
194 |
AddEvent(onCheckPoint2, {hero.gear}, checkPoint2, {hero.gear}, 0) |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
195 |
AddEvent(onCheckPoint3, {hero.gear}, checkPoint3, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
196 |
AddEvent(onCheckPoint4, {hero.gear}, checkPoint4, {hero.gear}, 0) |
9548 | 197 |
elseif checkPointReached == 3 then |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
198 |
AddEvent(onCheckPoint1, {hero.gear}, checkPoint1, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
199 |
AddEvent(onCheckPoint3, {hero.gear}, checkPoint3, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
200 |
AddEvent(onCheckPoint4, {hero.gear}, checkPoint4, {hero.gear}, 0) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
201 |
elseif checkPointReached == 4 then |
9758 | 202 |
AddEvent(onCheckPoint4, {hero.gear}, checkPoint4, {hero.gear}, 0) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
203 |
elseif checkPointReached == 5 then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
204 |
-- EMPTY |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
205 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
206 |
if checkPointReached ~= 1 then |
9548 | 207 |
loadWeapons() |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
208 |
end |
9758 | 209 |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
210 |
-- girders |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
211 |
if checkPointReached > 1 then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
212 |
PlaceGirder(1580, 875, 4) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
213 |
PlaceGirder(1800, 875, 4) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
214 |
end |
9758 | 215 |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
216 |
-- place crates |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
217 |
if checkPointReached < 2 then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
218 |
SpawnAmmoCrate(girderCrate.x, girderCrate.y, girderCrate.name) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
219 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
220 |
if checkPointReached < 5 then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
221 |
SpawnAmmoCrate(eagleCrate.x, eagleCrate.y, eagleCrate.name) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
222 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
223 |
SpawnAmmoCrate(ropeCrate.x, ropeCrate.y, ropeCrate.name) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
224 |
|
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
225 |
if tookPartInBattle then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
226 |
SpawnAmmoCrate(weaponCrate.x, weaponCrate.y, amWatermelon) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
227 |
else |
9758 | 228 |
SpawnAmmoCrate(weaponCrate.x, weaponCrate.y, amSniperRifle) |
9548 | 229 |
end |
9758 | 230 |
|
9527 | 231 |
SendHealthStatsOff() |
232 |
end |
|
233 |
||
234 |
function onNewTurn() |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
235 |
if not inBattle and CurrentHedgehog == green1.gear then |
9527 | 236 |
TurnTimeLeft = 0 |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
237 |
elseif CurrentHedgehog == green2.gear or CurrentHedgehog == green3.gear then |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
238 |
TurnTimeLeft = 0 |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
239 |
elseif inBattle then |
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
240 |
if CurrentHedgehog == green1.gear and previousHog ~= hero.gear then |
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
241 |
TurnTimeLeft = 0 |
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
242 |
return |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
243 |
end |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
244 |
for i=1,table.getn(redHedgehogs) do |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
245 |
if CurrentHedgehog == redHedgehogs[i].gear and previousHog ~= hero.gear then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
246 |
TurnTimeLeft = 0 |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
247 |
return |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
248 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
249 |
end |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
250 |
TurnTimeLeft = 20000 |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
251 |
wind() |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
252 |
elseif not inBattle and CurrentHedgehog == hero.gear then |
9527 | 253 |
TurnTimeLeft = -1 |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
254 |
wind() |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
255 |
else |
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
256 |
TurnTimeLeft = 0 |
9527 | 257 |
end |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
258 |
previousHog = CurrentHedgehog |
9527 | 259 |
end |
260 |
||
261 |
function onGameTick() |
|
262 |
AnimUnWait() |
|
263 |
if ShowAnimation() == false then |
|
264 |
return |
|
265 |
end |
|
266 |
ExecuteAfterAnimations() |
|
267 |
CheckEvents() |
|
268 |
end |
|
269 |
||
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
270 |
function onGameTick20() |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
271 |
if not permitCaptainLimeDeath and not GetHealth(green1.gear) then |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
272 |
-- game ends with the according stat messages |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
273 |
heroDeath() |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
274 |
permitCaptainLimeDeath = true |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
275 |
end |
9747
abe0c8a2d573
adjusting the wind in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9746
diff
changeset
|
276 |
if CurrentHedgehog and GetY(CurrentHedgehog) > 1350 then |
abe0c8a2d573
adjusting the wind in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9746
diff
changeset
|
277 |
SetWind(-40) |
abe0c8a2d573
adjusting the wind in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9746
diff
changeset
|
278 |
end |
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
279 |
end |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
280 |
|
9527 | 281 |
function onGearDelete(gear) |
282 |
if gear == hero.gear then |
|
283 |
hero.dead = true |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
284 |
elseif gear == green1.bot then |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
285 |
green1.dead = true |
9527 | 286 |
end |
287 |
end |
|
288 |
||
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
289 |
function onGearDamage(gear, damage) |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
290 |
if GetGearType(gear) == gtCase then |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
291 |
-- in this mode every crate is essential in order to complete the mission |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
292 |
-- destroying a crate ends the game |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
293 |
heroDeath() |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
294 |
end |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
295 |
end |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
296 |
|
9527 | 297 |
function onAmmoStoreInit() |
298 |
SetAmmo(amDEagle, 0, 0, 0, 6) |
|
9587
d6ddcafb1c56
fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
299 |
SetAmmo(amGirder, 0, 0, 0, 2) |
9527 | 300 |
SetAmmo(amRope, 0, 0, 0, 1) |
11976
d5dabb71d6bf
Add skip option to desert01, fruit02, moon01 in A Space Adventure
Wuzzy <almikes@aol.com>
parents:
11692
diff
changeset
|
301 |
SetAmmo(amSkip, 9, 0, 0, 1) |
9630 | 302 |
if tonumber(getBonus(2)) == 1 then |
303 |
SetAmmo(amWatermelon, 0, 0, 0, 2) |
|
304 |
SetAmmo(amSniperRifle, 0, 0, 0, 2) |
|
305 |
else |
|
306 |
SetAmmo(amWatermelon, 0, 0, 0, 1) |
|
307 |
SetAmmo(amSniperRifle, 0, 0, 0, 1) |
|
308 |
end |
|
9527 | 309 |
end |
310 |
||
311 |
function onPrecise() |
|
312 |
if GameTime > 3000 then |
|
9758 | 313 |
SetAnimSkip(true) |
9527 | 314 |
end |
315 |
end |
|
316 |
||
317 |
-------------- EVENTS ------------------ |
|
318 |
||
319 |
function onHeroDeath(gear) |
|
320 |
if hero.dead then |
|
321 |
return true |
|
322 |
end |
|
323 |
return false |
|
324 |
end |
|
325 |
||
9532 | 326 |
function onDeviceCrates(gear) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
327 |
if not hero.dead and GetY(hero.gear)>1850 and GetX(hero.gear)>1340 and GetX(hero.gear)<1640 then |
9532 | 328 |
return true |
329 |
end |
|
330 |
return false |
|
331 |
end |
|
332 |
||
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
333 |
function onSurface(gear) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
334 |
if not hero.dead and GetY(hero.gear)<850 and StoppedGear(hero.gear) then |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
335 |
return true |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
336 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
337 |
return false |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
338 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
339 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
340 |
function onGaptainLimeDeath(gear) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
341 |
if green1.dead then |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
342 |
return true |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
343 |
end |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
344 |
return false |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
345 |
end |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
346 |
|
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
347 |
function onRedTeamDeath(gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
348 |
local redDead = true |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
349 |
for i=1,table.getn(redHedgehogs) do |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
350 |
if GetHealth(redHedgehogs[i].gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
351 |
redDead = false |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
352 |
break |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
353 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
354 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
355 |
return redDead |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
356 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
357 |
|
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
358 |
function onCheckPoint1(gear) |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
359 |
-- before barrel jump |
9758 | 360 |
if not hero.dead and GetX(hero.gear) > 2850 and GetX(hero.gear) < 2945 |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
361 |
and GetY(hero.gear) > 808 and GetY(hero.gear) < 852 and not isHeroAtWrongPlace() then |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
362 |
return true |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
363 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
364 |
return false |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
365 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
366 |
|
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
367 |
function onCheckPoint2(gear) |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
368 |
-- before barrel jump |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
369 |
if ((GetHealth(green2.gear) and GetX(green2.gear) > 2850 and GetX(green2.gear) < 2945 and GetY(green2.gear) > 808 and GetY(green2.gear) < 852) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
370 |
or (GetHealth(green3.gear) and GetX(green3.gear) > 2850 and GetX(green3.gear) < 2945 and GetY(green3.gear) > 808 and GetY(green3.gear) < 852)) |
9548 | 371 |
and not isHeroAtWrongPlace() then |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
372 |
return true |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
373 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
374 |
return false |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
375 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
376 |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
377 |
function onCheckPoint3(gear) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
378 |
-- after barrel jump |
9758 | 379 |
if ((GetHealth(green2.gear) and GetY(green2.gear) > 1550 and GetX(green2.gear) < 3000 and StoppedGear(green2.gear)) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
380 |
or (GetHealth(green3.gear) and GetY(green3.gear) > 1550 and GetX(green3.gear) < 3000 and StoppedGear(green2.gear))) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
381 |
and not isHeroAtWrongPlace() then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
382 |
return true |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
383 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
384 |
return false |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
385 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
386 |
|
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
387 |
function onCheckPoint4(gear) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
388 |
-- hero at crates |
9758 | 389 |
if not hero.dead and GetX(hero.gear) > 1288 and GetX(hero.gear) < 1420 |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
390 |
and GetY(hero.gear) > 1840 and not isHeroAtWrongPlace() then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
391 |
return true |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
392 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
393 |
return false |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
394 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
395 |
|
9527 | 396 |
-------------- ACTIONS ------------------ |
9760
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
397 |
ended = false |
9527 | 398 |
|
399 |
function heroDeath(gear) |
|
9760
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
400 |
if not ended then |
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
401 |
SendStat(siGameResult, loc("Hog Solo lost, try again!")) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
402 |
SendStat(siCustomAchievement, loc("To win the game, Hog Solo has to get the bottom crates and come back to the surface.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
403 |
SendStat(siCustomAchievement, loc("You can use the other 2 hogs to assist you.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
404 |
SendStat(siCustomAchievement, loc("Do not destroy the crates!")) |
9760
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
405 |
if tookPartInBattle then |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
406 |
SendStat(siCustomAchievement, loc("You'll have to eliminate the Strawberry Assassins at the end.")) |
9760
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
407 |
else |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
408 |
SendStat(siCustomAchievement, loc("You'll have to eliminate Captain Lime at the end.")) |
9760
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
409 |
SendStat(siCustomAchievement, loc("Don't eliminate Captain Lime before collecting the last crate!")) |
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
410 |
end |
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
411 |
SendStat(siPlayerKills,'0',teamA.name) |
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
412 |
EndGame() |
395ca7fe6362
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution,
sheepluva
parents:
9758
diff
changeset
|
413 |
ended = true |
9542 | 414 |
end |
9527 | 415 |
end |
416 |
||
9532 | 417 |
function deviceCrates(gear) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
418 |
TurnTimeLeft = 0 |
9532 | 419 |
if not tookPartInBattle then |
420 |
AddAnim(dialog03) |
|
421 |
else |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
422 |
for i=1,table.getn(redHedgehogs) do |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
423 |
RestoreHog(redHedgehogs[i].gear) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
424 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
425 |
AddAnim(dialog04) |
9532 | 426 |
end |
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
427 |
-- needs to be set to true for both plots |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
428 |
permitCaptainLimeDeath = true |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
429 |
AddAmmo(hero.gear, amSwitch, 0) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
430 |
AddEvent(onSurface, {hero.gear}, surface, {hero.gear}, 0) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
431 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
432 |
|
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
433 |
function surface(gear) |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
434 |
previousHog = -1 |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
435 |
if tookPartInBattle then |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
436 |
if GetHealth(green1.gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
437 |
HideHog(green1.gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
438 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
439 |
AddEvent(onRedTeamDeath, {green1.gear}, redTeamDeath, {green1.gear}, 0) |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
440 |
else |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
441 |
DeleteGear(green1.human) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
442 |
RestoreHog(green1.bot) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
443 |
green1.gear = green1.bot |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
444 |
AddEvent(onGaptainLimeDeath, {green1.gear}, captainLimeDeath, {green1.gear}, 0) |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
445 |
end |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
446 |
if GetHealth(green2.gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
447 |
HideHog(green2.gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
448 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
449 |
if GetHealth(green3.gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
450 |
HideHog(green3.gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
451 |
end |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
452 |
inBattle = true |
9532 | 453 |
end |
454 |
||
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
455 |
function captainLimeDeath(gear) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
456 |
-- hero win in scenario of escape in 1st part |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
457 |
saveCompletedStatus(3) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
458 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
459 |
SendStat(siCustomAchievement, loc("You retrieved the lost part.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
460 |
SendStat(siCustomAchievement, loc("You defended yourself against Captain Lime.")) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
461 |
SendStat(siPlayerKills,'1',teamA.name) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
462 |
SendStat(siPlayerKills,'0',teamB.name) |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
463 |
EndGame() |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
464 |
end |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
465 |
|
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
466 |
function redTeamDeath(gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
467 |
-- hero win in battle scenario |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
468 |
saveCompletedStatus(3) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
469 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
470 |
SendStat(siCustomAchievement, loc("You retrieved the lost part.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
471 |
SendStat(siCustomAchievement, loc("You defended yourself against the Strawberry Assassins.")) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
472 |
SendStat(siPlayerKills,'1',teamA.name) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
473 |
SendStat(siPlayerKills,'0',teamC.name) |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
474 |
EndGame() |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
475 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
476 |
|
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
477 |
function checkPoint1(gear) |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
478 |
saveCheckPointLocal(2) |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
479 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
480 |
|
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
481 |
function checkPoint2(gear) |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
482 |
saveCheckPointLocal(3) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
483 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
484 |
|
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
485 |
function checkPoint3(gear) |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
486 |
saveCheckPointLocal(4) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
487 |
end |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
488 |
|
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
489 |
function checkPoint4(gear) |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
490 |
saveCheckPointLocal(5) |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
491 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
492 |
|
9527 | 493 |
-------------- ANIMATIONS ------------------ |
494 |
||
495 |
function Skipanim(anim) |
|
496 |
if goals[anim] ~= nil then |
|
497 |
ShowMission(unpack(goals[anim])) |
|
498 |
end |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
499 |
TurnTimeLeft = 0 |
9527 | 500 |
end |
501 |
||
502 |
function AnimationSetup() |
|
9529 | 503 |
-- DIALOG 01 - Start, Captain Lime helps Hog Solo because he took part in the battle |
9527 | 504 |
AddSkipFunction(dialog01, Skipanim, {dialog01}) |
505 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
|
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
506 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere else on the planet of fruits, Captain Lime helps Hog Solo"), 5000}}) |
9529 | 507 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("You fought bravely and you helped us win this battle!"), SAY_SAY, 5000}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
508 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("So, as promised I have brought you where I think that the device you are looking for is hidden."), SAY_SAY, 7000}}) |
9758 | 509 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I know that your resources are low due to the battle but I'll send two of my best hogs to assist you."), SAY_SAY, 7000}}) |
9529 | 510 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Good luck!"), SAY_SAY, 2000}}) |
9527 | 511 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
512 |
table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
|
9529 | 513 |
-- DIALOG02 - Start, Hog Solo escaped from the previous battle |
514 |
AddSkipFunction(dialog02, Skipanim, {dialog02}) |
|
515 |
table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3000}}) |
|
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
516 |
table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("Somewhere else on the planet of fruits Hog Solo gets closer to the device"), 5000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
517 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("You are the one who fled! So, you are alive."), SAY_SAY, 4000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
518 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("I'm still low on hogs. If you are not afraid I could use a set of extra hands."), SAY_SAY, 4000}}) |
9529 | 519 |
table.insert(dialog02, {func = AnimWait, args = {hero.gear, 8000}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
520 |
table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("I am sorry but I was looking for a device that may be hidden somewhere around here."), SAY_SAY, 4500}}) |
9529 | 521 |
table.insert(dialog02, {func = AnimWait, args = {green1.gear, 12500}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9554
diff
changeset
|
522 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Many long forgotten things can be found in the same tunnels that we are about to explore!"), SAY_SAY, 7000}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
523 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("If you help us you can keep the device if you find it but we'll keep everything else."), SAY_SAY, 7000}}) |
9529 | 524 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("What do you say? Are you in?"), SAY_SAY, 3000}}) |
525 |
table.insert(dialog02, {func = AnimWait, args = {hero.gear, 1800}}) |
|
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
526 |
table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Okay then!"), SAY_SAY, 2000}}) |
9529 | 527 |
table.insert(dialog02, {func = AnimSwitchHog, args = {hero.gear}}) |
9532 | 528 |
-- DIALOG03 - At crates, hero learns that Captain Lime is bad |
529 |
AddSkipFunction(dialog03, Skipanim, {dialog03}) |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
530 |
table.insert(dialog03, {func = AnimWait, args = {hero.gear, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
531 |
table.insert(dialog03, {func = FollowGear, args = {hero.gear}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
532 |
table.insert(dialog03, {func = AnimSay, args = {hero.gear, loc("Hooray! I've found it, now I have to get back to Captain Lime!"), SAY_SAY, 4000}}) |
9532 | 533 |
table.insert(dialog03, {func = AnimWait, args = {green1.gear, 4000}}) |
9758 | 534 |
table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("This Hog Solo is so naive! When he returns I'll shoot him and keep that device for myself!"), SAY_THINK, 4000}}) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
535 |
table.insert(dialog03, {func = goToThesurface, args = {hero.gear}}) |
9831 | 536 |
-- DIALOG04 - At crates, hero learns about the Assassins ambush |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
537 |
AddSkipFunction(dialog04, Skipanim, {dialog04}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
538 |
table.insert(dialog04, {func = AnimWait, args = {hero.gear, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
539 |
table.insert(dialog04, {func = FollowGear, args = {hero.gear}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
540 |
table.insert(dialog04, {func = AnimSay, args = {hero.gear, loc("Hooray! I've found it, now I have to get back to Captain Lime!"), SAY_SAY, 4000}}) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
541 |
table.insert(dialog04, {func = AnimWait, args = {redHedgehogs[1].gear, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
542 |
table.insert(dialog04, {func = AnimSay, args = {redHedgehogs[1].gear, loc("We have spotted the enemy! We'll attack when the enemies start gathering!"), SAY_THINK, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
543 |
table.insert(dialog04, {func = goToThesurface, args = {hero.gear}}) |
9527 | 544 |
end |
545 |
||
546 |
------------- OTHER FUNCTIONS --------------- |
|
547 |
||
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
548 |
function goToThesurface() |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
549 |
TurnTimeLeft = 0 |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
550 |
end |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
551 |
|
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
552 |
function wind() |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9782
diff
changeset
|
553 |
SetWind(GetRandom(201)-100) |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
554 |
end |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
555 |
|
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
556 |
function saveHogsPositions() |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
557 |
local positions; |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
558 |
positions = GetX(hero.gear)..","..GetY(hero.gear) |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
559 |
if GetHealth(green2.gear) then |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
560 |
positions = positions..","..GetX(green2.gear)..","..GetY(green2.gear) |
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
561 |
else |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
562 |
positions = positions..",1,1" |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
563 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
564 |
if GetHealth(green3.gear) then |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
565 |
positions = positions..","..GetX(green3.gear)..","..GetY(green3.gear) |
9746
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
566 |
else |
64abf9862562
fixed wrong saved positions, illegal crate destroying and killing cap.Lime early in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9642
diff
changeset
|
567 |
positions = positions..",1,1" |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
568 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
569 |
SaveCampaignVar("HogsPosition", positions) |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
570 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
571 |
|
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
572 |
function loadHogsPositions() |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
573 |
local positions; |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
574 |
if GetCampaignVar("HogsPosition") then |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
575 |
positions = GetCampaignVar("HogsPosition") |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
576 |
else |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
577 |
return |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
578 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
579 |
positions = split(positions,",") |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
580 |
if positions[1] then |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
581 |
hero.x = positions[1] |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
582 |
hero.y = positions[2] |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
583 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
584 |
if positions[3] then |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
585 |
green2.x = tonumber(positions[3]) |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
586 |
green2.y = tonumber(positions[4]) |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
587 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
588 |
if positions[5] then |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
589 |
green3.x = tonumber(positions[5]) |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
590 |
green3.y = tonumber(positions[6]) |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
591 |
end |
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
592 |
end |
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
593 |
|
9548 | 594 |
function saveWeapons() |
595 |
-- firepunch - gilder - deagle - watermelon - sniper |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
596 |
SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amFirePunch)..GetAmmoCount(hero.gear, amGirder).. |
9548 | 597 |
GetAmmoCount(hero.gear, amDEagle)..GetAmmoCount(hero.gear, amWatermelon)..GetAmmoCount(hero.gear, amSniperRifle)) |
598 |
end |
|
599 |
||
600 |
function loadWeapons() |
|
601 |
local ammo = GetCampaignVar("HeroAmmo") |
|
9550
59061246a25c
fixed weapon type typo
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9548
diff
changeset
|
602 |
AddAmmo(hero.gear, amFirePunch, tonumber(ammo:sub(1,1))) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
603 |
AddAmmo(hero.gear, amGirder, tonumber(ammo:sub(2,2))) |
9548 | 604 |
AddAmmo(hero.gear, amDEagle, tonumber(ammo:sub(3,3))) |
605 |
AddAmmo(hero.gear, amWatermelon, tonumber(ammo:sub(4,4))) |
|
606 |
AddAmmo(hero.gear, amSniperRifle, tonumber(ammo:sub(5,5))) |
|
607 |
end |
|
608 |
||
9546
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
609 |
function isHeroAtWrongPlace() |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
610 |
if GetX(hero.gear) > 1480 and GetX(hero.gear) < 1892 and GetY(hero.gear) > 1000 and GetY(hero.gear) < 1220 then |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
611 |
return true |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
612 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
613 |
return false |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
614 |
end |
f7530a7e5612
added custom lua split
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9544
diff
changeset
|
615 |
|
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
616 |
function saveCheckPointLocal(cpoint) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
617 |
AnimCaption(hero.gear, loc("Checkpoint reached!"), 3000) |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
618 |
saveCheckpoint(cpoint) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
619 |
SaveCampaignVar("HeroHealth", GetHealth(hero.gear)) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
620 |
saveHogsPositions() |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
621 |
saveWeapons() |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
622 |
end |