author | Periklis Ntanasis <pntanasis@gmail.com> |
Thu, 29 Aug 2013 19:51:44 +0300 | |
branch | spacecampaign |
changeset 9595 | 1acc5c3dc066 |
parent 9594 | 749ef5bd0eaf |
child 9596 | feb3d880852d |
permissions | -rw-r--r-- |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
1 |
------------------- ABOUT ---------------------- |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
2 |
-- |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
3 |
-- Hero has get into an Red Strawberies ambush |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
4 |
-- He has to eliminate the enemies by using limited |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
5 |
-- ammo of sniper rifle and watermelon |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
6 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
7 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
8 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
9 |
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
10 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
11 |
----------------- VARIABLES -------------------- |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
12 |
-- globals |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
13 |
local missionName = loc("Precise shooting") |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
14 |
local timeLeft = 10000 |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
15 |
local lastWeaponUsed = amSniperRifle |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
16 |
-- hogs |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
17 |
local hero = { |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
18 |
name = loc("Hog Solo"), |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
19 |
x = 1100, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
20 |
y = 560 |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
21 |
} |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
22 |
local enemiesOdd = { |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
23 |
{name = "Hog 1", x = 2000 , y = 175}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
24 |
{name = "Hog 3", x = 1950 , y = 1110}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
25 |
{name = "Hog 5", x = 1270 , y = 1480}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
26 |
{name = "Hog 7", x = 240 , y = 790}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
27 |
{name = "Hog 9", x = 620 , y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
28 |
{name = "Hog 11", x = 720 , y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
29 |
{name = "Hog 13", x = 1620 , y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
30 |
{name = "Hog 15", x = 1720 , y = 1950}, |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
31 |
} |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
32 |
local enemiesEven = { |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
33 |
{name = "Hog 2", x = 660, y = 140}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
34 |
{name = "Hog 4", x = 1120, y = 1250}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
35 |
{name = "Hog 6", x = 1290, y = 1250}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
36 |
{name = "Hog 8", x = 820, y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
37 |
{name = "Hog 10", x = 920, y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
38 |
{name = "Hog 12", x = 1820, y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
39 |
{name = "Hog 14", x = 1920, y = 1950}, |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
40 |
{name = "Hog 16", x = 1200, y = 560}, |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
41 |
} |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
42 |
-- teams |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
43 |
local teamA = { |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
44 |
name = loc("Hog Solo"), |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
45 |
color = tonumber("38D61C",16) -- green |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
46 |
} |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
47 |
local teamB = { |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
48 |
name = loc("RS1"), |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
49 |
color = tonumber("FF0000",16) -- red |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
50 |
} |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
51 |
local teamC = { |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
52 |
name = loc("RS2"), |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
53 |
color = tonumber("FF0000",16) -- red |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
54 |
} |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
55 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
56 |
-------------- LuaAPI EVENT HANDLERS ------------------ |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
57 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
58 |
function onGameInit() |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
59 |
GameFlags = gfDisableWind + gfInfAttack |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
60 |
Seed = 1 |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
61 |
TurnTime = 15000 |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
62 |
CaseFreq = 0 |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
63 |
MinesNum = 0 |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
64 |
MinesTime = 1 |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
65 |
Explosives = 0 |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
66 |
Map = "fruit03_map" |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
67 |
Theme = "Fruit" |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
68 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
69 |
-- Hog Solo |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
70 |
AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
71 |
hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
72 |
AnimSetGearPosition(hero.gear, hero.x, hero.y) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
73 |
-- enemies |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
74 |
AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
75 |
for i=1,table.getn(enemiesEven) do |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
76 |
enemiesEven[i].gear = AddHog(enemiesEven[i].name, 1, 100, "war_desertgrenadier1") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
77 |
AnimSetGearPosition(enemiesEven[i].gear, enemiesEven[i].x, enemiesEven[i].y) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
78 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
79 |
AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
80 |
for i=1,table.getn(enemiesOdd) do |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
81 |
enemiesOdd[i].gear = AddHog(enemiesOdd[i].name, 1, 100, "war_desertgrenadier1") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
82 |
AnimSetGearPosition(enemiesOdd[i].gear, enemiesOdd[i].x, enemiesOdd[i].y) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
83 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
84 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
85 |
initCheckpoint("fruit03") |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
86 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
87 |
AnimInit() |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
88 |
--AnimationSetup() |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
89 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
90 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
91 |
function onGameStart() |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
92 |
AnimWait(hero.gear, 3000) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
93 |
FollowGear(hero.gear) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
94 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
95 |
AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
96 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
97 |
--hero ammo |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
98 |
AddAmmo(hero.gear, amTeleport, 2) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
99 |
AddAmmo(hero.gear, amSniperRifle, 2) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
100 |
AddAmmo(hero.gear, amWatermelon, 2) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
101 |
--enemies ammo |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
102 |
AddAmmo(enemiesOdd[1].gear, amDEagle, 100) |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
103 |
AddAmmo(enemiesOdd[1].gear, amSniperRifle, 100) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
104 |
AddAmmo(enemiesOdd[1].gear, amWatermelon, 1) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
105 |
AddAmmo(enemiesOdd[1].gear, amGrenade, 5) |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
106 |
AddAmmo(enemiesEven[1].gear, amDEagle, 100) |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
107 |
AddAmmo(enemiesEven[1].gear, amSniperRifle, 100) |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
108 |
AddAmmo(enemiesEven[1].gear, amWatermelon, 1) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
109 |
AddAmmo(enemiesEven[1].gear, amGrenade, 5) |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
110 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
111 |
SendHealthStatsOff() |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
112 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
113 |
|
9592 | 114 |
function onNewTurn() |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
115 |
if CurrentHedgehog == hero.gear then |
9594
749ef5bd0eaf
fixed the time adding in new hero turn
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9593
diff
changeset
|
116 |
if GetAmmoCount(hero.gear, amSkip) == 0 then |
749ef5bd0eaf
fixed the time adding in new hero turn
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9593
diff
changeset
|
117 |
TurnTimeLeft = TurnTime + timeLeft |
749ef5bd0eaf
fixed the time adding in new hero turn
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9593
diff
changeset
|
118 |
AddAmmo(hero.gear, amSkip, 1) |
749ef5bd0eaf
fixed the time adding in new hero turn
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9593
diff
changeset
|
119 |
end |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
120 |
timeLeft = 0 |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
121 |
end |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
122 |
turnHogs() |
9592 | 123 |
end |
124 |
||
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
125 |
function onGameTick20() |
9594
749ef5bd0eaf
fixed the time adding in new hero turn
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9593
diff
changeset
|
126 |
if CurrentHedgehog == hero.gear and TurnTimeLeft ~= 0 then |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
127 |
timeLeft = TurnTimeLeft |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
128 |
end |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
129 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
130 |
|
9595
1acc5c3dc066
deleted debug prints
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9594
diff
changeset
|
131 |
function onGearDelete(gear) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
132 |
if (gear > hero.gear and gear <= enemiesOdd[table.getn(enemiesOdd)].gear) or |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
133 |
(gear > hero.gear and gear <= enemiesEven[table.getn(enemiesEven)].gear) then |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
134 |
local availableTeleports = GetAmmoCount(hero.gear,amTeleport) |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
135 |
local availableSniper = GetAmmoCount(hero.gear,amSniperRifle) |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
136 |
if availableTeleports < 2 then |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
137 |
AddAmmo(hero.gear, amTeleport, availableTeleports + 1 ) |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
138 |
end |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
139 |
if availableSniper < 3 then |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
140 |
AddAmmo(hero.gear, amSniperRifle, availableSniper + 1 ) |
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
141 |
end |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
142 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
143 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
144 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
145 |
-------------- EVENTS ------------------ |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
146 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
147 |
function onHeroDeath(gear) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
148 |
if not GetHealth(hero.gear) then |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
149 |
return true |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
150 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
151 |
return false |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
152 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
153 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
154 |
-------------- ACTIONS ------------------ |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
155 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
156 |
-- game ends anyway but I want to sent custom stats probably... |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
157 |
function heroDeath(gear) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
158 |
EndGame() |
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
159 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
160 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
161 |
------------------ Other Functions ------------------- |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
162 |
|
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
163 |
function turnHogs() |
9592 | 164 |
if GetHealth(hero.gear) then |
165 |
for i=1,table.getn(enemiesEven) do |
|
166 |
if GetHealth(enemiesEven[i].gear) then |
|
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
167 |
if GetX(enemiesEven[i].gear) < GetX(hero.gear) then |
9592 | 168 |
HogTurnLeft(enemiesEven[i].gear, false) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
169 |
elseif GetX(enemiesEven[i].gear) > GetX(hero.gear) then |
9592 | 170 |
HogTurnLeft(enemiesEven[i].gear, true) |
171 |
end |
|
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
172 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
173 |
end |
9592 | 174 |
for i=1,table.getn(enemiesOdd) do |
175 |
if GetHealth(enemiesOdd[i].gear) then |
|
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
176 |
if GetX(enemiesOdd[i].gear) < GetX(hero.gear) then |
9592 | 177 |
HogTurnLeft(enemiesOdd[i].gear, false) |
9593
ac522dd06f00
changed map and fixed some bugs regarding hog turning and adding more teleport
Periklis Ntanasis <pntanasis@gmail.com>
parents:
9592
diff
changeset
|
178 |
elseif GetX(enemiesOdd[i].gear) > GetX(hero.gear) then |
9592 | 179 |
HogTurnLeft(enemiesOdd[i].gear, true) |
180 |
end |
|
9590
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
181 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
182 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
183 |
end |
347e799f01de
fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff
changeset
|
184 |
end |