author | Periklis Ntanasis <pntanasis@gmail.com> |
Thu, 01 Aug 2013 19:50:01 +0300 | |
branch | spacecampaign |
changeset 9436 | 07fe70ba7dcd |
parent 9434 | b472a2f7b65b |
child 9438 | 77dde6234fec |
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.. |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
10 |
-- in this map I have to track the weapons the player has in checkpoints |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
11 |
-- GENERAL NOTE: change hats :D |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
13 |
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
|
14 |
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
|
15 |
|
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
16 |
----------------- VARIABLES -------------------- |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
17 |
-- globals |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
18 |
local campaignName = loc("A Space Adventure") |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
19 |
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
|
20 |
local heroIsInBattle = false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
21 |
local ongoingBattle = 0 |
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 = { |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
27 |
[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
|
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 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
32 |
local btorch2Y = 1800 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
33 |
local btorch2X = 1010 |
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 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
44 |
local constructY = 1630 |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
45 |
local constructX = 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 |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
57 |
hero.name = "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 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
61 |
ally.name = "Chief Sandologist" |
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 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
64 |
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
|
65 |
smuggler1.x = 400 |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
66 |
smuggler1.y = 235 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
67 |
smuggler2.name = "Spike" |
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 |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
70 |
smuggler3.name = "Sandstorm" |
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" |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
93 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
94 |
-- get the check point |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
95 |
if tonumber(GetCampaignVar("Desert01CheckPoint")) then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
96 |
checkPointReached = tonumber(GetCampaignVar("Desert01CheckPoint")) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
97 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
98 |
-- get hero health |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
99 |
local heroHealth = 100 |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
100 |
if checkPointReached > 1 and tonumber(GetCampaignVar("HeroHealth")) then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
101 |
heroHealth = tonumber(GetCampaignVar("HeroHealth")) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
102 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
103 |
|
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
104 |
-- Hog Solo |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
105 |
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
|
106 |
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
|
107 |
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
|
108 |
HogTurnLeft(hero.gear, true) |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
109 |
-- PAotH undercover scientist and chief Sandologist |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
110 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy") |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
111 |
ally.gear = AddHog(ally.name, 0, 100, "war_desertgrenadier1") |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
112 |
AnimSetGearPosition(ally.gear, ally.x, ally.y) |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
113 |
-- Smugglers |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
114 |
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
|
115 |
smuggler1.gear = AddHog(smuggler1.name, 1, 100, "tophats") |
9412
b4717f50846e
oops, hogs placing corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9410
diff
changeset
|
116 |
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
|
117 |
smuggler2.gear = AddHog(smuggler2.name, 1, 100, "tophats") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
118 |
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
|
119 |
smuggler3.gear = AddHog(smuggler3.name, 1, 100, "tophats") |
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
120 |
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
|
121 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
122 |
if checkPointReached == 1 then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
123 |
-- Start of the game |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
124 |
elseif checkPointReached == 2 then |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
125 |
AnimSetGearPosition(hero.gear, 1050, 615) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
126 |
HogTurnLeft(hero.gear, true) |
9432 | 127 |
elseif checkPointReached == 3 then |
128 |
AnimSetGearPosition(hero.gear, 1680, 920) |
|
129 |
HogTurnLeft(hero.gear, true) |
|
9434 | 130 |
elseif checkPointReached == 4 then |
131 |
AnimSetGearPosition(hero.gear, 1160, 1180) |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
132 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
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() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
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) |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
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) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
146 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
147 |
-- smugglers ammo |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
148 |
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
|
149 |
AddAmmo(smuggler1.gear, amGrenade, 2) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
150 |
AddAmmo(smuggler1.gear, amDEagle, 2) |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
151 |
|
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
152 |
-- spawn crates |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
153 |
SpawnAmmoCrate(btorch1X, btorch1Y, amBlowTorch) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
154 |
SpawnAmmoCrate(btorch2X, btorch2Y, amBlowTorch) |
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
155 |
SpawnAmmoCrate(btorch3X, btorch3Y, amBlowTorch) |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
156 |
SpawnAmmoCrate(rope1X, rope1Y, amRope) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
157 |
SpawnAmmoCrate(rope2X, rope2Y, amRope) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
158 |
SpawnAmmoCrate(rope3X, rope3Y, amRope) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
159 |
SpawnAmmoCrate(portalX, portalY, amPortalGun) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
160 |
SpawnAmmoCrate(constructX, constructY, amConstruction) |
9418
6e0831e42e12
added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9416
diff
changeset
|
161 |
|
6e0831e42e12
added health crate
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9416
diff
changeset
|
162 |
SpawnHealthCrate(3300, 970) |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
163 |
SpawnHealthCrate(680, 460) |
9420 | 164 |
|
165 |
-- adding mines - BOOM! |
|
166 |
AddGear(1280, 460, gtMine, 0, 0, 0, 0) |
|
167 |
AddGear(270, 460, gtMine, 0, 0, 0, 0) |
|
168 |
AddGear(3460, 60, gtMine, 0, 0, 0, 0) |
|
169 |
AddGear(3500, 240, gtMine, 0, 0, 0, 0) |
|
170 |
AddGear(3410, 670, gtMine, 0, 0, 0, 0) |
|
171 |
AddGear(3450, 720, gtMine, 0, 0, 0, 0) |
|
172 |
||
173 |
local x = 800 |
|
9432 | 174 |
while x < 1630 do |
9420 | 175 |
AddGear(x, 900, gtMine, 0, 0, 0, 0) |
176 |
x = x + math.random(8,20) |
|
177 |
end |
|
178 |
x = 1890 |
|
179 |
while x < 2988 do |
|
180 |
AddGear(x, 760, gtMine, 0, 0, 0, 0) |
|
181 |
x = x + math.random(8,20) |
|
182 |
end |
|
183 |
x = 2480 |
|
184 |
while x < 3300 do |
|
185 |
AddGear(x, 1450, gtMine, 0, 0, 0, 0) |
|
186 |
x = x + math.random(8,20) |
|
187 |
end |
|
9424
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
188 |
x = 1570 |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
189 |
while x < 2900 do |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
190 |
AddGear(x, 470, gtMine, 0, 0, 0, 0) |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
191 |
x = x + math.random(8,20) |
9a150b7862e9
hooray! more crates and mines
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9422
diff
changeset
|
192 |
end |
9420 | 193 |
|
9434 | 194 |
if checkPointReached == 1 then |
195 |
AddEvent(onHeroAtCheckpoint2, {hero.gear}, heroAtCheckpoint2, {hero.gear}, 0) |
|
196 |
AddEvent(onHeroAtCheckpoint3, {hero.gear}, heroAtCheckpoint3, {hero.gear}, 0) |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
197 |
-- hero ammo |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
198 |
AddAmmo(hero.gear, amRope, 2) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
199 |
AddAmmo(hero.gear, amBazooka, 3) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
200 |
AddAmmo(hero.gear, amParachute, 1) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
201 |
AddAmmo(hero.gear, amGrenade, 6) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
202 |
AddAmmo(hero.gear, amDEagle, 4) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
203 |
|
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
204 |
AddAnim(dialog01) |
9432 | 205 |
elseif checkPointReached == 2 or checkPointReached == 3 then |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
206 |
ShowMission(campaignName, missionName, loc("The part is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
9436 | 207 |
loadHeroAmmo() |
9430 | 208 |
|
9432 | 209 |
secondBattle() |
9434 | 210 |
elseif checkPointReached == 4 then |
211 |
ShowMission(campaignName, missionName, loc("The part is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
|
9436 | 212 |
loadHeroAmmo() |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
213 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
214 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
215 |
SendHealthStatsOff() |
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
216 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
217 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
218 |
function onNewTurn() |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
219 |
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
|
220 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
221 |
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
|
222 |
TurnTimeLeft = -1 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
223 |
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
|
224 |
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
|
225 |
TurnTimeLeft = 0 |
9430 | 226 |
elseif (CurrentHedgehog == smuggler1.gear or CurrentHedgehog == smuggler3.gear) and ongoingBattle == 2 then |
227 |
AnimSwitchHog(hero.gear) |
|
228 |
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
|
229 |
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
|
230 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
231 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
232 |
WriteLnToConsole("CURRENT HEDGEHOG IS "..CurrentHedgehog) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
233 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
234 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
235 |
function onGameTick() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
236 |
AnimUnWait() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
237 |
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
|
238 |
return |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
239 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
240 |
ExecuteAfterAnimations() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
241 |
CheckEvents() |
9416
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
242 |
end |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
243 |
|
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
244 |
function onAmmoStoreInit() |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
245 |
SetAmmo(amBlowTorch, 0, 0, 0, 1) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
246 |
SetAmmo(amRope, 0, 0, 0, 1) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
247 |
SetAmmo(amPortalGun, 0, 0, 0, 1) |
8d0054adf0c6
added weapon crates
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9412
diff
changeset
|
248 |
SetAmmo(amConstruction, 0, 0, 0, 1) |
9404
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
249 |
end |
4ae9b399fa73
desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
250 |
|
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
251 |
function onGearDelete(gear) |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
252 |
if gear == hero.gear then |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
253 |
hero.dead = true |
9430 | 254 |
elseif (gear == smuggler1.gear or gear == smuggler2.gear or gear == smuggler3.gear) and heroIsInBattle then |
255 |
heroIsInBattle = false |
|
256 |
ongoingBattle = 0 |
|
9410
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
257 |
end |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
258 |
end |
92a0b74ed740
added hedgehogs in desert01
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9408
diff
changeset
|
259 |
|
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
260 |
function onPrecise() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
261 |
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
|
262 |
SetAnimSkip(true) |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
263 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
264 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
265 |
|
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
266 |
-------------- EVENTS ------------------ |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
267 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
268 |
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
|
269 |
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
|
270 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
271 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
272 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
273 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
274 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
275 |
function onHeroAtFirstBattle(gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
276 |
if not hero.dead and not heroIsInBattle and GetX(hero.gear) <= 1450 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
277 |
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
|
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 onHeroFleeFirstBattle(gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
284 |
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
|
285 |
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
|
286 |
return true |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
287 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
288 |
return false |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
289 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
290 |
|
9430 | 291 |
-- 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
|
292 |
function onHeroAtCheckpoint2(gear) |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
293 |
if not hero.dead and GetX(hero.gear) > 1000 and GetX(hero.gear) < 1100 |
9432 | 294 |
and GetY(hero.gear) > 590 and GetY(hero.gear) < 700 then |
295 |
return true |
|
296 |
end |
|
297 |
return false |
|
298 |
end |
|
299 |
||
300 |
function onHeroAtCheckpoint3(gear) |
|
301 |
if not hero.dead and GetX(hero.gear) > 1610 and GetX(hero.gear) < 1680 |
|
302 |
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
|
303 |
return true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
304 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
305 |
return false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
306 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
307 |
|
9434 | 308 |
function onHeroAtCheckpoint4(gear) |
309 |
if not hero.dead and GetX(hero.gear) > 1110 and GetX(hero.gear) < 1300 |
|
310 |
and GetY(hero.gear) > 1100 and GetY(hero.gear) < 1220 then |
|
311 |
return true |
|
312 |
end |
|
313 |
return false |
|
314 |
end |
|
315 |
||
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
316 |
-------------- OUTCOMES ------------------ |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
317 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
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
|
322 |
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
|
323 |
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
|
324 |
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
|
325 |
EndGame() |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
326 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
327 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
328 |
function heroAtFirstBattle(gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
329 |
WriteLnToConsole("**HERO AT FIRST BATTLE") |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
330 |
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
|
331 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
332 |
heroIsInBattle = true |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
333 |
ongoingBattle = 1 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
334 |
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
|
335 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
336 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
337 |
|
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
338 |
function heroFleeFirstBattle(gear) |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
339 |
WriteLnToConsole("++HERO FLEE FIRST BATTLE") |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
340 |
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
|
341 |
TurnTimeLeft = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
342 |
heroIsInBattle = false |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
343 |
ongoingBattle = 0 |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
344 |
end |
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
345 |
|
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
346 |
function heroAtCheckpoint2(gear) |
9436 | 347 |
saveCheckPoint("2") |
9432 | 348 |
end |
349 |
||
350 |
function heroAtCheckpoint3(gear) |
|
9436 | 351 |
saveCheckPoint("3") |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
352 |
end |
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
353 |
|
9434 | 354 |
function heroAtCheckpoint4(gear) |
9436 | 355 |
saveCheckPoint("4") |
9434 | 356 |
end |
357 |
||
9422
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
358 |
-------------- ANIMATIONS ------------------ |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
359 |
|
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
360 |
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
|
361 |
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
|
362 |
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
|
363 |
end |
9426
f89c512925da
first battle event handlers, hero starting ammo and hero death event handlers
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9424
diff
changeset
|
364 |
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
|
365 |
end |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
366 |
|
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
367 |
function AnimationSetup() |
85b17f344c97
first dialog added, maybe reconsider the seconds the bubbles are displayed later
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9420
diff
changeset
|
368 |
-- 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
|
369 |
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
|
370 |
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
|
371 |
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
|
372 |
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
|
373 |
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
|
374 |
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
|
375 |
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
|
376 |
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
|
377 |
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
|
378 |
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
|
379 |
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
|
380 |
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
|
381 |
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
|
382 |
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
|
383 |
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
|
384 |
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
|
385 |
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
|
386 |
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
|
387 |
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
|
388 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
9428
b483a2683d08
first checkpoint with saved ammo left :)
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9426
diff
changeset
|
389 |
table.insert(dialog01, {func = AnimSwitchHog, 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
|
390 |
end |
9432 | 391 |
|
392 |
--------------- OTHER FUNCTIONS ------------------ |
|
393 |
||
394 |
function secondBattle() |
|
395 |
-- second battle |
|
396 |
heroIsInBattle = true |
|
397 |
ongoingBattle = 2 |
|
398 |
AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice..."), SAY_THINK, 5000) |
|
399 |
AnimSwitchHog(smuggler2.gear) |
|
400 |
TurnTimeLeft = 0 |
|
401 |
end |
|
9434 | 402 |
|
403 |
function saveCheckPoint(cpoint) |
|
9436 | 404 |
-- save checkpoint |
405 |
SaveCampaignVar("Desert01CheckPoint", cpoint) |
|
406 |
SaveCampaignVar("HeroHealth", GetHealth(hero.gear)) |
|
407 |
-- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal |
|
408 |
SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade).. |
|
409 |
GetAmmoCount(hero.gear, amRope)..GetAmmoCount(hero.gear, amParachute)..GetAmmoCount(hero.gear, amDEagle).. |
|
410 |
GetAmmoCount(hero.gear, amBlowTorch)..GetAmmoCount(hero.gear, amConstruction)..GetAmmoCount(hero.gear, amPortalGun)) |
|
411 |
AnimCaption(hero.gear, loc("Checkpoint reached!"), 5000) |
|
412 |
end |
|
9434 | 413 |
|
9436 | 414 |
function loadHeroAmmo() |
415 |
-- hero ammo |
|
416 |
local ammo = GetCampaignVar("HeroAmmo") |
|
417 |
AddAmmo(hero.gear, amRope, tonumber(ammo:sub(3,3))) |
|
418 |
AddAmmo(hero.gear, amBazooka, tonumber(ammo:sub(1,1))) |
|
419 |
AddAmmo(hero.gear, amParachute, tonumber(ammo:sub(4,4))) |
|
420 |
AddAmmo(hero.gear, amGrenade, tonumber(ammo:sub(2,2))) |
|
421 |
AddAmmo(hero.gear, amDEagle, tonumber(ammo:sub(5,5))) |
|
422 |
AddAmmo(hero.gear, amBlowTorch, tonumber(ammo:sub(6,6))) |
|
423 |
-- weird, if 0 bazooka isn't displayed in the weapons menu |
|
424 |
if tonumber(ammo:sub(7,7)) > 0 then |
|
425 |
AddAmmo(hero.gear, amConstruction, tonumber(ammo:sub(7,7))) |
|
426 |
end |
|
427 |
AddAmmo(hero.gear, amPortalGun, tonumber(ammo:sub(8,8))) |
|
9434 | 428 |
end |