author | Wuzzy <almikes@aol.com> |
Mon, 25 Sep 2017 20:09:33 +0200 | |
changeset 12520 | 22f2a586b9ca |
parent 12514 | d89dabfd07ce |
child 12528 | 7b32e83aaf48 |
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 |
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
|
16 |
local permitCaptainLimeDeath = false |
9527 | 17 |
-- dialogs |
18 |
local dialog01 = {} |
|
19 |
local dialog02 = {} |
|
20 |
local dialog03 = {} |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
21 |
local dialog04 = {} |
9527 | 22 |
-- mission objectives |
12226
3ec0261e01f0
Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents:
12224
diff
changeset
|
23 |
local minesTimeText = loc("Mines time: 0 seconds") |
9527 | 24 |
local goals = { |
12425
f9cbb896967b
Fix 3 more incorrect uses of loc() in scripts
Wuzzy <almikes@aol.com>
parents:
12226
diff
changeset
|
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") .. "|" .. minesTimeText, 1, 4000}, |
12226
3ec0261e01f0
Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents:
12224
diff
changeset
|
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") .. "|" .. minesTimeText, 1, 4000}, |
3ec0261e01f0
Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents:
12224
diff
changeset
|
27 |
[dialog03] = {missionName, loc("Return to the Surface"), loc("Go to the surface!").."|"..loc("Attack Captain Lime before he attacks back").."|"..minesTimeText, 1, 4000}, |
3ec0261e01f0
Display mines timer in all missions with non-default timer
Wuzzy <almikes@aol.com>
parents:
12224
diff
changeset
|
28 |
[dialog04] = {missionName, loc("Return to the Surface"), loc("Go to the surface!").."|"..loc("Attack the assassins before they attack back").."|"..minesTimeText, 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 |
|
12224
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12088
diff
changeset
|
81 |
-- Disable Sudden Death |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12088
diff
changeset
|
82 |
HealthDecrease = 0 |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12088
diff
changeset
|
83 |
WaterRise = 0 |
9527 | 84 |
Map = "fruit02_map" |
85 |
Theme = "Fruit" |
|
9758 | 86 |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
87 |
local health = 100 |
9758 | 88 |
|
9527 | 89 |
-- 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
|
90 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "hedgehog") |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
91 |
hero.gear = AddHog(hero.name, 0, health, "war_desertgrenadier1") |
9527 | 92 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
9758 | 93 |
HogTurnLeft(hero.gear, true) |
9629 | 94 |
green2.gear = AddHog(green2.name, 0, 100, "war_britmedic") |
9527 | 95 |
AnimSetGearPosition(green2.gear, green2.x, green2.y) |
96 |
HogTurnLeft(green2.gear, true) |
|
9629 | 97 |
green3.gear = AddHog(green3.name, 0, 100, "hair_red") |
9527 | 98 |
AnimSetGearPosition(green3.gear, green3.x, green3.y) |
99 |
HogTurnLeft(green3.gear, true) |
|
100 |
-- Captain Lime |
|
12049
030464f34d47
Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents:
11976
diff
changeset
|
101 |
AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "congo-brazzaville") |
9629 | 102 |
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
|
103 |
AnimSetGearPosition(green1.human, green1.x, green1.y) |
9629 | 104 |
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
|
105 |
AnimSetGearPosition(green1.bot, green1.x, green1.y) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
106 |
green1.gear = green1.human |
9831 | 107 |
-- Fruit Assassins |
9629 | 108 |
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
|
109 |
AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_scout") |
9527 | 110 |
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
|
111 |
redHedgehogs[i].gear = AddHog(redHedgehogs[i].name, 1, 100, assasinsHats[GetRandom(3)+1]) |
9527 | 112 |
AnimSetGearPosition(redHedgehogs[i].gear, 2010 + 50*i, 630) |
113 |
end |
|
114 |
||
12088
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12049
diff
changeset
|
115 |
AnimInit(true) |
9758 | 116 |
AnimationSetup() |
9527 | 117 |
end |
118 |
||
119 |
function onGameStart() |
|
120 |
AnimWait(hero.gear, 3000) |
|
121 |
FollowGear(hero.gear) |
|
9758 | 122 |
|
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
123 |
if GetCampaignVar("Fruit01JoinedBattle") and GetCampaignVar("Fruit01JoinedBattle") == "true" then |
9529 | 124 |
tookPartInBattle = true |
125 |
end |
|
9758 | 126 |
|
9527 | 127 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
128 |
AddEvent(onDeviceCrates, {hero.gear}, deviceCrates, {hero.gear}, 0) |
9758 | 129 |
|
9527 | 130 |
-- Hog Solo and GB weapons |
131 |
AddAmmo(hero.gear, amSwitch, 100) |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
132 |
-- Captain Lime weapons |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
133 |
AddAmmo(green1.bot, amBazooka, 6) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
134 |
AddAmmo(green1.bot, amGrenade, 6) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
135 |
AddAmmo(green1.bot, amDEagle, 2) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
136 |
HideHog(green1.bot) |
9831 | 137 |
-- Assassins weapons |
9527 | 138 |
AddAmmo(redHedgehogs[1].gear, amBazooka, 6) |
139 |
AddAmmo(redHedgehogs[1].gear, amGrenade, 6) |
|
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
140 |
AddAmmo(redHedgehogs[1].bot, amDEagle, 6) |
9527 | 141 |
for i=1,table.getn(redHedgehogs) do |
142 |
HideHog(redHedgehogs[i].gear) |
|
143 |
end |
|
9758 | 144 |
|
9527 | 145 |
-- explosives |
146 |
-- I wanted to use FindPlace but doesn't accept height values... |
|
147 |
local x1 = 950 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
148 |
local x2 = 1306 |
9527 | 149 |
local y1 = 1210 |
150 |
local y2 = 1620 |
|
151 |
while true do |
|
152 |
if y2<y1 then |
|
153 |
break |
|
154 |
end |
|
155 |
if x2<x1 then |
|
156 |
x2 = 1305 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
157 |
y2 = y2 - 50 |
9527 | 158 |
end |
159 |
if not TestRectForObstacle(x2+25, y2+25, x2-25, y2-25, true) then |
|
160 |
AddGear(x2, y2, gtExplosives, 0, 0, 0, 0) |
|
161 |
end |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
162 |
x2 = x2 - 25 |
9527 | 163 |
end |
164 |
AddGear(3128, 1680, gtExplosives, 0, 0, 0, 0) |
|
9758 | 165 |
|
9527 | 166 |
--mines |
167 |
AddGear(3135, 1680, gtMine, 0, 0, 0, 0) |
|
168 |
AddGear(3145, 1680, gtMine, 0, 0, 0, 0) |
|
169 |
AddGear(3155, 1680, gtMine, 0, 0, 0, 0) |
|
170 |
AddGear(3165, 1680, gtMine, 0, 0, 0, 0) |
|
171 |
AddGear(3175, 1680, gtMine, 0, 0, 0, 0) |
|
172 |
AddGear(3115, 1680, gtMine, 0, 0, 0, 0) |
|
173 |
AddGear(3105, 1680, gtMine, 0, 0, 0, 0) |
|
174 |
AddGear(3095, 1680, gtMine, 0, 0, 0, 0) |
|
175 |
AddGear(3085, 1680, gtMine, 0, 0, 0, 0) |
|
9758 | 176 |
AddGear(3075, 1680, gtMine, 0, 0, 0, 0) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
177 |
|
12520
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
178 |
AddAmmo(hero.gear, amFirePunch, 3) |
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
179 |
if tookPartInBattle then |
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
180 |
AddAnim(dialog01) |
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
181 |
else |
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
182 |
AddAnim(dialog02) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
183 |
end |
9758 | 184 |
|
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
185 |
-- place crates |
12520
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
186 |
SpawnUtilityCrate(girderCrate.x, girderCrate.y, girderCrate.name) |
22f2a586b9ca
Remove checkpoints in ASA: Getting to the device
Wuzzy <almikes@aol.com>
parents:
12514
diff
changeset
|
187 |
SpawnAmmoCrate(eagleCrate.x, eagleCrate.y, eagleCrate.name) |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
188 |
SpawnUtilityCrate(ropeCrate.x, ropeCrate.y, ropeCrate.name) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
189 |
|
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
190 |
if tookPartInBattle then |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
191 |
SpawnAmmoCrate(weaponCrate.x, weaponCrate.y, amWatermelon) |
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
192 |
else |
9758 | 193 |
SpawnAmmoCrate(weaponCrate.x, weaponCrate.y, amSniperRifle) |
9548 | 194 |
end |
9758 | 195 |
|
9527 | 196 |
SendHealthStatsOff() |
197 |
end |
|
198 |
||
199 |
function onNewTurn() |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
200 |
if not inBattle and CurrentHedgehog == green1.gear then |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
201 |
EndTurn(true) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
202 |
elseif CurrentHedgehog == green2.gear or CurrentHedgehog == green3.gear then |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
203 |
EndTurn(true) |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
204 |
elseif inBattle then |
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
205 |
if CurrentHedgehog == green1.gear and previousHog ~= hero.gear then |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
206 |
EndTurn(true) |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
207 |
return |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
208 |
end |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
209 |
for i=1,table.getn(redHedgehogs) do |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
210 |
if CurrentHedgehog == redHedgehogs[i].gear and previousHog ~= hero.gear then |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
211 |
EndTurn(true) |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
212 |
return |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
213 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
214 |
end |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
215 |
TurnTimeLeft = 20000 |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
216 |
wind() |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
217 |
elseif not inBattle and CurrentHedgehog == hero.gear then |
9527 | 218 |
TurnTimeLeft = -1 |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
219 |
wind() |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
220 |
else |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
221 |
EndTurn(true) |
9527 | 222 |
end |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
223 |
previousHog = CurrentHedgehog |
9527 | 224 |
end |
225 |
||
226 |
function onGameTick() |
|
227 |
AnimUnWait() |
|
228 |
if ShowAnimation() == false then |
|
229 |
return |
|
230 |
end |
|
231 |
ExecuteAfterAnimations() |
|
232 |
CheckEvents() |
|
233 |
end |
|
234 |
||
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
|
235 |
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
|
236 |
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
|
237 |
-- 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
|
238 |
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
|
239 |
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
|
240 |
end |
9747
abe0c8a2d573
adjusting the wind in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9746
diff
changeset
|
241 |
if CurrentHedgehog and GetY(CurrentHedgehog) > 1350 then |
abe0c8a2d573
adjusting the wind in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9746
diff
changeset
|
242 |
SetWind(-40) |
abe0c8a2d573
adjusting the wind in fruit02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9746
diff
changeset
|
243 |
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
|
244 |
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
|
245 |
|
9527 | 246 |
function onGearDelete(gear) |
247 |
if gear == hero.gear then |
|
248 |
hero.dead = true |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
249 |
elseif gear == green1.bot then |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
250 |
green1.dead = true |
9527 | 251 |
end |
252 |
end |
|
253 |
||
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
|
254 |
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
|
255 |
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
|
256 |
-- 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
|
257 |
-- 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
|
258 |
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
|
259 |
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
|
260 |
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
|
261 |
|
9527 | 262 |
function onAmmoStoreInit() |
263 |
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
|
264 |
SetAmmo(amGirder, 0, 0, 0, 2) |
9527 | 265 |
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
|
266 |
SetAmmo(amSkip, 9, 0, 0, 1) |
9630 | 267 |
if tonumber(getBonus(2)) == 1 then |
268 |
SetAmmo(amWatermelon, 0, 0, 0, 2) |
|
269 |
SetAmmo(amSniperRifle, 0, 0, 0, 2) |
|
270 |
else |
|
271 |
SetAmmo(amWatermelon, 0, 0, 0, 1) |
|
272 |
SetAmmo(amSniperRifle, 0, 0, 0, 1) |
|
273 |
end |
|
9527 | 274 |
end |
275 |
||
276 |
function onPrecise() |
|
277 |
if GameTime > 3000 then |
|
9758 | 278 |
SetAnimSkip(true) |
9527 | 279 |
end |
280 |
end |
|
281 |
||
282 |
-------------- EVENTS ------------------ |
|
283 |
||
284 |
function onHeroDeath(gear) |
|
285 |
if hero.dead then |
|
286 |
return true |
|
287 |
end |
|
288 |
return false |
|
289 |
end |
|
290 |
||
9532 | 291 |
function onDeviceCrates(gear) |
9552
90d69a2c1729
checkpoint system seems complete
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9550
diff
changeset
|
292 |
if not hero.dead and GetY(hero.gear)>1850 and GetX(hero.gear)>1340 and GetX(hero.gear)<1640 then |
9532 | 293 |
return true |
294 |
end |
|
295 |
return false |
|
296 |
end |
|
297 |
||
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
298 |
function onSurface(gear) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
299 |
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
|
300 |
return true |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
301 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
302 |
return false |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
303 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
304 |
|
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
305 |
function onGaptainLimeDeath(gear) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
306 |
if green1.dead then |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
307 |
return true |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
308 |
end |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
309 |
return false |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
310 |
end |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
311 |
|
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
312 |
function onRedTeamDeath(gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
313 |
local redDead = true |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
314 |
for i=1,table.getn(redHedgehogs) do |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
315 |
if GetHealth(redHedgehogs[i].gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
316 |
redDead = false |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
317 |
break |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
318 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
319 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
320 |
return redDead |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
321 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
322 |
|
9527 | 323 |
-------------- 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
|
324 |
ended = false |
9527 | 325 |
|
326 |
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
|
327 |
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
|
328 |
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
|
329 |
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
|
330 |
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
|
331 |
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
|
332 |
if tookPartInBattle then |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
333 |
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
|
334 |
else |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
335 |
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
|
336 |
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
|
337 |
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
|
338 |
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
|
339 |
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
|
340 |
ended = true |
9542 | 341 |
end |
9527 | 342 |
end |
343 |
||
9532 | 344 |
function deviceCrates(gear) |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
345 |
EndTurn(true) |
9532 | 346 |
if not tookPartInBattle then |
347 |
AddAnim(dialog03) |
|
348 |
else |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
349 |
for i=1,table.getn(redHedgehogs) do |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
350 |
RestoreHog(redHedgehogs[i].gear) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
351 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
352 |
AddAnim(dialog04) |
9532 | 353 |
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
|
354 |
-- 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
|
355 |
permitCaptainLimeDeath = true |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
356 |
AddAmmo(hero.gear, amSwitch, 0) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
357 |
AddEvent(onSurface, {hero.gear}, surface, {hero.gear}, 0) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
358 |
end |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
359 |
|
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
360 |
function surface(gear) |
9536
7456b28a3421
this seems to work fine for the escape scenario
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9534
diff
changeset
|
361 |
previousHog = -1 |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
362 |
if tookPartInBattle then |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
363 |
if GetHealth(green1.gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
364 |
HideHog(green1.gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
365 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
366 |
AddEvent(onRedTeamDeath, {green1.gear}, redTeamDeath, {green1.gear}, 0) |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
367 |
else |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
368 |
DeleteGear(green1.human) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
369 |
RestoreHog(green1.bot) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
370 |
green1.gear = green1.bot |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
371 |
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
|
372 |
end |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
373 |
if GetHealth(green2.gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
374 |
HideHog(green2.gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
375 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
376 |
if GetHealth(green3.gear) then |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
377 |
HideHog(green3.gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
378 |
end |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
379 |
inBattle = true |
9532 | 380 |
end |
381 |
||
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
382 |
function captainLimeDeath(gear) |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
383 |
-- hero win in scenario of escape in 1st part |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
384 |
saveCompletedStatus(3) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
385 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
386 |
SendStat(siCustomAchievement, loc("You retrieved the lost part.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
387 |
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
|
388 |
SendStat(siPlayerKills,'1',teamA.name) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
389 |
SendStat(siPlayerKills,'0',teamB.name) |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
390 |
EndGame() |
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
391 |
end |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
392 |
|
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
393 |
function redTeamDeath(gear) |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
394 |
-- hero win in battle scenario |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
395 |
saveCompletedStatus(3) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
396 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
397 |
SendStat(siCustomAchievement, loc("You retrieved the lost part.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
398 |
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
|
399 |
SendStat(siPlayerKills,'1',teamA.name) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
400 |
SendStat(siPlayerKills,'0',teamC.name) |
9540
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
401 |
EndGame() |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
402 |
end |
92329918463f
game against red team seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9538
diff
changeset
|
403 |
|
9527 | 404 |
-------------- ANIMATIONS ------------------ |
405 |
||
406 |
function Skipanim(anim) |
|
407 |
if goals[anim] ~= nil then |
|
408 |
ShowMission(unpack(goals[anim])) |
|
409 |
end |
|
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
410 |
EndTurn(true) |
9527 | 411 |
end |
412 |
||
413 |
function AnimationSetup() |
|
9529 | 414 |
-- DIALOG 01 - Start, Captain Lime helps Hog Solo because he took part in the battle |
9527 | 415 |
AddSkipFunction(dialog01, Skipanim, {dialog01}) |
416 |
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
|
417 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere else on the planet of fruits, Captain Lime helps Hog Solo"), 5000}}) |
9529 | 418 |
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
|
419 |
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 | 420 |
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 | 421 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Good luck!"), SAY_SAY, 2000}}) |
9527 | 422 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
423 |
table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
|
9529 | 424 |
-- DIALOG02 - Start, Hog Solo escaped from the previous battle |
425 |
AddSkipFunction(dialog02, Skipanim, {dialog02}) |
|
426 |
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
|
427 |
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
|
428 |
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
|
429 |
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 | 430 |
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
|
431 |
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 | 432 |
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
|
433 |
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
|
434 |
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 | 435 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("What do you say? Are you in?"), SAY_SAY, 3000}}) |
436 |
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
|
437 |
table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Okay then!"), SAY_SAY, 2000}}) |
9529 | 438 |
table.insert(dialog02, {func = AnimSwitchHog, args = {hero.gear}}) |
9532 | 439 |
-- DIALOG03 - At crates, hero learns that Captain Lime is bad |
440 |
AddSkipFunction(dialog03, Skipanim, {dialog03}) |
|
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
441 |
table.insert(dialog03, {func = AnimWait, args = {hero.gear, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
442 |
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
|
443 |
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 | 444 |
table.insert(dialog03, {func = AnimWait, args = {green1.gear, 4000}}) |
9758 | 445 |
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
|
446 |
table.insert(dialog03, {func = goToThesurface, args = {hero.gear}}) |
9831 | 447 |
-- DIALOG04 - At crates, hero learns about the Assassins ambush |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
448 |
AddSkipFunction(dialog04, Skipanim, {dialog04}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
449 |
table.insert(dialog04, {func = AnimWait, args = {hero.gear, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
450 |
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
|
451 |
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
|
452 |
table.insert(dialog04, {func = AnimWait, args = {redHedgehogs[1].gear, 4000}}) |
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
453 |
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
|
454 |
table.insert(dialog04, {func = goToThesurface, args = {hero.gear}}) |
9527 | 455 |
end |
456 |
||
457 |
------------- OTHER FUNCTIONS --------------- |
|
458 |
||
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
459 |
function goToThesurface() |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
460 |
EndTurn(true) |
9534
662edfec06be
many dialogs and events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9532
diff
changeset
|
461 |
end |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
462 |
|
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
463 |
function wind() |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9782
diff
changeset
|
464 |
SetWind(GetRandom(201)-100) |
9538
51596e01c5df
scenario of escape seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9536
diff
changeset
|
465 |
end |
9544
e247251fa751
position saving functions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9542
diff
changeset
|
466 |