author | sheepluva |
Fri, 06 Dec 2013 20:38:48 +0100 | |
changeset 9758 | 3b8058b251b8 |
parent 9642 | 8a691e0f117a |
child 9765 | 6cad4393a315 |
permissions | -rw-r--r-- |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
1 |
------------------- ABOUT ---------------------- |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
2 |
-- |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
3 |
-- In the desert planet Hero will have to explore |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
4 |
-- the dunes below the surface and find the hidden |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
5 |
-- crates. It is told that one crate contains the |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
6 |
-- lost part. |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
7 |
|
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
8 |
-- Idea: game will be successfully end when the 2 lower crates are collected |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
9 |
-- it would be more defficult (and sadistic) if one should collect *all* the crates |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
10 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
13 |
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
14 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
15 |
----------------- VARIABLES -------------------- |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
16 |
-- globals |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
17 |
local campaignName = loc("A Space Adventure") |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
18 |
local missionName = loc("Searching in the dust") |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
19 |
local heroIsInBattle = false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
20 |
local ongoingBattle = 0 |
9441 | 21 |
local cratesFound = 0 |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
22 |
local checkPointReached = 1 -- 1 is normal spawn |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
23 |
-- dialogs |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
24 |
local dialog01 = {} |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
25 |
-- mission objectives |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
26 |
local goals = { |
9758 | 27 |
[dialog01] = {missionName, loc("Getting ready"), loc("The device part is hidden in one of the crates! Go and get it!"), 1, 4500}, |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
28 |
} |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
29 |
-- crates |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
30 |
local btorch1Y = 60 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
31 |
local btorch1X = 2700 |
9441 | 32 |
local btorch2Y = 1900 |
33 |
local btorch2X = 2150 |
|
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
34 |
local btorch3Y = 980 |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
35 |
local btorch3X = 3260 |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
36 |
local rope1Y = 970 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
37 |
local rope1X = 3200 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
38 |
local rope2Y = 1900 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
39 |
local rope2X = 680 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
40 |
local rope3Y = 1850 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
41 |
local rope3X = 2460 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
42 |
local portalY = 480 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
43 |
local portalX = 1465 |
9441 | 44 |
local girderY = 1630 |
45 |
local girderX = 3350 |
|
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
46 |
-- hogs |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
47 |
local hero = {} |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
48 |
local ally = {} |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
49 |
local smuggler1 = {} |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
50 |
local smuggler2 = {} |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
51 |
local smuggler3 = {} |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
52 |
-- teams |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
53 |
local teamA = {} |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
54 |
local teamB = {} |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
55 |
local teamC = {} |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
56 |
-- hedgehogs values |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
57 |
hero.name = loc("Hog Solo") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
58 |
hero.x = 1740 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
59 |
hero.y = 40 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
60 |
hero.dead = false |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
61 |
ally.name = loc("Chief Sandologist") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
62 |
ally.x = 1660 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
63 |
ally.y = 40 |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
64 |
smuggler1.name = loc("Sandy") |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
65 |
smuggler1.x = 400 |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
66 |
smuggler1.y = 235 |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
67 |
smuggler2.name = loc("Spike") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
68 |
smuggler2.x = 736 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
69 |
smuggler2.y = 860 |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
70 |
smuggler3.name = loc("Sandstorm") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
71 |
smuggler3.x = 1940 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
72 |
smuggler3.y = 1625 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
73 |
teamA.name = loc("PAotH") |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
74 |
teamA.color = tonumber("FF0000",16) -- red |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
75 |
teamB.name = loc("Smugglers") |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
76 |
teamB.color = tonumber("0033FF",16) -- blues |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
77 |
teamC.name = loc("Hog Solo") |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
78 |
teamC.color = tonumber("38D61C",16) -- green |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
79 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
80 |
-------------- LuaAPI EVENT HANDLERS ------------------ |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
81 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
function onGameInit() |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
83 |
Seed = 1 |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
84 |
TurnTime = 20000 |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
85 |
CaseFreq = 0 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
86 |
MinesNum = 0 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
MinesTime = 1 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
88 |
Explosives = 0 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
89 |
Delay = 3 |
9418
6e0831e42e12
added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9416
diff
changeset
|
90 |
HealthCaseAmount = 30 |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
Map = "desert01_map" |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
92 |
Theme = "Desert" |
9758 | 93 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
94 |
-- get the check point |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
95 |
checkPointReached = initCheckpoint("desert01") |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
96 |
-- get hero health |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
97 |
local heroHealth = 100 |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
98 |
if checkPointReached > 1 and tonumber(GetCampaignVar("HeroHealth")) then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
99 |
heroHealth = tonumber(GetCampaignVar("HeroHealth")) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
100 |
end |
9758 | 101 |
|
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
102 |
-- Hog Solo |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
103 |
AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
104 |
hero.gear = AddHog(hero.name, 0, heroHealth, "war_desertgrenadier1") |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
105 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
106 |
HogTurnLeft(hero.gear, true) |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
107 |
-- PAotH undercover scientist and chief Sandologist |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
108 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy") |
9629 | 109 |
ally.gear = AddHog(ally.name, 0, 100, "Cowboy") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
110 |
AnimSetGearPosition(ally.gear, ally.x, ally.y) |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
111 |
-- Smugglers |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
112 |
AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy") |
9629 | 113 |
smuggler1.gear = AddHog(smuggler1.name, 1, 100, "hair_orange") |
9412
b4717f50846e
oops, hogs placing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9410
diff
changeset
|
114 |
AnimSetGearPosition(smuggler1.gear, smuggler1.x, smuggler1.y) |
9629 | 115 |
smuggler2.gear = AddHog(smuggler2.name, 1, 100, "lambda") |
9758 | 116 |
AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y) |
9629 | 117 |
smuggler3.gear = AddHog(smuggler3.name, 1, 100, "beefeater") |
9758 | 118 |
AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y) |
119 |
||
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
120 |
if checkPointReached == 1 then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
121 |
-- Start of the game |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
122 |
elseif checkPointReached == 2 then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
123 |
AnimSetGearPosition(hero.gear, 1050, 615) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
124 |
HogTurnLeft(hero.gear, true) |
9432 | 125 |
elseif checkPointReached == 3 then |
126 |
AnimSetGearPosition(hero.gear, 1680, 920) |
|
127 |
HogTurnLeft(hero.gear, true) |
|
9434 | 128 |
elseif checkPointReached == 4 then |
129 |
AnimSetGearPosition(hero.gear, 1160, 1180) |
|
9443 | 130 |
elseif checkPointReached == 5 then |
9447 | 131 |
AnimSetGearPosition(hero.gear, girderX+40, girderY-30) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
132 |
end |
9758 | 133 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
134 |
AnimInit() |
9758 | 135 |
AnimationSetup() |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
136 |
end |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
137 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
138 |
function onGameStart() |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
139 |
AnimWait(hero.gear, 3000) |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
140 |
FollowGear(hero.gear) |
9758 | 141 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
142 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
143 |
AddEvent(onHeroAtFirstBattle, {hero.gear}, heroAtFirstBattle, {hero.gear}, 1) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
144 |
AddEvent(onHeroFleeFirstBattle, {hero.gear}, heroFleeFirstBattle, {hero.gear}, 1) |
9434 | 145 |
AddEvent(onHeroAtCheckpoint4, {hero.gear}, heroAtCheckpoint4, {hero.gear}, 0) |
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
146 |
AddEvent(onHeroAtThirdBattle, {hero.gear}, heroAtThirdBattle, {hero.gear}, 0) |
9441 | 147 |
AddEvent(onCheckForWin1, {hero.gear}, checkForWin1, {hero.gear}, 0) |
148 |
AddEvent(onCheckForWin2, {hero.gear}, checkForWin2, {hero.gear}, 0) |
|
9758 | 149 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
150 |
-- smugglers ammo |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
151 |
AddAmmo(smuggler1.gear, amBazooka, 2) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
152 |
AddAmmo(smuggler1.gear, amGrenade, 2) |
9758 | 153 |
AddAmmo(smuggler1.gear, amDEagle, 2) |
9441 | 154 |
AddAmmo(smuggler3.gear, amRope, 2) |
9758 | 155 |
|
9632
9dd1c36d8b54
final mission map and most logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9630
diff
changeset
|
156 |
-- spawn crates |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
157 |
SpawnAmmoCrate(btorch2X, btorch2Y, amBlowTorch) |
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
158 |
SpawnAmmoCrate(btorch3X, btorch3Y, amBlowTorch) |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
159 |
SpawnAmmoCrate(rope1X, rope1Y, amRope) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
160 |
SpawnAmmoCrate(rope2X, rope2Y, amRope) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
161 |
SpawnAmmoCrate(rope3X, rope3Y, amRope) |
9758 | 162 |
SpawnAmmoCrate(portalX, portalY, amPortalGun) |
9441 | 163 |
SpawnAmmoCrate(girderX, girderY, amGirder) |
9758 | 164 |
|
9418
6e0831e42e12
added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9416
diff
changeset
|
165 |
SpawnHealthCrate(3300, 970) |
9758 | 166 |
|
9420 | 167 |
-- adding mines - BOOM! |
168 |
AddGear(1280, 460, gtMine, 0, 0, 0, 0) |
|
169 |
AddGear(270, 460, gtMine, 0, 0, 0, 0) |
|
170 |
AddGear(3460, 60, gtMine, 0, 0, 0, 0) |
|
171 |
AddGear(3500, 240, gtMine, 0, 0, 0, 0) |
|
172 |
AddGear(3410, 670, gtMine, 0, 0, 0, 0) |
|
173 |
AddGear(3450, 720, gtMine, 0, 0, 0, 0) |
|
9758 | 174 |
|
9420 | 175 |
local x = 800 |
9432 | 176 |
while x < 1630 do |
9420 | 177 |
AddGear(x, 900, gtMine, 0, 0, 0, 0) |
178 |
x = x + math.random(8,20) |
|
179 |
end |
|
180 |
x = 1890 |
|
181 |
while x < 2988 do |
|
182 |
AddGear(x, 760, gtMine, 0, 0, 0, 0) |
|
183 |
x = x + math.random(8,20) |
|
184 |
end |
|
9441 | 185 |
x = 2500 |
9420 | 186 |
while x < 3300 do |
187 |
AddGear(x, 1450, gtMine, 0, 0, 0, 0) |
|
188 |
x = x + math.random(8,20) |
|
189 |
end |
|
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
190 |
x = 1570 |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
191 |
while x < 2900 do |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
192 |
AddGear(x, 470, gtMine, 0, 0, 0, 0) |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
193 |
x = x + math.random(8,20) |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
194 |
end |
9758 | 195 |
|
196 |
if checkPointReached == 1 then |
|
9434 | 197 |
AddEvent(onHeroAtCheckpoint2, {hero.gear}, heroAtCheckpoint2, {hero.gear}, 0) |
198 |
AddEvent(onHeroAtCheckpoint3, {hero.gear}, heroAtCheckpoint3, {hero.gear}, 0) |
|
9449
435ba2dd5508
changing when some crates are spawned
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9447
diff
changeset
|
199 |
-- crates |
435ba2dd5508
changing when some crates are spawned
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9447
diff
changeset
|
200 |
SpawnAmmoCrate(btorch1X, btorch1Y, amBlowTorch) |
435ba2dd5508
changing when some crates are spawned
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9447
diff
changeset
|
201 |
SpawnHealthCrate(680, 460) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
202 |
-- hero ammo |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
203 |
AddAmmo(hero.gear, amRope, 2) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
204 |
AddAmmo(hero.gear, amBazooka, 3) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
205 |
AddAmmo(hero.gear, amParachute, 1) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
206 |
AddAmmo(hero.gear, amGrenade, 6) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
207 |
AddAmmo(hero.gear, amDEagle, 4) |
9630 | 208 |
AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1))) |
9758 | 209 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
210 |
AddAnim(dialog01) |
9432 | 211 |
elseif checkPointReached == 2 or checkPointReached == 3 then |
9758 | 212 |
ShowMission(campaignName, missionName, loc("The device part is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
9436 | 213 |
loadHeroAmmo() |
9758 | 214 |
|
9432 | 215 |
secondBattle() |
9443 | 216 |
elseif checkPointReached == 4 or checkPointReached == 5 then |
9758 | 217 |
ShowMission(campaignName, missionName, loc("The part device is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
9436 | 218 |
loadHeroAmmo() |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
219 |
end |
9758 | 220 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
221 |
SendHealthStatsOff() |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
222 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
223 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
224 |
function onNewTurn() |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
225 |
if CurrentHedgehog ~= hero.gear and not heroIsInBattle then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
226 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
227 |
elseif CurrentHedgehog == hero.gear and not heroIsInBattle then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
228 |
TurnTimeLeft = -1 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
229 |
elseif (CurrentHedgehog == smuggler2.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 1 then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
230 |
AnimSwitchHog(hero.gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
231 |
TurnTimeLeft = 0 |
9430 | 232 |
elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then |
233 |
AnimSwitchHog(hero.gear) |
|
234 |
TurnTimeLeft = 0 |
|
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
235 |
elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler2.gear) and ongoingBattle == 3 then |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
236 |
AnimSwitchHog(hero.gear) |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
237 |
TurnTimeLeft = 0 |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
238 |
elseif CurrentHedgehog == ally.gear then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
239 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
240 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
241 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
242 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
243 |
function onGameTick() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
244 |
AnimUnWait() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
245 |
if ShowAnimation() == false then |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
246 |
return |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
247 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
248 |
ExecuteAfterAnimations() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
249 |
CheckEvents() |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
250 |
end |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
251 |
|
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
252 |
function onAmmoStoreInit() |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
253 |
SetAmmo(amBlowTorch, 0, 0, 0, 1) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
254 |
SetAmmo(amRope, 0, 0, 0, 1) |
9758 | 255 |
SetAmmo(amPortalGun, 0, 0, 0, 1) |
9441 | 256 |
SetAmmo(amGirder, 0, 0, 0, 3) |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
257 |
end |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
258 |
|
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
259 |
function onGearDelete(gear) |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
260 |
if gear == hero.gear then |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
261 |
hero.dead = true |
9430 | 262 |
elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then |
263 |
heroIsInBattle = false |
|
264 |
ongoingBattle = 0 |
|
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
265 |
end |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
266 |
end |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
267 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
268 |
function onPrecise() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
269 |
if GameTime > 3000 then |
9758 | 270 |
SetAnimSkip(true) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
271 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
272 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
273 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
274 |
-------------- EVENTS ------------------ |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
275 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
276 |
function onHeroDeath(gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
277 |
if hero.dead then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
278 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
279 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
280 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
281 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
282 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
283 |
function onHeroAtFirstBattle(gear) |
9758 | 284 |
if not hero.dead and not heroIsInBattle and GetHealth(smuggler1.gear) and GetX(hero.gear) <= 1450 |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
285 |
and GetY(hero.gear) <= GetY(smuggler1.gear)+5 and GetY(hero.gear) >= GetY(smuggler1.gear)-5 then |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
286 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
287 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
288 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
289 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
290 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
291 |
function onHeroFleeFirstBattle(gear) |
9758 | 292 |
if not hero.dead and GetHealth(smuggler1.gear) and heroIsInBattle and ongoingBattle == 1 and (GetX(hero.gear) > 1450 |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
293 |
or (GetY(hero.gear) < GetY(smuggler1.gear)-80 or GetY(hero.gear) > smuggler1.y+300)) then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
294 |
return true |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
295 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
296 |
return false |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
297 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
298 |
|
9430 | 299 |
-- saves the location of the hero and prompts him for the second battle |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
300 |
function onHeroAtCheckpoint2(gear) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
301 |
if not hero.dead and GetX(hero.gear) > 1000 and GetX(hero.gear) < 1100 |
9432 | 302 |
and GetY(hero.gear) > 590 and GetY(hero.gear) < 700 then |
303 |
return true |
|
304 |
end |
|
305 |
return false |
|
306 |
end |
|
307 |
||
308 |
function onHeroAtCheckpoint3(gear) |
|
309 |
if not hero.dead and GetX(hero.gear) > 1610 and GetX(hero.gear) < 1680 |
|
310 |
and GetY(hero.gear) > 850 and GetY(hero.gear) < 1000 then |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
311 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
312 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
313 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
314 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
315 |
|
9434 | 316 |
function onHeroAtCheckpoint4(gear) |
317 |
if not hero.dead and GetX(hero.gear) > 1110 and GetX(hero.gear) < 1300 |
|
318 |
and GetY(hero.gear) > 1100 and GetY(hero.gear) < 1220 then |
|
319 |
return true |
|
320 |
end |
|
321 |
return false |
|
322 |
end |
|
323 |
||
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
324 |
function onHeroAtThirdBattle(gear) |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
325 |
if not hero.dead and GetX(hero.gear) > 2000 and GetX(hero.gear) < 2200 |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
326 |
and GetY(hero.gear) > 1430 and GetY(hero.gear) < 1670 then |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
327 |
return true |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
328 |
end |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
329 |
return false |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
330 |
end |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
331 |
|
9441 | 332 |
function onCheckForWin1(gear) |
333 |
if not hero.dead and GetX(hero.gear) > btorch2X-30 and GetX(hero.gear) < btorch2X+30 |
|
334 |
and GetY(hero.gear) > btorch2Y-30 and GetY(hero.gear) < btorch2Y+30 then |
|
335 |
return true |
|
336 |
end |
|
337 |
return false |
|
338 |
end |
|
339 |
||
340 |
function onCheckForWin2(gear) |
|
341 |
if not hero.dead and GetX(hero.gear) > girderX-30 and GetX(hero.gear) < girderX+30 |
|
342 |
and GetY(hero.gear) > girderY-30 and GetY(hero.gear) < girderY+30 then |
|
343 |
return true |
|
344 |
end |
|
345 |
return false |
|
346 |
end |
|
347 |
||
9639
6b2ae2eaf1b2
remove unnecessary comments
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9632
diff
changeset
|
348 |
-------------- ACTIONS ------------------ |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
349 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
350 |
function heroDeath(gear) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
351 |
SendStat(siGameResult, loc("Hog Solo lost, try again!")) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
352 |
SendStat(siCustomAchievement, loc("To win the game you have to find the right crate")) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
353 |
SendStat(siCustomAchievement, loc("You can avoid some battles")) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
354 |
SendStat(siCustomAchievement, loc("Use your ammo wisely")) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
355 |
SendStat(siPlayerKills,'1',teamB.name) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
356 |
SendStat(siPlayerKills,'0',teamC.name) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
357 |
EndGame() |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
358 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
359 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
360 |
function heroAtFirstBattle(gear) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
361 |
AnimCaption(hero.gear, loc("A smuggler! Prepare for battle"), 5000) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
362 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
363 |
heroIsInBattle = true |
9758 | 364 |
ongoingBattle = 1 |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
365 |
AnimSwitchHog(smuggler1.gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
366 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
367 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
368 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
369 |
function heroFleeFirstBattle(gear) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
370 |
AnimSay(smuggler1.gear, loc("Run away you coward!"), SAY_SHOUT, 4000) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
371 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
372 |
heroIsInBattle = false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
373 |
ongoingBattle = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
374 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
375 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
376 |
function heroAtCheckpoint2(gear) |
9621
0e633b929825
should fix deadlock checkpoint reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9620
diff
changeset
|
377 |
if GetAmmoCount(hero.gear, amRope) > 0 or GetAmmoCount(hero.gear, amParachute) > 0 then |
0e633b929825
should fix deadlock checkpoint reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9620
diff
changeset
|
378 |
saveCheckPointLocal("2") |
0e633b929825
should fix deadlock checkpoint reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9620
diff
changeset
|
379 |
end |
9476
3ca7160dc6d2
fix bug, not triggered event
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9474
diff
changeset
|
380 |
secondBattle() |
9432 | 381 |
end |
382 |
||
383 |
function heroAtCheckpoint3(gear) |
|
9621
0e633b929825
should fix deadlock checkpoint reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9620
diff
changeset
|
384 |
if GetAmmoCount(hero.gear, amRope) > 0 then |
0e633b929825
should fix deadlock checkpoint reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9620
diff
changeset
|
385 |
saveCheckPointLocal("3") |
0e633b929825
should fix deadlock checkpoint reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9620
diff
changeset
|
386 |
end |
9476
3ca7160dc6d2
fix bug, not triggered event
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9474
diff
changeset
|
387 |
secondBattle() |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
388 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
389 |
|
9434 | 390 |
function heroAtCheckpoint4(gear) |
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
391 |
saveCheckPointLocal("4") |
9434 | 392 |
end |
393 |
||
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
394 |
function heroAtThirdBattle(gear) |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
395 |
heroIsInBattle = true |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
396 |
ongoingBattle = 3 |
9758 | 397 |
AnimSay(smuggler3.gear, loc("Who's there?! I'll get you..."), SAY_SHOUT, 5000) |
9438
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
398 |
AnimSwitchHog(smuggler3.gear) |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
399 |
TurnTimeLeft = 0 |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
400 |
end |
77dde6234fec
3rd battle event handler
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9436
diff
changeset
|
401 |
|
9443 | 402 |
-- for some weird reson I couldn't call the same action for both events |
9441 | 403 |
function checkForWin1(gear) |
404 |
checkForWin() |
|
405 |
end |
|
406 |
||
407 |
function checkForWin2(gear) |
|
9443 | 408 |
-- ok lets place one more checkpoint as next part seems challenging without rope |
409 |
if cratesFound == 0 then |
|
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
410 |
saveCheckPointLocal("5") |
9443 | 411 |
end |
9758 | 412 |
|
413 |
checkForWin() |
|
9441 | 414 |
end |
415 |
||
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
416 |
-------------- ANIMATIONS ------------------ |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
417 |
|
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
418 |
function Skipanim(anim) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
419 |
if goals[anim] ~= nil then |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
420 |
ShowMission(unpack(goals[anim])) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
421 |
end |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
422 |
AnimSwitchHog(hero.gear) |
9620
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
423 |
if anim == dialog01 then |
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
424 |
startMission() |
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
425 |
end |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
426 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
427 |
|
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
428 |
function AnimationSetup() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
429 |
-- DIALOG 01 - Start, getting info about the device |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
430 |
AddSkipFunction(dialog01, Skipanim, {dialog01}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
431 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
432 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Planet of Sand, you have to double check your moves..."), 5000}}) |
9758 | 433 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finally you are here..."), SAY_SAY, 2000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
434 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}}) |
9758 | 435 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me on such a short notice!"), SAY_SAY, 3000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
436 |
table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
437 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for H!"), SAY_SAY, 4000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
438 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now listen carefully! Below us there are tunnels that have been created naturally over the years"), SAY_SAY, 4000}}) |
9758 | 439 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("I have heard that the local tribes say that many years ago some PAotH scientists were dumping their waste here"), SAY_SAY, 5000}}) |
440 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("H confirmed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}}) |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
441 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}}) |
9574
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
442 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware though! Many smugglers come often to explore these tunnels and scavage whatever valuable items they can find"), SAY_SAY, 5000}}) |
da3d39667881
strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
443 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to rob you!"), SAY_SAY, 4000}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
444 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
445 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
446 |
table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
447 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
448 |
table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}}) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
449 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
9758 | 450 |
table.insert(dialog01, {func = startMission, args = {hero.gear}}) |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
451 |
end |
9432 | 452 |
|
453 |
--------------- OTHER FUNCTIONS ------------------ |
|
454 |
||
9474
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
455 |
function startMission() |
9620
55c82fd210cb
fixed lua error reported by Wuzzy
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9582
diff
changeset
|
456 |
AnimSwitchHog(ally.gear) |
9474
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
457 |
TurnTimeLeft = 0 |
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
458 |
end |
c255f6c46e33
stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9453
diff
changeset
|
459 |
|
9432 | 460 |
function secondBattle() |
461 |
-- second battle |
|
462 |
heroIsInBattle = true |
|
463 |
ongoingBattle = 2 |
|
9758 | 464 |
AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice..."), SAY_THINK, 5000) |
9432 | 465 |
AnimSwitchHog(smuggler2.gear) |
466 |
TurnTimeLeft = 0 |
|
467 |
end |
|
9434 | 468 |
|
9582
bf314b2258b3
less variables used to save the checkpoints - potential breakage xD
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9578
diff
changeset
|
469 |
function saveCheckPointLocal(cpoint) |
9436 | 470 |
-- save checkpoint |
9758 | 471 |
saveCheckpoint(cpoint) |
9436 | 472 |
SaveCampaignVar("HeroHealth", GetHealth(hero.gear)) |
9630 | 473 |
-- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal - rcplane |
9436 | 474 |
SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade).. |
475 |
GetAmmoCount(hero.gear, amRope)..GetAmmoCount(hero.gear, amParachute)..GetAmmoCount(hero.gear, amDEagle).. |
|
9630 | 476 |
GetAmmoCount(hero.gear, amBlowTorch)..GetAmmoCount(hero.gear, amConstruction).. |
477 |
GetAmmoCount(hero.gear, amPortalGun)..GetAmmoCount(hero.gear, amRCPlane)) |
|
9436 | 478 |
AnimCaption(hero.gear, loc("Checkpoint reached!"), 5000) |
479 |
end |
|
9434 | 480 |
|
9436 | 481 |
function loadHeroAmmo() |
482 |
-- hero ammo |
|
483 |
local ammo = GetCampaignVar("HeroAmmo") |
|
484 |
AddAmmo(hero.gear, amRope, tonumber(ammo:sub(3,3))) |
|
485 |
AddAmmo(hero.gear, amBazooka, tonumber(ammo:sub(1,1))) |
|
486 |
AddAmmo(hero.gear, amParachute, tonumber(ammo:sub(4,4))) |
|
487 |
AddAmmo(hero.gear, amGrenade, tonumber(ammo:sub(2,2))) |
|
488 |
AddAmmo(hero.gear, amDEagle, tonumber(ammo:sub(5,5))) |
|
489 |
AddAmmo(hero.gear, amBlowTorch, tonumber(ammo:sub(6,6))) |
|
490 |
-- weird, if 0 bazooka isn't displayed in the weapons menu |
|
491 |
if tonumber(ammo:sub(7,7)) > 0 then |
|
492 |
AddAmmo(hero.gear, amConstruction, tonumber(ammo:sub(7,7))) |
|
493 |
end |
|
494 |
AddAmmo(hero.gear, amPortalGun, tonumber(ammo:sub(8,8))) |
|
9630 | 495 |
AddAmmo(hero.gear, amRCPlane, tonumber(ammo:sub(9,9))) |
9434 | 496 |
end |
9441 | 497 |
|
498 |
function checkForWin() |
|
499 |
if cratesFound == 0 then |
|
9758 | 500 |
-- have to look more |
9441 | 501 |
AnimSay(hero.gear, loc("Haven't found it yet..."), SAY_THINK, 5000) |
502 |
cratesFound = cratesFound + 1 |
|
503 |
elseif cratesFound == 1 then |
|
504 |
-- end game |
|
9578
16139270448f
save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9574
diff
changeset
|
505 |
saveCompletedStatus(5) |
9441 | 506 |
AnimSay(hero.gear, loc("Hoo Ray!!!"), SAY_SHOUT, 5000) |
9642
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
507 |
SendStat(siGameResult, loc("Congratulations, you won!")) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
508 |
SendStat(siCustomAchievement, loc("To win the game you had to collect the 2 crates with no specific order")) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
509 |
SendStat(siPlayerKills,'1',teamC.name) |
8a691e0f117a
use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9639
diff
changeset
|
510 |
SendStat(siPlayerKills,'0',teamB.name) |
9441 | 511 |
EndGame() |
512 |
end |
|
513 |
end |