6349
|
1 |
--------------------------------
|
|
2 |
-- HIGHLANDER / HOGS OF WAR
|
|
3 |
-- version 0.3
|
|
4 |
-- by mikade
|
|
5 |
--------------------------------
|
|
6 |
|
|
7 |
-----------
|
|
8 |
--0.1
|
|
9 |
-----------
|
|
10 |
|
|
11 |
-- concept test
|
|
12 |
|
|
13 |
-----------
|
|
14 |
--0.2
|
|
15 |
-----------
|
|
16 |
|
|
17 |
-- remove tardis till Henek fixes his tracker
|
|
18 |
-- change wep crates to health crates
|
|
19 |
-- reset arb turntimevalue
|
|
20 |
-- include randomOrder
|
|
21 |
-- Until fixed .17 methods come out, remove switches and resurrector
|
|
22 |
-- on request, removed kamikaze and piano weapons
|
|
23 |
-- provisional fixing of bugs that can't actually be fixed yet
|
|
24 |
|
|
25 |
-----------
|
|
26 |
--0.3
|
|
27 |
-----------
|
|
28 |
|
|
29 |
-- meh, update incorrect display
|
|
30 |
-- may change this in the future to have switches
|
|
31 |
-- but for now people are used to it without, so~
|
|
32 |
|
|
33 |
-- mudball is now counted as a utility
|
|
34 |
|
|
35 |
----------------
|
|
36 |
-- other ideas
|
|
37 |
----------------
|
|
38 |
|
|
39 |
-- circles to mark hogs with more than 4 weapons
|
|
40 |
-- health crate and switch drops
|
|
41 |
-- hogs start with 1 weap and 1 utility each (some are rarer than others?)
|
|
42 |
-- could always create a "donor card" mini circle instead of automatic disposal
|
|
43 |
|
|
44 |
|
|
45 |
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
|
|
46 |
loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
|
|
47 |
|
|
48 |
local wepArray = {}
|
|
49 |
local wepArrayCount = 0
|
|
50 |
|
|
51 |
local atkArray = {}
|
|
52 |
local atkCount = 0
|
|
53 |
|
|
54 |
local utilArray = {}
|
|
55 |
local utilArrayCount = 0
|
|
56 |
|
|
57 |
local currName
|
|
58 |
local lastName
|
|
59 |
local started = false
|
|
60 |
local switchStage = 0
|
|
61 |
|
|
62 |
function StartingSetUp(gear)
|
|
63 |
|
|
64 |
for i = 0, (wepArrayCount-1) do
|
|
65 |
setGearValue(gear,wepArray[i],0)
|
|
66 |
end
|
|
67 |
|
|
68 |
i = GetRandom(atkArrayCount)
|
|
69 |
setGearValue(gear,atkArray[i],1)
|
|
70 |
|
|
71 |
i = GetRandom(utilArrayCount)
|
|
72 |
setGearValue(gear,utilArray[i],1)
|
|
73 |
|
|
74 |
SetHealth(gear, 100)
|
|
75 |
|
|
76 |
end
|
|
77 |
|
|
78 |
--[[function SaveWeapons(gear)
|
|
79 |
|
|
80 |
-
|
|
81 |
for i = 0, (wepArrayCount-1) do
|
|
82 |
setGearValue(gear, wepArray[i], GetAmmoCount(gear, wepArray[i]) )
|
|
83 |
--AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
|
|
84 |
end
|
|
85 |
|
|
86 |
end]]
|
|
87 |
|
|
88 |
function ConvertValues(gear)
|
|
89 |
|
|
90 |
for i = 0, (wepArrayCount-1) do
|
|
91 |
AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
|
|
92 |
end
|
|
93 |
|
|
94 |
|
|
95 |
end
|
|
96 |
|
|
97 |
|
|
98 |
function TransferWeps(gear)
|
|
99 |
|
|
100 |
if CurrentHedgehog ~= nil then
|
|
101 |
|
|
102 |
for i = 0, (wepArrayCount-1) do
|
|
103 |
val = getGearValue(gear,wepArray[i])
|
|
104 |
if val ~= 0 then
|
|
105 |
setGearValue(CurrentHedgehog, wepArray[i], val)
|
|
106 |
AddAmmo(CurrentHedgehog, wepArray[i], val)
|
|
107 |
end
|
|
108 |
end
|
|
109 |
|
|
110 |
end
|
|
111 |
|
|
112 |
end
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
function onGameInit()
|
|
117 |
GameFlags = gfInfAttack + gfRandomOrder
|
|
118 |
HealthCaseProb = 100
|
|
119 |
end
|
|
120 |
|
|
121 |
function onGameStart()
|
|
122 |
|
|
123 |
|
|
124 |
ShowMission (
|
|
125 |
loc("HIGHLANDER"),
|
|
126 |
loc("Not all hogs are born equal."),
|
|
127 |
|
|
128 |
"- " .. loc("Eliminate enemy hogs and take their weapons.") .. "|" ..
|
|
129 |
"- " .. loc("Per-Hog Ammo") .. "|" ..
|
|
130 |
"- " .. loc("Weapons reset.") .. "|" ..
|
|
131 |
"- " .. loc("Unlimited Attacks") .. "|" ..
|
|
132 |
"", 4, 4000
|
|
133 |
)
|
|
134 |
|
|
135 |
atkArray[0] = amBazooka
|
|
136 |
atkArray[1] = amBee
|
|
137 |
atkArray[2] = amMortar
|
|
138 |
atkArray[3] = amDrill
|
|
139 |
--atkArray[4] = amSnowball
|
|
140 |
|
|
141 |
atkArray[4] = amGrenade
|
|
142 |
atkArray[5] = amClusterBomb
|
|
143 |
atkArray[6] = amMolotov
|
|
144 |
atkArray[7] = amWatermelon
|
|
145 |
atkArray[8] = amHellishBomb
|
|
146 |
atkArray[9] = amGasBomb
|
|
147 |
|
|
148 |
atkArray[10] = amShotgun
|
|
149 |
atkArray[11] = amDEagle
|
|
150 |
atkArray[12] = amFlamethrower
|
|
151 |
atkArray[13] = amSniperRifle
|
|
152 |
atkArray[14] = amSineGun
|
|
153 |
|
|
154 |
atkArray[15] = amFirePunch
|
|
155 |
atkArray[16] = amWhip
|
|
156 |
atkArray[17] = amBaseballBat
|
|
157 |
--atkArray[19] = amKamikaze
|
|
158 |
atkArray[18] = amBirdy
|
|
159 |
atkArray[19] = amSeduction
|
|
160 |
atkArray[20] = amHammer
|
|
161 |
|
|
162 |
atkArray[21] = amMine
|
|
163 |
atkArray[22] = amDynamite
|
|
164 |
atkArray[23] = amCake
|
|
165 |
atkArray[24] = amBallgun
|
|
166 |
atkArray[25] = amRCPlane
|
|
167 |
atkArray[26] = amSMine
|
|
168 |
|
|
169 |
atkArray[27] = amAirAttack
|
|
170 |
atkArray[28] = amMineStrike
|
|
171 |
atkArray[29] = amDrillStrike
|
|
172 |
atkArray[30] = amNapalm
|
|
173 |
--atkArray[32] = amPiano
|
|
174 |
atkArray[31] = amLandGun
|
|
175 |
|
|
176 |
--atkArray[33] = amBirdy
|
|
177 |
--atkArray[34] = amLandGun
|
|
178 |
|
|
179 |
atkArrayCount = 32
|
|
180 |
|
|
181 |
-------------------------------
|
|
182 |
|
|
183 |
|
|
184 |
wepArray[0] = amBazooka
|
|
185 |
wepArray[1] = amBee
|
|
186 |
wepArray[2] = amMortar
|
|
187 |
wepArray[3] = amDrill
|
|
188 |
wepArray[4] = amSnowball
|
|
189 |
|
|
190 |
wepArray[5] = amGrenade
|
|
191 |
wepArray[6] = amClusterBomb
|
|
192 |
wepArray[7] = amMolotov
|
|
193 |
wepArray[8] = amWatermelon
|
|
194 |
wepArray[9] = amHellishBomb
|
|
195 |
wepArray[10] = amGasBomb
|
|
196 |
|
|
197 |
wepArray[11] = amShotgun
|
|
198 |
wepArray[12] = amDEagle
|
|
199 |
wepArray[13] = amFlamethrower
|
|
200 |
wepArray[14] = amSniperRifle
|
|
201 |
wepArray[15] = amSineGun
|
|
202 |
|
|
203 |
wepArray[16] = amFirePunch
|
|
204 |
wepArray[17] = amWhip
|
|
205 |
wepArray[18] = amBaseballBat
|
|
206 |
--wepArray[19] = amKamikaze
|
|
207 |
wepArray[19] = amExtraTime
|
|
208 |
wepArray[20] = amSeduction
|
|
209 |
wepArray[21] = amHammer
|
|
210 |
|
|
211 |
wepArray[22] = amMine
|
|
212 |
wepArray[23] = amDynamite
|
|
213 |
wepArray[24] = amCake
|
|
214 |
wepArray[25] = amBallgun
|
|
215 |
wepArray[26] = amRCPlane
|
|
216 |
wepArray[27] = amSMine
|
|
217 |
|
|
218 |
wepArray[28] = amAirAttack
|
|
219 |
wepArray[29] = amMineStrike
|
|
220 |
wepArray[30] = amDrillStrike
|
|
221 |
wepArray[31] = amNapalm
|
|
222 |
--wepArray[32] = amPiano
|
|
223 |
wepArray[32] = amExtraDamage
|
|
224 |
|
|
225 |
wepArray[33] = amBirdy
|
|
226 |
wepArray[34] = amLandGun
|
|
227 |
|
|
228 |
wepArray[35] = amBlowTorch
|
|
229 |
wepArray[36] = amPickHammer
|
|
230 |
wepArray[37] = amGirder
|
|
231 |
wepArray[38] = amPortalGun
|
|
232 |
|
|
233 |
wepArray[39] = amRope
|
|
234 |
wepArray[40] = amParachute
|
|
235 |
wepArray[41] = amTeleport
|
|
236 |
wepArray[42] = amJetpack
|
|
237 |
|
|
238 |
wepArray[43] = amInvulnerable
|
|
239 |
wepArray[44] = amLaserSight
|
|
240 |
wepArray[45] = amVampiric
|
|
241 |
----resurrector used to be here
|
|
242 |
|
|
243 |
wepArray[46] = amLowGravity
|
|
244 |
|
|
245 |
--wepArray[47] = amExtraDamage -- see 19
|
|
246 |
--wepArray[48] = amExtraTime -- see 32
|
|
247 |
|
|
248 |
--wepArray[49] = amResurrector
|
|
249 |
--wepArray[50] = amTardis
|
|
250 |
|
|
251 |
wepArrayCount = 47
|
|
252 |
|
|
253 |
----------------------------
|
|
254 |
|
|
255 |
utilArray[0] = amBlowTorch
|
|
256 |
utilArray[1] = amPickHammer
|
|
257 |
utilArray[2] = amGirder
|
|
258 |
utilArray[3] = amPortalGun
|
|
259 |
|
|
260 |
utilArray[4] = amRope
|
|
261 |
utilArray[5] = amParachute
|
|
262 |
utilArray[6] = amTeleport
|
|
263 |
utilArray[7] = amJetpack
|
|
264 |
|
|
265 |
utilArray[8] = amInvulnerable
|
|
266 |
utilArray[9] = amLaserSight
|
|
267 |
utilArray[10] = amVampiric
|
|
268 |
|
|
269 |
utilArray[11] = amLowGravity
|
|
270 |
utilArray[12] = amExtraDamage
|
|
271 |
utilArray[13] = amExtraTime
|
|
272 |
|
|
273 |
utilArray[14] = amSnowball
|
|
274 |
|
|
275 |
--utilArray[14] = amResurrector
|
|
276 |
--utilArray[15] = amTardis
|
|
277 |
|
|
278 |
utilArrayCount = 15
|
|
279 |
|
|
280 |
runOnGears(StartingSetUp)
|
|
281 |
runOnGears(ConvertValues)
|
|
282 |
|
|
283 |
|
|
284 |
end
|
|
285 |
|
|
286 |
function onNewTurn()
|
|
287 |
--
|
|
288 |
end
|
|
289 |
|
|
290 |
|
|
291 |
function onGameTick()
|
|
292 |
|
|
293 |
if (CurrentHedgehog ~= nil) then
|
|
294 |
|
|
295 |
currName = GetHogName(CurrentHedgehog)
|
|
296 |
|
|
297 |
if (currName ~= lastName) then
|
|
298 |
AddCaption(loc("Switched to ") .. currName .. "!")
|
|
299 |
ConvertValues(CurrentHedgehog)
|
|
300 |
end
|
|
301 |
|
|
302 |
lastName = currName
|
|
303 |
end
|
|
304 |
|
|
305 |
end
|
|
306 |
|
|
307 |
--[[function onHogHide(gear)
|
|
308 |
-- waiting for Henek
|
|
309 |
end
|
|
310 |
|
|
311 |
function onHogRestore(gear)
|
|
312 |
-- waiting for Henek
|
|
313 |
end]]
|
|
314 |
|
|
315 |
function onGearAdd(gear)
|
|
316 |
|
|
317 |
--if GetGearType(gear) == gtSwitcher then
|
|
318 |
-- SaveWeapons(CurrentHedgehog)
|
|
319 |
--end
|
|
320 |
|
|
321 |
if (GetGearType(gear) == gtHedgehog) then
|
|
322 |
trackGear(gear)
|
|
323 |
end
|
|
324 |
|
|
325 |
end
|
|
326 |
|
|
327 |
function onGearDelete(gear)
|
|
328 |
|
|
329 |
if (GetGearType(gear) == gtHedgehog) then --or (GetGearType(gear) == gtResurrector) then
|
|
330 |
TransferWeps(gear)
|
|
331 |
trackDeletion(gear)
|
|
332 |
end
|
|
333 |
|
|
334 |
end
|
|
335 |
|
|
336 |
function onAmmoStoreInit()
|
|
337 |
SetAmmo(amSkip, 9, 0, 0, 0)
|
|
338 |
--SetAmmo(amSwitch, 9, 0, 0, 0) -------1
|
|
339 |
end
|
|
340 |
|