author | Wuzzy <Wuzzy2@mail.ru> |
Sat, 11 May 2019 04:58:11 +0200 | |
changeset 14917 | 3a53309e684b |
parent 13774 | e874bfe563c7 |
child 14977 | 7d63665cc38b |
permissions | -rw-r--r-- |
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
1 |
------------------------------- |
5821
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
2 |
-- CTF_BLIZZARD 0.9 |
4786 | 3 |
-------------------------------- |
4 |
||
5 |
--------- |
|
6 |
-- 0.2 |
|
7 |
--------- |
|
8 |
||
9 |
-- disabled super weapons |
|
10 |
||
11 |
-- theme modifications |
|
12 |
||
13 |
-- improved hog placement system: teams can now be put |
|
14 |
-- in any order and be of any size |
|
15 |
||
16 |
--------- |
|
17 |
-- 0.3 |
|
18 |
--------- |
|
19 |
||
20 |
-- In this version: |
|
21 |
||
22 |
-- changed starting weapons |
|
23 |
-- changed crate drop contents and rate of drops |
|
24 |
||
25 |
-- completely removed super weapons and super weapon scripts |
|
26 |
||
27 |
-- removed custom respawning |
|
28 |
-- removed set respawn points |
|
29 |
||
30 |
-- added AIRespawn-esque respawning |
|
31 |
-- added simple left vs right respawn points |
|
32 |
||
33 |
-- added non-lethal poison to flag carriers as an indicator |
|
34 |
||
35 |
-- improved flag mechanics and player-flag feedback |
|
36 |
-- flag now instantly respawns if you kill enemy hog and return it, |
|
37 |
-- or if the flag falls in water, _BUT_ not if it is blown up |
|
38 |
||
39 |
--------- |
|
40 |
-- 0.4 |
|
41 |
--------- |
|
42 |
||
43 |
-- tweaked crate drop rates and crate contents |
|
44 |
-- improved the teleporters, they should now be able to handle rope... hopefully |
|
45 |
-- updated SetEffect calls to be in line with 0.9.15 definitions |
|
46 |
-- added visual gears when hogs respawn |
|
47 |
-- added visual gears when hogs teleport |
|
48 |
-- added visual gear to track flag and flag carriers |
|
49 |
-- removed poisoning of flag carriers |
|
50 |
-- removed health adjustments for flag carriers due to aforementioned poisons |
|
51 |
||
52 |
--------- |
|
53 |
-- 0.5 |
|
54 |
--------- |
|
55 |
||
56 |
-- added translation support, hopefully |
|
57 |
-- added ctf rules |
|
58 |
-- added effects to the teleporters |
|
59 |
-- added aura round spawning area |
|
60 |
-- changed the aura around the flag carrier / flag to an aura and added some support for this |
|
61 |
-- changed things so the seed is no longer always the same... |
|
62 |
||
4843 | 63 |
--------- |
64 |
-- 0.6 |
|
65 |
--------- |
|
66 |
||
67 |
-- removed branding and version number |
|
68 |
-- removed teleport from starting weapons |
|
69 |
-- increased captures to 3 |
|
4786 | 70 |
|
5821
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
71 |
------------ |
4871 | 72 |
-- 0.7 |
73 |
------------ |
|
74 |
||
75 |
-- hopefully fixed a bug with the teleporters |
|
4953
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
76 |
-- added a fix for crate possibly getting imbedded in land when it was near the water line |
4871 | 77 |
|
5821
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
78 |
------------ |
4953
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
79 |
-- 0.8 |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
80 |
------------ |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
81 |
|
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
82 |
-- fixed version control fail with missing check on onGearDelete |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
83 |
|
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
84 |
-- changed hog placements code so that they start in the same place for both teams |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
85 |
-- and hogs move in the same order, not backwards to each other. |
4871 | 86 |
|
5821
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
87 |
----------- |
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
88 |
-- 0.9 |
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
89 |
------------ |
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
90 |
|
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
91 |
-- add support for more players |
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
92 |
-- re-enable sudden death, but set water rise to 0 |
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
93 |
|
9093 | 94 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
4786 | 95 |
|
96 |
--------------------------------------------------------------- |
|
97 |
----------lots of bad variables and things |
|
98 |
----------because someone is too lazy |
|
99 |
----------to read about tables properly |
|
100 |
------------------ "Oh well, they probably have the memory" |
|
101 |
||
102 |
local actionReset = 0 -- used in CheckTeleporters() |
|
103 |
||
104 |
local roundsCounter = 0 -- used to determine when to spawn more crates |
|
105 |
-- currently every 6 TURNS, should this work |
|
106 |
-- on ROUNDS instead? |
|
107 |
local effectTimer = 0 |
|
108 |
||
4871 | 109 |
local ropeGear = nil |
110 |
||
4786 | 111 |
-------------------------- |
112 |
-- hog and team tracking variales |
|
113 |
-------------------------- |
|
114 |
||
115 |
local numhhs = 0 -- store number of hedgehogs |
|
116 |
local hhs = {} -- store hedgehog gears |
|
117 |
||
118 |
local teamNameArr = {} -- store the list of teams |
|
119 |
local teamSize = {} -- store how many hogs per team |
|
120 |
local teamIndex = {} -- at what point in the hhs{} does each team begin |
|
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
121 |
local clanTeams = {} -- list of teams per clan |
4786 | 122 |
|
123 |
------------------- |
|
124 |
-- flag variables |
|
125 |
------------------- |
|
126 |
||
127 |
local fGear = {} -- pointer to the case gears that represent the flag |
|
128 |
local fThief = {} -- pointer to the hogs who stole the flags |
|
129 |
local fIsMissing = {} -- have the flags been destroyed or captured |
|
130 |
local fNeedsRespawn = {} -- do the flags need to be respawned |
|
131 |
local fCaptures = {} -- the team "scores" how many captures |
|
132 |
local fSpawnX = {} -- spawn X for flags |
|
133 |
local fSpawnY = {} -- spawn Y for flags |
|
134 |
||
135 |
local fThiefX = {} |
|
136 |
local fThiefY = {} |
|
137 |
||
138 |
local fSpawnC = {} |
|
139 |
local fCirc = {} -- flag/carrier marker circles |
|
140 |
local fCol = {} -- colour of the clans |
|
141 |
||
142 |
local vCircX = {} |
|
143 |
local vCircY = {} |
|
144 |
local vCircMinA = {} |
|
145 |
local vCircMaxA = {} |
|
146 |
local vCircType = {} |
|
147 |
local vCircPulse = {} |
|
148 |
local vCircFuckAll = {} |
|
149 |
local vCircRadius = {} |
|
150 |
local vCircWidth = {} |
|
151 |
local vCircCol = {} |
|
152 |
||
153 |
||
154 |
-------------------------------- |
|
155 |
--zone and teleporter variables |
|
156 |
-------------------------------- |
|
157 |
||
158 |
local redTel |
|
159 |
local orangeTel |
|
160 |
||
161 |
local zXMin = {} |
|
162 |
local zWidth = {} |
|
163 |
local zYMin = {} |
|
164 |
local zHeight = {} |
|
165 |
local zOccupied = {} |
|
166 |
local zCount = 0 |
|
167 |
||
168 |
------------------------ |
|
169 |
-- zone methods |
|
170 |
------------------------ |
|
171 |
-- see on gameTick also |
|
172 |
||
173 |
function ManageTeleporterEffects() |
|
174 |
effectTimer = effectTimer + 1 |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
175 |
if effectTimer > 50 then |
4786 | 176 |
effectTimer = 0 |
4843 | 177 |
|
178 |
for i = 0,1 do |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
179 |
local eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10) |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
180 |
local eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110) |
4786 | 181 |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
182 |
-- steam and smoke and DUST look good, smokering looks trippy |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
183 |
-- smoketrace and eviltrace are not effected by wind? |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
184 |
-- chunk is a LR falling gear |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
185 |
local tempE = AddVisualGear(eX, eY, vgtDust, 0, false) |
13692
a8b2a5e7e9db
Clean up more visual gears stuff in scripts
Wuzzy <Wuzzy2@mail.ru>
parents:
13648
diff
changeset
|
186 |
SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, nil, nil, fCol[i]) |
4786 | 187 |
end |
4843 | 188 |
end |
4786 | 189 |
end |
190 |
||
191 |
function CreateZone(xMin, yMin, width, height) |
|
192 |
||
193 |
||
194 |
zXMin[zCount] = xMin |
|
195 |
zYMin[zCount] = yMin |
|
196 |
zWidth[zCount] = width |
|
197 |
zHeight[zCount] = height |
|
198 |
zOccupied[zCount] = false |
|
199 |
zCount = zCount + 1 |
|
200 |
||
201 |
return (zCount-1) |
|
202 |
||
203 |
end |
|
204 |
||
205 |
function GearIsInZone(gear, zI) |
|
206 |
||
207 |
if (GetX(gear) > zXMin[zI]) and (GetX(gear) < (zXMin[zI]+zWidth[zI])) and (GetY(gear) > zYMin[zI]) and (GetY(gear) < (zYMin[zI]+zHeight[zI])) then |
|
208 |
zOccupied[zI] = true |
|
209 |
else |
|
210 |
zOccupied[zI] = false |
|
211 |
end |
|
212 |
||
213 |
return zOccupied[zI] |
|
214 |
||
215 |
end |
|
216 |
||
217 |
------------------------ |
|
218 |
--flag methods |
|
219 |
------------------------ |
|
220 |
||
221 |
function CheckScore(teamID) |
|
222 |
||
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
223 |
local alt |
4786 | 224 |
if teamID == 0 then |
225 |
alt = 1 |
|
226 |
||
227 |
elseif teamID == 1 then |
|
228 |
alt = 0 |
|
229 |
end |
|
230 |
||
4843 | 231 |
if fCaptures[teamID] == 3 then |
4786 | 232 |
for i = 0, (numhhs-1) do |
233 |
if GetHogClan(hhs[i]) == alt then |
|
7838 | 234 |
SetEffect(hhs[i], heResurrectable, 0) |
4786 | 235 |
SetHealth(hhs[i],0) |
236 |
end |
|
237 |
end |
|
238 |
ShowMission(loc("GAME OVER!"), loc("Victory for the ") .. GetHogTeamName(CurrentHedgehog), loc("Hooray!"), 0, 0) |
|
239 |
end |
|
240 |
||
241 |
end |
|
242 |
||
243 |
function HandleRespawns() |
|
244 |
||
245 |
for i = 0, 1 do |
|
246 |
||
247 |
if fNeedsRespawn[i] == true then |
|
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
248 |
fGear[i] = SpawnFakeAmmoCrate(fSpawnX[i],fSpawnY[i],false,false) |
4786 | 249 |
--fGear[i] = SpawnHealthCrate(fSpawnX[i],fSpawnY[i]) |
250 |
fNeedsRespawn[i] = false |
|
251 |
fIsMissing[i] = false -- new, this should solve problems of a respawned flag being "returned" when a player tries to score |
|
252 |
AddCaption(loc("Flag respawned!")) |
|
253 |
end |
|
254 |
||
255 |
end |
|
256 |
||
257 |
end |
|
258 |
||
259 |
function FlagDeleted(gear) |
|
260 |
||
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
261 |
local wtf, bbq |
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
262 |
PlaySound(sndShotgunReload) |
4786 | 263 |
if (gear == fGear[0]) then |
264 |
wtf = 0 |
|
265 |
bbq = 1 |
|
266 |
elseif (gear == fGear[1]) then |
|
267 |
wtf = 1 |
|
268 |
bbq = 0 |
|
269 |
end |
|
270 |
||
271 |
if CurrentHedgehog ~= nil then |
|
272 |
||
273 |
--if the player picks up the flag |
|
274 |
if CheckDistance(CurrentHedgehog, fGear[wtf]) < 1600 then |
|
275 |
||
276 |
fGear[wtf] = nil -- the flag has now disappeared and we shouldnt be pointing to it |
|
277 |
||
278 |
-- player has successfully captured the enemy flag |
|
279 |
if (GetHogClan(CurrentHedgehog) == wtf) and (CurrentHedgehog == fThief[bbq]) and (fIsMissing[wtf] == false) then |
|
280 |
fIsMissing[wtf] = false |
|
281 |
fNeedsRespawn[wtf] = true |
|
282 |
fIsMissing[bbq] = false |
|
283 |
fNeedsRespawn[bbq] = true |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
284 |
fCaptures[wtf] = fCaptures[wtf] +1 |
4843 | 285 |
|
13648 | 286 |
AddCaption(string.format(loc("%s has scored!"), GetHogTeamName(CurrentHedgehog)), capcolDefault, capgrpGameState) |
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
287 |
for i=1, #clanTeams[wtf] do |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
288 |
SetTeamLabel(clanTeams[wtf][i], fCaptures[wtf]) |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
289 |
end |
4786 | 290 |
|
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
291 |
PlaySound(sndHomerun) |
4786 | 292 |
fThief[bbq] = nil -- player no longer has the enemy flag |
293 |
CheckScore(wtf) |
|
294 |
||
295 |
--if the player is returning the flag |
|
296 |
elseif GetHogClan(CurrentHedgehog) == wtf then |
|
297 |
||
298 |
fNeedsRespawn[wtf] = true |
|
299 |
||
300 |
-- NEW ADDIITON, does this work? Should make it possible to return your flag and then score in the same turn |
|
301 |
if fIsMissing[wtf] == true then |
|
302 |
HandleRespawns() -- this will set fIsMissing[wtf] to false :) |
|
303 |
AddCaption(loc("Flag returned!")) |
|
304 |
elseif fIsMissing[wtf] == false then |
|
12431
9f3387907e06
Fix even more bad/broken loc()'s in scripts (hopefully the last one)
Wuzzy <almikes@aol.com>
parents:
12084
diff
changeset
|
305 |
AddCaption(loc("That was pointless. The flag will respawn next round.")) |
4786 | 306 |
end |
307 |
||
308 |
--if the player is taking the enemy flag |
|
309 |
elseif GetHogClan(CurrentHedgehog) == bbq then |
|
310 |
fIsMissing[wtf] = true |
|
311 |
for i = 0,numhhs-1 do |
|
312 |
if CurrentHedgehog == hhs[i] then |
|
313 |
fThief[wtf] = hhs[i] |
|
314 |
end |
|
315 |
end |
|
316 |
||
317 |
AddCaption(loc("Flag captured!")) |
|
318 |
||
319 |
else --below line doesnt usually get called |
|
320 |
AddCaption("Hmm... that wasn't supposed to happen...") |
|
321 |
||
322 |
end |
|
323 |
||
324 |
-- if flag has been destroyed, probably |
|
325 |
else |
|
326 |
||
327 |
if GetY(fGear[wtf]) > 2025 then |
|
328 |
fGear[wtf] = nil |
|
329 |
fIsMissing[wtf] = true |
|
330 |
fNeedsRespawn[wtf] = true |
|
331 |
HandleRespawns() |
|
332 |
else |
|
333 |
fGear[wtf] = nil |
|
334 |
fIsMissing[wtf] = true |
|
335 |
fNeedsRespawn[wtf] = true |
|
336 |
AddCaption(loc("Boom!") .. " " .. loc("The flag will respawn next round.")) |
|
337 |
end |
|
338 |
||
339 |
end |
|
340 |
||
341 |
-- if flag has been destroyed deep underwater and player is now nil |
|
342 |
-- probably only gets called if the flag thief drowns himself |
|
343 |
-- otherwise the above one will work fine |
|
344 |
else |
|
345 |
fGear[wtf] = nil |
|
346 |
fIsMissing[wtf] = true |
|
347 |
fNeedsRespawn[wtf] = true |
|
348 |
AddCaption(loc("The flag will respawn next round.")) |
|
349 |
end |
|
350 |
||
351 |
end |
|
352 |
||
353 |
function FlagThiefDead(gear) |
|
354 |
||
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
355 |
local wtf, bbq |
4786 | 356 |
if (gear == fThief[0]) then |
357 |
wtf = 0 |
|
358 |
bbq = 1 |
|
359 |
elseif (gear == fThief[1]) then |
|
360 |
wtf = 1 |
|
361 |
bbq = 0 |
|
362 |
end |
|
363 |
||
364 |
if fThief[wtf] ~= nil then |
|
4871 | 365 |
|
366 |
if fThiefY[wtf] > 2040 then |
|
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
367 |
fGear[wtf] = SpawnFakeAmmoCrate(fThiefX[wtf],(fThiefY[wtf]+10),false,false) |
4871 | 368 |
else |
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
369 |
fGear[wtf] = SpawnFakeAmmoCrate(fThiefX[wtf],(fThiefY[wtf]-50),false,false) |
4871 | 370 |
end |
371 |
||
4786 | 372 |
AddVisualGear(fThiefX[wtf], fThiefY[wtf], vgtBigExplosion, 0, false) |
373 |
fThief[wtf] = nil |
|
374 |
end |
|
375 |
||
376 |
end |
|
377 |
||
378 |
function HandleCircles() |
|
4843 | 379 |
|
4786 | 380 |
for i = 0, 1 do |
381 |
if fIsMissing[i] == false then -- draw a circle at the flag's spawning place |
|
382 |
SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
383 |
elseif (fIsMissing[i] == true) and (fNeedsRespawn[i] == false) then |
|
384 |
if fThief[i] ~= nil then -- draw circle round flag carrier |
|
385 |
SetVisualGearValues(fCirc[i], fThiefX[i], fThiefY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
386 |
elseif fThief[i] == nil then -- draw cirle round dropped flag |
|
387 |
SetVisualGearValues(fCirc[i], GetX(fGear[i]),GetY(fGear[i]), vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
388 |
end |
|
389 |
end |
|
4843 | 390 |
|
4786 | 391 |
if fNeedsRespawn[i] == true then -- if the flag has been destroyed, no need for a circle |
392 |
SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 0, 0, fCol[i]) |
|
393 |
end |
|
394 |
end |
|
395 |
||
396 |
end |
|
397 |
||
398 |
------------------------ |
|
399 |
-- general methods |
|
400 |
------------------------ |
|
401 |
||
402 |
function CheckDistance(gear1, gear2) |
|
403 |
||
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
404 |
local g1X, g1Y = GetGearPosition(gear1) |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
405 |
local g2X, g2Y = GetGearPosition(gear2) |
4786 | 406 |
|
407 |
g1X = g1X - g2X |
|
408 |
g1Y = g1Y - g2Y |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
409 |
local dist = (g1X*g1X) + (g1Y*g1Y) |
4786 | 410 |
|
411 |
return dist |
|
412 |
||
413 |
end |
|
414 |
||
415 |
function CheckTeleporters() |
|
416 |
||
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
417 |
local teleportActive = false |
4786 | 418 |
|
419 |
if (GearIsInZone(CurrentHedgehog, redTel) == true) and (GetHogClan(CurrentHedgehog) == 0) then |
|
420 |
teleportActive = true |
|
421 |
destinationX = 1402 |
|
422 |
destinationY = 321 |
|
423 |
elseif (GearIsInZone(CurrentHedgehog, orangeTel) == true) and (GetHogClan(CurrentHedgehog) == 1) then |
|
424 |
teleportActive = true |
|
425 |
destinationX = 2692 |
|
426 |
destinationY = 321 |
|
427 |
end |
|
428 |
||
429 |
if teleportActive == true then |
|
430 |
if actionReset == 0 then |
|
4871 | 431 |
if ropeGear ~= nil then |
432 |
if GetGearElasticity(ropeGear) ~= 0 then |
|
433 |
SetGearMessage(CurrentHedgehog, gmAttack) |
|
434 |
end |
|
435 |
end |
|
4786 | 436 |
elseif actionReset == 10 then |
437 |
SetGearMessage(CurrentHedgehog, 0) |
|
438 |
elseif actionReset == 20 then |
|
439 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false) |
|
440 |
SetGearPosition(CurrentHedgehog,destinationX,destinationY) |
|
441 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false) |
|
442 |
end |
|
443 |
||
444 |
actionReset = actionReset + 1 |
|
445 |
if actionReset >= 30 then |
|
446 |
actionReset = 0 |
|
447 |
end |
|
448 |
||
449 |
end |
|
450 |
||
451 |
end |
|
452 |
||
453 |
function RebuildTeamInfo() |
|
454 |
||
455 |
||
456 |
-- make a list of individual team names |
|
5821
afb988c1a2fe
Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents:
5328
diff
changeset
|
457 |
for i = 0, (TeamsCount-1) do |
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
458 |
teamNameArr[i] = GetTeamName(i) |
4786 | 459 |
teamSize[i] = 0 |
460 |
teamIndex[i] = 0 |
|
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
461 |
SetTeamLabel(teamNameArr[i], "0") |
4786 | 462 |
end |
463 |
||
464 |
-- find out how many hogs per team, and the index of the first hog in hhs |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
465 |
for i = 0, TeamsCount-1 do |
4786 | 466 |
|
467 |
for z = 0, numhhs-1 do |
|
468 |
if GetHogTeamName(hhs[z]) == teamNameArr[i] then |
|
469 |
if teamSize[i] == 0 then |
|
470 |
teamIndex[i] = z -- should give starting index |
|
471 |
end |
|
472 |
teamSize[i] = teamSize[i] + 1 |
|
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
473 |
|
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
474 |
local clan = GetHogClan(hhs[z]) |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
475 |
-- Also remember the clan to which the team belongs to |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
476 |
if not clanTeams[clan] then |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
477 |
clanTeams[clan] = {} |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
478 |
end |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
479 |
table.insert(clanTeams[clan], teamNameArr[i]) |
4786 | 480 |
end |
481 |
end |
|
482 |
||
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
483 |
|
4786 | 484 |
end |
485 |
||
486 |
end |
|
487 |
||
488 |
function HandleCrateDrops() |
|
489 |
||
490 |
roundsCounter = roundsCounter +1 |
|
491 |
||
492 |
if roundsCounter == 5 then |
|
493 |
||
494 |
roundsCounter = 0 |
|
495 |
||
496 |
r = GetRandom(8) |
|
497 |
if r == 0 then |
|
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
498 |
SpawnSupplyCrate(0,0,amSwitch) |
4786 | 499 |
elseif r == 1 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
500 |
SpawnSupplyCrate(0,0,amTeleport) |
4786 | 501 |
elseif r == 2 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
502 |
SpawnSupplyCrate(0,0,amJetpack) |
4786 | 503 |
elseif r == 3 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
504 |
SpawnSupplyCrate(0,0,amExtraTime) |
4786 | 505 |
elseif r == 4 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
506 |
SpawnSupplyCrate(0,0,amGirder) |
4786 | 507 |
elseif r == 5 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
508 |
SpawnSupplyCrate(0,0,amDynamite) |
4786 | 509 |
elseif r == 6 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
510 |
SpawnSupplyCrate(0,0,amFlamethrower) |
4786 | 511 |
elseif r == 7 then |
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
512 |
SpawnSupplyCrate(0,0,amPortalGun) |
4786 | 513 |
end |
514 |
||
515 |
end |
|
516 |
||
517 |
end |
|
518 |
||
519 |
------------------------ |
|
520 |
-- game methods |
|
521 |
------------------------ |
|
522 |
||
523 |
function onGameInit() |
|
524 |
||
525 |
-- Things we don't modify here will use their default values. |
|
526 |
GameFlags = gfDivideTeams -- Game settings and rules |
|
13122
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
527 |
TurnTime = 30000 -- The time the player has to move each round (in ms) |
4786 | 528 |
CaseFreq = 0 -- The frequency of crate drops |
529 |
MinesNum = 0 -- The number of mines being placed |
|
530 |
Explosives = 0 -- The number of explosives being placed |
|
12084
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
531 |
-- Disable Sudden Death |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
532 |
WaterRise = 0 |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12082
diff
changeset
|
533 |
HealthDecrease = 0 |
4786 | 534 |
Map = "Blizzard" -- The map to be played |
13122
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
535 |
Theme = "Snow" -- The theme to be used |
4786 | 536 |
|
537 |
end |
|
538 |
||
539 |
||
540 |
function onGameStart() |
|
541 |
||
12082
ce3860c82c8b
Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents:
9093
diff
changeset
|
542 |
ShowMission(loc("CTF_Blizzard"), loc("Capture The Flag"), loc(" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"), 0, 0) |
4786 | 543 |
|
544 |
||
545 |
-- initialize teleporters |
|
546 |
redTel = CreateZone(342,1316,42,449) -- red teleporter |
|
547 |
orangeTel = CreateZone(3719,1330,45,449) -- orange teleporter |
|
548 |
||
549 |
||
550 |
--new improved placement schematics aw yeah |
|
551 |
RebuildTeamInfo() |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
552 |
local team1Placed = 0 |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
553 |
local team2Placed = 0 |
4786 | 554 |
for i = 0, (TeamsCount-1) do |
555 |
for g = teamIndex[i], (teamIndex[i]+teamSize[i]-1) do |
|
556 |
if GetHogClan(hhs[g]) == 0 then |
|
557 |
SetGearPosition(hhs[g],1403+ ((team1Placed+1)*50),1570) |
|
558 |
team1Placed = team1Placed +1 |
|
559 |
if team1Placed > 6 then |
|
560 |
team1Placed = 0 |
|
561 |
end |
|
562 |
elseif GetHogClan(hhs[g]) == 1 then |
|
4953
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
563 |
SetGearPosition(hhs[g],2691- ((team2Placed+1)*50),1570) |
4786 | 564 |
team2Placed = team2Placed +1 |
565 |
if team2Placed > 6 then |
|
566 |
team2Placed = 0 |
|
567 |
end |
|
568 |
end |
|
569 |
end |
|
570 |
end |
|
571 |
||
572 |
||
573 |
||
574 |
--spawn starting ufos and or super weapons |
|
12938
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12431
diff
changeset
|
575 |
SpawnSupplyCrate(2048,1858,amJetpack) |
4786 | 576 |
|
577 |
--set flag spawn points and spawn the flags |
|
578 |
fSpawnX[0] = 957 |
|
579 |
fSpawnY[0] = 1747 |
|
580 |
fSpawnX[1] = 3123 |
|
581 |
fSpawnY[1] = 1747 |
|
582 |
||
13774
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
583 |
if ClansCount < 2 then |
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
584 |
return |
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
585 |
end |
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
586 |
|
4786 | 587 |
for i = 0, 1 do |
13024
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12938
diff
changeset
|
588 |
fGear[i] = SpawnFakeAmmoCrate(fSpawnX[i],fSpawnY[i],false,false) |
4786 | 589 |
fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
4843 | 590 |
fCol[i] = GetClanColor(i) |
4786 | 591 |
|
592 |
fSpawnC[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
|
4843 | 593 |
SetVisualGearValues(fSpawnC[i], fSpawnX[i],fSpawnY[i], 10, 200, 1, 10, 0, 300, 5, fCol[i]) |
594 |
||
595 |
||
4786 | 596 |
fIsMissing[i] = false |
597 |
fNeedsRespawn[i] = false |
|
598 |
fCaptures[i] = 0 |
|
599 |
||
600 |
vCircMinA[i] = 20 |
|
601 |
vCircMaxA[i] = 255 |
|
602 |
vCircType[i] = 1 |
|
603 |
vCircPulse[i] = 10 |
|
604 |
vCircFuckAll[i] = 0 |
|
605 |
vCircRadius[i] = 150 |
|
606 |
vCircWidth[i] = 5 |
|
607 |
vCircCol[i] = fCol[i] |
|
608 |
||
609 |
SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
610 |
||
611 |
end |
|
612 |
||
613 |
end |
|
614 |
||
615 |
||
616 |
function onNewTurn() |
|
617 |
||
618 |
HandleRespawns() |
|
619 |
HandleCrateDrops() |
|
620 |
||
621 |
end |
|
622 |
||
623 |
function onGameTick() |
|
624 |
||
625 |
-- onRessurect calls AFTER you have resurrected, |
|
626 |
-- so keeping track of x,y a few milliseconds before |
|
627 |
-- is useful |
|
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
628 |
|
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
629 |
for i = 0,1 do |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
630 |
if fThief[i] ~= nil then |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
631 |
fThiefX[i] = GetX(fThief[i]) |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
632 |
fThiefY[i] = GetY(fThief[i]) |
4786 | 633 |
end |
13121
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13024
diff
changeset
|
634 |
end |
4786 | 635 |
|
636 |
-- things we wanna check often |
|
637 |
if (CurrentHedgehog ~= nil) then |
|
638 |
CheckTeleporters() |
|
639 |
end |
|
640 |
||
641 |
HandleCircles() |
|
642 |
ManageTeleporterEffects() |
|
643 |
||
644 |
end |
|
645 |
||
646 |
||
647 |
function onAmmoStoreInit() |
|
648 |
||
649 |
SetAmmo(amDrill,9,0,0,0) |
|
650 |
SetAmmo(amMortar,9,0,0,0) |
|
651 |
||
652 |
SetAmmo(amGrenade,9,0,0,0) |
|
653 |
SetAmmo(amClusterBomb,4,0,0,0) |
|
654 |
||
655 |
SetAmmo(amShotgun, 9, 0, 0, 0) |
|
656 |
SetAmmo(amFlamethrower, 1, 0, 0, 1) |
|
657 |
||
658 |
SetAmmo(amFirePunch, 9, 0, 0, 0) |
|
659 |
SetAmmo(amBaseballBat, 2, 0, 0, 0) |
|
660 |
||
661 |
SetAmmo(amDynamite,2,0,0,1) |
|
662 |
SetAmmo(amSMine,4,0,0,0) |
|
663 |
||
664 |
SetAmmo(amBlowTorch, 9, 0, 0, 0) |
|
665 |
SetAmmo(amPickHammer, 9, 0, 0, 0) |
|
666 |
SetAmmo(amGirder, 2, 0, 0, 2) |
|
667 |
SetAmmo(amPortalGun, 2, 0, 0, 2) |
|
668 |
||
669 |
SetAmmo(amParachute, 9, 0, 0, 0) |
|
670 |
SetAmmo(amRope, 9, 0, 0, 0) |
|
4843 | 671 |
SetAmmo(amTeleport, 0, 0, 0, 1) |
4786 | 672 |
SetAmmo(amJetpack, 1, 0, 0, 1) |
673 |
||
674 |
SetAmmo(amSwitch, 2, 0, 0, 1) |
|
675 |
SetAmmo(amExtraTime,1,0,0,1) |
|
676 |
SetAmmo(amLowGravity,1,0,0,0) |
|
677 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
678 |
||
679 |
end |
|
680 |
||
681 |
||
13635
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13122
diff
changeset
|
682 |
function onGearResurrect(gear, vGear) |
4786 | 683 |
|
684 |
-- mark the flag thief as dead if he needed a respawn |
|
685 |
for i = 0,1 do |
|
686 |
if gear == fThief[i] then |
|
687 |
FlagThiefDead(gear) |
|
688 |
end |
|
689 |
end |
|
690 |
||
691 |
-- place hogs belonging to each clan either left or right side of map |
|
692 |
if GetHogClan(gear) == 0 then |
|
693 |
FindPlace(gear, false, 0, 2048) |
|
694 |
elseif GetHogClan(gear) == 1 then |
|
695 |
FindPlace(gear, false, 2048, LAND_WIDTH) |
|
696 |
end |
|
4843 | 697 |
|
13635
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13122
diff
changeset
|
698 |
if vGear then |
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13122
diff
changeset
|
699 |
SetVisualGearValues(vGear, GetX(gear), GetY(gear)) |
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13122
diff
changeset
|
700 |
end |
4786 | 701 |
|
702 |
end |
|
703 |
||
13122
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
704 |
local excessHogsWarning = false |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
705 |
|
4786 | 706 |
function onGearAdd(gear) |
707 |
||
708 |
if GetGearType(gear) == gtHedgehog then |
|
709 |
||
13122
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
710 |
if GetHogClan(gear) > 1 then |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
711 |
DeleteGear(gear) |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
712 |
if not excessHogsWarning then |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
713 |
WriteLnToChat(loc("Only two clans allowed! Excess hedgehogs will be removed.")) |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
714 |
excessHogsWarning = true |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
715 |
end |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
716 |
else |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
717 |
hhs[numhhs] = gear |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
718 |
numhhs = numhhs + 1 |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
719 |
SetEffect(gear, heResurrectable, 1) |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
720 |
end |
4786 | 721 |
|
13122
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13121
diff
changeset
|
722 |
elseif GetGearType(gear) == gtRope then |
4871 | 723 |
ropeGear = gear |
724 |
end |
|
725 |
||
4786 | 726 |
end |
727 |
||
728 |
function onGearDelete(gear) |
|
729 |
||
730 |
if (gear == fGear[0]) or (gear == fGear[1]) then |
|
731 |
FlagDeleted(gear) |
|
732 |
end |
|
733 |
||
4871 | 734 |
if GetGearType(gear) == gtRope then |
735 |
ropeGear = nil |
|
736 |
end |
|
737 |
||
4953
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
738 |
if GetGearType(gear) == gtHedgehog then |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
739 |
for i = 0, (numhhs-1) do |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
740 |
if gear == hhs[i] then |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
741 |
|
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
742 |
for k = 0,1 do |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
743 |
if gear == fThief[k] then |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
744 |
FlagThiefDead(gear) |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
745 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
746 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
747 |
hhs[i] = nil |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
748 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
749 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
750 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
751 |
|
4786 | 752 |
end |