author | Wuzzy <Wuzzy2@mail.ru> |
Thu, 16 May 2019 19:29:51 +0200 | |
changeset 14995 | 2eea2c370389 |
parent 14994 | e50943f1d0af |
child 14996 | fdfe8bf91b8b |
permissions | -rw-r--r-- |
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
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 |
|
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
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 |
||
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
158 |
local leftTel |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
159 |
local rightTel |
4786 | 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 |
|
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
175 |
if effectTimer > 50 then |
4786 | 176 |
effectTimer = 0 |
4843 | 177 |
|
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
178 |
local i = GetHogClan(CurrentHedgehog) |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
179 |
if i ~= 0 and i ~= 1 then |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
180 |
return |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
181 |
end |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
182 |
local eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10) |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
183 |
local eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110) |
4786 | 184 |
|
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
185 |
-- steam and smoke and DUST look good, smokering looks trippy |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
186 |
-- smoketrace and eviltrace are not effected by wind? |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
187 |
-- chunk is a LR falling gear |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
188 |
local tempE = AddVisualGear(eX, eY, vgtDust, 0, false) |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
189 |
SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, nil, nil, fCol[i]) |
4843 | 190 |
end |
4786 | 191 |
end |
192 |
||
193 |
function CreateZone(xMin, yMin, width, height) |
|
194 |
||
195 |
||
196 |
zXMin[zCount] = xMin |
|
197 |
zYMin[zCount] = yMin |
|
198 |
zWidth[zCount] = width |
|
199 |
zHeight[zCount] = height |
|
200 |
zOccupied[zCount] = false |
|
201 |
zCount = zCount + 1 |
|
202 |
||
203 |
return (zCount-1) |
|
204 |
||
205 |
end |
|
206 |
||
207 |
function GearIsInZone(gear, zI) |
|
208 |
||
209 |
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 |
|
210 |
zOccupied[zI] = true |
|
211 |
else |
|
212 |
zOccupied[zI] = false |
|
213 |
end |
|
214 |
||
215 |
return zOccupied[zI] |
|
216 |
||
217 |
end |
|
218 |
||
219 |
------------------------ |
|
220 |
--flag methods |
|
221 |
------------------------ |
|
222 |
||
223 |
function CheckScore(teamID) |
|
224 |
||
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
225 |
local alt |
4786 | 226 |
if teamID == 0 then |
227 |
alt = 1 |
|
228 |
||
229 |
elseif teamID == 1 then |
|
230 |
alt = 0 |
|
231 |
end |
|
232 |
||
4843 | 233 |
if fCaptures[teamID] == 3 then |
4786 | 234 |
for i = 0, (numhhs-1) do |
235 |
if GetHogClan(hhs[i]) == alt then |
|
7838 | 236 |
SetEffect(hhs[i], heResurrectable, 0) |
4786 | 237 |
SetHealth(hhs[i],0) |
238 |
end |
|
239 |
end |
|
240 |
ShowMission(loc("GAME OVER!"), loc("Victory for the ") .. GetHogTeamName(CurrentHedgehog), loc("Hooray!"), 0, 0) |
|
241 |
end |
|
242 |
||
243 |
end |
|
244 |
||
245 |
function HandleRespawns() |
|
246 |
||
247 |
for i = 0, 1 do |
|
248 |
||
249 |
if fNeedsRespawn[i] == true then |
|
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
250 |
fGear[i] = SpawnFakeAmmoCrate(fSpawnX[i],fSpawnY[i],false,false) |
4786 | 251 |
fNeedsRespawn[i] = false |
252 |
fIsMissing[i] = false -- new, this should solve problems of a respawned flag being "returned" when a player tries to score |
|
14994 | 253 |
AddCaption(loc("Flag respawned!"), capcolDefault, capgrpAmmoinfo) |
4786 | 254 |
end |
255 |
||
256 |
end |
|
257 |
||
258 |
end |
|
259 |
||
260 |
function FlagDeleted(gear) |
|
261 |
||
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
262 |
local wtf, bbq |
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 |
|
14994 | 274 |
if band(GetGearMessage(gear), gmDestroy) ~= 0 then |
4786 | 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 |
|
14994 | 280 |
PlaySound(sndShotgunReload) |
4786 | 281 |
fIsMissing[wtf] = false |
282 |
fNeedsRespawn[wtf] = true |
|
283 |
fIsMissing[bbq] = false |
|
284 |
fNeedsRespawn[bbq] = true |
|
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
285 |
fCaptures[wtf] = fCaptures[wtf] +1 |
4843 | 286 |
|
13643 | 287 |
AddCaption(string.format(loc("%s has scored!"), GetHogTeamName(CurrentHedgehog)), capcolDefault, capgrpGameState) |
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
288 |
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:
12933
diff
changeset
|
289 |
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:
12933
diff
changeset
|
290 |
end |
4786 | 291 |
|
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
292 |
PlaySound(sndHomerun) |
4786 | 293 |
fThief[bbq] = nil -- player no longer has the enemy flag |
294 |
CheckScore(wtf) |
|
295 |
||
296 |
--if the player is returning the flag |
|
297 |
elseif GetHogClan(CurrentHedgehog) == wtf then |
|
14994 | 298 |
PlaySound(sndShotgunReload) |
4786 | 299 |
fNeedsRespawn[wtf] = true |
300 |
||
301 |
-- NEW ADDIITON, does this work? Should make it possible to return your flag and then score in the same turn |
|
302 |
if fIsMissing[wtf] == true then |
|
303 |
HandleRespawns() -- this will set fIsMissing[wtf] to false :) |
|
14994 | 304 |
AddCaption(loc("Flag returned!"), capcolDefault, capgrpAmmoinfo) |
4786 | 305 |
elseif fIsMissing[wtf] == false then |
12426
9f3387907e06
Fix even more bad/broken loc()'s in scripts (hopefully the last one)
Wuzzy <almikes@aol.com>
parents:
12079
diff
changeset
|
306 |
AddCaption(loc("That was pointless. The flag will respawn next round.")) |
4786 | 307 |
end |
308 |
||
309 |
--if the player is taking the enemy flag |
|
310 |
elseif GetHogClan(CurrentHedgehog) == bbq then |
|
14994 | 311 |
PlaySound(sndShotgunReload) |
4786 | 312 |
fIsMissing[wtf] = true |
313 |
for i = 0,numhhs-1 do |
|
314 |
if CurrentHedgehog == hhs[i] then |
|
315 |
fThief[wtf] = hhs[i] |
|
316 |
end |
|
317 |
end |
|
318 |
||
319 |
AddCaption(loc("Flag captured!")) |
|
320 |
||
321 |
else --below line doesnt usually get called |
|
322 |
AddCaption("Hmm... that wasn't supposed to happen...") |
|
323 |
||
324 |
end |
|
325 |
||
14994 | 326 |
-- if flag has been destroyed |
4786 | 327 |
else |
328 |
||
329 |
if GetY(fGear[wtf]) > 2025 then |
|
330 |
fGear[wtf] = nil |
|
331 |
fIsMissing[wtf] = true |
|
332 |
fNeedsRespawn[wtf] = true |
|
333 |
HandleRespawns() |
|
334 |
else |
|
335 |
fGear[wtf] = nil |
|
336 |
fIsMissing[wtf] = true |
|
337 |
fNeedsRespawn[wtf] = true |
|
338 |
AddCaption(loc("Boom!") .. " " .. loc("The flag will respawn next round.")) |
|
339 |
end |
|
340 |
||
341 |
end |
|
342 |
||
343 |
-- if flag has been destroyed deep underwater and player is now nil |
|
344 |
-- probably only gets called if the flag thief drowns himself |
|
345 |
-- otherwise the above one will work fine |
|
346 |
else |
|
347 |
fGear[wtf] = nil |
|
348 |
fIsMissing[wtf] = true |
|
349 |
fNeedsRespawn[wtf] = true |
|
350 |
AddCaption(loc("The flag will respawn next round.")) |
|
351 |
end |
|
352 |
||
353 |
end |
|
354 |
||
355 |
function FlagThiefDead(gear) |
|
356 |
||
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
357 |
local wtf, bbq |
4786 | 358 |
if (gear == fThief[0]) then |
359 |
wtf = 0 |
|
360 |
bbq = 1 |
|
361 |
elseif (gear == fThief[1]) then |
|
362 |
wtf = 1 |
|
363 |
bbq = 0 |
|
364 |
end |
|
365 |
||
366 |
if fThief[wtf] ~= nil then |
|
4871 | 367 |
|
368 |
if fThiefY[wtf] > 2040 then |
|
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
369 |
fGear[wtf] = SpawnFakeAmmoCrate(fThiefX[wtf],(fThiefY[wtf]+10),false,false) |
4871 | 370 |
else |
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
371 |
fGear[wtf] = SpawnFakeAmmoCrate(fThiefX[wtf],(fThiefY[wtf]-50),false,false) |
4871 | 372 |
end |
14994 | 373 |
AddCaption(string.format(loc("%s has dropped the flag!"), GetHogName(gear)), capcolDefault, capgrpAmmoinfo) |
4871 | 374 |
|
4786 | 375 |
AddVisualGear(fThiefX[wtf], fThiefY[wtf], vgtBigExplosion, 0, false) |
376 |
fThief[wtf] = nil |
|
377 |
end |
|
378 |
||
379 |
end |
|
380 |
||
381 |
function HandleCircles() |
|
4843 | 382 |
|
4786 | 383 |
for i = 0, 1 do |
384 |
if fIsMissing[i] == false then -- draw a circle at the flag's spawning place |
|
385 |
SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
386 |
elseif (fIsMissing[i] == true) and (fNeedsRespawn[i] == false) then |
|
387 |
if fThief[i] ~= nil then -- draw circle round flag carrier |
|
388 |
SetVisualGearValues(fCirc[i], fThiefX[i], fThiefY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
389 |
elseif fThief[i] == nil then -- draw cirle round dropped flag |
|
390 |
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]) |
|
391 |
end |
|
392 |
end |
|
4843 | 393 |
|
4786 | 394 |
if fNeedsRespawn[i] == true then -- if the flag has been destroyed, no need for a circle |
395 |
SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 0, 0, fCol[i]) |
|
396 |
end |
|
397 |
end |
|
398 |
||
399 |
end |
|
400 |
||
401 |
------------------------ |
|
402 |
-- general methods |
|
403 |
------------------------ |
|
404 |
||
405 |
function CheckTeleporters() |
|
406 |
||
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
407 |
local teleportActive = false |
4786 | 408 |
|
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
409 |
if (GearIsInZone(CurrentHedgehog, leftTel) == true) and (GetHogClan(CurrentHedgehog) == 0) then |
4786 | 410 |
teleportActive = true |
411 |
destinationX = 1402 |
|
412 |
destinationY = 321 |
|
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
413 |
elseif (GearIsInZone(CurrentHedgehog, rightTel) == true) and (GetHogClan(CurrentHedgehog) == 1) then |
4786 | 414 |
teleportActive = true |
415 |
destinationX = 2692 |
|
416 |
destinationY = 321 |
|
417 |
end |
|
418 |
||
419 |
if teleportActive == true then |
|
420 |
if actionReset == 0 then |
|
4871 | 421 |
if ropeGear ~= nil then |
422 |
if GetGearElasticity(ropeGear) ~= 0 then |
|
423 |
SetGearMessage(CurrentHedgehog, gmAttack) |
|
424 |
end |
|
425 |
end |
|
4786 | 426 |
elseif actionReset == 10 then |
427 |
SetGearMessage(CurrentHedgehog, 0) |
|
428 |
elseif actionReset == 20 then |
|
429 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false) |
|
430 |
SetGearPosition(CurrentHedgehog,destinationX,destinationY) |
|
431 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false) |
|
432 |
end |
|
433 |
||
434 |
actionReset = actionReset + 1 |
|
435 |
if actionReset >= 30 then |
|
436 |
actionReset = 0 |
|
437 |
end |
|
438 |
||
439 |
end |
|
440 |
||
441 |
end |
|
442 |
||
443 |
function RebuildTeamInfo() |
|
444 |
||
445 |
||
446 |
-- 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
|
447 |
for i = 0, (TeamsCount-1) do |
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
448 |
teamNameArr[i] = GetTeamName(i) |
4786 | 449 |
teamSize[i] = 0 |
450 |
teamIndex[i] = 0 |
|
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
451 |
SetTeamLabel(teamNameArr[i], "0") |
4786 | 452 |
end |
453 |
||
454 |
-- find out how many hogs per team, and the index of the first hog in hhs |
|
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
455 |
for i = 0, TeamsCount-1 do |
4786 | 456 |
|
457 |
for z = 0, numhhs-1 do |
|
458 |
if GetHogTeamName(hhs[z]) == teamNameArr[i] then |
|
459 |
if teamSize[i] == 0 then |
|
460 |
teamIndex[i] = z -- should give starting index |
|
461 |
end |
|
462 |
teamSize[i] = teamSize[i] + 1 |
|
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
463 |
|
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
464 |
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:
12933
diff
changeset
|
465 |
-- 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:
12933
diff
changeset
|
466 |
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:
12933
diff
changeset
|
467 |
clanTeams[clan] = {} |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
468 |
end |
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
469 |
table.insert(clanTeams[clan], teamNameArr[i]) |
4786 | 470 |
end |
471 |
end |
|
472 |
||
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
473 |
|
4786 | 474 |
end |
475 |
||
476 |
end |
|
477 |
||
478 |
function HandleCrateDrops() |
|
479 |
||
480 |
roundsCounter = roundsCounter +1 |
|
481 |
||
482 |
if roundsCounter == 5 then |
|
483 |
||
484 |
roundsCounter = 0 |
|
485 |
||
486 |
r = GetRandom(8) |
|
487 |
if r == 0 then |
|
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
488 |
SpawnSupplyCrate(0,0,amSwitch) |
4786 | 489 |
elseif r == 1 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
490 |
SpawnSupplyCrate(0,0,amTeleport) |
4786 | 491 |
elseif r == 2 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
492 |
SpawnSupplyCrate(0,0,amJetpack) |
4786 | 493 |
elseif r == 3 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
494 |
SpawnSupplyCrate(0,0,amExtraTime) |
4786 | 495 |
elseif r == 4 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
496 |
SpawnSupplyCrate(0,0,amGirder) |
4786 | 497 |
elseif r == 5 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
498 |
SpawnSupplyCrate(0,0,amDynamite) |
4786 | 499 |
elseif r == 6 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
500 |
SpawnSupplyCrate(0,0,amFlamethrower) |
4786 | 501 |
elseif r == 7 then |
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
502 |
SpawnSupplyCrate(0,0,amPortalGun) |
4786 | 503 |
end |
14994 | 504 |
PlaySound(sndReinforce, CurrentHedgehog) |
4786 | 505 |
|
506 |
end |
|
507 |
||
508 |
end |
|
509 |
||
510 |
------------------------ |
|
511 |
-- game methods |
|
512 |
------------------------ |
|
513 |
||
514 |
function onGameInit() |
|
515 |
||
516 |
-- Things we don't modify here will use their default values. |
|
517 |
GameFlags = gfDivideTeams -- Game settings and rules |
|
13117
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
518 |
TurnTime = 30000 -- The time the player has to move each round (in ms) |
4786 | 519 |
CaseFreq = 0 -- The frequency of crate drops |
520 |
MinesNum = 0 -- The number of mines being placed |
|
521 |
Explosives = 0 -- The number of explosives being placed |
|
12079
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
522 |
-- Disable Sudden Death |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
523 |
WaterRise = 0 |
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
524 |
HealthDecrease = 0 |
4786 | 525 |
Map = "Blizzard" -- The map to be played |
13117
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
526 |
Theme = "Snow" -- The theme to be used |
4786 | 527 |
|
528 |
end |
|
529 |
||
530 |
||
531 |
function onGameStart() |
|
532 |
||
14994 | 533 |
ShowMission(loc("CTF_Blizzard"), loc("Capture The Flag"), |
534 |
loc("- Place your clan flag at the end of your first turn") .. "|" .. |
|
535 |
loc("- Return the enemy flag to your base to score") .."|".. |
|
536 |
string.format(loc("- First clan to score %d captures wins"), 3) .. "|".. |
|
537 |
loc("- You may only score when your flag is in your base") .."|".. |
|
538 |
loc("- Hogs will drop the flag when killed") .."|".. |
|
539 |
loc("- Dropped flags may be returned or recaptured").."|".. |
|
540 |
loc("- Hogs will be revived") .."|".. |
|
541 |
loc("- Enter the sparkling forcefield to teleport"), 0, 0) |
|
4786 | 542 |
|
543 |
-- initialize teleporters |
|
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
544 |
leftTel = CreateZone(342,1316,42,449) -- left teleporter (clan 0) |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
545 |
rightTel = CreateZone(3719,1330,45,449) -- right teleporter (clan 1) |
4786 | 546 |
|
547 |
||
548 |
--new improved placement schematics aw yeah |
|
549 |
RebuildTeamInfo() |
|
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
550 |
local team1Placed = 0 |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
551 |
local team2Placed = 0 |
4786 | 552 |
for i = 0, (TeamsCount-1) do |
553 |
for g = teamIndex[i], (teamIndex[i]+teamSize[i]-1) do |
|
554 |
if GetHogClan(hhs[g]) == 0 then |
|
555 |
SetGearPosition(hhs[g],1403+ ((team1Placed+1)*50),1570) |
|
556 |
team1Placed = team1Placed +1 |
|
557 |
if team1Placed > 6 then |
|
558 |
team1Placed = 0 |
|
559 |
end |
|
560 |
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
|
561 |
SetGearPosition(hhs[g],2691- ((team2Placed+1)*50),1570) |
4786 | 562 |
team2Placed = team2Placed +1 |
563 |
if team2Placed > 6 then |
|
564 |
team2Placed = 0 |
|
565 |
end |
|
566 |
end |
|
567 |
end |
|
568 |
end |
|
569 |
||
570 |
||
571 |
||
572 |
--spawn starting ufos and or super weapons |
|
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12426
diff
changeset
|
573 |
SpawnSupplyCrate(2048,1858,amJetpack) |
4786 | 574 |
|
575 |
--set flag spawn points and spawn the flags |
|
576 |
fSpawnX[0] = 957 |
|
577 |
fSpawnY[0] = 1747 |
|
578 |
fSpawnX[1] = 3123 |
|
579 |
fSpawnY[1] = 1747 |
|
580 |
||
13798
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13687
diff
changeset
|
581 |
if ClansCount < 2 then |
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13687
diff
changeset
|
582 |
return |
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13687
diff
changeset
|
583 |
end |
e874bfe563c7
Make sure scripts don't break w/ only 1 clan
Wuzzy <Wuzzy2@mail.ru>
parents:
13687
diff
changeset
|
584 |
|
4786 | 585 |
for i = 0, 1 do |
13019
880662cf41ee
Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents:
12933
diff
changeset
|
586 |
fGear[i] = SpawnFakeAmmoCrate(fSpawnX[i],fSpawnY[i],false,false) |
4786 | 587 |
fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
4843 | 588 |
fCol[i] = GetClanColor(i) |
4786 | 589 |
|
590 |
fSpawnC[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
|
4843 | 591 |
SetVisualGearValues(fSpawnC[i], fSpawnX[i],fSpawnY[i], 10, 200, 1, 10, 0, 300, 5, fCol[i]) |
592 |
||
593 |
||
4786 | 594 |
fIsMissing[i] = false |
595 |
fNeedsRespawn[i] = false |
|
596 |
fCaptures[i] = 0 |
|
597 |
||
598 |
vCircMinA[i] = 20 |
|
599 |
vCircMaxA[i] = 255 |
|
600 |
vCircType[i] = 1 |
|
601 |
vCircPulse[i] = 10 |
|
602 |
vCircFuckAll[i] = 0 |
|
603 |
vCircRadius[i] = 150 |
|
604 |
vCircWidth[i] = 5 |
|
605 |
vCircCol[i] = fCol[i] |
|
606 |
||
607 |
SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
|
608 |
||
609 |
end |
|
610 |
||
611 |
end |
|
612 |
||
613 |
||
614 |
function onNewTurn() |
|
615 |
||
616 |
HandleRespawns() |
|
14993
7d63665cc38b
CTF_Blizzard: Use onCaseDrop function
Wuzzy <Wuzzy2@mail.ru>
parents:
13798
diff
changeset
|
617 |
|
7d63665cc38b
CTF_Blizzard: Use onCaseDrop function
Wuzzy <Wuzzy2@mail.ru>
parents:
13798
diff
changeset
|
618 |
end |
7d63665cc38b
CTF_Blizzard: Use onCaseDrop function
Wuzzy <Wuzzy2@mail.ru>
parents:
13798
diff
changeset
|
619 |
|
7d63665cc38b
CTF_Blizzard: Use onCaseDrop function
Wuzzy <Wuzzy2@mail.ru>
parents:
13798
diff
changeset
|
620 |
function onCaseDrop() |
7d63665cc38b
CTF_Blizzard: Use onCaseDrop function
Wuzzy <Wuzzy2@mail.ru>
parents:
13798
diff
changeset
|
621 |
|
4786 | 622 |
HandleCrateDrops() |
623 |
||
624 |
end |
|
625 |
||
626 |
function onGameTick() |
|
627 |
||
628 |
-- onRessurect calls AFTER you have resurrected, |
|
629 |
-- so keeping track of x,y a few milliseconds before |
|
630 |
-- is useful |
|
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
631 |
|
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
632 |
for i = 0,1 do |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
633 |
if fThief[i] ~= nil then |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
634 |
fThiefX[i] = GetX(fThief[i]) |
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
635 |
fThiefY[i] = GetY(fThief[i]) |
4786 | 636 |
end |
13116
3b7cd18c4a06
CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents:
13019
diff
changeset
|
637 |
end |
4786 | 638 |
|
639 |
-- things we wanna check often |
|
640 |
if (CurrentHedgehog ~= nil) then |
|
641 |
CheckTeleporters() |
|
642 |
end |
|
643 |
||
644 |
HandleCircles() |
|
14995
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
645 |
if (CurrentHedgehog ~= nil) then |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
646 |
ManageTeleporterEffects() |
2eea2c370389
CTF_Blizzard: Disable sparkles for inactive teleporters
Wuzzy <Wuzzy2@mail.ru>
parents:
14994
diff
changeset
|
647 |
end |
4786 | 648 |
|
649 |
end |
|
650 |
||
651 |
||
652 |
function onAmmoStoreInit() |
|
653 |
||
654 |
SetAmmo(amDrill,9,0,0,0) |
|
655 |
SetAmmo(amMortar,9,0,0,0) |
|
656 |
||
657 |
SetAmmo(amGrenade,9,0,0,0) |
|
658 |
SetAmmo(amClusterBomb,4,0,0,0) |
|
659 |
||
660 |
SetAmmo(amShotgun, 9, 0, 0, 0) |
|
661 |
SetAmmo(amFlamethrower, 1, 0, 0, 1) |
|
662 |
||
663 |
SetAmmo(amFirePunch, 9, 0, 0, 0) |
|
664 |
SetAmmo(amBaseballBat, 2, 0, 0, 0) |
|
665 |
||
666 |
SetAmmo(amDynamite,2,0,0,1) |
|
667 |
SetAmmo(amSMine,4,0,0,0) |
|
668 |
||
669 |
SetAmmo(amBlowTorch, 9, 0, 0, 0) |
|
670 |
SetAmmo(amPickHammer, 9, 0, 0, 0) |
|
671 |
SetAmmo(amGirder, 2, 0, 0, 2) |
|
672 |
SetAmmo(amPortalGun, 2, 0, 0, 2) |
|
673 |
||
674 |
SetAmmo(amParachute, 9, 0, 0, 0) |
|
675 |
SetAmmo(amRope, 9, 0, 0, 0) |
|
4843 | 676 |
SetAmmo(amTeleport, 0, 0, 0, 1) |
4786 | 677 |
SetAmmo(amJetpack, 1, 0, 0, 1) |
678 |
||
679 |
SetAmmo(amSwitch, 2, 0, 0, 1) |
|
680 |
SetAmmo(amExtraTime,1,0,0,1) |
|
681 |
SetAmmo(amLowGravity,1,0,0,0) |
|
682 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
683 |
||
684 |
end |
|
685 |
||
686 |
||
13630
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13117
diff
changeset
|
687 |
function onGearResurrect(gear, vGear) |
4786 | 688 |
|
689 |
-- mark the flag thief as dead if he needed a respawn |
|
690 |
for i = 0,1 do |
|
691 |
if gear == fThief[i] then |
|
692 |
FlagThiefDead(gear) |
|
693 |
end |
|
694 |
end |
|
695 |
||
696 |
-- place hogs belonging to each clan either left or right side of map |
|
697 |
if GetHogClan(gear) == 0 then |
|
698 |
FindPlace(gear, false, 0, 2048) |
|
699 |
elseif GetHogClan(gear) == 1 then |
|
700 |
FindPlace(gear, false, 2048, LAND_WIDTH) |
|
701 |
end |
|
4843 | 702 |
|
13630
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13117
diff
changeset
|
703 |
if vGear then |
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13117
diff
changeset
|
704 |
SetVisualGearValues(vGear, GetX(gear), GetY(gear)) |
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13117
diff
changeset
|
705 |
end |
4786 | 706 |
|
707 |
end |
|
708 |
||
13117
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
709 |
local excessHogsWarning = false |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
710 |
|
4786 | 711 |
function onGearAdd(gear) |
712 |
||
713 |
if GetGearType(gear) == gtHedgehog then |
|
714 |
||
13117
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
715 |
if GetHogClan(gear) > 1 then |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
716 |
DeleteGear(gear) |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
717 |
if not excessHogsWarning then |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
718 |
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:
13116
diff
changeset
|
719 |
excessHogsWarning = true |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
720 |
end |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
721 |
else |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
722 |
hhs[numhhs] = gear |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
723 |
numhhs = numhhs + 1 |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
724 |
SetEffect(gear, heResurrectable, 1) |
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
725 |
end |
4786 | 726 |
|
13117
cd1561b0337f
CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents:
13116
diff
changeset
|
727 |
elseif GetGearType(gear) == gtRope then |
4871 | 728 |
ropeGear = gear |
729 |
end |
|
730 |
||
4786 | 731 |
end |
732 |
||
733 |
function onGearDelete(gear) |
|
734 |
||
735 |
if (gear == fGear[0]) or (gear == fGear[1]) then |
|
736 |
FlagDeleted(gear) |
|
737 |
end |
|
738 |
||
4871 | 739 |
if GetGearType(gear) == gtRope then |
740 |
ropeGear = nil |
|
741 |
end |
|
742 |
||
4953
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
743 |
if GetGearType(gear) == gtHedgehog then |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
744 |
for i = 0, (numhhs-1) do |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
745 |
if gear == hhs[i] then |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
746 |
|
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
747 |
for k = 0,1 do |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
748 |
if gear == fThief[k] then |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
749 |
FlagThiefDead(gear) |
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 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
752 |
hhs[i] = nil |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
753 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
754 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
755 |
end |
ebd3dae634ca
Fixed scoring exploit on Control and removed user branding from the map
mikade
parents:
4871
diff
changeset
|
756 |
|
4786 | 757 |
end |