author | Henek |
Sat, 22 Jan 2011 22:31:05 +0100 | |
changeset 4869 | 7a720b5d2247 |
parent 4590 | d9fed5a816e9 |
child 4893 | 353781305c07 |
permissions | -rw-r--r-- |
4590
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
1 |
loadfile(GetDataPath() .. "Scripts/Locale.lua")() |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
2 |
|
4551 | 3 |
local weapons = { amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, |
4 |
amMine, amDEagle, amDynamite, amFirePunch, amWhip, amPickHammer, |
|
4590
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
5 |
amBaseballBat, amTeleport, amMortar, amCake, amSeduction, |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
6 |
amWatermelon, amHellishBomb, amDrill, amBallgun, amRCPlane, |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
7 |
amSniperRifle, amMolotov, amBirdy, amBlowTorch, amGasBomb, |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
8 |
amFlamethrower, amSMine, amHammer, amSnowball } |
4551 | 9 |
|
4590
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
10 |
local airweapons = { amAirAttack, amMineStrike, amNapalm, amDrillStrike } |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
11 |
|
4551 | 12 |
|
13 |
function onGameInit() |
|
14 |
GameFlags = band(bor(GameFlags, gfResetWeps), bnot(gfInfAttack + gfPerHogAmmo)) |
|
15 |
end |
|
16 |
||
4590
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
17 |
function onGameStart() |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
18 |
if MapHasBorder() == false then |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
19 |
for i, w in pairs(airweapons) do |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
20 |
table.insert(weapons, w) |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
21 |
end |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
22 |
end |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
23 |
|
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
24 |
ShowMission(loc("Random Weapons"), loc("A game of luck"), loc("There has been a mix-up with your gear and now you|have to utilize whatever is coming your way!"), -amSkip, 0) |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
25 |
end |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
26 |
|
4551 | 27 |
function onAmmoStoreInit() |
28 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
29 |
||
30 |
SetAmmo(amParachute, 0, 1, 0, 1) |
|
31 |
SetAmmo(amGirder, 0, 1, 0, 2) |
|
32 |
SetAmmo(amSwitch, 0, 1, 0, 1) |
|
33 |
SetAmmo(amLowGravity, 0, 1, 0, 1) |
|
34 |
SetAmmo(amExtraDamage, 0, 1, 0, 1) |
|
35 |
SetAmmo(amInvulnerable, 0, 1, 0, 1) |
|
36 |
SetAmmo(amExtraTime, 0, 1, 0, 1) |
|
37 |
SetAmmo(amLaserSight, 0, 1, 0, 1) |
|
38 |
SetAmmo(amVampiric, 0, 1, 0, 1) |
|
39 |
SetAmmo(amJetpack, 0, 1, 0, 1) |
|
40 |
SetAmmo(amPortalGun, 0, 1, 0, 1) |
|
41 |
SetAmmo(amResurrector, 0, 1, 0, 1) |
|
42 |
||
43 |
for i, w in pairs(weapons) do |
|
44 |
SetAmmo(w, 0, 0, 0, 1) |
|
45 |
end |
|
4590
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
46 |
|
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
47 |
for i, w in pairs(airweapons) do |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
48 |
SetAmmo(w, 0, 0, 0, 1) |
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
49 |
end |
4551 | 50 |
end |
51 |
||
52 |
function onNewTurn() |
|
4590
d9fed5a816e9
added MapHasBorder function for lua and finnished Random Weapons gameplay, might still change though
Henek
parents:
4551
diff
changeset
|
53 |
AddAmmo(CurrentHedgehog, weapons[GetRandom(table.maxn(weapons)) + 1]) |
4551 | 54 |
end |