author | Wuzzy <Wuzzy2@mail.ru> |
Thu, 13 Dec 2018 22:50:14 +0100 | |
changeset 14438 | a88c61d8976a |
parent 14406 | 6c21bd8547dd |
child 14469 | ead8928a59f8 |
permissions | -rw-r--r-- |
12233 | 1 |
-- Teamwork 2 |
2 |
-- Original scenario by Arkhnen |
|
3 |
||
4 |
HedgewarsScriptLoad("Scripts/Locale.lua") |
|
5 |
||
6 |
local player = nil |
|
7 |
local hlayer = nil |
|
8 |
local enemy = nil |
|
9 |
local Pack = nil |
|
10 |
local help = false |
|
11 |
local GameOver = false |
|
12 |
||
13 |
function onGameInit() |
|
14 |
Seed = 0 |
|
15 |
GameFlags = gfDisableWind |
|
13755
110d6c1e817f
Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents:
13669
diff
changeset
|
16 |
TurnTime = MAX_TURN_TIME |
12233 | 17 |
CaseFreq = 0 |
18 |
MinesNum = 0 |
|
19 |
MinesTime = 0 |
|
20 |
-- Disable Sudden Death |
|
21 |
HealthDecrease = 0 |
|
22 |
WaterRise = 0 |
|
23 |
||
24 |
Explosives = 0 |
|
25 |
Map = "CrazyMission" |
|
26 |
Theme = "CrazyMission" |
|
27 |
||
13588
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
13359
diff
changeset
|
28 |
AddTeam(loc("Feeble Resistance"), -1, "Statue", "Island", "Default", "cm_kiwi") |
12233 | 29 |
player = AddHog(loc("Greg"), 0, 30, "NoHat") |
30 |
hlayer = AddHog(loc("Mark"), 0, 40, "NoHat") |
|
31 |
||
13588
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
13359
diff
changeset
|
32 |
AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot", "cm_binary") |
12233 | 33 |
enemy = AddHog(loc("WatchBot 4000"), 5, 50, "cyborg1") |
34 |
||
35 |
SetGearPosition(player, 180, 555) |
|
36 |
SetGearPosition(enemy, 1500, 914) |
|
37 |
SetGearPosition(hlayer, 333, 555) |
|
38 |
end |
|
39 |
||
40 |
function onGameStart() |
|
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
41 |
Pack = SpawnSupplyCrate(40, 888, amPickHammer) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
42 |
SpawnSupplyCrate(90, 888, amBaseballBat) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
43 |
SpawnSupplyCrate(822, 750, amBlowTorch) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
44 |
SpawnSupplyCrate(700, 580, amJetpack) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
45 |
SpawnSupplyCrate(1400, 425, amParachute) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
46 |
SpawnSupplyCrate(1900, 770, amDynamite) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
47 |
SpawnSupplyCrate(1794, 970, amDynamite) |
12233 | 48 |
|
49 |
ShowMission(loc("Teamwork 2"), loc("Scenario"), loc("Eliminate WatchBot 4000.") .. "|" .. loc("Both your hedgehogs must survive.") .. "|" .. loc("Land mines explode instantly."), -amBaseballBat, 0) |
|
50 |
||
51 |
AddGear(355, 822, gtSMine, 0, 0, 0, 0) |
|
52 |
AddGear(515, 525, gtSMine, 0, 0, 0, 0) |
|
53 |
AddGear(1080, 821, gtMine, 0, 0, 0, 0) |
|
54 |
AddGear(1055, 821, gtMine, 0, 0, 0, 0) |
|
55 |
AddGear(930, 587, gtMine, 0, 0, 0, 0) |
|
56 |
AddGear(955, 556, gtMine, 0, 0, 0, 0) |
|
57 |
AddGear(980, 556, gtMine, 0, 0, 0, 0) |
|
58 |
AddGear(1005, 556, gtMine, 0, 0, 0, 0) |
|
59 |
AddGear(710, 790, gtMine, 0, 0, 0, 0) |
|
60 |
AddGear(685, 790, gtMine, 0, 0, 0, 0) |
|
61 |
AddGear(660, 790, gtMine, 0, 0, 0, 0) |
|
62 |
AddGear(1560, 540, gtMine, 0, 0, 0, 0) |
|
63 |
AddGear(1610, 600, gtMine, 0, 0, 0, 0) |
|
64 |
AddGear(1660, 655, gtMine, 0, 0, 0, 0) |
|
65 |
AddGear(713, 707, gtMine, 0, 0, 0, 0) |
|
66 |
AddGear(1668, 969, gtExplosives, 0, 0, 0, 0) |
|
67 |
AddGear(1668, 906, gtExplosives, 0, 0, 0, 0) |
|
68 |
AddGear(1668, 842, gtExplosives, 0, 0, 0, 0) |
|
69 |
AddGear(1713, 969, gtExplosives, 0, 0, 0, 0) |
|
70 |
SetWind(90) |
|
12358
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
71 |
|
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
72 |
-- The enemy has no weapons and can only skip |
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
73 |
for i=0, AmmoTypeMax do |
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
74 |
if i ~= amNothing and i ~= amSkip then |
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
75 |
AddAmmo(enemy, i, 0) |
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
76 |
end |
ebff18a44c1e
Refactor Teamwork 2: No more hacky skipping, set proper ammos for enemy instead
Wuzzy <almikes@aol.com>
parents:
12357
diff
changeset
|
77 |
end |
12233 | 78 |
end |
79 |
||
80 |
function onGearAdd(gear) |
|
81 |
if GetGearType(gear) == gtJetpack then |
|
82 |
SetHealth(gear, 300) |
|
83 |
end |
|
84 |
end |
|
85 |
||
86 |
function onAmmoStoreInit() |
|
87 |
SetAmmo(amParachute, 1, 0, 0, 2) |
|
88 |
SetAmmo(amSwitch, 9, 0, 0, 0) |
|
89 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
90 |
SetAmmo(amPickHammer, 0, 0, 0, 1) |
|
91 |
SetAmmo(amBaseballBat, 0, 0, 0, 1) |
|
92 |
SetAmmo(amBlowTorch, 0, 0, 0, 2) |
|
93 |
SetAmmo(amJetpack, 0, 0, 0, 1) |
|
94 |
SetAmmo(amDynamite, 0, 0, 0, 1) |
|
95 |
end |
|
96 |
||
97 |
function onGearDelete(gear) |
|
98 |
if gear == Pack then |
|
13359 | 99 |
HogSay(CurrentHedgehog, loc("This will certainly come in handy."), SAY_THINK) |
12233 | 100 |
end |
12357
7f09d01ecb45
Fix false victory in Teamwork/Teamwork 2 when one of your hogs die in same turn as enemy
Wuzzy <almikes@aol.com>
parents:
12233
diff
changeset
|
101 |
-- Note: The victory sequence is done automatically by Hedgewars |
7f09d01ecb45
Fix false victory in Teamwork/Teamwork 2 when one of your hogs die in same turn as enemy
Wuzzy <almikes@aol.com>
parents:
12233
diff
changeset
|
102 |
if ( ((gear == player) or (gear == hlayer)) and (GameOver == false)) then |
12233 | 103 |
ShowMission(loc("Teamwork 2"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0) |
104 |
GameOver = true |
|
105 |
SetHealth(hlayer, 0) |
|
106 |
SetHealth(player, 0) |
|
107 |
end |
|
108 |
end |