author | Periklis Ntanasis <pntanasis@gmail.com> |
Sat, 10 Aug 2013 22:57:27 +0300 | |
branch | spacecampaign |
changeset 9518 | 549ca737206c |
parent 9516 | d46172a49215 |
child 9520 | 34c7ba17c66b |
permissions | -rw-r--r-- |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
1 |
------------------- ABOUT ---------------------- |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
2 |
-- |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
3 |
-- In this adventure hero visits the fruit planet |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
4 |
-- to search for the missing part. However, a war |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
5 |
-- has broke out and hero has to take part or leave. |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
6 |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
7 |
-- TODO: remove unwanted delay after first dialog |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
8 |
|
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
9 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
10 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
|
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
----------------- VARIABLES -------------------- |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
13 |
-- globals |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
14 |
local campaignName = loc("A Space Adventure") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
15 |
local missionName = loc("Fruit planet, The War!") |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
16 |
local chooseToBattle = false |
9498
54bfc44f9554
fixed bug that make hog not able to move
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9496
diff
changeset
|
17 |
local previousHog = 0 |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
18 |
-- dialogs |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
19 |
local dialog01 = {} |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
20 |
local dialog02 = {} |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
21 |
local dialog03 = {} |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
22 |
-- mission objectives |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
23 |
local goals = { |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
24 |
[dialog01] = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer"), 1, 7000}, |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
25 |
[dialog02] = {missionName, loc("Battle Starts Now!"), loc("You have choose to fight! Lead the Green Bananas to battle and try not to let them be killed"), 1, 7000}, |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
26 |
[dialog03] = {missionName, loc("Ready for Battle?"), loc("You have choose to flee... Unfortunately the only place where you can launch your saucer is in the most left side of the map"), 1, 7000}, |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
27 |
} |
9496 | 28 |
-- crates |
29 |
local crateWMX = 2170 |
|
30 |
local crateWMY = 1950 |
|
31 |
local health1X = 2680 |
|
9508 | 32 |
local health1Y = 916 |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
33 |
-- hogs |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
34 |
local hero = {} |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
35 |
local yellow1 = {} |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
36 |
local green1 = {} |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
37 |
local green2 = {} |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
38 |
local green3 = {} |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
39 |
local green4 = {} |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
40 |
-- teams |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
41 |
local teamA = {} |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
42 |
local teamB = {} |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
43 |
local teamC = {} |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
44 |
-- hedgehogs values |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
45 |
hero.name = "Hog Solo" |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
46 |
hero.x = 3650 |
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
47 |
hero.y = 295 |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
48 |
hero.dead = false |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
49 |
green1.name = "Captain Lime" |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
50 |
green1.x = 3600 |
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
51 |
green1.y = 295 |
9496 | 52 |
green1.dead = false |
9490
b93448b75fa4
fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9488
diff
changeset
|
53 |
green2.name = "Mister Pear" |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
54 |
green2.x = 3600 |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
55 |
green2.y = 1570 |
9490
b93448b75fa4
fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9488
diff
changeset
|
56 |
green3.name = "Lady Mango" |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
57 |
green3.x = 2170 |
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
58 |
green3.y = 980 |
9490
b93448b75fa4
fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9488
diff
changeset
|
59 |
green4.name = "Green Hog Grape" |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
60 |
green4.x = 2900 |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
61 |
green4.y = 1650 |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
62 |
yellow1.name = "General Lemon" |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
63 |
yellow1.x = 140 |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
64 |
yellow1.y = 1980 |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
65 |
local yellowArmy = { |
9496 | 66 |
{name = "Robert Yellow Apple", x = 710, y = 1780}, |
67 |
{name = "Summer Squash", x = 315 , y = 1960}, |
|
68 |
{name = "Tall Potato", x = 830 , y = 1748}, |
|
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
69 |
{name = "Yellow Pepper", x = 2160 , y = 820}, |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
70 |
{name = "Corn", x = 1320 , y = 740}, |
9496 | 71 |
{name = "Max Citrus", x = 1900 , y = 1700}, |
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
72 |
{name = "Naranja Jed", x = 960 , y = 516}, |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
73 |
} |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
74 |
teamA.name = loc("Hog Solo") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
75 |
teamA.color = tonumber("38D61C",16) -- green |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
76 |
teamB.name = loc("Green Bananas") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
77 |
teamB.color = tonumber("38D61C",16) -- green |
9508 | 78 |
teamC.name = loc("Yellow Watermelons") |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
79 |
teamC.color = tonumber("DDFF00",16) -- yellow |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
80 |
|
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
81 |
function onGameInit() |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
Seed = 1 |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
83 |
TurnTime = 20000 |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
84 |
CaseFreq = 0 |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
85 |
MinesNum = 0 |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
86 |
MinesTime = 1 |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
Explosives = 0 |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
88 |
Delay = 3 |
9502
6aebf7a3b655
changed rounds till suden death
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9500
diff
changeset
|
89 |
SuddenDeathTurns = 100 |
9496 | 90 |
HealthCaseAmount = 50 |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
Map = "fruit01_map" |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
92 |
Theme = "Fruit" |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
93 |
|
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
94 |
-- Hog Solo |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
95 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
96 |
hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1") |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
97 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
98 |
HogTurnLeft(hero.gear, true) |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
99 |
-- Green Bananas |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
100 |
AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy") |
9516 | 101 |
green1.gear = AddHog(green1.name, 1, 100, "war_desertgrenadier1") |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
102 |
AnimSetGearPosition(green1.gear, green1.x, green1.y) |
9496 | 103 |
green2.gear = AddHog(green2.name, 0, 100, "war_desertgrenadier1") |
104 |
AnimSetGearPosition(green2.gear, green2.x, green2.y) |
|
105 |
HogTurnLeft(green2.gear, true) |
|
106 |
green3.gear = AddHog(green3.name, 0, 100, "war_desertgrenadier1") |
|
107 |
AnimSetGearPosition(green3.gear, green3.x, green3.y) |
|
108 |
HogTurnLeft(green3.gear, true) |
|
109 |
green4.gear = AddHog(green4.name, 0, 100, "war_desertgrenadier1") |
|
110 |
AnimSetGearPosition(green4.gear, green4.x, green4.y) |
|
111 |
HogTurnLeft(green4.gear, true) |
|
9508 | 112 |
-- Yellow Watermelons |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
113 |
AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
114 |
yellow1.gear = AddHog(yellow1.name, 1, 100, "war_desertgrenadier1") |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
115 |
AnimSetGearPosition(yellow1.gear, yellow1.x, yellow1.y) |
9508 | 116 |
-- the rest of the Yellow Watermelons |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
117 |
for i=1,7 do |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
118 |
yellowArmy[i].gear = AddHog(yellowArmy[i].name, 1, 100, "war_desertgrenadier1") |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
119 |
AnimSetGearPosition(yellowArmy[i].gear, yellowArmy[i].x, yellowArmy[i].y) |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
120 |
end |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
121 |
|
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
122 |
AnimInit() |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
123 |
AnimationSetup() |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
124 |
end |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
125 |
|
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
126 |
function onGameStart() |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
127 |
AnimWait(hero.gear, 3000) |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
128 |
FollowGear(hero.gear) |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
129 |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
130 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
131 |
AddEvent(onHeroSelect, {hero.gear}, heroSelect, {hero.gear}, 0) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
132 |
|
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
133 |
-- Hog Solo weapons |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
134 |
AddAmmo(hero.gear, amRope, 2) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
135 |
AddAmmo(hero.gear, amBazooka, 3) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
136 |
AddAmmo(hero.gear, amParachute, 1) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
137 |
AddAmmo(hero.gear, amGrenade, 6) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
138 |
AddAmmo(hero.gear, amDEagle, 4) |
9496 | 139 |
-- Green team weapons |
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
140 |
AddAmmo(green1.gear, amBlowTorch, 5) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
141 |
AddAmmo(green1.gear, amRope, 5) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
142 |
AddAmmo(green1.gear, amBazooka, 10) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
143 |
AddAmmo(green1.gear, amGrenade, 7) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
144 |
AddAmmo(green1.gear, amFirePunch, 2) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
145 |
AddAmmo(green1.gear, amDrill, 3) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
146 |
AddAmmo(green1.gear, amSkip, 100) |
9496 | 147 |
-- Yellow team weapons |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
148 |
AddAmmo(yellow1.gear, amBlowTorch, 1) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
149 |
AddAmmo(yellow1.gear, amRope, 1) |
9500
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
150 |
AddAmmo(yellow1.gear, amBazooka, 10) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
151 |
AddAmmo(yellow1.gear, amGrenade, 10) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
152 |
AddAmmo(yellow1.gear, amFirePunch, 5) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
153 |
AddAmmo(yellow1.gear, amDrill, 3) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
154 |
AddAmmo(yellow1.gear, amBee, 1) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
155 |
AddAmmo(yellow1.gear, amMortar, 3) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
156 |
AddAmmo(yellow1.gear, amSniperRifle, 5) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
157 |
AddAmmo(yellow1.gear, amDEagle, 4) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
158 |
AddAmmo(yellow1.gear, amDynamite, 1) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
159 |
AddAmmo(yellow1.gear, amSwitch, 100) |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
160 |
for i=3,7 do |
c9487f415fd3
some changes in the map, hog placing etc
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9498
diff
changeset
|
161 |
HideHog(yellowArmy[i].gear) |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
162 |
end |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
163 |
|
9508 | 164 |
-- crates |
165 |
SpawnHealthCrate(health1X, health1Y) |
|
166 |
SpawnAmmoCrate(crateWMX, crateWMY, amWatermelon) |
|
167 |
||
9516 | 168 |
SetHogLevel(green1.gear,0) |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
169 |
AddAnim(dialog01) |
9486
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
170 |
SendHealthStatsOff() |
036fece2fb5f
forgot to commit the new files :/
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
171 |
end |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
172 |
|
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
173 |
function onNewTurn() |
9516 | 174 |
WriteLnToConsole("NEW TURN "..TotalRounds.." hog "..CurrentHedgehog) |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
175 |
if chooseToBattle then |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
176 |
if CurrentHedgehog == green1.gear then |
9516 | 177 |
WriteLnToConsole("IT'S GREEN HOG ") |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
178 |
TotalRounds = TotalRounds - 2 |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
179 |
SwitchHog(previousHog) |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
180 |
TurnTimeLeft = 0 |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
181 |
end |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
182 |
previousHog = CurrentHedghog |
9496 | 183 |
end |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
184 |
getNextWave() |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
185 |
end |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
186 |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
187 |
function onGameTick() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
188 |
AnimUnWait() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
189 |
if ShowAnimation() == false then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
190 |
return |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
191 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
192 |
ExecuteAfterAnimations() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
193 |
CheckEvents() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
194 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
195 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
196 |
function onGearDelete(gear) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
197 |
if gear == hero.gear then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
198 |
hero.dead = true |
9496 | 199 |
elseif gear == green1.gear then |
200 |
green1.dead = true |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
201 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
202 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
203 |
|
9508 | 204 |
function onAmmoStoreInit() |
205 |
SetAmmo(amWatermelon, 0, 0, 0, 1) |
|
206 |
end |
|
207 |
||
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
208 |
function onPrecise() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
209 |
if GameTime > 3000 then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
210 |
SetAnimSkip(true) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
211 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
212 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
213 |
|
9496 | 214 |
function onHogHide(gear) |
215 |
for i=3,7 do |
|
216 |
if gear == yellowArmy[i].gear then |
|
217 |
yellowArmy[i].hidden = true |
|
218 |
break |
|
219 |
end |
|
220 |
end |
|
221 |
end |
|
222 |
||
223 |
function onHogRestore(gear) |
|
224 |
for i=3,7 do |
|
225 |
if gear == yellowArmy[i].gear then |
|
226 |
yellowArmy[i].hidden = false |
|
227 |
break |
|
228 |
end |
|
229 |
end |
|
230 |
end |
|
231 |
||
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
232 |
-------------- EVENTS ------------------ |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
233 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
234 |
function onHeroDeath(gear) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
235 |
if hero.dead then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
236 |
return true |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
237 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
238 |
return false |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
239 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
240 |
|
9496 | 241 |
function onGreen1Death(gear) |
242 |
if green1.dead then |
|
243 |
return true |
|
244 |
end |
|
245 |
return false |
|
246 |
end |
|
247 |
||
248 |
function onBattleWin(gear) |
|
249 |
local win = true |
|
250 |
for i=1,7 do |
|
251 |
if i<3 then |
|
252 |
if GetHealth(yellowArmy[i].gear) then |
|
253 |
win = false |
|
254 |
end |
|
255 |
else |
|
256 |
if GetHealth(yellowArmy[i].gear) and not yellowArmy[i].hidden then |
|
257 |
win = false |
|
258 |
end |
|
259 |
end |
|
260 |
end |
|
261 |
if GetHealth(yellow1.gear) then |
|
262 |
win = false |
|
263 |
end |
|
264 |
return win |
|
265 |
end |
|
266 |
||
9504
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
267 |
function onEscapeWin(gear) |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
268 |
local escape = false |
9506
adc05ca2cb10
some fixes to the map and the events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9504
diff
changeset
|
269 |
if not hero.dead and GetX(hero.gear) < 170 and GetY(hero.gear) > 1980 and StoppedGear(hero.gear) then |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
270 |
escape = true |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
271 |
local yellowTeam = { yellow1, unpack(yellowArmy) } |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
272 |
for i=1,8 do |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
273 |
if not yellowTeam[i].hidden and GetHealth(yellowTeam[i].gear) and GetX(yellowTeam[i].gear) < 170 then |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
274 |
escape = false |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
275 |
break |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
276 |
end |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
277 |
end |
9504
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
278 |
end |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
279 |
return escape |
9504
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
280 |
end |
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
281 |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
282 |
function onHeroSelect(gear) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
283 |
if GetX(hero.gear) ~= hero.x then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
284 |
return true |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
285 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
286 |
return false |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
287 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
288 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
289 |
-------------- OUTCOMES ------------------ I should really s/OUTCOMES/ACTIONS/ |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
290 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
291 |
function heroDeath(gear) |
9496 | 292 |
gameLost() |
293 |
end |
|
294 |
||
295 |
function green1Death(gear) |
|
296 |
gameLost() |
|
297 |
end |
|
298 |
||
299 |
function battleWin(gear) |
|
300 |
-- add stats |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
301 |
EndGame() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
302 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
303 |
|
9504
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
304 |
function escapeWin(gear) |
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
305 |
-- add stats |
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
306 |
EndGame() |
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
307 |
end |
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
308 |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
309 |
function heroSelect(gear) |
9496 | 310 |
TurnTimeLeft = 0 |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
311 |
FollowGear(hero.gear) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
312 |
if GetX(hero.gear) < hero.x then |
9496 | 313 |
chooseToBattle = true |
314 |
AddEvent(onGreen1Death, {green1.gear}, green1Death, {green1.gear}, 0) |
|
315 |
AddEvent(onBattleWin, {hero.gear}, battleWin, {hero.gear}, 0) |
|
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
316 |
AddAnim(dialog02) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
317 |
elseif GetX(hero.gear) > hero.x then |
9506
adc05ca2cb10
some fixes to the map and the events
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9504
diff
changeset
|
318 |
HogTurnLeft(hero.gear, true) |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
319 |
AddAmmo(green1.gear, amSwitch, 100) |
9504
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
320 |
AddEvent(onEscapeWin, {hero.gear}, escapeWin, {hero.gear}, 0) |
9514
b72e99bcc423
previous fix was wrong..
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9512
diff
changeset
|
321 |
local greenTeam = { green2, green3, green4 } |
b72e99bcc423
previous fix was wrong..
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9512
diff
changeset
|
322 |
for i=1,3 do |
9504
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
323 |
SetHogLevel(greenTeam[i].gear, 1) |
cdba61cfba93
event for escape win
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9502
diff
changeset
|
324 |
end |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
325 |
AddAnim(dialog03) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
326 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
327 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
328 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
329 |
-------------- ANIMATIONS ------------------ |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
330 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
331 |
function Skipanim(anim) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
332 |
if goals[anim] ~= nil then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
333 |
ShowMission(unpack(goals[anim])) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
334 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
335 |
if anim == dialog01 then |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
336 |
AnimSwitchHog(hero.gear) |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
337 |
elseif anim == dialog02 or anim == dialog03 then |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
338 |
startBattle() |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
339 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
340 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
341 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
342 |
function AnimationSetup() |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
343 |
-- DIALOG 01 - Start, Captain Lime talks explains to Hog Solo |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
344 |
AddSkipFunction(dialog01, Skipanim, {dialog01}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
345 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
346 |
table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the planet of fruits a terrible war is about to begin..."), 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
347 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I was told that as the leader of the king's guard, no one knows this world better than you!"), SAY_SAY, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
348 |
table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("So, I kindly ask for your help."), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
349 |
table.insert(dialog01, {func = AnimWait, args = {green1.gear, 2000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
350 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("You couldn't have come to a worse time Hog Solo!"), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
351 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("The clan of the Red Strawberry wants to take over the dominion and overthrone king Pineapple."), SAY_SAY, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
352 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Under normal circumstances we could easily defeat them but we have kindly sent most of our men to the kingdom of sand to help to the annual dusting of the king's palace."), SAY_SAY, 8000}}) |
9508 | 353 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("However the army of Yellow Watermelons is about to attack any moment now."), SAY_SAY, 4000}}) |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
354 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I would gladly help you if we won this battle but under these circumstances I'll only help you if you fight for our side."), SAY_SAY, 6000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
355 |
table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("What do you say? Will you fight for us?"), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
356 |
table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
357 |
table.insert(dialog01, {func = ShowMission, args = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer"), 1, 7000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
358 |
table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
359 |
-- DIALOG 02 - Hero selects to fight |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
360 |
AddSkipFunction(dialog02, Skipanim, {dialog02}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
361 |
table.insert(dialog02, {func = AnimWait, args = {green1.gear, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
362 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("You choose well Hog Solo!"), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
363 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("I have only 3 hogs available and they are all cadets"), SAY_SAY, 4000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
364 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("As more experienced I want you to lead them to the battle"), SAY_SAY, 4000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
365 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("I of cource will observe the battle and intervene if necessary"), SAY_SAY, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
366 |
table.insert(dialog02, {func = AnimWait, args = {hero.gear, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
367 |
table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("No problem Captain! The enemies aren't many anyway, it is going to be easy!"), SAY_SAY, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
368 |
table.insert(dialog02, {func = AnimWait, args = {green1.gear, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
369 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Don't be fool son, they'll be more"), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
370 |
table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Try to be smart and eliminate them quickly. This way you might scare the rest!"), SAY_SAY, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
371 |
table.insert(dialog02, {func = startBattle, args = {hero.gear}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
372 |
-- DIALOG 03 - Hero selects to flee |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
373 |
AddSkipFunction(dialog03, Skipanim, {dialog03}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
374 |
table.insert(dialog03, {func = AnimWait, args = {green1.gear, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
375 |
table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("Too bad... Then you should really leave!"), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
376 |
table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("Things are going to get messy around here"), SAY_SAY, 3000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
377 |
table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("Also, you should know that the only place that you can fly would be the most left one"), SAY_SAY, 5000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
378 |
table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("All the other places are protected by our anti flying weapons"), SAY_SAY, 4000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
379 |
table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("Now go and don't waste more of my time you coward..."), SAY_SAY, 4000}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
380 |
table.insert(dialog03, {func = startBattle, args = {hero.gear}}) |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
381 |
end |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
382 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
383 |
------------- OTHER FUNCTIONS --------------- |
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
384 |
|
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
385 |
function startBattle() |
9516 | 386 |
SetHogLevel(green1.gear, 1) |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
387 |
AnimSwitchHog(yellow1.gear) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
388 |
TurnTimeLeft = 0 |
9488
2e2bb48566ae
dialogs, events for hero death and side choice
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9486
diff
changeset
|
389 |
end |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
390 |
|
9518
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
391 |
function gameLost() |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
392 |
if chooseToBattle then |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
393 |
SendStat('siGameResult', loc("Green Bananas lost, try again!")) --1 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
394 |
SendStat('siCustomAchievement', loc("You have to eliminate all the visible enemies")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
395 |
SendStat('siCustomAchievement', loc("5 additional enemies will be spawned during the game")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
396 |
SendStat('siCustomAchievement', loc("You are controlling all the active ally units")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
397 |
SendStat('siCustomAchievement', loc("The ally units share their ammo")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
398 |
SendStat('siCustomAchievement', loc("Try to keep as many allies alive as possible")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
399 |
else |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
400 |
SendStat('siGameResult', loc("Hog Solo couldn't escape, try again!")) --1 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
401 |
SendStat('siCustomAchievement', loc("You have to get to the most left land and remove any enemy hog from there")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
402 |
SendStat('siCustomAchievement', loc("You will play every 3 turns")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
403 |
SendStat('siCustomAchievement', loc("Green hogs won't intenionally hurt you")) --11 |
549ca737206c
custom stats in case of lose
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9516
diff
changeset
|
404 |
end |
9496 | 405 |
SendStat('siPlayerKills','1',teamC.name) |
406 |
SendStat('siPlayerKills','0',teamA.name) |
|
407 |
SendStat('siPlayerKills','0',teamB.name) |
|
408 |
EndGame() |
|
409 |
end |
|
410 |
||
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
411 |
function getNextWave() |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
412 |
if TotalRounds == 4 then |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
413 |
RestoreHog(yellowArmy[3].gear) |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
414 |
AnimCaption(hero.gear, loc("Next wave in 3 turns"), 5000) |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
415 |
if not chooseToBattle and not GetHealth(yellow1.gear) then |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
416 |
SetGearPosition(yellowArmy[3].gear, yellow1.x, yellow1.y) |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
417 |
end |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
418 |
elseif TotalRounds == 7 then |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
419 |
RestoreHog(yellowArmy[4].gear) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
420 |
RestoreHog(yellowArmy[5].gear) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
421 |
AnimCaption(hero.gear, loc("Last wave in 3 turns"), 5000) |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
422 |
if not chooseToBattle and not GetHealth(yellow1.gear) and not GetHealth(yellowArmy[3].gear) then |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
423 |
SetGearPosition(yellowArmy[4].gear, yellow1.x, yellow1.y) |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
424 |
end |
9494
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
425 |
elseif TotalRounds == 10 then |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
426 |
RestoreHog(yellowArmy[6].gear) |
e515962d7af4
hide hogs and spawn them per waves
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9492
diff
changeset
|
427 |
RestoreHog(yellowArmy[7].gear) |
9510
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
428 |
if not chooseToBattle and not GetHealth(yellow1.gear) and not GetHealth(yellowArmy[3].gear) |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
429 |
and not GetHealth(yellowArmy[4].gear) then |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
430 |
SetGearPosition(yellowArmy[6].gear, yellow1.x, yellow1.y) |
e7481fac10c4
change regarding the difficulty in escape
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9508
diff
changeset
|
431 |
end |
9492
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
432 |
end |
1cbd49706334
added newly created hogs
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9490
diff
changeset
|
433 |
end |