author | Wuzzy <Wuzzy2@mail.ru> |
Wed, 16 Jan 2019 19:59:08 +0100 | |
changeset 14617 | bd15c8551318 |
parent 14609 | ce315bb8b59d |
child 14903 | 4596357d002d |
permissions | -rw-r--r-- |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
1 |
------------------- ABOUT ---------------------- |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
2 |
-- |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
3 |
-- This map works as a menu for the hero hog to |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
4 |
-- navigate through planets. It portrays the hogs |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
5 |
-- planet and above the planets that he'll later |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
6 |
-- visit. |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
7 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
8 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
9 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
10 |
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
----------------- VARIABLES -------------------- |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
13 |
-- globals |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9572
diff
changeset
|
14 |
local missionName = loc("Spacetrip") |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
15 |
local timeForGuard1ToTurn = 1000 * 5 -- 5 sec |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
16 |
local timeForGuard1ToTurnLeft = timeForGuard1ToTurn |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
17 |
local saucerAcquired = false |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
18 |
local status |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
19 |
local getReadyForRumble = false -- guards wake up |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
20 |
local ropeDestroyed = false -- for detecting if player roped to the moon |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
21 |
local ropedToMoon = 0 |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
22 |
local checkPointReached = 1 -- 1 is start of the game |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
23 |
-- dialogs |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
24 |
local dialog01 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
25 |
local dialog02 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
26 |
local dialog03 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
27 |
local dialog04 = {} |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
28 |
local dialog05 = {} |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
29 |
local dialog06 = {} |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
30 |
local dialog07 = {} |
9636
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
31 |
local dialog08 = {} |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
32 |
local dialog09 = {} |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
33 |
-- mission objectives |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
34 |
local goals = { |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
35 |
["init"] = {missionName, loc("Getting ready"), loc("Find all the parts of the anti-gravity device.").. |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
36 |
"|"..loc("Travel to all the neighbor planets and collect all the pieces"), 1, 0}, |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9572
diff
changeset
|
37 |
[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500}, |
9758 | 38 |
[dialog02] = {missionName, loc("The adventure begins!"), loc("Use the saucer and fly to the moon").."|"..loc("Travel carefully as your fuel is limited"), 1, 4500}, |
9638 | 39 |
[dialog03] = {missionName, loc("An unexpected event!"), loc("Use the saucer and fly away").."|"..loc("Beware, any damage taken will stay until you complete the moon's main mission"), 1, 7000}, |
9758 | 40 |
[dialog07] = {missionName, loc("Searching the stars!"), loc("Use the saucer and fly away").."|"..loc("Visit the planets of Ice, Desert and Fruit before you proceed to the Death Planet"), 1, 6000}, |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
41 |
[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}, |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
42 |
["open_side_missions"] = {missionName, loc("Conquering the galaxy"), |
12835
ffa905c96dd8
Fix grammar fail in cosmos.lua (string freeze compliant)
Wuzzy <Wuzzy2@mail.ru>
parents:
12620
diff
changeset
|
43 |
loc("Use the flying saucer to fly to the other planets.").."|".. |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
44 |
loc("Complete the remaining side missions to complete this mission.").."|".. |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
45 |
loc("One flower: Incomplete side missions").."|".. |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
46 |
loc("Two flowers: All missions complete"), 1, 8000}, |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
47 |
["free"] = {missionName, loc("Spacetrip"), loc("Use the flying saucer to fly to the other planets."), 1, 5000} |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
48 |
} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
49 |
-- crates |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
50 |
local saucerX = 3270 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
51 |
local saucerY = 1500 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
52 |
-- hogs |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
53 |
local hero = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
54 |
local director = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
55 |
local doctor = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
56 |
local guard1 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
57 |
local guard2 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
58 |
-- teams |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
59 |
local teamA = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
60 |
local teamB = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
61 |
local teamC = {} |
12523
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
62 |
-- to check if flying saucer is active |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
63 |
local saucerGear = nil |
12529
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
64 |
-- if player abandoned any incomplete planet mission |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
65 |
local abandonedPlanetMission = false |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
66 |
-- hedgehogs values |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
67 |
hero.name = loc("Hog Solo") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
68 |
hero.x = 1450 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
69 |
hero.y = 1550 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
70 |
director.name = loc("H") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
71 |
director.x = 1350 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
72 |
director.y = 1550 |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
73 |
doctor.name = loc("Dr. Cornelius") |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
74 |
doctor.x = 1300 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
75 |
doctor.y = 1550 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
76 |
guard1.name = loc("Bob") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
77 |
guard1.x = 3350 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
78 |
guard1.y = 1800 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
79 |
guard1.turn = false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
80 |
guard1.keepTurning = true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
81 |
guard2.name = loc("Sam") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
guard2.x = 3400 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
83 |
guard2.y = 1800 |
12578
a778c1bb032e
ASA: Explain team abbreviations + update changelog
Wuzzy <almikes@aol.com>
parents:
12576
diff
changeset
|
84 |
-- Planetary Association of the Hedgehogs |
9831 | 85 |
teamA.name = loc("PAotH") |
13588
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
13167
diff
changeset
|
86 |
teamA.color = -6 |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
teamB.name = loc("Guards") |
13588
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
13167
diff
changeset
|
88 |
teamB.color = -2 |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
89 |
teamC.name = loc("Hog Solo") |
13588
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
13167
diff
changeset
|
90 |
teamC.color = -6 |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
92 |
-------------- LuaAPI EVENT HANDLERS ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
93 |
function onGameInit() |
13104
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
94 |
-- get the check point |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
95 |
if tonumber(GetCampaignVar("CosmosCheckPoint")) then |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
96 |
checkPointReached = tonumber(GetCampaignVar("CosmosCheckPoint")) |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
97 |
end |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
98 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
99 |
Seed = 35 |
13104
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
100 |
ClearGameFlags() |
14617
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14609
diff
changeset
|
101 |
EnableGameFlags(gfSolidLand, gfDisableWind) |
13104
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
102 |
if checkPointReached == 4 then |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
103 |
-- Disable walking as long we're stuck on the moon |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
104 |
EnableGameFlags(gfArtillery) |
071dcdf33f86
Fix artillery being broken in some missions
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
105 |
end |
12565
2f7274e5e090
Update ChangeLog for ASA, increase spacetrip turn time to 20s
Wuzzy <almikes@aol.com>
parents:
12564
diff
changeset
|
106 |
TurnTime = 20000 |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
107 |
CaseFreq = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
108 |
MinesNum = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
109 |
Explosives = 0 |
12473
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12228
diff
changeset
|
110 |
-- Disable Sudden Death |
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12228
diff
changeset
|
111 |
WaterRise = 0 |
d652c6f5d5f1
Disable Sudden Death for a couple of ASA missions
Wuzzy <almikes@aol.com>
parents:
12228
diff
changeset
|
112 |
HealthDecrease = 0 |
9635
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
113 |
-- completed main missions |
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
114 |
status = getCompletedStatus() |
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
115 |
if status.death01 then |
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
116 |
Map = "cosmos2_map" |
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
117 |
else |
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
118 |
Map = "cosmos_map" -- custom map included in file |
ea454f8a1593
changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9619
diff
changeset
|
119 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
120 |
Theme = "Nature" |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
121 |
-- Hero |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
122 |
teamC.name = AddMissionTeam(teamC.color) |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
123 |
hero.gear = AddMissionHog(100) |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
124 |
hero.name = GetHogName(hero.gear) |
9758 | 125 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
126 |
HogTurnLeft(hero.gear, true) |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
127 |
-- PAotH |
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
128 |
teamA.name = AddTeam(teamA.name, teamA.color, "Earth", "Island", "Default", "cm_galaxy") |
14617
bd15c8551318
Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14609
diff
changeset
|
129 |
SetTeamPassive(teamA.name, true) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
130 |
director.gear = AddHog(director.name, 0, 100, "hair_yellow") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
131 |
AnimSetGearPosition(director.gear, director.x, director.y) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
132 |
doctor.gear = AddHog(doctor.name, 0, 100, "Glasses") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
133 |
AnimSetGearPosition(doctor.gear, doctor.x, doctor.y) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
134 |
-- Guards |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
135 |
teamB.name = AddTeam(teamB.name, teamB.color, "Statue", "Island", "Default", "cm_swordshield2") |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
136 |
guard1.gear = AddHog(guard1.name, 1, 100, "policecap") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
137 |
AnimSetGearPosition(guard1.gear, guard1.x, guard1.y) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
138 |
guard2.gear = AddHog(guard2.name, 1, 100, "policecap") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
139 |
AnimSetGearPosition(guard2.gear, guard2.x, guard2.y) |
12093
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
140 |
-- Whether to start with an animation |
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
141 |
local startSequence |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
142 |
-- do checkpoint stuff needed before game starts |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
143 |
if checkPointReached == 1 then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
144 |
-- Start of the game |
12093
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
145 |
startSequence = true |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
146 |
elseif checkPointReached == 2 then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
147 |
-- Hero on the column, just took space ship unnoticed |
12093
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
148 |
startSequence = true |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
149 |
AnimSetGearPosition(hero.gear, saucerX, saucerY) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
150 |
elseif checkPointReached == 3 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
151 |
-- Hero near column, without space ship unnoticed |
12093
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
152 |
startSequence = true |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
153 |
elseif checkPointReached == 4 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
154 |
-- Hero visited moon for fuels |
12093
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
155 |
startSequence = true |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
156 |
AnimSetGearPosition(hero.gear, 1110, 850) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
157 |
elseif checkPointReached == 5 then |
14609
ce315bb8b59d
ASA cosmos: Minor cinematic tweaks for meteorite cut scene
Wuzzy <Wuzzy2@mail.ru>
parents:
14507
diff
changeset
|
158 |
startSequence = status.death01 and not status.final |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
159 |
-- Hero has visited a planet, he has plenty of fuels and can change planet |
9342
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
160 |
if GetCampaignVar("Planet") == "moon" then |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
161 |
AnimSetGearPosition(hero.gear, 1110, 850) |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
162 |
elseif GetCampaignVar("Planet") == "desertPlanet" then |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
163 |
AnimSetGearPosition(hero.gear, 3670, 270) |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
164 |
elseif GetCampaignVar("Planet") == "fruitPlanet" then |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
165 |
AnimSetGearPosition(hero.gear, 2400, 375) |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
166 |
elseif GetCampaignVar("Planet") == "icePlanet" then |
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
167 |
AnimSetGearPosition(hero.gear, 1440, 260) |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
168 |
elseif GetCampaignVar("Planet") == "deathPlanet" then |
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
169 |
AnimSetGearPosition(hero.gear, 620, 530) |
9637
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
170 |
elseif GetCampaignVar("Planet") == "meteorite" then |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
171 |
AnimSetGearPosition(hero.gear, 3080, 850) |
9342
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
172 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
173 |
end |
12093
1da37e2ba6fd
Fix A Space Adventure Missions allowing player to walk before 1st animation and screw things up
Wuzzy <almikes@aol.com>
parents:
12054
diff
changeset
|
174 |
AnimInit(startSequence) |
12529
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
175 |
|
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
176 |
-- Reset checkpoint of other missions when entering this mission. |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
177 |
-- The player has left the planet, so we count that “abandoning” any incomplete missions. |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
178 |
-- This also allows the player (indirectly) to reset the checkpointed missions. |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
179 |
abandonedPlanetMission = resetCheckpoint() |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
180 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
181 |
AnimationSetup() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
182 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
183 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
184 |
function onGameStart() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
185 |
-- wait for the first turn to start |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
186 |
AnimWait(hero.gear, 3000) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
187 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
188 |
FollowGear(hero.gear) |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
189 |
if GetCampaignVar("Won") == "true" then |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
190 |
if GetCampaignVar("Mission1Won") == "true" then |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
191 |
ShowMission(unpack(goals["free"])) |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
192 |
else |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
193 |
ShowMission(unpack(goals["open_side_missions"])) |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
194 |
end |
14609
ce315bb8b59d
ASA cosmos: Minor cinematic tweaks for meteorite cut scene
Wuzzy <Wuzzy2@mail.ru>
parents:
14507
diff
changeset
|
195 |
elseif status.death01 and not status.final then |
ce315bb8b59d
ASA cosmos: Minor cinematic tweaks for meteorite cut scene
Wuzzy <Wuzzy2@mail.ru>
parents:
14507
diff
changeset
|
196 |
HideMission() |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
197 |
else |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
198 |
ShowMission(unpack(goals["init"])) |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
199 |
end |
9758 | 200 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
201 |
-- do checkpoint stuff needed after game starts |
9758 | 202 |
if checkPointReached == 1 then |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
203 |
AddAnim(dialog01) |
9618
c937b532f8ec
give player only one rope
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9617
diff
changeset
|
204 |
AddAmmo(hero.gear, amRope, 1) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
205 |
AddAmmo(guard1.gear, amDEagle, 100) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
206 |
AddAmmo(guard2.gear, amDEagle, 100) |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12905
diff
changeset
|
207 |
SpawnSupplyCrate(saucerX, saucerY, amJetpack) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
208 |
-- EVENT HANDLERS |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
209 |
AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0) |
12563
0116cfdf9074
ASA, Spacetrip: Fix not properly recognizing crate collection
Wuzzy <almikes@aol.com>
parents:
12562
diff
changeset
|
210 |
AddEvent(onHeroAcquiredSaucer, {hero.gear}, heroAcquiredSaucer, {hero.gear}, 1) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
211 |
AddEvent(onHeroOutOfGuardSight, {hero.gear}, heroOutOfGuardSight, {hero.gear}, 0) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
212 |
elseif checkPointReached == 2 then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
213 |
AddAmmo(hero.gear, amJetpack, 1) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
214 |
AddAnim(dialog02) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
215 |
elseif checkPointReached == 3 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
216 |
-- Hero near column, without space ship unnoticed |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
217 |
elseif checkPointReached == 4 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
218 |
-- Hero visited moon for fuels |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
219 |
AddAnim(dialog05) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
220 |
elseif checkPointReached == 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
221 |
-- Hero has visited a planet, he has plenty of fuels and can change planet |
12228
f30eab4b9b05
Give infinite flying saucers in Space Adventure main menu
Wuzzy <almikes@aol.com>
parents:
12093
diff
changeset
|
222 |
AddAmmo(hero.gear, amJetpack, 100) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
223 |
end |
9758 | 224 |
|
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
225 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
226 |
AddEvent(onNoFuelAtLand, {hero.gear}, noFuelAtLand, {hero.gear}, 0) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
227 |
-- always check for landings |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
228 |
if GetCampaignVar("Planet") ~= "moon" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
229 |
AddEvent(onMoonLanding, {hero.gear}, moonLanding, {hero.gear}, 0) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
230 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
231 |
if GetCampaignVar("Planet") ~= "desertPlanet" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
232 |
AddEvent(onDesertPlanetLanding, {hero.gear}, desertPlanetLanding, {hero.gear}, 0) |
9758 | 233 |
end |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
234 |
if GetCampaignVar("Planet") ~= "fruitPlanet" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
235 |
AddEvent(onFruitPlanetLanding, {hero.gear}, fruitPlanetLanding, {hero.gear}, 0) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
236 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
237 |
if GetCampaignVar("Planet") ~= "icePlanet" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
238 |
AddEvent(onIcePlanetLanding, {hero.gear}, icePlanetLanding, {hero.gear}, 0) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
239 |
end |
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
240 |
if GetCampaignVar("Planet") ~= "deathPlanet" then |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
241 |
AddEvent(onDeathPlanetLanding, {hero.gear}, deathPlanetLanding, {hero.gear}, 0) |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
242 |
end |
9758 | 243 |
|
9636
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
244 |
if status.death01 and not status.final then |
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
245 |
AddAnim(dialog08) |
9637
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
246 |
if GetCampaignVar("Planet") ~= "meteorite" then |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
247 |
AddEvent(onMeteoriteLanding, {hero.gear}, meteoriteLanding, {hero.gear}, 0) |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
248 |
end |
9636
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
249 |
end |
9758 | 250 |
|
9584
a7bf5464dfb6
add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9580
diff
changeset
|
251 |
SendHealthStatsOff() |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
252 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
253 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
254 |
function onGameTick() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
255 |
-- maybe alert this to avoid timeForGuard1ToTurnLeft overflow |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
256 |
if timeForGuard1ToTurnLeft == 0 and guard1.keepTurning then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
257 |
guard1.turn = not guard1.turn |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
258 |
HogTurnLeft(guard1.gear, guard1.turn) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
259 |
timeForGuard1ToTurnLeft = timeForGuard1ToTurn |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
260 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
261 |
timeForGuard1ToTurnLeft = timeForGuard1ToTurnLeft - 1 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
262 |
AnimUnWait() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
263 |
if ShowAnimation() == false then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
264 |
return |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
265 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
266 |
ExecuteAfterAnimations() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
267 |
CheckEvents() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
268 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
269 |
|
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
270 |
function onGameTick20() |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
271 |
setFoundDeviceVisual() |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
272 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
273 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
274 |
function onPrecise() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
275 |
if GameTime > 3000 then |
9758 | 276 |
SetAnimSkip(true) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
277 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
278 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
279 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
280 |
function onAmmoStoreInit() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
281 |
SetAmmo(amJetpack, 0, 0, 0, 1) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
282 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
283 |
|
12529
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
284 |
local abandonCheck = false |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
285 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
286 |
function onNewTurn() |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
287 |
if ropedToMoon == 1 then |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
288 |
AnimSetInputMask(0) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
289 |
sendStatsOnRopedToMoon() |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
290 |
return |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
291 |
end |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
292 |
if saucerAcquired then |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
293 |
-- The only way for the player to have a saucer at turn start is by having used the rope |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
294 |
-- before; there's no other way to get it. We can therefore conclude the rope has been |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
295 |
-- used. |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
296 |
ropeDestroyed = true |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
297 |
end |
12529
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
298 |
if not abandonCheck and checkPointReached == 5 then |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
299 |
if abandonedPlanetMission then |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
300 |
HogSay(hero.gear, loc("I just forgot all checkpoints of incomplete missions."), SAY_THINK) |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
301 |
end |
12620
fbd0001ba2e7
ASA, moon01: Move escape dialog into a proper animation dialogue
Wuzzy <almikes@aol.com>
parents:
12603
diff
changeset
|
302 |
abandonCheck = true |
12529
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
303 |
end |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
304 |
|
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
305 |
if CurrentHedgehog == hero.gear then |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
306 |
-- Hero just got spotted by guards |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
307 |
if getReadyForRumble then |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
308 |
EndTurn(true) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
309 |
getReadyForRumble = false |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
310 |
else |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
311 |
if guard1.keepTurning then |
13755
110d6c1e817f
Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents:
13745
diff
changeset
|
312 |
SetTurnTimeLeft(MAX_TURN_TIME) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
313 |
end |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
314 |
end |
13167
9ec7d2fb9da7
ASA_cosmos: Fix game not ending when hero dies after being seen by Guards
Wuzzy <Wuzzy2@mail.ru>
parents:
13104
diff
changeset
|
315 |
elseif not onHeroDeath() and CurrentHedgehog == director.gear or CurrentHedgehog == doctor.gear then |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
316 |
EndTurn(true) |
13167
9ec7d2fb9da7
ASA_cosmos: Fix game not ending when hero dies after being seen by Guards
Wuzzy <Wuzzy2@mail.ru>
parents:
13104
diff
changeset
|
317 |
elseif not onHeroDeath() and (CurrentHedgehog == guard1.gear or CurrentHedgehog == guard2.gear) and guard1.keepTurning then |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
318 |
EndTurn(true) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
319 |
end |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
320 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
321 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
322 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
323 |
-------------- EVENTS ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
324 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
325 |
function onHeroBeforeTreePosition(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
326 |
if GetHealth(hero.gear) and GetX(gear) > 2350 then |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
327 |
return true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
328 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
329 |
return false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
330 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
331 |
|
12523
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
332 |
function onGearAdd(gear) |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
333 |
if GetGearType(gear) == gtJetpack then |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
334 |
saucerGear = gear |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
335 |
end |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
336 |
end |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
337 |
|
12522
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
338 |
function onGearDelete(gear) |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
339 |
if GetGearType(gear) == gtCase and band(GetGearMessage(gear), gmDestroy) ~= 0 then |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
340 |
saucerAcquired = true |
12523
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
341 |
elseif GetGearType(gear) == gtJetpack then |
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
342 |
saucerGear = nil |
12522
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
343 |
end |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
344 |
end |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
345 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
346 |
function onHeroOutOfGuardSight(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
347 |
if GetHealth(hero.gear) and GetX(gear) < 3100 and GetY(gear) > saucerY-25 and StoppedGear(gear) and not guard1.keepTurning then |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
348 |
return true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
349 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
350 |
return false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
351 |
end |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
352 |
|
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
353 |
function onMoonLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
354 |
if GetHealth(hero.gear) and GetX(gear) > 1010 and GetX(gear) < 1220 and GetY(gear) < 1300 and GetY(gear) > 750 and StoppedGear(gear) then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
355 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
356 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
357 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
358 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
359 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
360 |
function onFruitPlanetLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
361 |
if GetHealth(hero.gear) and GetX(gear) > 2240 and GetX(gear) < 2540 and GetY(gear) < 1100 and StoppedGear(gear) then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
362 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
363 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
364 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
365 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
366 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
367 |
function onDesertPlanetLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
368 |
if GetHealth(hero.gear) and GetX(gear) > 3568 and GetX(gear) < 4052 and GetY(gear) < 500 and StoppedGear(gear) then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
369 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
370 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
371 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
372 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
373 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
374 |
function onIcePlanetLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
375 |
if GetHealth(hero.gear) and GetX(gear) > 1330 and GetX(gear) < 1650 and GetY(gear) < 500 and StoppedGear(gear) then |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
376 |
return true |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
377 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
378 |
return false |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
379 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
380 |
|
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
381 |
function onDeathPlanetLanding(gear) |
9637
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
382 |
if GetHealth(hero.gear) and GetX(gear) > 280 and GetX(gear) < 700 and GetY(gear) < 720 and StoppedGear(gear) then |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
383 |
return true |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
384 |
end |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
385 |
return false |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
386 |
end |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
387 |
|
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
388 |
function onMeteoriteLanding(gear) |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
389 |
if GetHealth(hero.gear) and GetX(gear) > 2990 and GetX(gear) < 3395 and GetY(gear) < 940 and StoppedGear(gear) then |
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
390 |
return true |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
391 |
end |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
392 |
return false |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
393 |
end |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
394 |
|
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
395 |
function onNoFuelAtLand(gear) |
9758 | 396 |
if checkPointReached > 1 and GetHealth(hero.gear) and GetY(gear) > 1400 and |
12523
94bba599efd3
ASA, Spacetrip: Fix mission fail if touching ground in flying saucer but still got fuel
Wuzzy <almikes@aol.com>
parents:
12522
diff
changeset
|
397 |
GetAmmoCount(gear, amJetpack) == 0 and saucerGear == nil and StoppedGear(gear) then |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
398 |
return true |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
399 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
400 |
return false |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
401 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
402 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
403 |
function onHeroDeath(gear) |
9617
662956a081a0
fixed bug that didn't endgame when make wrong landing with no fuels
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9611
diff
changeset
|
404 |
if not GetHealth(hero.gear) then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
405 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
406 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
407 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
408 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
409 |
|
9639
6b2ae2eaf1b2
remove unnecessary comments
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9638
diff
changeset
|
410 |
-------------- ACTIONS ------------------ |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
411 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
412 |
function heroBeforeTreePosition(gear) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
413 |
if band(GetState(gear), gstHHDriven) ~= 0 then |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
414 |
AnimSay(gear,loc("Now I have to climb these trees"), SAY_SAY, 4000) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
415 |
AnimCaption(hero.gear, loc("Use the rope to get to the crate"), 4000) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
416 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
417 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
418 |
|
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
419 |
function prepareDialog02(gear) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
420 |
if StoppedGear(gear) and guard1.keepTurning and checkPointReached < 2 then |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
421 |
SetGearMessage(gear, band(GetGearMessage(gear), bnot(gmLeft+gmRight+gmUp+gmDown+gmPrecise))) |
12522
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
422 |
EndTurn(true) |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
423 |
-- save check point |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
424 |
SaveCampaignVar("CosmosCheckPoint", "2") |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
425 |
checkPointReached = 2 |
193b5882429d
ASA, Spacetrip mission: Fix poor detection of crate collection
Wuzzy <almikes@aol.com>
parents:
12521
diff
changeset
|
426 |
AddAnim(dialog02) |
12563
0116cfdf9074
ASA, Spacetrip: Fix not properly recognizing crate collection
Wuzzy <almikes@aol.com>
parents:
12562
diff
changeset
|
427 |
|
0116cfdf9074
ASA, Spacetrip: Fix not properly recognizing crate collection
Wuzzy <almikes@aol.com>
parents:
12562
diff
changeset
|
428 |
RemoveEventFunc(onHeroAcquiredSaucer) |
9758 | 429 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
430 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
431 |
|
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
432 |
function heroAcquiredSaucer(gear) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
433 |
-- check if he was spotted by the guard |
12563
0116cfdf9074
ASA, Spacetrip: Fix not properly recognizing crate collection
Wuzzy <almikes@aol.com>
parents:
12562
diff
changeset
|
434 |
if guard1.turn and guard1.keepTurning and GetX(gear) > saucerX-150 then |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
435 |
guard1.keepTurning = false |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
436 |
SetGearMessage(gear, band(GetGearMessage(gear), bnot(gmLeft+gmRight+gmUp+gmDown+gmPrecise))) |
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
437 |
local _, dy = GetGearVelocity(gear) |
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
438 |
SetGearVelocity(gear, 0, dy) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
439 |
AddAnim(dialog03) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
440 |
end |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
441 |
|
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
442 |
prepareDialog02(gear) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
443 |
end |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
444 |
|
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
445 |
function onHeroAcquiredSaucer(gear) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
446 |
return saucerAcquired |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
447 |
end |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
448 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
449 |
function heroOutOfGuardSight(gear) |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
450 |
SetGearMessage(gear, 0) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
451 |
guard1.keepTurning = true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
452 |
AddAnim(dialog04) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
453 |
|
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
454 |
if onHeroAcquiredSaucer(gear) then |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
455 |
prepareDialog02(gear) |
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
456 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
457 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
458 |
|
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
459 |
function moonLanding(gear) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
460 |
if checkPointReached == 1 and not ropeDestroyed then |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
461 |
-- Player climbed the moon with rope. |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
462 |
-- THIS IS A CRIMINAL OFFENSE AND WILL BE PUNISHED! |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
463 |
ropedToMoon = 1 |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
464 |
SetGearVelocity(gear, 0, 0) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
465 |
SetGearMessage(gear, 0) |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
466 |
AnimSetInputMask(0) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
467 |
AddAnim(dialog09) |
9589
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
468 |
else |
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
469 |
if checkPointReached ~= 5 then |
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
470 |
SaveCampaignVar("CosmosCheckPoint", "4") |
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
471 |
SaveCampaignVar("HeroHealth",GetHealth(hero.gear)) |
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
472 |
end |
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
473 |
AnimCaption(hero.gear,loc("Welcome to the moon!")) |
13755
110d6c1e817f
Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents:
13745
diff
changeset
|
474 |
SetTurnTimeLeft(MAX_TURN_TIME) |
9640
a6a903a6c2b3
some changes regarding hp save in cosmos and moon
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
475 |
SaveCampaignVar("HeroHealth", GetHealth(hero.gear)) |
9589
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
476 |
SaveCampaignVar("Planet", "moon") |
9611
ef374528a9fb
moon side mission map and most of the logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9605
diff
changeset
|
477 |
SaveCampaignVar("UnlockedMissions", "3") |
9589
20facc736354
cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9587
diff
changeset
|
478 |
SaveCampaignVar("Mission1", "2") |
9611
ef374528a9fb
moon side mission map and most of the logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9605
diff
changeset
|
479 |
SaveCampaignVar("Mission2", "13") |
ef374528a9fb
moon side mission map and most of the logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9605
diff
changeset
|
480 |
SaveCampaignVar("Mission3", "1") |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
481 |
sendStats(string.format(loc("%s arrived at the moon!"), hero.name)) |
9326
689f591aa226
added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9310
diff
changeset
|
482 |
end |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
483 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
484 |
|
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
485 |
function punishHeroForRopingToMoon(gear) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
486 |
-- Initiate the secret PAotH anti-rope defense system (5 bazookas dropped from sky) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
487 |
AddGear(GetX(gear), 100, gtShell, 0, 0, 0, 0) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
488 |
AddGear(GetX(gear), 0, gtShell, 0, 0, 0, 0) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
489 |
AddGear(GetX(gear), -100, gtShell, 0, 0, 0, 0) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
490 |
AddGear(GetX(gear), -200, gtShell, 0, 0, 0, 0) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
491 |
AddGear(GetX(gear), -300, gtShell, 0, 0, 0, 0) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
492 |
FollowGear(hero.gear) |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
493 |
AnimSetInputMask(0) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
494 |
end |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
495 |
|
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
496 |
function fruitPlanetLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
497 |
if checkPointReached < 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
498 |
AddAnim(dialog06) |
9758 | 499 |
else |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9572
diff
changeset
|
500 |
AnimCaption(hero.gear,loc("Welcome to the Fruit Planet!")) |
9484
a63307092bc6
fruit planet main mission first commit
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9467
diff
changeset
|
501 |
SaveCampaignVar("Planet", "fruitPlanet") |
12572
459543ef9b1b
ASA: Fix 2 important fruit planet mission unlocking bugs
Wuzzy <almikes@aol.com>
parents:
12571
diff
changeset
|
502 |
if status.fruit01 then |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9589
diff
changeset
|
503 |
SaveCampaignVar("UnlockedMissions", "4") |
12572
459543ef9b1b
ASA: Fix 2 important fruit planet mission unlocking bugs
Wuzzy <almikes@aol.com>
parents:
12571
diff
changeset
|
504 |
SaveCampaignVar("Mission1", "8") |
459543ef9b1b
ASA: Fix 2 important fruit planet mission unlocking bugs
Wuzzy <almikes@aol.com>
parents:
12571
diff
changeset
|
505 |
SaveCampaignVar("Mission2", "3") |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9589
diff
changeset
|
506 |
SaveCampaignVar("Mission3", "10") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9589
diff
changeset
|
507 |
SaveCampaignVar("Mission4", "1") |
9587
d6ddcafb1c56
fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9586
diff
changeset
|
508 |
else |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9589
diff
changeset
|
509 |
SaveCampaignVar("UnlockedMissions", "3") |
9587
d6ddcafb1c56
fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9586
diff
changeset
|
510 |
SaveCampaignVar("Mission1", "3") |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9589
diff
changeset
|
511 |
SaveCampaignVar("Mission2", "10") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9589
diff
changeset
|
512 |
SaveCampaignVar("Mission3", "1") |
9587
d6ddcafb1c56
fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9586
diff
changeset
|
513 |
end |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
514 |
sendStats(string.format(loc("%s arrived at the Fruit Planet!"), hero.name)) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
515 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
516 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
517 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
518 |
function desertPlanetLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
519 |
if checkPointReached < 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
520 |
AddAnim(dialog06) |
9758 | 521 |
else |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9572
diff
changeset
|
522 |
AnimCaption(hero.gear,loc("Welcome to the Desert Planet!")) |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9342
diff
changeset
|
523 |
SaveCampaignVar("Planet", "desertPlanet") |
9605
66cd14e5bdad
part of desert03 side mission - map not finished yet, will be commited later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9601
diff
changeset
|
524 |
SaveCampaignVar("UnlockedMissions", "4") |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9342
diff
changeset
|
525 |
SaveCampaignVar("Mission1", "4") |
9467
483a73697535
desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9457
diff
changeset
|
526 |
SaveCampaignVar("Mission2", "7") |
9605
66cd14e5bdad
part of desert03 side mission - map not finished yet, will be commited later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9601
diff
changeset
|
527 |
SaveCampaignVar("Mission3", "12") |
66cd14e5bdad
part of desert03 side mission - map not finished yet, will be commited later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9601
diff
changeset
|
528 |
SaveCampaignVar("Mission4", "1") |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
529 |
sendStats(string.format(loc("%s arrived at the Desert Planet!"), hero.name)) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
530 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
531 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
532 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
533 |
function icePlanetLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
534 |
if checkPointReached < 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
535 |
AddAnim(dialog06) |
9342
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
536 |
else |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9572
diff
changeset
|
537 |
AnimCaption(hero.gear,loc("Welcome to the Planet of Ice!")) |
9342
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
538 |
SaveCampaignVar("Planet", "icePlanet") |
9457
934f4d8370f1
finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9455
diff
changeset
|
539 |
SaveCampaignVar("UnlockedMissions", "3") |
9342
51b5fffe3892
changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9328
diff
changeset
|
540 |
SaveCampaignVar("Mission1", "5") |
9455
4bf3fac0e49d
added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9404
diff
changeset
|
541 |
SaveCampaignVar("Mission2", "6") |
4bf3fac0e49d
added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9404
diff
changeset
|
542 |
SaveCampaignVar("Mission3", "1") |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
543 |
sendStats(string.format(loc("%s arrived at the Ice Planet!"), hero.name)) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
544 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
545 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
546 |
|
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
547 |
function deathPlanetLanding(gear) |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
548 |
if checkPointReached < 5 then |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
549 |
AddAnim(dialog06) |
9580
49db7a78c2bd
fix typo in cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
550 |
elseif not (status.fruit02 and status.ice01 and status.desert01) then |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
551 |
AddAnim(dialog07) |
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
552 |
else |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
553 |
AnimCaption(hero.gear,loc("Welcome to the Death Planet!")) |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
554 |
SaveCampaignVar("Planet", "deathPlanet") |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9590
diff
changeset
|
555 |
SaveCampaignVar("UnlockedMissions", "3") |
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
556 |
SaveCampaignVar("Mission1", "9") |
9601
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9590
diff
changeset
|
557 |
SaveCampaignVar("Mission2", "11") |
6af4ca27421a
added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9590
diff
changeset
|
558 |
SaveCampaignVar("Mission3", "1") |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
559 |
sendStats(string.format(loc("%s arrived at the Planet of Death!"), hero.name)) |
9572
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
560 |
end |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
561 |
end |
278cff2a965f
added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9484
diff
changeset
|
562 |
|
9637
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
563 |
function meteoriteLanding(gear) |
9640
a6a903a6c2b3
some changes regarding hp save in cosmos and moon
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
564 |
-- first two conditionals are not possible but I'll leave it there... |
9637
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
565 |
if checkPointReached < 5 then |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
566 |
AddAnim(dialog06) |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
567 |
elseif not (status.fruit02 and status.ice01 and status.desert01) then |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
568 |
AddAnim(dialog07) |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
569 |
else |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
570 |
AnimCaption(hero.gear,loc("Welcome to the meteorite!")) |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
571 |
SaveCampaignVar("Planet", "meteorite") |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
572 |
SaveCampaignVar("UnlockedMissions", "2") |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
573 |
SaveCampaignVar("Mission1", "14") |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
574 |
SaveCampaignVar("Mission2", "1") |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
575 |
sendStats(string.format(loc("%s arrived at the meteorite!"), hero.name)) |
9637
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
576 |
end |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
577 |
end |
b23f9b7d49fa
added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9636
diff
changeset
|
578 |
|
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
579 |
function noFuelAtLand(gear) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
580 |
AddAnim(dialog06) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
581 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
582 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
583 |
function heroDeath(gear) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
584 |
if ropedToMoon == 1 then |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
585 |
sendStatsOnRopedToMoon() |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
586 |
elseif ropedToMoon == 0 then |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
587 |
sendStatsOnRetry() |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
588 |
end |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
589 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
590 |
|
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
591 |
function setFoundDeviceVisual() |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
592 |
--WriteLnToConsole("status: "..status.fruit01.." - "..status.fruit02) |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
593 |
if status.moon01 then |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
594 |
vgear = AddVisualGear(1116, 848, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
595 |
if status.moon02 then |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
596 |
vgear = AddVisualGear(1116, 828, vgtBeeTrace, 0, false) |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
597 |
end |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
598 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
599 |
if status.ice01 then |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
600 |
vgear = AddVisualGear(1512, 120, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
601 |
if status.ice02 then |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
602 |
vgear = AddVisualGear(1512, 100, vgtBeeTrace, 0, false) |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
603 |
end |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
604 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
605 |
if status.desert01 then |
14507
abe0a561005e
ASA cosmos: Move flower icons of desert planet above cactus instead of bird
Wuzzy <Wuzzy2@mail.ru>
parents:
14506
diff
changeset
|
606 |
vgear = AddVisualGear(3759, 28, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
607 |
if status.desert02 and status.desert03 then |
14507
abe0a561005e
ASA cosmos: Move flower icons of desert planet above cactus instead of bird
Wuzzy <Wuzzy2@mail.ru>
parents:
14506
diff
changeset
|
608 |
vgear = AddVisualGear(3759, 8, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
609 |
end |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
610 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
611 |
if status.fruit01 and status.fruit02 then |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
612 |
vgear = AddVisualGear(2390, 384, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
613 |
if status.fruit03 then |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
614 |
vgear = AddVisualGear(2390, 364, vgtBeeTrace, 0, false) |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
615 |
end |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
616 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
617 |
if status.death01 then |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
618 |
vgear = AddVisualGear(444, 400, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
619 |
if status.death02 then |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
620 |
vgear = AddVisualGear(444, 380, vgtBeeTrace, 0, false) |
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
621 |
end |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
622 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
623 |
if status.final then |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
624 |
vgear = AddVisualGear(3070, 810, vgtBeeTrace, 0, false) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
625 |
vgear = AddVisualGear(3070, 790, vgtBeeTrace, 0, false) |
9802
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
626 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
627 |
end |
00216d609140
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9758
diff
changeset
|
628 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
629 |
-------------- ANIMATIONS ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
630 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
631 |
function Skipanim(anim) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
632 |
if goals[anim] ~= nil then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
633 |
ShowMission(unpack(goals[anim])) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
634 |
end |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
635 |
if anim == dialog09 then |
12603
9805a1f8fb93
ASA, Spacetrip: Fix guards taking 2 turns in succession
Wuzzy <almikes@aol.com>
parents:
12592
diff
changeset
|
636 |
AnimSetInputMask(0) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
637 |
-- Quick punishment for the impatient |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
638 |
AddGear(GetX(hero.gear)-1, GetY(hero.gear)+1, gtDynamite, 0, 0, 0, 1) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
639 |
sendStatsOnRopedToMoon() |
12571
172157a47986
ASA, Spacetrip: Fix stats screen messages when running out of fuel
Wuzzy <almikes@aol.com>
parents:
12567
diff
changeset
|
640 |
elseif anim == dialog05 then |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
641 |
sendStatsOnStuckOnMoon() |
12571
172157a47986
ASA, Spacetrip: Fix stats screen messages when running out of fuel
Wuzzy <almikes@aol.com>
parents:
12567
diff
changeset
|
642 |
elseif anim == dialog06 then |
172157a47986
ASA, Spacetrip: Fix stats screen messages when running out of fuel
Wuzzy <almikes@aol.com>
parents:
12567
diff
changeset
|
643 |
sendStatsOnRetry() |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
644 |
elseif CurrentHedgehog ~= hero.gear and anim ~= dialog03 then |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
645 |
AnimSwitchHog(hero.gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
646 |
elseif anim == dialog03 then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
647 |
startCombat() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
648 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
649 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
650 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
651 |
function AnimationSetup() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
652 |
-- DIALOG 01 - Start |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
653 |
AddSkipFunction(dialog01, Skipanim, {dialog01}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
654 |
table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
655 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near Secret Base 17 of PAotH in the rural Hogland ..."), 4000}}) |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
656 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, string.format(loc("So, %s, here we are ..."), hero.name), SAY_SAY, 2000}}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
657 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the east side there is Secret Base 17."), SAY_SAY, 4000}}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
658 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("You have to continue alone from now on."), SAY_SAY, 3000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
659 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
660 |
table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you."), SAY_SAY, 2600}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
661 |
table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with some rope."), SAY_SAY, 5000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
662 |
table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("You may find it handy."), SAY_SAY, 2300}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
663 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you, Dr. Cornelius."), SAY_SAY, 1600}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
664 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I'll make good use of it."), SAY_SAY, 4500}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
665 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("It would be wiser to steal the space ship while the PAotH guards are taking a brake!"), SAY_SAY, 7000}}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
666 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Remember! Many will seek the anti-gravity device! Now go, hurry up!"), SAY_SAY, 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
667 |
table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
12562
b745e322a366
ASA: Update mission texts properly after watching dialog
Wuzzy <almikes@aol.com>
parents:
12561
diff
changeset
|
668 |
table.insert(dialog01, {func = ShowMission, args = goals[dialog01]}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
669 |
-- DIALOG 02 - Hero got the saucer |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
670 |
AddSkipFunction(dialog02, Skipanim, {dialog02}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
671 |
table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
672 |
table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("Checkpoint reached!"), 4000}}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
673 |
table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Got the saucer!"), SAY_SHOUT, 2000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
674 |
table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}}) |
9758 | 675 |
table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Now use it and go to the moon PAotH station to get more fuel!"), SAY_SHOUT, 5000}}) |
12562
b745e322a366
ASA: Update mission texts properly after watching dialog
Wuzzy <almikes@aol.com>
parents:
12561
diff
changeset
|
676 |
table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}}) |
b745e322a366
ASA: Update mission texts properly after watching dialog
Wuzzy <almikes@aol.com>
parents:
12561
diff
changeset
|
677 |
table.insert(dialog02, {func = ShowMission, args = goals[dialog02]}) |
b745e322a366
ASA: Update mission texts properly after watching dialog
Wuzzy <almikes@aol.com>
parents:
12561
diff
changeset
|
678 |
-- DIALOG 03 - Hero got spotted by guard |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
679 |
AddSkipFunction(dialog03, Skipanim, {dialog03}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
680 |
table.insert(dialog03, {func = AnimSay, args = {guard1.gear, string.format(loc("Hey, %s! Look, someone is stealing the saucer!"), guard2.name), SAY_SHOUT, 4000}}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
681 |
table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}}) |
12563
0116cfdf9074
ASA, Spacetrip: Fix not properly recognizing crate collection
Wuzzy <almikes@aol.com>
parents:
12562
diff
changeset
|
682 |
table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to flee!"), 1000}}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
683 |
table.insert(dialog03, {func = startCombat, args = {guard1.gear}}) |
12562
b745e322a366
ASA: Update mission texts properly after watching dialog
Wuzzy <almikes@aol.com>
parents:
12561
diff
changeset
|
684 |
table.insert(dialog03, {func = ShowMission, args = goals[dialog03]}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
685 |
-- DIALOG 04 - Hero out of sight |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
686 |
AddSkipFunction(dialog04, Skipanim, {dialog04}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
687 |
table.insert(dialog04, {func = AnimCaption, args = {guard1.gear, loc("You are out of danger, time to go to the moon!"), 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
688 |
table.insert(dialog04, {func = AnimSay, args = {guard1.gear, loc("I guess we lost him!"), SAY_SAY, 3000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
689 |
table.insert(dialog04, {func = AnimSay, args = {guard2.gear, loc("We should better report this and continue our watch!"), SAY_SAY, 5000}}) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
690 |
table.insert(dialog04, {func = AnimSwitchHog, args = {hero.gear}}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
691 |
-- DIALOG 05 - Hero returned from moon without fuels |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
692 |
AddSkipFunction(dialog05, Skipanim, {dialog05}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
693 |
table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuel!"), SAY_THINK, 6000}}) |
12529
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
694 |
if abandonedPlanetMission then |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
695 |
-- Hog solo is mad he has to play the moon main mission from start. Very sarcastic tone. ;-) |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
696 |
table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("And I just forgot the checkpoint of my main mission. Great, just great!"), SAY_THINK, 7000}}) |
a5ddc6b4abbd
ASA: Inform the player about a checkpoint reset
Wuzzy <almikes@aol.com>
parents:
12528
diff
changeset
|
697 |
end |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
698 |
table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Got to go back."), SAY_THINK, 2000}}) |
12564
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
699 |
table.insert(dialog05, {func = sendStatsOnStuckOnMoon, args = {hero.gear}}) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
700 |
-- DIALOG 06 - Landing on wrong planet or on earth if not enough fuels |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
701 |
AddSkipFunction(dialog06, Skipanim, {dialog06}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
702 |
table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm ... Now I ran out of fuel."), SAY_THINK, 3000}}) |
12524
206cb38d030f
ASA, Spacetrip: Improve messages when running out of fuel
Wuzzy <almikes@aol.com>
parents:
12523
diff
changeset
|
703 |
table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"), 0}}) |
9586
0b2494d87d99
stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9585
diff
changeset
|
704 |
table.insert(dialog06, {func = sendStatsOnRetry, args = {hero.gear}}) |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
705 |
-- DIALOG 07 - Hero lands on Death Planet but isn't allowed yet to play this map |
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
706 |
AddSkipFunction(dialog07, Skipanim, {dialog07}) |
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
707 |
table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"), 5000}}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
708 |
table.insert(dialog07, {func = AnimSay, args = {hero.gear, loc("I am not ready for this planet yet. I should visit it when I have found all the other device parts."), SAY_THINK, 4000}}) |
9636
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
709 |
-- DIALOG 08 - Hero wins death01 |
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
710 |
AddSkipFunction(dialog08, Skipanim, {dialog08}) |
12905
a9e4e8fa852c
Fix various typos in translatable strings
Wuzzy <Wuzzy2@mail.ru>
parents:
12835
diff
changeset
|
711 |
table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite’s shadow ..."), 4000}}) |
14493
7bb7e5e54f70
Update ASA campaign to use player chosen team identity
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
712 |
table.insert(dialog08, {func = AnimSay, args = {doctor.gear, string.format(loc("You did great, %s! However, we aren't out of danger yet!"), hero.name), SAY_SHOUT, 4500}}) |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
713 |
table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("The meteorite has come too close and the anti-gravity device isn't powerful enough to stop it now."), SAY_SHOUT, 5000}}) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
714 |
table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts."), SAY_SHOUT, 3000}}) |
9636
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
715 |
table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("PAotH has sent explosives but unfortunately the trigger mechanism seems to be faulty!"), SAY_SHOUT, 5000}}) |
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
716 |
table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}}) |
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
717 |
table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}}) |
e1921235fc78
cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9635
diff
changeset
|
718 |
table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}}) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
719 |
table.insert(dialog08, {func = ShowMission, args = goals[dialog08]}) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
720 |
-- DIALOG 09 - Hero roped to the moon (how naughty!) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
721 |
AddSkipFunction(dialog09, Skipanim, {dialog09}) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
722 |
table.insert(dialog09, {func = AnimSay, args = {doctor.gear, loc("One does not simply rope to the moon!"), SAY_SHOUT, 4500}}) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
723 |
table.insert(dialog09, {func = punishHeroForRopingToMoon, args = {hero.gear}}) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
724 |
table.insert(dialog09, {func = AnimWait, args = {hero.gear, 5000}}) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
725 |
table.insert(dialog09, {func = sendStatsOnRopedToMoon, args = {hero.gear}}) |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
726 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
727 |
|
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
728 |
------------------- custom "animation" functions -------------------------- |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
729 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
730 |
function startCombat() |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
731 |
-- Use this so guard2 gains control |
12519
d89dabfd07ce
Use EndTurn to replace TurnTimeLeft=0 in ASA campaign (fixes #225)
Wuzzy <almikes@aol.com>
parents:
12518
diff
changeset
|
732 |
EndTurn(true) |
12561
846fa8bb856e
ASA: Spacetrip: Fix guards ignoring stealing completely, fix various other game logic fails
Wuzzy <almikes@aol.com>
parents:
12543
diff
changeset
|
733 |
getReadyForRumble = true |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
734 |
end |
9584
a7bf5464dfb6
add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9580
diff
changeset
|
735 |
|
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
736 |
function sendStats(planetMsg) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
737 |
SendStat(siGameResult, planetMsg) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
738 |
SendStat(siCustomAchievement, loc("Return to the mission menu by pressing the \"Go back\" button.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
739 |
SendStat(siCustomAchievement, loc("You can choose another planet by replaying this mission.")) |
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
740 |
SendStat(siCustomAchievement, loc("Planets with completed main missions will be marked with a flower.")) |
11969
f3c1679694d3
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
Wuzzy <almikes@aol.com>
parents:
11697
diff
changeset
|
741 |
SendStat(siCustomAchievement, loc("Planets with all missions completed will be marked with two flowers.")) |
11970
72be38f6d0c0
Complete space campaign's spacetrip mission if all main+side missions are completed
Wuzzy <almikes@aol.com>
parents:
11969
diff
changeset
|
742 |
if GetCampaignVar("Won") == "true" and GetCampaignVar("Mission1Won") ~= "true" then |
72be38f6d0c0
Complete space campaign's spacetrip mission if all main+side missions are completed
Wuzzy <almikes@aol.com>
parents:
11969
diff
changeset
|
743 |
SendStat(siCustomAchievement, loc("Complete all main and side missions to complete the spacetrip mission.")) |
72be38f6d0c0
Complete space campaign's spacetrip mission if all main+side missions are completed
Wuzzy <almikes@aol.com>
parents:
11969
diff
changeset
|
744 |
end |
12543
952afc3d2df2
Show correct kill counts in all ASA missions (fixes #147)
Wuzzy <almikes@aol.com>
parents:
12529
diff
changeset
|
745 |
sendSimpleTeamRankings({teamC.name}) |
9584
a7bf5464dfb6
add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9580
diff
changeset
|
746 |
EndGame() |
a7bf5464dfb6
add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9580
diff
changeset
|
747 |
end |
9586
0b2494d87d99
stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9585
diff
changeset
|
748 |
|
0b2494d87d99
stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9585
diff
changeset
|
749 |
function sendStatsOnRetry() |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9640
diff
changeset
|
750 |
SendStat(siGameResult, loc("You have to travel again")) |
14506
4e7fbbdca061
ASA cosmos: Remove unneccary message when hero dies after moon was reached
Wuzzy <Wuzzy2@mail.ru>
parents:
14493
diff
changeset
|
751 |
if checkPointReached < 4 then |
4e7fbbdca061
ASA cosmos: Remove unneccary message when hero dies after moon was reached
Wuzzy <Wuzzy2@mail.ru>
parents:
14493
diff
changeset
|
752 |
SendStat(siCustomAchievement, loc("Your first destination is the moon in order to get more fuel.")) |
4e7fbbdca061
ASA cosmos: Remove unneccary message when hero dies after moon was reached
Wuzzy <Wuzzy2@mail.ru>
parents:
14493
diff
changeset
|
753 |
end |
11697
68eddcdc9f26
Typo fixes for A Space Adventure campaign
Wuzzy <almikes@aol.com>
parents:
9831
diff
changeset
|
754 |
SendStat(siCustomAchievement, loc("You have to be careful and must not die!")) |
12543
952afc3d2df2
Show correct kill counts in all ASA missions (fixes #147)
Wuzzy <almikes@aol.com>
parents:
12529
diff
changeset
|
755 |
sendSimpleTeamRankings({teamC.name}) |
9586
0b2494d87d99
stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9585
diff
changeset
|
756 |
EndGame() |
0b2494d87d99
stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9585
diff
changeset
|
757 |
end |
12564
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
758 |
|
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
759 |
function sendStatsOnStuckOnMoon() |
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
760 |
SendStat(siGameResult, loc("You have to go back to the moon!")) |
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
761 |
SendStat(siCustomAchievement, loc("You have to complete the main mission on moon in order to travel to other planets.")) |
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
762 |
sendSimpleTeamRankings({teamC.name}) |
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
763 |
EndGame() |
199971225506
ASA, Spacetrip: Better behaviour when entering mission while stuck on woon w/o fuel
Wuzzy <almikes@aol.com>
parents:
12563
diff
changeset
|
764 |
end |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
765 |
|
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
766 |
function sendStatsOnRopedToMoon() |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
767 |
if ropedToMoon ~= 2 then |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
768 |
ropedToMoon = 2 |
12571
172157a47986
ASA, Spacetrip: Fix stats screen messages when running out of fuel
Wuzzy <almikes@aol.com>
parents:
12567
diff
changeset
|
769 |
SendStat(siGameResult, loc("You have violated PAotH regulations!")) |
12580
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
770 |
SendStat(siCustomAchievement, loc("You have triggered the secret Do-Not-Rope-to-the-Moon Defense System.")) |
0c5ce463949b
ASA: Improve displaying of mission panels all over the place
Wuzzy <almikes@aol.com>
parents:
12578
diff
changeset
|
771 |
SendStat(siCustomAchievement, loc("Use the flying saucer from the crate to fly to the moon.")) |
12566
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
772 |
sendSimpleTeamRankings({teamC.name}) |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
773 |
EndGame() |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
774 |
end |
250a10a48388
ASA, Spacetrip: Drop weapons on player when landing on moon by rope
Wuzzy <almikes@aol.com>
parents:
12565
diff
changeset
|
775 |
end |