author | Wuzzy <Wuzzy2@mail.ru> |
Sat, 05 Jan 2019 20:45:46 +0100 | |
changeset 14523 | a97216ff1c51 |
parent 14522 | 2fd8f4cd3aa4 |
child 14524 | 213a636f57fe |
permissions | -rw-r--r-- |
5277 | 1 |
---------------------------------- |
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
2 |
-- THE SPECIALISTS |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
3 |
-- original style by mikade |
5277 | 4 |
---------------------------------- |
5 |
||
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
6 |
-- SCRIPT PARAMETER SYNTAX |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
7 |
--[[ |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
8 |
With the script parameter, you can change the order of specialists per team. |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
9 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
10 |
Valid keys: t1, t2, ... t8 |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
11 |
One per team (team 1, team 2, ... team 8) |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
12 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
13 |
The value is a sequence of “specialist letters”. |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
14 |
Each letter stands for a hedgehog. |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
15 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
16 |
Specialist letters: |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
17 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
18 |
S = Soldier |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
19 |
E = Engineer |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
20 |
N = Ninja |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
21 |
D = Demo |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
22 |
I = Sniper |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
23 |
A = Saint |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
24 |
P = Pyro |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
25 |
L = Loon |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
26 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
27 |
Example 1: |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
28 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
29 |
t1=SENDIAPL,t2=SENDIAPL |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
30 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
31 |
Team 1 and team 2 have the standard specialists. |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
32 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
33 |
Example 2: |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
34 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
35 |
t1=SSSSPPPP |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
36 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
37 |
4 soldiers and 4 pyros for team 1. |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
38 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
39 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
40 |
]] |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
41 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
42 |
-------------------- |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
43 |
-- TODO |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
44 |
-------------------- |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
45 |
-- add proper gameflag checking, maybe (so that we can throw in a .cfg and let the users break everything) |
5362
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
46 |
|
5277 | 47 |
|
8043 | 48 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
49 |
HedgewarsScriptLoad("/Scripts/Tracker.lua") |
|
14521 | 50 |
HedgewarsScriptLoad("/Scripts/Params.lua") |
51 |
||
52 |
-- default team values |
|
53 |
local currTeamIdx = 0; |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
54 |
local teamRoles = { |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
55 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
56 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
57 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
58 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
59 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
60 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
61 |
{'S','E','N','D','I','A','P','L'}, |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
62 |
{'S','E','N','D','I','A','P','L'} |
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
63 |
}; |
5277 | 64 |
|
5382 | 65 |
local numhhs = 0 |
66 |
local hhs = {} |
|
5277 | 67 |
|
5362
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
68 |
local started = false |
5457 | 69 |
|
14521 | 70 |
function onParameters() |
71 |
parseParams() |
|
72 |
for i = 1, 8 do |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
73 |
if params['t'..i] ~= nil then |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
74 |
for j = 1, 8 do |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
75 |
if string.len(params['t'..i]) >= j then |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
76 |
teamRoles[i][j] = string.upper(string.sub(params['t'..i],j,j)); |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
77 |
end |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
78 |
end |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
79 |
end |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
80 |
end |
14521 | 81 |
end |
82 |
||
6747 | 83 |
function onNewAmmoStore(groupIndex, hogIndex) |
5277 | 84 |
|
6747 | 85 |
SetAmmo(amSkip, 9, 0, 0, 0) |
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
86 |
groupIndex = groupIndex + 1 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
87 |
hogIndex = hogIndex + 1 |
5277 | 88 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
89 |
if teamRoles[groupIndex][hogIndex] == 'S' then |
6747 | 90 |
SetAmmo(amBazooka, 1, 0, 0, 0) |
91 |
SetAmmo(amGrenade, 1, 0, 0, 0) |
|
92 |
SetAmmo(amShotgun, 1, 0, 0, 0) |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
93 |
elseif teamRoles[groupIndex][hogIndex] == 'E' then |
6747 | 94 |
SetAmmo(amGirder, 2, 0, 0, 0) |
95 |
SetAmmo(amBlowTorch, 1, 0, 0, 0) |
|
96 |
SetAmmo(amPickHammer, 1, 0, 0, 0) |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
97 |
elseif teamRoles[groupIndex][hogIndex] == 'N' then |
6747 | 98 |
SetAmmo(amRope, 9, 0, 0, 0) |
99 |
SetAmmo(amParachute, 9, 0, 0, 0) |
|
100 |
SetAmmo(amFirePunch, 1, 0, 0, 0) |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
101 |
elseif teamRoles[groupIndex][hogIndex] == 'D' then |
6747 | 102 |
SetAmmo(amDynamite, 1, 0, 0, 0) |
103 |
SetAmmo(amMine, 1, 0, 0, 0) |
|
104 |
SetAmmo(amDrill, 1, 0, 0, 0) |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
105 |
elseif teamRoles[groupIndex][hogIndex] == 'I' then |
6747 | 106 |
SetAmmo(amSniperRifle, 1, 0, 0, 0) |
107 |
SetAmmo(amDEagle, 1, 0, 0, 0) |
|
108 |
SetAmmo(amPortalGun, 2, 0, 0, 0) |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
109 |
elseif teamRoles[groupIndex][hogIndex] == 'A' then |
6747 | 110 |
SetAmmo(amSeduction, 9, 0, 0, 0) |
111 |
SetAmmo(amResurrector, 1, 0, 0, 0) |
|
112 |
SetAmmo(amInvulnerable, 1, 0, 0, 0) |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
113 |
SetAmmo(amLowGravity, 1, 0, 0, 0) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
114 |
elseif teamRoles[groupIndex][hogIndex] == 'P' then |
6747 | 115 |
SetAmmo(amFlamethrower, 1, 0, 0, 0) |
116 |
SetAmmo(amMolotov, 1, 0, 0, 0) |
|
117 |
SetAmmo(amNapalm, 1, 0, 0, 0) |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
118 |
elseif teamRoles[groupIndex][hogIndex] == 'L' then |
6747 | 119 |
SetAmmo(amBaseballBat, 1, 0, 0, 0) |
120 |
SetAmmo(amGasBomb, 1, 0, 0, 0) |
|
121 |
SetAmmo(amKamikaze, 1, 0, 0, 0) |
|
122 |
end |
|
5277 | 123 |
|
124 |
end |
|
125 |
||
6747 | 126 |
function CreateTeam() |
5277 | 127 |
|
6747 | 128 |
currTeam = "" |
129 |
lastTeam = "" |
|
130 |
z = 0 |
|
131 |
||
132 |
for i = 0, (numhhs-1) do |
|
5277 | 133 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
134 |
currTeam = GetHogTeamName(hhs[i]) |
5382 | 135 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
136 |
if currTeam == lastTeam then |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
137 |
z = z + 1 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
138 |
else |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
139 |
z = 1 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
140 |
currTeamIdx = currTeamIdx + 1; |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
141 |
end |
5277 | 142 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
143 |
if teamRoles[currTeamIdx][z] == 'S' then |
5277 | 144 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
145 |
SetHogName(hhs[i],loc("Soldier")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
146 |
SetHogHat(hhs[i], "sf_vega") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
147 |
SetHealth(hhs[i],200) |
6747 | 148 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
149 |
elseif teamRoles[currTeamIdx][z] == 'E' then |
5382 | 150 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
151 |
SetHogHat(hhs[i], "Glasses") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
152 |
SetHogName(hhs[i],loc("Engineer")) |
5382 | 153 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
154 |
elseif teamRoles[currTeamIdx][z] == 'N' then |
5277 | 155 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
156 |
SetHogName(hhs[i],loc("Ninja")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
157 |
SetHogHat(hhs[i], "NinjaFull") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
158 |
SetHealth(hhs[i],80) |
5277 | 159 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
160 |
elseif teamRoles[currTeamIdx][z] == 'D' then |
6747 | 161 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
162 |
SetHogName(hhs[i],loc("Demo")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
163 |
SetHogHat(hhs[i], "Skull") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
164 |
SetHealth(hhs[i],200) |
6747 | 165 |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
166 |
elseif teamRoles[currTeamIdx][z] == 'I' then |
5277 | 167 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
168 |
SetHogName(hhs[i],loc("Sniper")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
169 |
SetHogHat(hhs[i], "Sniper") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
170 |
SetHealth(hhs[i],120) |
6747 | 171 |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
172 |
elseif teamRoles[currTeamIdx][z] == 'A' then |
6747 | 173 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
174 |
SetHogName(hhs[i],loc("Saint")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
175 |
SetHogHat(hhs[i], "angel") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
176 |
SetHealth(hhs[i],300) |
5277 | 177 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
178 |
elseif teamRoles[currTeamIdx][z] == 'P' then |
6747 | 179 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
180 |
SetHogName(hhs[i],loc("Pyro")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
181 |
SetHogHat(hhs[i], "Gasmask") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
182 |
SetHealth(hhs[i],150) |
6747 | 183 |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
184 |
elseif teamRoles[currTeamIdx][z] == 'L' then |
6747 | 185 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
186 |
SetHogName(hhs[i],loc("Loon")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
187 |
SetHogHat(hhs[i], "clown") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
188 |
SetHealth(hhs[i],100) |
6747 | 189 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
190 |
end |
6747 | 191 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
192 |
lastTeam = GetHogTeamName(hhs[i]) |
6747 | 193 |
|
194 |
end |
|
5277 | 195 |
|
196 |
end |
|
197 |
||
198 |
function onGameInit() |
|
10036 | 199 |
ClearGameFlags() |
14521 | 200 |
EnableGameFlags(gfResetWeps, gfInfAttack, gfPlaceHog, gfPerHogAmmo, gfSwitchHog) |
5817
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
201 |
HealthCaseProb = 100 |
5277 | 202 |
end |
203 |
||
204 |
function onGameStart() |
|
5382 | 205 |
|
6747 | 206 |
CreateTeam() |
5277 | 207 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
208 |
ShowMission( |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
209 |
loc("THE SPECIALISTS"), |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
210 |
loc("a Hedgewars mini-game"), |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
211 |
loc("Eliminate the enemy specialists.") .. "|" .. |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
212 |
" " .. "|" .. |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
213 |
loc("Game Modifiers: ") .. "|" .. |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
214 |
loc("Per-Hog Ammo") .. "|" .. |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
215 |
loc("Weapons Reset") .. "|" .. |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
216 |
loc("Unlimited Attacks") .. "|" .. |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
217 |
"", 4, 4000 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
218 |
) |
5277 | 219 |
|
5457 | 220 |
trackTeams() |
221 |
||
5277 | 222 |
end |
223 |
||
224 |
||
225 |
function onNewTurn() |
|
13278
8f579173b161
The Specialits: Use gfSwitchHog for hog switching and delete the terrible Lua hacks
Wuzzy <Wuzzy2@mail.ru>
parents:
12355
diff
changeset
|
226 |
|
6747 | 227 |
started = true |
13278
8f579173b161
The Specialits: Use gfSwitchHog for hog switching and delete the terrible Lua hacks
Wuzzy <Wuzzy2@mail.ru>
parents:
12355
diff
changeset
|
228 |
AddCaption(loc("Prepare yourself") .. ", " .. GetHogName(CurrentHedgehog).. "!") |
5277 | 229 |
|
230 |
end |
|
231 |
||
232 |
function onGearAdd(gear) |
|
5382 | 233 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
234 |
if GetGearType(gear) == gtHedgehog then |
6747 | 235 |
hhs[numhhs] = gear |
236 |
numhhs = numhhs + 1 |
|
237 |
elseif (GetGearType(gear) == gtMine) and (started == true) then |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
238 |
SetTimer(gear,5000) |
5457 | 239 |
end |
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
240 |
|
5457 | 241 |
if (GetGearType(gear) == gtHedgehog) or (GetGearType(gear) == gtResurrector) then |
242 |
trackGear(gear) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
243 |
end |
5457 | 244 |
|
5277 | 245 |
end |
246 |
||
247 |
function onGearDelete(gear) |
|
5457 | 248 |
if (GetGearType(gear) == gtHedgehog) or (GetGearType(gear) == gtResurrector) then |
249 |
trackDeletion(gear) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
250 |
end |
5277 | 251 |
end |
252 |