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