1 -------------------------------- |
1 ------------- |
2 -- CONTROL 0.6 |
2 -- CONTROL -- |
3 -------------------------------- |
3 ------------- |
4 |
4 |
5 --------- |
5 -- Goal: Stand on pillars to score points over time. |
6 -- 0.2 |
6 -- First clan to hit the score limit wins! |
7 --------- |
7 |
8 -- fixed score display errrors |
8 -- Rules: |
9 -- added missing resurrection effects |
9 -- * You generate points while standing on a pillar during your turn. |
10 -- moved hogs off control points if thats where they started |
10 -- * Control more pillars for more points |
11 -- added sanity limit for the above |
11 -- * If multiple clans compete for a pillar, no one generates points for this pillar. |
12 -- added tint tags to display clan score on each point as it scors |
12 -- * If you skip turn, you win the same points as if you would have just waited out the turn |
13 -- added gameflags filter |
|
14 -- changed scoring rate |
|
15 -- hogs now only score point DURING THEIR TURN |
|
16 -- map now accepts custom weaponsets and themes |
|
17 -- changed win limit |
|
18 |
|
19 --------- |
|
20 -- 0.3 |
|
21 --------- |
|
22 |
|
23 -- added translation support |
|
24 |
|
25 -------- |
|
26 -- 0.4 |
|
27 -------- |
|
28 |
|
29 -- added scaling scoring based on clans: 300 points to win - 25 per team in game |
|
30 |
|
31 -------- |
|
32 -- 0.5 |
|
33 -------- |
|
34 |
|
35 -- removed user branding |
|
36 -- fixed infinite attack time exploit |
|
37 |
|
38 -------- |
|
39 -- 0.6 |
|
40 -------- |
|
41 |
|
42 -- timebox fix |
|
43 -- support for more players |
|
44 -- remove version numbers |
|
45 -- enable limited sudden death |
|
46 -- using skip go generates as many points as you would have gotten had you sat and waited |
|
47 |
13 |
48 ----------------- |
14 ----------------- |
49 --script begins |
15 -- script begins |
50 ----------------- |
16 ----------------- |
51 |
17 |
52 HedgewarsScriptLoad("/Scripts/Locale.lua") |
18 HedgewarsScriptLoad("/Scripts/Locale.lua") |
53 |
19 |
54 --------------------------------------------------------------- |
20 --------------------------------------------------------------- |
55 ----------lots of bad variables and things |
21 -- lots variables and things |
56 ----------because someone is too lazy |
22 --------------------------------------------------------------- |
57 ----------to read about tables properly |
|
58 ------------------ "Oh well, they probably have the memory" |
|
59 |
23 |
60 local TimeCounter = 0 |
24 local TimeCounter = 0 |
61 |
25 |
62 local gameWon = false |
26 local gameWon = false |
63 local pointLimit = 300 |
27 local pointLimit = 300 |
167 |
131 |
168 for i = 0,(zCount-1) do |
132 for i = 0,(zCount-1) do |
169 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff) |
133 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff) |
170 cOwnerClan[i] = nil |
134 cOwnerClan[i] = nil |
171 for k = 0, (numhhs-1) do |
135 for k = 0, (numhhs-1) do |
172 if (hhs[k] ~= nil) then --and (GetGearType(hhs[k]) ~= nil) then |
136 if (hhs[k] ~= nil) then |
173 if (GearIsInZone(hhs[k],i)) == true then |
137 if (GearIsInZone(hhs[k],i)) == true then |
174 |
138 |
175 if cOwnerClan[i] ~= nil then |
139 if cOwnerClan[i] ~= nil then |
176 if cOwnerClan[i] ~= GetHogClan(hhs[k]) then |
140 if cOwnerClan[i] ~= GetHogClan(hhs[k]) then |
177 --if the hog now being compared is different to one that is also here and was previously compared |
141 --if the hog now being compared is different to one that is also here and was previously compared |
178 |
142 |
179 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff) |
143 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff) |
180 --SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, 0xffffffff) |
|
181 |
144 |
182 cOwnerClan[i] = 10 -- this means conflicted |
145 cOwnerClan[i] = 10 -- this means conflicted |
183 end |
146 end |
184 elseif cOwnerClan[i] == nil then |
147 elseif cOwnerClan[i] == nil then |
185 cOwnerClan[i] = GetHogClan(hhs[k]) |
148 cOwnerClan[i] = GetHogClan(hhs[k]) |
186 --SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, GetClanColor( GetHogClan(hhs[k])) ) |
|
187 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], GetClanColor( GetHogClan(hhs[k]))) |
149 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], GetClanColor( GetHogClan(hhs[k]))) |
188 |
150 |
189 end |
151 end |
190 |
152 |
191 end |
153 end |
192 -- else hhs[k] = nil |
|
193 end |
154 end |
194 end |
155 end |
195 |
156 |
196 end |
157 end |
197 |
158 |
199 |
160 |
200 function AwardPoints() |
161 function AwardPoints() |
201 |
162 |
202 for i = 0,(zCount-1) do |
163 for i = 0,(zCount-1) do |
203 -- give score to all players controlling points |
164 -- give score to all players controlling points |
204 --if (cOwnerClan[i] ~= nil) and (cOwnerClan[i] ~= 10) then |
|
205 -- teamScore[cOwnerClan[i]] = teamScore[cOwnerClan[i]] + 1 |
|
206 --end |
|
207 |
165 |
208 -- only give score to the player currently in control |
166 -- only give score to the player currently in control |
209 if CurrentHedgehog ~= nil then |
167 if CurrentHedgehog ~= nil then |
210 if cOwnerClan[i] == GetHogClan(CurrentHedgehog) then |
168 if cOwnerClan[i] == GetHogClan(CurrentHedgehog) then |
211 teamScore[cOwnerClan[i]] = teamScore[cOwnerClan[i]] + 1 |
169 teamScore[cOwnerClan[i]] = teamScore[cOwnerClan[i]] + 1 |
353 vCircCol[i] = 0xffffffff |
310 vCircCol[i] = 0xffffffff |
354 |
311 |
355 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
312 SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i]) |
356 end |
313 end |
357 |
314 |
358 --zxc = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true) |
|
359 --SetVisualGearValues(zxc, 1000,1000, 20, 255, 1, 10, 0, 100, 1, GetClanColor(0)) |
|
360 --minO,max0 -glowyornot --pulsate timer -- fuckall -- radius -- width -- colour |
|
361 |
|
362 --new improved placement schematics aw yeah |
315 --new improved placement schematics aw yeah |
363 RebuildTeamInfo() |
316 RebuildTeamInfo() |
364 |
317 |
365 for i = 0, (numTeams-1) do |
318 for i = 0, (numTeams-1) do |
366 pointLimit = pointLimit - 25 |
319 pointLimit = pointLimit - 25 |
369 missionHelp = loc("Control pillars to score points.") .. "|" .. |
322 missionHelp = loc("Control pillars to score points.") .. "|" .. |
370 string.format(loc("Score goal: %d"), pointLimit) |
323 string.format(loc("Score goal: %d"), pointLimit) |
371 |
324 |
372 -- reposition hogs if they are on control points until they are not or sanity limit kicks in |
325 -- reposition hogs if they are on control points until they are not or sanity limit kicks in |
373 reN = 0 |
326 reN = 0 |
374 --zz = 0 |
|
375 while (reN < 10) do |
327 while (reN < 10) do |
376 if ZonesAreEmpty() == false then |
328 if ZonesAreEmpty() == false then |
377 reN = reN + 1 |
329 reN = reN + 1 |
378 --zz = zz + 1 |
|
379 --SetGearPosition(hhs[0], 631, 82) -- put this in here to thwart attempts at repositioning and test sanity limit |
|
380 else |
330 else |
381 reN = 15 |
331 reN = 15 |
382 end |
332 end |
383 --AddCaption(zz) -- number of times it took to work |
|
384 end |
333 end |
385 |
334 |
386 for h=1, numhhs do |
335 for h=1, numhhs do |
387 -- Tardis screws up the game too much, teams might not get killed correctly after victory |
336 -- Tardis screws up the game too much, teams might not get killed correctly after victory |
388 -- if a hog is still in time-travel. |
337 -- if a hog is still in time-travel. |
437 if (vCircCount >= 500) and (gameWon == false) then |
386 if (vCircCount >= 500) and (gameWon == false) then |
438 vCircCount = 0 |
387 vCircCount = 0 |
439 CheckZones() |
388 CheckZones() |
440 end |
389 end |
441 |
390 |
442 -- things we wanna check often |
|
443 if (CurrentHedgehog ~= nil) then |
|
444 -- AddCaption(GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog)) |
|
445 --AddCaption(teamNameArr[0] .. " : " .. teamScore[0]) |
|
446 --AddCaption(GetHogTeamName(CurrentHedgehog) .. " : " .. teamScore[GetHogClan(CurrentHedgehog)]) -- this end up 1? |
|
447 |
|
448 -- huh? the first clan added seems to be clan 1, not 0 ?? |
|
449 |
|
450 end |
|
451 |
|
452 -- set TimeCounter to starting time if it is uninitialised (from onNewTurn) |
391 -- set TimeCounter to starting time if it is uninitialised (from onNewTurn) |
453 if (TimeCounter == 0) and (TurnTimeLeft > 0) then |
392 if (TimeCounter == 0) and (TurnTimeLeft > 0) then |
454 TimeCounter = TurnTimeLeft |
393 TimeCounter = TurnTimeLeft |
455 end |
394 end |
456 |
395 |