author | Wuzzy <Wuzzy2@mail.ru> |
Mon, 19 Nov 2018 00:19:21 +0100 | |
changeset 14235 | 8edbdd3a1fe7 |
parent 13278 | 8f579173b161 |
child 14406 | 6c21bd8547dd |
permissions | -rw-r--r-- |
5277 | 1 |
---------------------------------- |
6747 | 2 |
-- THE SPECIALISTS MODE 0.7 |
5277 | 3 |
-- by mikade |
4 |
---------------------------------- |
|
5 |
||
6 |
-- version history |
|
7 |
----------------- |
|
8 |
-- version 0.1 |
|
9 |
----------------- |
|
10 |
-- concept test |
|
11 |
||
12 |
---------------- |
|
13 |
-- version 0.2 |
|
14 |
---------------- |
|
15 |
-- added gfRandomOrder to gameflags |
|
16 |
-- removed some deprecated variables/methods |
|
17 |
-- fixed lack of portal reset |
|
18 |
||
5362
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
19 |
---------------- |
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
20 |
-- version 0.3 |
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
21 |
---------------- |
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
22 |
-- added switching on start |
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
23 |
-- removed switch from engineer weaponset |
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
24 |
|
5382 | 25 |
---------------- |
26 |
-- version 0.4 |
|
27 |
---------------- |
|
28 |
-- Attempted to: |
|
29 |
-- fix potential switch explit |
|
30 |
-- improve user feedback on start |
|
31 |
||
5457 | 32 |
---------------- |
33 |
-- version 0.5 |
|
34 |
---------------- |
|
35 |
-- provision for variable minetimer / demo mines set to 5000ms |
|
36 |
-- don't autoswitch if player only has 1 hog on his team |
|
37 |
||
5817
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
38 |
---------------- |
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
39 |
-- version 0.6 |
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
40 |
---------------- |
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
41 |
-- for the meanwhile, don't drop any crates except health crates |
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
42 |
|
6747 | 43 |
---------------- |
44 |
-- version 0.7 |
|
45 |
---------------- |
|
46 |
-- perhogadmsdf :D :D :D :D |
|
47 |
||
5277 | 48 |
-------------------- |
49 |
--TO DO |
|
50 |
-------------------- |
|
51 |
||
5457 | 52 |
-- balance hog health, maybe |
53 |
-- add proper gameflag checking, maybe (so that we can throw in a .cfg and let the users break everything) |
|
5277 | 54 |
|
8043 | 55 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
56 |
HedgewarsScriptLoad("/Scripts/Tracker.lua") |
|
5277 | 57 |
|
5382 | 58 |
local numhhs = 0 |
59 |
local hhs = {} |
|
5277 | 60 |
|
5362
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
61 |
local started = false |
5457 | 62 |
|
6747 | 63 |
function onNewAmmoStore(groupIndex, hogIndex) |
5277 | 64 |
|
6747 | 65 |
SetAmmo(amSkip, 9, 0, 0, 0) |
5277 | 66 |
|
6747 | 67 |
if hogIndex == 0 then |
68 |
SetAmmo(amBazooka, 1, 0, 0, 0) |
|
69 |
SetAmmo(amGrenade, 1, 0, 0, 0) |
|
70 |
SetAmmo(amShotgun, 1, 0, 0, 0) |
|
71 |
elseif hogIndex == 1 then |
|
72 |
SetAmmo(amGirder, 2, 0, 0, 0) |
|
73 |
SetAmmo(amBlowTorch, 1, 0, 0, 0) |
|
74 |
SetAmmo(amPickHammer, 1, 0, 0, 0) |
|
75 |
elseif hogIndex == 2 then |
|
76 |
SetAmmo(amRope, 9, 0, 0, 0) |
|
77 |
SetAmmo(amParachute, 9, 0, 0, 0) |
|
78 |
SetAmmo(amFirePunch, 1, 0, 0, 0) |
|
79 |
elseif hogIndex == 3 then |
|
80 |
SetAmmo(amDynamite, 1, 0, 0, 0) |
|
81 |
SetAmmo(amMine, 1, 0, 0, 0) |
|
82 |
SetAmmo(amDrill, 1, 0, 0, 0) |
|
83 |
elseif hogIndex == 4 then |
|
84 |
SetAmmo(amSniperRifle, 1, 0, 0, 0) |
|
85 |
SetAmmo(amDEagle, 1, 0, 0, 0) |
|
86 |
SetAmmo(amPortalGun, 2, 0, 0, 0) |
|
87 |
elseif hogIndex == 5 then |
|
88 |
SetAmmo(amSeduction, 9, 0, 0, 0) |
|
89 |
SetAmmo(amResurrector, 1, 0, 0, 0) |
|
90 |
SetAmmo(amInvulnerable, 1, 0, 0, 0) |
|
12355 | 91 |
SetAmmo(amLowGravity, 1, 0, 0, 0) |
6747 | 92 |
elseif hogIndex == 6 then |
93 |
SetAmmo(amFlamethrower, 1, 0, 0, 0) |
|
94 |
SetAmmo(amMolotov, 1, 0, 0, 0) |
|
95 |
SetAmmo(amNapalm, 1, 0, 0, 0) |
|
96 |
elseif hogIndex == 7 then |
|
97 |
SetAmmo(amBaseballBat, 1, 0, 0, 0) |
|
98 |
SetAmmo(amGasBomb, 1, 0, 0, 0) |
|
99 |
SetAmmo(amKamikaze, 1, 0, 0, 0) |
|
100 |
end |
|
5277 | 101 |
|
102 |
end |
|
103 |
||
6747 | 104 |
function CreateTeam() |
5277 | 105 |
|
6747 | 106 |
currTeam = "" |
107 |
lastTeam = "" |
|
108 |
z = 0 |
|
109 |
||
110 |
for i = 0, (numhhs-1) do |
|
5277 | 111 |
|
6747 | 112 |
currTeam = GetHogTeamName(hhs[i]) |
5382 | 113 |
|
6747 | 114 |
if currTeam == lastTeam then |
115 |
z = z + 1 |
|
116 |
else |
|
117 |
z = 1 |
|
118 |
end |
|
5277 | 119 |
|
6747 | 120 |
if z == 1 then |
5277 | 121 |
|
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
122 |
SetHogName(hhs[i],loc("Soldier")) |
6747 | 123 |
SetHogHat(hhs[i], "sf_vega") |
124 |
SetHealth(hhs[i],200) |
|
125 |
||
126 |
elseif z == 2 then |
|
5382 | 127 |
|
6747 | 128 |
SetHogHat(hhs[i], "Glasses") |
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
129 |
SetHogName(hhs[i],loc("Engineer")) |
5382 | 130 |
|
6747 | 131 |
elseif z == 3 then |
5277 | 132 |
|
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
133 |
SetHogName(hhs[i],loc("Ninja")) |
6747 | 134 |
SetHogHat(hhs[i], "NinjaFull") |
135 |
SetHealth(hhs[i],80) |
|
5277 | 136 |
|
6747 | 137 |
elseif z == 4 then |
138 |
||
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
139 |
SetHogName(hhs[i],loc("Demo")) |
6747 | 140 |
SetHogHat(hhs[i], "Skull") |
141 |
SetHealth(hhs[i],200) |
|
142 |
||
143 |
elseif z == 5 then |
|
5277 | 144 |
|
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
145 |
SetHogName(hhs[i],loc("Sniper")) |
6747 | 146 |
SetHogHat(hhs[i], "Sniper") |
147 |
SetHealth(hhs[i],120) |
|
148 |
||
149 |
elseif z == 6 then |
|
150 |
||
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
151 |
SetHogName(hhs[i],loc("Saint")) |
6747 | 152 |
SetHogHat(hhs[i], "angel") |
153 |
SetHealth(hhs[i],300) |
|
5277 | 154 |
|
6747 | 155 |
elseif z == 7 then |
156 |
||
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
157 |
SetHogName(hhs[i],loc("Pyro")) |
6747 | 158 |
SetHogHat(hhs[i], "Gasmask") |
159 |
SetHealth(hhs[i],150) |
|
160 |
||
161 |
elseif z == 8 then |
|
162 |
||
11301
fa18940f290d
- Rus localization for following game styles:
antonc27 <antonc27@mail.ru>
parents:
10289
diff
changeset
|
163 |
SetHogName(hhs[i],loc("Loon")) |
6747 | 164 |
SetHogHat(hhs[i], "clown") |
165 |
SetHealth(hhs[i],100) |
|
166 |
||
167 |
end |
|
168 |
||
169 |
lastTeam = GetHogTeamName(hhs[i]) |
|
170 |
||
171 |
end |
|
5277 | 172 |
|
173 |
end |
|
174 |
||
175 |
function onGameInit() |
|
10036 | 176 |
ClearGameFlags() |
13278
8f579173b161
The Specialits: Use gfSwitchHog for hog switching and delete the terrible Lua hacks
Wuzzy <Wuzzy2@mail.ru>
parents:
12355
diff
changeset
|
177 |
EnableGameFlags(gfRandomOrder, gfResetWeps, gfInfAttack, gfPlaceHog, gfPerHogAmmo, gfSwitchHog) |
6747 | 178 |
Delay = 10 |
5817
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
179 |
HealthCaseProb = 100 |
5277 | 180 |
end |
181 |
||
182 |
function onGameStart() |
|
5382 | 183 |
|
6747 | 184 |
CreateTeam() |
5277 | 185 |
|
6747 | 186 |
ShowMission ( |
5382 | 187 |
loc("THE SPECIALISTS"), |
188 |
loc("a Hedgewars mini-game"), |
|
5277 | 189 |
|
5382 | 190 |
loc("Eliminate the enemy specialists.") .. "|" .. |
191 |
" " .. "|" .. |
|
5277 | 192 |
|
5382 | 193 |
loc("Game Modifiers: ") .. "|" .. |
194 |
loc("Per-Hog Ammo") .. "|" .. |
|
195 |
loc("Weapons Reset") .. "|" .. |
|
196 |
loc("Unlimited Attacks") .. "|" .. |
|
5277 | 197 |
|
5382 | 198 |
"", 4, 4000 |
199 |
) |
|
5277 | 200 |
|
5457 | 201 |
trackTeams() |
202 |
||
5277 | 203 |
end |
204 |
||
205 |
||
206 |
function onNewTurn() |
|
13278
8f579173b161
The Specialits: Use gfSwitchHog for hog switching and delete the terrible Lua hacks
Wuzzy <Wuzzy2@mail.ru>
parents:
12355
diff
changeset
|
207 |
|
6747 | 208 |
started = true |
13278
8f579173b161
The Specialits: Use gfSwitchHog for hog switching and delete the terrible Lua hacks
Wuzzy <Wuzzy2@mail.ru>
parents:
12355
diff
changeset
|
209 |
AddCaption(loc("Prepare yourself") .. ", " .. GetHogName(CurrentHedgehog).. "!") |
5277 | 210 |
|
211 |
end |
|
212 |
||
213 |
function onGearAdd(gear) |
|
5382 | 214 |
|
6747 | 215 |
if GetGearType(gear) == gtHedgehog then |
216 |
hhs[numhhs] = gear |
|
217 |
numhhs = numhhs + 1 |
|
218 |
elseif (GetGearType(gear) == gtMine) and (started == true) then |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
219 |
SetTimer(gear,5000) |
5457 | 220 |
end |
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
221 |
|
5457 | 222 |
if (GetGearType(gear) == gtHedgehog) or (GetGearType(gear) == gtResurrector) then |
223 |
trackGear(gear) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
224 |
end |
5457 | 225 |
|
5277 | 226 |
end |
227 |
||
228 |
function onGearDelete(gear) |
|
5457 | 229 |
if (GetGearType(gear) == gtHedgehog) or (GetGearType(gear) == gtResurrector) then |
230 |
trackDeletion(gear) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
231 |
end |
5277 | 232 |
end |
233 |