author | Wuzzy <Wuzzy2@mail.ru> |
Mon, 08 Apr 2019 17:59:38 +0200 | |
changeset 14776 | 97a36fb44123 |
parent 14487 | d4aa64f51c9f |
child 14937 | ff4003a90ff8 |
permissions | -rw-r--r-- |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
1 |
|
8043 | 2 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
3 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
4 |
local player = nil -- This variable will point to the hog's gear |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
5 |
local enemy = nil |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
6 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
7 |
local GameOver = false |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
8 |
|
12395
c051ac2544f2
Add note in Diver scenario that jetpack only has 50% fuel
Wuzzy <almikes@aol.com>
parents:
12359
diff
changeset
|
9 |
local jetpackFuel = 1000 |
c051ac2544f2
Add note in Diver scenario that jetpack only has 50% fuel
Wuzzy <almikes@aol.com>
parents:
12359
diff
changeset
|
10 |
|
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
11 |
function onGameInit() |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
12 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
13 |
-- Things we don't modify here will use their default values. |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
14 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
15 |
Seed = 0 -- The base number for the random number generator |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
16 |
GameFlags = gfInfAttack + gfDisableWind-- Game settings and rules |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
17 |
TurnTime = 90000 -- The time the player has to move each round (in ms) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
18 |
CaseFreq = 0 -- The frequency of crate drops |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
19 |
MinesNum = 0 -- The number of mines being placed |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
20 |
MinesTime = 1000 |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
21 |
Explosives = 0 -- The number of explosives being placed |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
22 |
Map = "Hydrant" -- The map to be played |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
23 |
Theme = "City" -- The theme to be used |
12229
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12083
diff
changeset
|
24 |
|
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12083
diff
changeset
|
25 |
-- Disable Sudden Death |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12083
diff
changeset
|
26 |
HealthDecrease = 0 |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12083
diff
changeset
|
27 |
WaterRise = 0 |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
28 |
|
14487
d4aa64f51c9f
Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents:
14469
diff
changeset
|
29 |
AddMissionTeam(-1) |
d4aa64f51c9f
Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents:
14469
diff
changeset
|
30 |
player = AddMissionHog(1) |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
31 |
|
13588
141cdfe0f3ca
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
32 |
AddTeam(loc("Toxic Team"), -6, "skull", "Island", "Default", "cm_magicskull") |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
33 |
enemy = AddHog(loc("Poison"), 1, 100, "Skull") |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
34 |
|
7877
b3fb94986255
Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents:
5823
diff
changeset
|
35 |
SetGearPosition(player,430,516) |
b3fb94986255
Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents:
5823
diff
changeset
|
36 |
SetGearPosition(enemy,1464,936) |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
37 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
38 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
39 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
40 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
41 |
function onGameStart() |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
42 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
43 |
|
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
44 |
SpawnSupplyCrate(426,886,amJetpack) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
45 |
SpawnSupplyCrate(1544,690,amFirePunch) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
46 |
SpawnSupplyCrate(950,851,amBlowTorch) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12591
diff
changeset
|
47 |
SpawnSupplyCrate(1032,853,amParachute) |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
48 |
|
7877
b3fb94986255
Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents:
5823
diff
changeset
|
49 |
AddGear(579, 296, gtMine, 0, 0, 0, 0) |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
50 |
|
12359
5e4ac10a03ce
Mention inf attack rule in Diver, also fix the in-game mission name
Wuzzy <almikes@aol.com>
parents:
12231
diff
changeset
|
51 |
ShowMission(loc("Diver"), loc("Scenario"), |
5e4ac10a03ce
Mention inf attack rule in Diver, also fix the in-game mission name
Wuzzy <almikes@aol.com>
parents:
12231
diff
changeset
|
52 |
loc("Eliminate the enemy before the time runs out.") .. "|" .. |
5e4ac10a03ce
Mention inf attack rule in Diver, also fix the in-game mission name
Wuzzy <almikes@aol.com>
parents:
12231
diff
changeset
|
53 |
loc("Unlimited Attacks: Attacks don't end your turn") .. "|" .. |
5e4ac10a03ce
Mention inf attack rule in Diver, also fix the in-game mission name
Wuzzy <almikes@aol.com>
parents:
12231
diff
changeset
|
54 |
loc("Mines time: 1 second"), -amFirePunch, 0); |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
55 |
--SetTag(AddGear(0, 0, gtATSmoothWindCh, 0, 0, 0, 1), -70) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
56 |
|
12395
c051ac2544f2
Add note in Diver scenario that jetpack only has 50% fuel
Wuzzy <almikes@aol.com>
parents:
12359
diff
changeset
|
57 |
SetAmmoDescriptionAppendix(amJetpack, string.format(loc("In this mission you get %d%% fuel."), div(jetpackFuel, 20))) |
c051ac2544f2
Add note in Diver scenario that jetpack only has 50% fuel
Wuzzy <almikes@aol.com>
parents:
12359
diff
changeset
|
58 |
|
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
59 |
SetWind(-100) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
60 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
61 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
62 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
63 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
64 |
function onGameTick() |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
65 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
66 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
67 |
if (TotalRounds == 3) and (GameOver == false) then |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
68 |
SetHealth(player, 0) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
69 |
GameOver = true |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
70 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
71 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
72 |
if TurnTimeLeft == 1 then |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
73 |
SetHealth(player, 0) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
74 |
GameOver = true |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
75 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
76 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
77 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
78 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
79 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
80 |
function onAmmoStoreInit() |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
81 |
SetAmmo(amFirePunch, 1, 0, 0, 1) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
82 |
SetAmmo(amBlowTorch, 0, 0, 0, 1) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
83 |
SetAmmo(amGirder, 1, 0, 0, 0) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
84 |
SetAmmo(amParachute, 0, 0, 0, 1) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
85 |
SetAmmo(amJetpack, 0, 0, 0, 1) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
86 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
87 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
88 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
89 |
function onGearAdd(gear) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
90 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
91 |
if GetGearType(gear) == gtJetpack then |
12395
c051ac2544f2
Add note in Diver scenario that jetpack only has 50% fuel
Wuzzy <almikes@aol.com>
parents:
12359
diff
changeset
|
92 |
SetHealth(gear, jetpackFuel) |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
93 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
94 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
95 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
96 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
97 |
function onGearDelete(gear) |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
98 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
99 |
if (gear == enemy) and (GameOver == false) then |
12359
5e4ac10a03ce
Mention inf attack rule in Diver, also fix the in-game mission name
Wuzzy <almikes@aol.com>
parents:
12231
diff
changeset
|
100 |
ShowMission(loc("Diver"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0) |
14469
ead8928a59f8
Report mission victory for most missions
Wuzzy <Wuzzy2@mail.ru>
parents:
14406
diff
changeset
|
101 |
SaveMissionVar("Won", "true") |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
102 |
elseif gear == player then |
12359
5e4ac10a03ce
Mention inf attack rule in Diver, also fix the in-game mission name
Wuzzy <almikes@aol.com>
parents:
12231
diff
changeset
|
103 |
ShowMission(loc("Diver"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0) |
4662
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
104 |
GameOver = true |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
105 |
end |
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
106 |
|
63aafc9c2a81
Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff
changeset
|
107 |
end |