author | Wuzzy <Wuzzy2@mail.ru> |
Wed, 16 Jan 2019 20:03:07 +0100 | |
changeset 14634 | 3d4044b4aa3e |
parent 14633 | bd15c8551318 |
child 14635 | efa2bdeadd79 |
permissions | -rw-r--r-- |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
1 |
------------------- ABOUT ---------------------- |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
2 |
-- |
14509
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
3 |
-- In the desert planet, the hero will have to explore |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
4 |
-- the dunes below the surface and find the hidden |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
5 |
-- crates. It is told that one crate contains the |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
6 |
-- lost part. |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
7 |
|
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
8 |
-- Idea: game will be successfully end when the 2 lower crates are collected |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
9 |
-- it would be more defficult (and sadistic) if one should collect *all* the crates |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
10 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
13 |
HedgewarsScriptLoad("/Scripts/Utils.lua") |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
14 |
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
15 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
16 |
----------------- VARIABLES -------------------- |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
17 |
-- globals |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
18 |
local campaignName = loc("A Space Adventure") |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
19 |
local missionName = loc("Searching in the dust") |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
20 |
local heroIsInBattle = false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
21 |
local ongoingBattle = 0 |
9441 | 22 |
local cratesFound = 0 |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
23 |
local ropeGear = nil |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
24 |
-- dialogs |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
25 |
local dialog01 = {} |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
26 |
-- mission objectives |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
27 |
local goals = { |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9783
diff
changeset
|
28 |
[dialog01] = {missionName, loc("Getting ready"), loc("The device part is hidden in one of the crates! Go and get it!").."|".. |
12934 | 29 |
loc("Most of the destructible terrain is marked with dashed lines.").."|"..loc("Mines time: 0 seconds"), 1, 6000}, |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
30 |
} |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
31 |
-- crates |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
32 |
local btorch1Y = 60 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
33 |
local btorch1X = 2700 |
9441 | 34 |
local btorch2Y = 1900 |
35 |
local btorch2X = 2150 |
|
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
36 |
local btorch3Y = 980 |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
37 |
local btorch3X = 3260 |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
38 |
local rope1Y = 970 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
39 |
local rope1X = 3200 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
40 |
local rope2Y = 1900 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
41 |
local rope2X = 680 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
42 |
local rope3Y = 1850 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
43 |
local rope3X = 2460 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
44 |
local portalY = 480 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
45 |
local portalX = 1465 |
9441 | 46 |
local girderY = 1630 |
47 |
local girderX = 3350 |
|
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
48 |
-- win crates |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
49 |
local btorch2 = { gear = nil, destroyed = false, deleted = false} |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
50 |
local girder = { gear = nil, destroyed = false, deleted = false} |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
51 |
-- hogs |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
52 |
local hero = {} |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
53 |
local ally = {} |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
54 |
local smuggler1 = {} |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
55 |
local smuggler2 = {} |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
56 |
local smuggler3 = {} |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
57 |
-- teams |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
58 |
local teamA = {} |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
59 |
local teamB = {} |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
60 |
local teamC = {} |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
61 |
-- hedgehogs values |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
62 |
hero.name = loc("Hog Solo") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
63 |
hero.x = 1740 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
64 |
hero.y = 40 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
65 |
hero.dead = false |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
66 |
ally.name = loc("Chief Sandologist") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
67 |
ally.x = 1660 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
68 |
ally.y = 40 |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
69 |
smuggler1.name = loc("Sandy") |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
70 |
smuggler1.x = 400 |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
71 |
smuggler1.y = 235 |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
72 |
smuggler2.name = loc("Spike") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
73 |
smuggler2.x = 736 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
74 |
smuggler2.y = 860 |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
75 |
smuggler3.name = loc("Sandstorm") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
76 |
smuggler3.x = 1940 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
77 |
smuggler3.y = 1625 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
78 |
teamA.name = loc("PAotH") |
13583
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
12934
diff
changeset
|
79 |
teamA.color = -6 |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
80 |
teamB.name = loc("Smugglers") |
13583
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
12934
diff
changeset
|
81 |
teamB.color = -7 |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
teamC.name = loc("Hog Solo") |
13583
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
12934
diff
changeset
|
83 |
teamC.color = -6 |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
84 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
85 |
-------------- LuaAPI EVENT HANDLERS ------------------ |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
86 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
function onGameInit() |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
88 |
Seed = 1 |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
89 |
TurnTime = 20000 |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
90 |
CaseFreq = 0 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
MinesNum = 0 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
92 |
MinesTime = 1 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
93 |
Explosives = 0 |
9418
6e0831e42e12
added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9416
diff
changeset
|
94 |
HealthCaseAmount = 30 |
12468
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12226
diff
changeset
|
95 |
-- Disable Sudden Death |
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12226
diff
changeset
|
96 |
HealthDecrease = 0 |
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12226
diff
changeset
|
97 |
WaterRise = 0 |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
98 |
Map = "desert01_map" |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
99 |
Theme = "Desert" |
14511
6ac723d0fcb6
ASA desert01: Fix mission ending when all smugglers are dead
Wuzzy <Wuzzy2@mail.ru>
parents:
14509
diff
changeset
|
100 |
-- To prevent victory when smugglers have been defeated |
6ac723d0fcb6
ASA desert01: Fix mission ending when all smugglers are dead
Wuzzy <Wuzzy2@mail.ru>
parents:
14509
diff
changeset
|
101 |
GameFlags = gfOneClanMode |
9758 | 102 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
103 |
-- get hero health |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
104 |
local heroHealth = 100 |
9758 | 105 |
|
14509
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
106 |
-- Hero |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
107 |
teamC.name = AddMissionTeam(teamC.color) |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
108 |
hero.gear = AddMissionHog(heroHealth) |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
109 |
hero.name = GetHogName(hero.gear) |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
110 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
111 |
HogTurnLeft(hero.gear, true) |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
112 |
-- PAotH undercover scientist and chief Sandologist |
14509
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
113 |
teamA.name = AddTeam(teamA.name, teamA.color, "Earth", "Island", "Default", "cm_galaxy") |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
114 |
SetTeamPassive(teamA.name, true) |
9629 | 115 |
ally.gear = AddHog(ally.name, 0, 100, "Cowboy") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
116 |
AnimSetGearPosition(ally.gear, ally.x, ally.y) |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
117 |
-- Smugglers |
14509
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
118 |
teamB.name = AddTeam(teamB.name, teamB.color, "chest", "Island", "Default", "cm_bloodyblade") |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
119 |
SetTeamPassive(teamB.name, true) |
9629 | 120 |
smuggler1.gear = AddHog(smuggler1.name, 1, 100, "hair_orange") |
9412
b4717f50846e
oops, hogs placing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9410
diff
changeset
|
121 |
AnimSetGearPosition(smuggler1.gear, smuggler1.x, smuggler1.y) |
9629 | 122 |
smuggler2.gear = AddHog(smuggler2.name, 1, 100, "lambda") |
9758 | 123 |
AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y) |
9629 | 124 |
smuggler3.gear = AddHog(smuggler3.name, 1, 100, "beefeater") |
9758 | 125 |
AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y) |
126 |
||
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
127 |
AnimInit(true) |
9758 | 128 |
AnimationSetup() |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
129 |
end |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
130 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
131 |
function onGameStart() |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
132 |
AnimWait(hero.gear, 3000) |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
133 |
FollowGear(hero.gear) |
9758 | 134 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
135 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
136 |
AddEvent(onHeroAtFirstBattle, {hero.gear}, heroAtFirstBattle, {hero.gear}, 1) |
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
137 |
AddEvent(onHeroAtThirdBattle, {hero.gear}, heroAtThirdBattle, {hero.gear}, 0) |
9441 | 138 |
AddEvent(onCheckForWin1, {hero.gear}, checkForWin1, {hero.gear}, 0) |
139 |
AddEvent(onCheckForWin2, {hero.gear}, checkForWin2, {hero.gear}, 0) |
|
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
140 |
AddEvent(onCrateDestroyed, {hero.gear}, crateDestroyed, {hero.gear}, 0) |
9758 | 141 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
142 |
-- smugglers ammo |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
143 |
AddAmmo(smuggler1.gear, amBazooka, 2) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
144 |
AddAmmo(smuggler1.gear, amGrenade, 2) |
9758 | 145 |
AddAmmo(smuggler1.gear, amDEagle, 2) |
9441 | 146 |
AddAmmo(smuggler3.gear, amRope, 2) |
9758 | 147 |
|
9632
9dd1c36d8b54
final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
148 |
-- spawn crates |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
149 |
SpawnSupplyCrate(btorch3X, btorch3Y, amBlowTorch) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
150 |
SpawnSupplyCrate(rope1X, rope1Y, amRope) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
151 |
SpawnSupplyCrate(rope2X, rope2Y, amRope) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
152 |
SpawnSupplyCrate(rope3X, rope3Y, amRope) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
153 |
SpawnSupplyCrate(portalX, portalY, amPortalGun) |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
154 |
SpawnHealthCrate(3300, 970) |
9758 | 155 |
|
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
156 |
-- the win crates, collect both to win |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
157 |
btorch2.gear = SpawnSupplyCrate(btorch2X, btorch2Y, amBlowTorch) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
158 |
girder.gear = SpawnSupplyCrate(girderX, girderY, amGirder) |
9758 | 159 |
|
9420 | 160 |
-- adding mines - BOOM! |
161 |
AddGear(1280, 460, gtMine, 0, 0, 0, 0) |
|
162 |
AddGear(270, 460, gtMine, 0, 0, 0, 0) |
|
163 |
AddGear(3460, 60, gtMine, 0, 0, 0, 0) |
|
164 |
AddGear(3500, 240, gtMine, 0, 0, 0, 0) |
|
165 |
AddGear(3410, 670, gtMine, 0, 0, 0, 0) |
|
166 |
AddGear(3450, 720, gtMine, 0, 0, 0, 0) |
|
9758 | 167 |
|
9420 | 168 |
local x = 800 |
9432 | 169 |
while x < 1630 do |
9420 | 170 |
AddGear(x, 900, gtMine, 0, 0, 0, 0) |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
171 |
x = x + GetRandom(13)+8 |
9420 | 172 |
end |
173 |
x = 1890 |
|
174 |
while x < 2988 do |
|
175 |
AddGear(x, 760, gtMine, 0, 0, 0, 0) |
|
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
176 |
x = x + GetRandom(13)+8 |
9420 | 177 |
end |
9441 | 178 |
x = 2500 |
9420 | 179 |
while x < 3300 do |
180 |
AddGear(x, 1450, gtMine, 0, 0, 0, 0) |
|
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
181 |
x = x + GetRandom(13)+8 |
9420 | 182 |
end |
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
183 |
x = 1570 |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
184 |
while x < 2900 do |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
185 |
AddGear(x, 470, gtMine, 0, 0, 0, 0) |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
186 |
x = x + GetRandom(13)+8 |
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
187 |
end |
9758 | 188 |
|
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
189 |
AddEvent(onHeroFleeFirstBattle, {hero.gear}, heroFleeFirstBattle, {hero.gear}, 1) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
190 |
AddEvent(onHeroAtBattlePoint1, {hero.gear}, heroAtBattlePoint1, {hero.gear}, 0) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
191 |
AddEvent(onHeroAtBattlePoint2, {hero.gear}, heroAtBattlePoint2, {hero.gear}, 0) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
192 |
-- crates |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12900
diff
changeset
|
193 |
SpawnSupplyCrate(btorch1X, btorch1Y, amBlowTorch) |
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
194 |
SpawnHealthCrate(680, 460) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
195 |
-- hero ammo |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
196 |
AddAmmo(hero.gear, amRope, 2) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
197 |
AddAmmo(hero.gear, amBazooka, 3) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
198 |
AddAmmo(hero.gear, amParachute, 1) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
199 |
AddAmmo(hero.gear, amGrenade, 6) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
200 |
AddAmmo(hero.gear, amDEagle, 4) |
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
201 |
AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1))) |
9758 | 202 |
|
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
203 |
AddAnim(dialog01) |
9758 | 204 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
205 |
SendHealthStatsOff() |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
206 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
207 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
208 |
function onNewTurn() |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
209 |
if CurrentHedgehog == hero.gear and not heroIsInBattle then |
13752
110d6c1e817f
Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents:
13742
diff
changeset
|
210 |
SetTurnTimeLeft(MAX_TURN_TIME) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
211 |
elseif (CurrentHedgehog == smuggler2.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 1 then |
12589
fa837afff629
ASA, desert01: Fix smugglers sometimes getting multiple turns
Wuzzy <almikes@aol.com>
parents:
12588
diff
changeset
|
212 |
AnimSwitchHog(smuggler1.gear) |
9430 | 213 |
elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then |
12589
fa837afff629
ASA, desert01: Fix smugglers sometimes getting multiple turns
Wuzzy <almikes@aol.com>
parents:
12588
diff
changeset
|
214 |
AnimSwitchHog(smuggler2.gear) |
fa837afff629
ASA, desert01: Fix smugglers sometimes getting multiple turns
Wuzzy <almikes@aol.com>
parents:
12588
diff
changeset
|
215 |
elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler2.gear) and ongoingBattle == 3 then |
fa837afff629
ASA, desert01: Fix smugglers sometimes getting multiple turns
Wuzzy <almikes@aol.com>
parents:
12588
diff
changeset
|
216 |
AnimSwitchHog(smuggler3.gear) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
217 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
218 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
219 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
220 |
function onGameTick() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
221 |
AnimUnWait() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
222 |
if ShowAnimation() == false then |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
223 |
return |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
224 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
225 |
ExecuteAfterAnimations() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
226 |
CheckEvents() |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
227 |
end |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
228 |
|
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
229 |
function onAmmoStoreInit() |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
230 |
SetAmmo(amBlowTorch, 0, 0, 0, 1) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
231 |
SetAmmo(amRope, 0, 0, 0, 1) |
9758 | 232 |
SetAmmo(amPortalGun, 0, 0, 0, 1) |
9441 | 233 |
SetAmmo(amGirder, 0, 0, 0, 3) |
14634
3d4044b4aa3e
ASA desert01: Enable skip all the time
Wuzzy <Wuzzy2@mail.ru>
parents:
14633
diff
changeset
|
234 |
-- Give skip to all. |
3d4044b4aa3e
ASA desert01: Enable skip all the time
Wuzzy <Wuzzy2@mail.ru>
parents:
14633
diff
changeset
|
235 |
-- Skip intentionally kept for player so they can wait for |
3d4044b4aa3e
ASA desert01: Enable skip all the time
Wuzzy <Wuzzy2@mail.ru>
parents:
14633
diff
changeset
|
236 |
-- better wind conditions. |
11976
d5dabb71d6bf
Add skip option to desert01, fruit02, moon01 in A Space Adventure
Wuzzy <almikes@aol.com>
parents:
11692
diff
changeset
|
237 |
SetAmmo(amSkip, 9, 0, 0, 1) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
238 |
end |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
239 |
|
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
240 |
function onGearAdd(gear) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
241 |
if GetGearType(gear) == gtRope then |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
242 |
ropeGear = gear |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
243 |
end |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
244 |
end |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
245 |
|
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
246 |
function onGearDelete(gear) |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
247 |
if GetGearType(gear) == gtRope then |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
248 |
ropeGear = nil |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
249 |
end |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
250 |
local foundDeviceCrateCandidate = function(candidate_crate_table, other_crate_table) |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
251 |
candidate_crate_table.deleted = true |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
252 |
-- Evaluates to false if crate has been collected |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
253 |
if (band(GetGearMessage(candidate_crate_table.gear), gmDestroy) == 0) then |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
254 |
candidate_crate_table.destroyed = true |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
255 |
end |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
256 |
|
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
257 |
if cratesFound == 0 then |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
258 |
-- First win crate collected: |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
259 |
-- Turn the other crate into a fake crate; this will “contain” the device. |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
260 |
SetGearPos(other_crate_table.gear, bor(GetGearPos(other_crate_table.gear), 0x8)) |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
261 |
elseif cratesFound == 1 then |
13736
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
262 |
if not candidate_crate_table.destroyed then |
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
263 |
-- Second win crate collected: |
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
264 |
-- This crate contains the anti-gravity part! VICTORY! |
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
265 |
PlaySound(sndShotgunReload) |
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
266 |
-- It's displayed as if collecting a normal ammo/utility crate. :-) |
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
267 |
AddCaption(loc("Anti-Gravity Device Part (+1)"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
c6154fcb9420
ASA, desert01: Fix display error when destroying device crate
Wuzzy <Wuzzy2@mail.ru>
parents:
13735
diff
changeset
|
268 |
end |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
269 |
end |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
270 |
end |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
271 |
|
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
272 |
if gear == girder.gear then |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
273 |
foundDeviceCrateCandidate(girder, btorch2) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
274 |
elseif gear == btorch2.gear then |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
275 |
foundDeviceCrateCandidate(btorch2, girder) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
276 |
end |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
277 |
if gear == hero.gear then |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
278 |
hero.dead = true |
9430 | 279 |
elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then |
280 |
heroIsInBattle = false |
|
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
281 |
SetTeamPassive(teamB.name, true) |
9430 | 282 |
ongoingBattle = 0 |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
283 |
end |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
284 |
end |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
285 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
286 |
function onPrecise() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
287 |
if GameTime > 3000 then |
9758 | 288 |
SetAnimSkip(true) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
289 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
290 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
291 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
292 |
-------------- EVENTS ------------------ |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
293 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
294 |
function onHeroDeath(gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
295 |
if hero.dead then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
296 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
297 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
298 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
299 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
300 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
301 |
function onHeroAtFirstBattle(gear) |
13735
ae22928f2b01
ASA, desert01: Disable hero control at first battle left from the hole, not right above it
Wuzzy <Wuzzy2@mail.ru>
parents:
13583
diff
changeset
|
302 |
if not hero.dead and not heroIsInBattle and GetHealth(smuggler1.gear) and GetX(hero.gear) <= 1233 and GetX(hero.gear) > 80 |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
303 |
and GetY(hero.gear) <= GetY(smuggler1.gear)+5 and GetY(hero.gear) >= GetY(smuggler1.gear)-40 and |
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
304 |
-- If hero is standing or at a rope |
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
305 |
(StoppedGear(hero.gear) or GetGearElasticity(hero.gear) ~= 0) then |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
306 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
307 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
308 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
309 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
310 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
311 |
function onHeroFleeFirstBattle(gear) |
14630
e7bc81b303f3
ASA desert01: Fix third battle sometimes stopping instantly
Wuzzy <Wuzzy2@mail.ru>
parents:
14627
diff
changeset
|
312 |
if GetHealth(hero.gear) and GetHealth(smuggler1.gear) |
e7bc81b303f3
ASA desert01: Fix third battle sometimes stopping instantly
Wuzzy <Wuzzy2@mail.ru>
parents:
14627
diff
changeset
|
313 |
and heroIsInBattle and ongoingBattle == 1 |
9810
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
314 |
and not gearIsInCircle(smuggler1.gear, GetX(hero.gear), GetY(hero.gear), 1400, false) |
54c0fdec4600
changing math functions that may cause desyncs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9802
diff
changeset
|
315 |
and StoppedGear(hero.gear) then |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
316 |
return true |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
317 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
318 |
return false |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
319 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
320 |
|
9430 | 321 |
-- saves the location of the hero and prompts him for the second battle |
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
322 |
function onHeroAtBattlePoint1(gear) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
323 |
if not hero.dead and GetX(hero.gear) > 1000 and GetX(hero.gear) < 1100 |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
324 |
and GetY(hero.gear) > 590 and GetY(hero.gear) < 700 and StoppedGear(hero.gear) |
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
325 |
and (StoppedGear(hero.gear) or GetGearElasticity(hero.gear) ~= 0) then |
9432 | 326 |
return true |
327 |
end |
|
328 |
return false |
|
329 |
end |
|
330 |
||
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
331 |
function onHeroAtBattlePoint2(gear) |
9432 | 332 |
if not hero.dead and GetX(hero.gear) > 1610 and GetX(hero.gear) < 1680 |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
333 |
and GetY(hero.gear) > 850 and GetY(hero.gear) < 1000 |
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
334 |
and (StoppedGear(hero.gear) or GetGearElasticity(hero.gear) ~= 0) then |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
335 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
336 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
337 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
338 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
339 |
|
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
340 |
function onHeroAtThirdBattle(gear) |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
341 |
if not hero.dead and GetX(hero.gear) > 2000 and GetX(hero.gear) < 2200 |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
342 |
and GetY(hero.gear) > 1430 and GetY(hero.gear) < 1670 then |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
343 |
return true |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
344 |
end |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
345 |
return false |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
346 |
end |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
347 |
|
9441 | 348 |
function onCheckForWin1(gear) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
349 |
if not hero.dead and not btorch2.destroyed and btorch2.deleted then |
9441 | 350 |
return true |
351 |
end |
|
352 |
return false |
|
353 |
end |
|
354 |
||
355 |
function onCheckForWin2(gear) |
|
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
356 |
if not hero.dead and not girder.destroyed and girder.deleted then |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
357 |
return true |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
358 |
end |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
359 |
return false |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
360 |
end |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
361 |
|
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
362 |
function onCrateDestroyed(gear) |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
363 |
if not hero.dead and girder.destroyed or btorch2.destroyed then |
9441 | 364 |
return true |
365 |
end |
|
366 |
return false |
|
367 |
end |
|
368 |
||
9639
6b2ae2eaf1b2
remove unnecessary comments
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9632
diff
changeset
|
369 |
-------------- ACTIONS ------------------ |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
370 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
371 |
function heroDeath(gear) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
372 |
lose() |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
373 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
374 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
375 |
function heroAtFirstBattle(gear) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
376 |
AnimCaption(hero.gear, loc("A smuggler! Prepare for battle"), 5000) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
377 |
-- Remember velocity to restore it later |
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
378 |
local dx, dy = GetGearVelocity(hero.gear) |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
379 |
-- Hog gets scared if on rope |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
380 |
if isOnRope() then |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
381 |
PlaySound(sndRopeRelease) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
382 |
HogSay(hero.gear, loc("Gasp! A smuggler!"), SAY_SHOUT) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
383 |
dx = div(dx, 3) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
384 |
dy = div(dy, 3) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
385 |
end |
14627
db163acf53d1
ASA desert01: Clear hero gear message when battle starts
Wuzzy <Wuzzy2@mail.ru>
parents:
14511
diff
changeset
|
386 |
SetGearMessage(hero.gear, 0) |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
387 |
SetTeamPassive(teamB.name, false) |
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
388 |
heroIsInBattle = true |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
389 |
EndTurn(true) |
9758 | 390 |
ongoingBattle = 1 |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
391 |
AnimSwitchHog(smuggler1.gear) |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
392 |
EndTurn(true) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
393 |
SetGearVelocity(hero.gear, dx, dy) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
394 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
395 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
396 |
function heroFleeFirstBattle(gear) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
397 |
AnimSay(smuggler1.gear, loc("Run away, you coward!"), SAY_SHOUT, 4000) |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
398 |
SetTeamPassive(teamB.name, true) |
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
399 |
heroIsInBattle = false |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
400 |
EndTurn(true) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
401 |
ongoingBattle = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
402 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
403 |
|
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
404 |
function heroAtBattlePoint1(gear) |
9476
3ca7160dc6d2
fix bug, not triggered event
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9474
diff
changeset
|
405 |
secondBattle() |
9432 | 406 |
end |
407 |
||
12521
1877ca9e8703
Remove checkpoints in ASA: Searching in the dust
Wuzzy <almikes@aol.com>
parents:
12515
diff
changeset
|
408 |
function heroAtBattlePoint2(gear) |
9476
3ca7160dc6d2
fix bug, not triggered event
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9474
diff
changeset
|
409 |
secondBattle() |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
410 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
411 |
|
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
412 |
function heroAtThirdBattle(gear) |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
413 |
heroIsInBattle = true |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
414 |
SetTeamPassive(teamB.name, false) |
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
415 |
ongoingBattle = 3 |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
416 |
AnimSay(smuggler3.gear, loc("Who's there?! I'll get you!"), SAY_SHOUT, 5000) |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
417 |
local dx, dy = GetGearVelocity(hero.gear) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
418 |
-- Hog gets scared and falls from rope |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
419 |
if isOnRope() then |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
420 |
PlaySound(sndRopeRelease) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
421 |
HogSay(hero.gear, loc("Yikes!"), SAY_SHOUT) |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
422 |
dx = div(dx, 3) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
423 |
dy = div(dy, 3) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
424 |
end |
14627
db163acf53d1
ASA desert01: Clear hero gear message when battle starts
Wuzzy <Wuzzy2@mail.ru>
parents:
14511
diff
changeset
|
425 |
SetGearMessage(hero.gear, 0) |
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
426 |
AnimSwitchHog(smuggler3.gear) |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
427 |
EndTurn(true) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
428 |
SetGearVelocity(hero.gear, dx, dy) |
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
429 |
end |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
430 |
|
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
431 |
function crateDestroyed(gear) |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
432 |
lose() |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
433 |
end |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
434 |
|
9443 | 435 |
-- for some weird reson I couldn't call the same action for both events |
9441 | 436 |
function checkForWin1(gear) |
437 |
checkForWin() |
|
438 |
end |
|
439 |
||
440 |
function checkForWin2(gear) |
|
9758 | 441 |
checkForWin() |
9441 | 442 |
end |
443 |
||
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
444 |
-------------- ANIMATIONS ------------------ |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
445 |
|
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
446 |
function Skipanim(anim) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
447 |
if goals[anim] ~= nil then |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
448 |
ShowMission(unpack(goals[anim])) |
12575
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12571
diff
changeset
|
449 |
end |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12571
diff
changeset
|
450 |
AnimSwitchHog(hero.gear) |
9620
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
451 |
if anim == dialog01 then |
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
452 |
startMission() |
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
453 |
end |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
454 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
455 |
|
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
456 |
function AnimationSetup() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
457 |
-- DIALOG 01 - Start, getting info about the device |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
458 |
AddSkipFunction(dialog01, Skipanim, {dialog01}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
459 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
460 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the Planet of Sand, you have to double check your moves ..."), 5000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
461 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finally you are here!"), SAY_SAY, 2000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
462 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}}) |
9758 | 463 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me on such a short notice!"), SAY_SAY, 3000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
464 |
table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
465 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for H!"), SAY_SAY, 4000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
466 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now listen carefully! Below us there are tunnels that have been created naturally over the years"), SAY_SAY, 4000}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
467 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("I have heard that the local tribes say that many years ago some PAotH scientists were dumping their waste here."), SAY_SAY, 5000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
468 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("H confirmed that there isn't such a PAotH activity logged."), SAY_SAY, 4000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
469 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start."), SAY_SAY, 3000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
470 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware, though! Many smugglers come often to explore these tunnels and scavenge whatever valuable items they can find."), SAY_SAY, 5000}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
471 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to rob you!"), SAY_SAY, 4000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
472 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
473 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Okay, I'll be extra careful!"), SAY_SAY, 4000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
474 |
table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}}) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
475 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("The tunnel entrance is over there."), SAY_SAY, 3000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
476 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
477 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
12575
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12571
diff
changeset
|
478 |
table.insert(dialog01, {func = ShowMission, args = goals[dialog01]}) |
9758 | 479 |
table.insert(dialog01, {func = startMission, args = {hero.gear}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
480 |
end |
9432 | 481 |
|
482 |
--------------- OTHER FUNCTIONS ------------------ |
|
483 |
||
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
484 |
function isOnRope() |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
485 |
if ropeGear then |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
486 |
return true |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
487 |
end |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
488 |
return false |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
489 |
end |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
490 |
|
9474
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
491 |
function startMission() |
9620
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
492 |
AnimSwitchHog(ally.gear) |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
493 |
EndTurn(true) |
9474
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
494 |
end |
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
495 |
|
9432 | 496 |
function secondBattle() |
497 |
-- second battle |
|
9783
1e6b91080bfc
changed some things about checkpoints and battle events in desert01,fixes turn interruption when battle one or two is triggered
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9782
diff
changeset
|
498 |
if heroIsInBattle and ongoingBattle == 1 then |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
499 |
AnimSay(smuggler1.gear, loc("Get him, Spike!"), SAY_SHOUT, 4000) |
9783
1e6b91080bfc
changed some things about checkpoints and battle events in desert01,fixes turn interruption when battle one or two is triggered
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9782
diff
changeset
|
500 |
end |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
501 |
local dx, dy = GetGearVelocity(hero.gear) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
502 |
-- Hog gets scared if on rope |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
503 |
if isOnRope() then |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
504 |
PlaySound(sndRopeRelease) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
505 |
HogSay(hero.gear, loc("Gasp!"), SAY_SHOUT) |
12588
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
506 |
dx = div(dx, 3) |
2b9f658cba90
Fix rope detection in ASA desert01
Wuzzy <almikes@aol.com>
parents:
12587
diff
changeset
|
507 |
dy = div(dy, 3) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
508 |
end |
14627
db163acf53d1
ASA desert01: Clear hero gear message when battle starts
Wuzzy <Wuzzy2@mail.ru>
parents:
14511
diff
changeset
|
509 |
SetGearMessage(hero.gear, 0) |
9432 | 510 |
heroIsInBattle = true |
14633
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14630
diff
changeset
|
511 |
SetTeamPassive(teamB.name, false) |
9432 | 512 |
ongoingBattle = 2 |
12900
a9e4e8fa852c
Fix various typos in translatable strings
Wuzzy <Wuzzy2@mail.ru>
parents:
12619
diff
changeset
|
513 |
AnimSay(smuggler2.gear, loc("This seems like a wealthy hedgehog, nice ..."), SAY_THINK, 5000) |
9432 | 514 |
AnimSwitchHog(smuggler2.gear) |
12514
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12513
diff
changeset
|
515 |
EndTurn(true) |
12525
767920fd03a1
ASA, Searching in the dust: Fix Hog Solo being able to rope past all smugglers
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
516 |
SetGearVelocity(hero.gear, dx, dy) |
9432 | 517 |
end |
9434 | 518 |
|
9441 | 519 |
function checkForWin() |
520 |
if cratesFound == 0 then |
|
9758 | 521 |
-- have to look more |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
522 |
AnimSay(hero.gear, loc("Haven't found it yet ..."), SAY_THINK, 5000) |
9441 | 523 |
cratesFound = cratesFound + 1 |
524 |
elseif cratesFound == 1 then |
|
525 |
-- end game |
|
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
526 |
saveCompletedStatus(5) |
12526
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
527 |
AnimSay(hero.gear, loc("I found it! Hooray!"), SAY_SHOUT, 5000) |
6115bf1156ec
ASA: Searching in the dust: Fix incorrect crate content display after collecting device part
Wuzzy <almikes@aol.com>
parents:
12525
diff
changeset
|
528 |
PlaySound(sndVictory, hero.gear) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
529 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
530 |
SendStat(siCustomAchievement, loc("To win the game you had to collect the 2 crates with no specific order.")) |
12538
952afc3d2df2
Show correct kill counts in all ASA missions (fixes #147)
Wuzzy <almikes@aol.com>
parents:
12527
diff
changeset
|
531 |
sendSimpleTeamRankings({teamC.name, teamA.name, teamB.name}) |
9441 | 532 |
EndGame() |
533 |
end |
|
534 |
end |
|
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
535 |
|
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
536 |
function lose() |
14509
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
537 |
SendStat(siGameResult, string.format(loc("%s lost, try again!"), hero.name)) |
11692
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
538 |
SendStat(siCustomAchievement, loc("To win the game you have to find the right crate.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
539 |
SendStat(siCustomAchievement, loc("You can avoid some battles.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
10712
diff
changeset
|
540 |
SendStat(siCustomAchievement, loc("Use your ammo wisely.")) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
541 |
SendStat(siCustomAchievement, loc("Don't destroy the device crate!")) |
12538
952afc3d2df2
Show correct kill counts in all ASA missions (fixes #147)
Wuzzy <almikes@aol.com>
parents:
12527
diff
changeset
|
542 |
sendSimpleTeamRankings({teamB.name, teamC.name, teamA.name}) |
9782
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
543 |
EndGame() |
6c3cad32d4f4
fixed getting device crates with rc plane,end game when device crates destroyed,save/load hero position for checkpoint 5 in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9765
diff
changeset
|
544 |
end |