author | Periklis Ntanasis <pntanasis@gmail.com> |
Thu, 11 Jul 2013 04:57:01 +0300 | |
branch | spacecampaign |
changeset 9328 | 811574013fed |
parent 9326 | 689f591aa226 |
child 9342 | 51b5fffe3892 |
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 |
-- TODO |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
9 |
-- Save and Load All Check Points |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
10 |
-- Save hero health |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
-- Decide and implement if hero will use gas bombs... |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
12 |
-- ofc add custom stats page |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
13 |
-- PROBLEM : What if one makes a bad choice and wants to replay it map, how to reset? |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
14 |
-- POSSIBLE SOLUTIONS: In game function keys, frontend button... |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
15 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
16 |
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
|
17 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
18 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
19 |
----------------- VARIABLES -------------------- |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
20 |
-- globals |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
21 |
local campaignName = loc("A Space Adventure") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
22 |
local missionName = loc("Cosmos") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
23 |
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
|
24 |
local timeForGuard1ToTurnLeft = timeForGuard1ToTurn |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
25 |
local saucerAcquired = false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
26 |
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
|
27 |
-- dialogs |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
28 |
local dialog01 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
29 |
local dialog02 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
30 |
local dialog03 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
31 |
local dialog04 = {} |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
32 |
local dialog05 = {} |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
33 |
local dialog06 = {} |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
34 |
-- mission objectives |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
35 |
local goals = { |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
36 |
[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate on top of the column").."|"..loc("Use the sleep gas bomb if the guards spot you!"), 1, 4500}, |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
37 |
[dialog02] = {missionName, loc("The adventure begins!"), loc("Use the saucer and fly to the moon").."|"..loc("Drive carefully as your fuels are limited"), 1, 4500}, |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
38 |
[dialog03] = {missionName, loc("An unexpected event!"), loc("Use the saucer and fly away or use the gas bomb to neutralize the guards").."|"..loc("Beware, any damage taken will stay until you take some medicine or visit moon"), 1, 7000} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
39 |
} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
40 |
-- crates |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
41 |
local saucerX = 3270 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
42 |
local saucerY = 1500 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
43 |
-- hogs |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
44 |
local hero = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
45 |
local director = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
46 |
local doctor = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
47 |
local guard1 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
48 |
local guard2 = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
49 |
-- teams |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
50 |
local teamA = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
51 |
local teamB = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
52 |
local teamC = {} |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
53 |
-- hedgehogs values |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
54 |
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
|
55 |
hero.x = 1450 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
56 |
hero.y = 1550 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
57 |
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
|
58 |
director.x = 1350 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
59 |
director.y = 1550 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
60 |
doctor.name = loc("Dr.Cornelius") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
61 |
doctor.x = 1300 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
62 |
doctor.y = 1550 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
63 |
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
|
64 |
guard1.x = 3350 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
65 |
guard1.y = 1800 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
66 |
guard1.turn = false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
67 |
guard1.keepTurning = true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
68 |
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
|
69 |
guard2.x = 3400 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
70 |
guard2.y = 1800 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
71 |
teamA.name = loc("PAoTH") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
72 |
teamA.color = tonumber("FF0000",16) -- red |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
73 |
teamB.name = loc("Guards") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
74 |
teamB.color = tonumber("0033FF",16) -- blue |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
75 |
teamC.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
|
76 |
teamC.color = tonumber("38D61C",16) -- green |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
77 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
78 |
-------------- LuaAPI EVENT HANDLERS ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
79 |
function onGameInit() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
80 |
Seed = 35 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
81 |
GameFlags = gfSolidLand + gfDisableWind |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
TurnTime = 40000 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
83 |
CaseFreq = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
84 |
MinesNum = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
85 |
Explosives = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
86 |
Delay = 5 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
Map = "cosmos_map" -- custom map included in file |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
88 |
Theme = "Nature" |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
89 |
-- I had originally hero in PAoTH team and changed it, may reconsider though |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
90 |
-- PAoTH |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
92 |
hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
93 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
94 |
HogTurnLeft(hero.gear, true) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
95 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
96 |
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
|
97 |
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
|
98 |
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
|
99 |
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
|
100 |
-- Guards |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
101 |
AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
102 |
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
|
103 |
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
|
104 |
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
|
105 |
AnimSetGearPosition(guard2.gear, guard2.x, guard2.y) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
106 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
107 |
-- get the check point |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
108 |
if tonumber(GetCampaignVar("CosmosCheckPoint")) then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
109 |
checkPointReached = tonumber(GetCampaignVar("CosmosCheckPoint")) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
110 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
111 |
-- 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
|
112 |
if checkPointReached == 1 then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
113 |
-- Start of the game |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
114 |
elseif checkPointReached == 2 then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
115 |
-- Hero on the column, just took space ship unnoticed |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
116 |
AnimSetGearPosition(hero.gear, saucerX, saucerY) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
117 |
elseif checkPointReached == 3 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
118 |
-- Hero near column, without space ship unnoticed |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
119 |
elseif checkPointReached == 4 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
120 |
-- Hero visited moon for fuels |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
121 |
AnimSetGearPosition(hero.gear, 1110, 850) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
122 |
elseif checkPointReached == 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
123 |
-- Hero has visited a planet, he has plenty of fuels and can change planet |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
124 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
125 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
126 |
AnimInit() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
127 |
AnimationSetup() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
128 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
129 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
130 |
function onGameStart() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
131 |
-- 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
|
132 |
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
|
133 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
134 |
FollowGear(hero.gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
135 |
ShowMission(loc("A Space Adventure"), loc("Cosmos"), loc("Help Hog Solo to find all the parts of the anti-gravity device.").. |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
136 |
"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
137 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
138 |
-- do checkpoint stuff needed after game starts |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
139 |
if checkPointReached == 1 then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
140 |
AddAnim(dialog01) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
141 |
AddAmmo(hero.gear, amGasBomb, 5) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
142 |
AddAmmo(hero.gear, amRope, 2) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
143 |
-- Added for dev/debug purposes, remove before release |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
144 |
AddAmmo(hero.gear, amJetpack, 2) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
145 |
AddAmmo(guard1.gear, amDEagle, 2) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
146 |
AddAmmo(guard2.gear, amDEagle, 2) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
147 |
SpawnAmmoCrate(saucerX, saucerY, amJetpack) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
148 |
-- EVENT HANDLERS |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
149 |
AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
150 |
AddEvent(onHeroAtSaucerPosition, {hero.gear}, heroAtSaucerPosition, {hero.gear}, 0) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
151 |
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
|
152 |
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
|
153 |
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
|
154 |
AddAnim(dialog02) |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
155 |
elseif checkPointReached == 3 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
156 |
-- Hero near column, without space ship unnoticed |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
157 |
elseif checkPointReached == 4 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
158 |
-- Hero visited moon for fuels |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
159 |
AddAnim(dialog05) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
160 |
elseif checkPointReached == 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
161 |
-- Hero has visited a planet, he has plenty of fuels and can change planet |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
162 |
end |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
163 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
164 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
165 |
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
|
166 |
-- always check for landings |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
167 |
if GetCampaignVar("Planet") ~= "moon" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
168 |
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
|
169 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
170 |
if GetCampaignVar("Planet") ~= "desertPlanet" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
171 |
AddEvent(onDesertPlanetLanding, {hero.gear}, desertPlanetLanding, {hero.gear}, 0) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
172 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
173 |
if GetCampaignVar("Planet") ~= "fruitPlanet" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
174 |
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
|
175 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
176 |
if GetCampaignVar("Planet") ~= "icePlanet" then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
177 |
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
|
178 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
179 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
180 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
181 |
function onGameTick() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
182 |
-- 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
|
183 |
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
|
184 |
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
|
185 |
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
|
186 |
timeForGuard1ToTurnLeft = timeForGuard1ToTurn |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
187 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
188 |
timeForGuard1ToTurnLeft = timeForGuard1ToTurnLeft - 1 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
189 |
AnimUnWait() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
190 |
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
|
191 |
return |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
192 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
193 |
ExecuteAfterAnimations() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
194 |
CheckEvents() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
195 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
196 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
197 |
function onPrecise() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
198 |
if GameTime > 3000 then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
199 |
SetAnimSkip(true) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
200 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
201 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
202 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
203 |
function onAmmoStoreInit() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
204 |
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
|
205 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
206 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
207 |
function onNewTurn() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
208 |
if CurrentHedgehog == director.gear or CurrentHedgehog == doctor.gear then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
209 |
TurnTimeLeft = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
210 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
211 |
if guard1.keepTurning then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
212 |
AnimSwitchHog(hero.gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
213 |
TurnTimeLeft = -1 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
214 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
215 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
216 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
217 |
-------------- EVENTS ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
218 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
219 |
function onHeroBeforeTreePosition(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
220 |
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
|
221 |
return true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
222 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
223 |
return false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
224 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
225 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
226 |
function onHeroAtSaucerPosition(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
227 |
if GetHealth(hero.gear) and GetX(gear) >= saucerX-25 and GetX(gear) <= saucerX+32 and GetY(gear) >= saucerY-32 and GetY(gear) <= saucerY+32 then |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
228 |
saucerAcquired = true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
229 |
end |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
230 |
if saucerAcquired and GetHealth(hero.gear) and StoppedGear(gear) then |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
231 |
return true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
232 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
233 |
return false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
234 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
235 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
236 |
function onHeroOutOfGuardSight(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
237 |
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
|
238 |
return true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
239 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
240 |
return false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
241 |
end |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
242 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
243 |
-- TODO somehow make it to count fall damage |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
244 |
function onMoonLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
245 |
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
|
246 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
247 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
248 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
249 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
250 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
251 |
function onFruitPlanetLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
252 |
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
|
253 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
254 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
255 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
256 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
257 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
258 |
function onDesertPlanetLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
259 |
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
|
260 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
261 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
262 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
263 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
264 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
265 |
function onIcePlanetLanding(gear) |
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
266 |
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
|
267 |
return true |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
268 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
269 |
return false |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
270 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
271 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
272 |
function onNoFuelAtLand(gear) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
273 |
if GetHealth(hero.gear) and GetY(gear) > 1400 and GetAmmoCount(gear, amJetpack) == 0 and StoppedGear(gear) then |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
274 |
return true |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
275 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
276 |
return false |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
277 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
278 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
279 |
function onHeroDeath(gear) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
280 |
if not GetHealth(gear) then |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
281 |
return true |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
282 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
283 |
return false |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
284 |
end |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
285 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
286 |
-------------- OUTCOMES ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
287 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
288 |
function heroBeforeTreePosition(gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
289 |
AnimSay(gear,loc("Now I have to climb the trees"), SAY_SAY, 4000) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
290 |
AnimCaption(hero.gear, loc("Use the rope to get to the crate"), 4000) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
291 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
292 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
293 |
function heroAtSaucerPosition(gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
294 |
TurnTimeLeft = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
295 |
-- save check point |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
296 |
SaveCampaignVar("CosmosCheckPoint", "2") |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
297 |
AddAnim(dialog02) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
298 |
-- check if he was spotted by the guard |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
299 |
if guard1.turn then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
300 |
guard1.keepTurning = false |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
301 |
AddAnim(dialog03) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
302 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
303 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
304 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
305 |
function heroOutOfGuardSight(gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
306 |
guard1.keepTurning = true |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
307 |
AddAnim(dialog04) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
308 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
309 |
|
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
310 |
function moonLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
311 |
WriteLnToConsole("MOON LANDING, HOORAY!") |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
312 |
AnimCaption(hero.gear,loc("Welcome to the moon!")) |
9326
689f591aa226
added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9310
diff
changeset
|
313 |
if checkPointReached ~= 5 then |
689f591aa226
added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9310
diff
changeset
|
314 |
SaveCampaignVar("CosmosCheckPoint", "4") |
689f591aa226
added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9310
diff
changeset
|
315 |
SaveCampaignVar("HeroHealth",GetHealth(hero.gear)) |
689f591aa226
added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9310
diff
changeset
|
316 |
end |
689f591aa226
added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9310
diff
changeset
|
317 |
SaveCampaignVar("UnlockedMissions", "2") |
9310
1469147c110f
moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9308
diff
changeset
|
318 |
SaveCampaignVar("Mission1", "2") |
1469147c110f
moon01 stab and finally moon01 map
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9308
diff
changeset
|
319 |
SaveCampaignVar("Mission2", "1") |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
320 |
EndGame() |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
321 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
322 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
323 |
function fruitPlanetLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
324 |
if checkPointReached < 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
325 |
AddAnim(dialog06) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
326 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
327 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
328 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
329 |
function desertPlanetLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
330 |
if checkPointReached < 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
331 |
AddAnim(dialog06) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
332 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
333 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
334 |
|
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
335 |
function icePlanetLanding(gear) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
336 |
if checkPointReached < 5 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
337 |
AddAnim(dialog06) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
338 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
339 |
end |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
340 |
|
9328
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
341 |
function noFuelAtLand(gear) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
342 |
AddAnim(dialog06) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
343 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
344 |
|
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
345 |
function heroDeath(gear) |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
346 |
EndGame() |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
347 |
end |
811574013fed
more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9326
diff
changeset
|
348 |
|
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
349 |
-------------- ANIMATIONS ------------------ |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
350 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
351 |
function Skipanim(anim) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
352 |
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
|
353 |
ShowMission(unpack(goals[anim])) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
354 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
355 |
if CurrentHedgehog ~= hero.gear and anim ~= dialog03 then |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
356 |
AnimSwitchHog(hero.gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
357 |
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
|
358 |
startCombat() |
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
359 |
elseif anim == dialog05 or anim == dialog06 then |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
360 |
EndGame() |
9258
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
361 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
362 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
363 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
364 |
function AnimationSetup() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
365 |
-- DIALOG 01 - Start |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
366 |
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
|
367 |
table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
368 |
--table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2500}, skipFunc = Skipanim, skipArgs = dialog01}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
369 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near secret base 17 of PAoTH in the rural Hogland..."), 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
370 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("So Hog Solo, here we are..."), SAY_SAY, 2000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
371 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the East there is secret base 17"), SAY_SAY, 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
372 |
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
|
373 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
374 |
table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you"), SAY_SAY, 2600}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
375 |
table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with a rope and a sleep gas bomb"), SAY_SAY, 5000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
376 |
table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("You may find them handy"), SAY_SAY, 2300}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
377 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you Dr.Cornelius"), SAY_SAY, 1600}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
378 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I'll make good use of them"), SAY_SAY, 4500}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
379 |
table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("It would be wiser to steal the space ship while PAoTH guards are taking a brake!"), SAY_SAY, 7000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
380 |
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
|
381 |
table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
382 |
-- 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
|
383 |
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
|
384 |
table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
385 |
table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("CheckPoint reached!"), 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
386 |
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
|
387 |
table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
388 |
table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Now use it and go to the moon PAoTH station to get more fuels!"), SAY_SHOUT, 5000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
389 |
table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
390 |
-- DIALOG 03 - Hero got spotted by guard |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
391 |
AddSkipFunction(dialog03, Skipanim, {dialog03}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
392 |
table.insert(dialog03, {func = AnimWait, args = {guard1.gear, 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
393 |
table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to battle or flee!"), 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
394 |
table.insert(dialog03, {func = AnimSay, args = {guard1.gear, loc("Hey").." "..guard2.name.."! "..loc("Look, someone is stealing the saucer!"), SAY_SHOUT, 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
395 |
table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
396 |
table.insert(dialog03, {func = startCombat, args = {guard1.gear}}) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
397 |
-- 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
|
398 |
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
|
399 |
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
|
400 |
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
|
401 |
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
|
402 |
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
|
403 |
-- 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
|
404 |
AddSkipFunction(dialog05, Skipanim, {dialog05}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
405 |
table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuels!"), SAY_THINK, 6000}}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
406 |
table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Go to go back"), SAY_THINK, 2000}}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
407 |
table.insert(dialog05, {func = EndGame, args = {hero.gear}}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
408 |
-- 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
|
409 |
AddSkipFunction(dialog06, Skipanim, {dialog06}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
410 |
table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"), 5000}}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
411 |
table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm... Now I run out of fuels..."), SAY_THINK, 3000}}) |
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
412 |
table.insert(dialog06, {func = EndGame, 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
|
413 |
end |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
414 |
|
9266
199c1f066aad
added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9258
diff
changeset
|
415 |
------------------- 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
|
416 |
|
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
417 |
function startCombat() |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
418 |
-- use this so guard2 will gain control |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
419 |
AnimSwitchHog(hero.gear) |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
420 |
TurnTimeLeft = 0 |
5c760ed50b3d
first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
421 |
end |