author | Wuzzy <Wuzzy2@mail.ru> |
Sat, 05 Jan 2019 21:07:22 +0100 | |
changeset 14525 | c96079ee4687 |
parent 14524 | 213a636f57fe |
child 14526 | 8a11548cb1d2 |
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 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
10 |
== Changing the specialists for all teams == |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
11 |
In the script parameter, put: |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
12 |
|
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
13 |
t=XXXXXXXX |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
14 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
15 |
Where 'X' is a “specialist letter” (see below). Each letter stands for |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
16 |
the role of a hedgehog in the team (in that order). |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
17 |
If you leave out a letter, that hedgehog will be the default. |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
18 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
19 |
== Changing the specialists for on a per-team basis == |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
20 |
Same as above, but instead of “t”, you use “t1”, “t2”, ... “t8” for |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
21 |
each of the teams (team 1 to team 8). |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
22 |
|
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
23 |
== Specialist letters == |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
24 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
25 |
S = Soldier |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
26 |
E = Engineer |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
27 |
N = Ninja |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
28 |
D = Demo |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
29 |
I = Sniper |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
30 |
A = Saint |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
31 |
P = Pyro |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
32 |
L = Loon |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
33 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
34 |
== Examples == |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
35 |
Example 1: |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
36 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
37 |
t=SSSSPPPP |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
38 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
39 |
4 soldiers and 4 pyros for all teams. |
14523
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 |
Example 2: |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
42 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
43 |
t1=LPAIDNES,t2=NNNNNNNN |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
44 |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
45 |
Team 1: Loon, Pyro, Saint, Sniper, Demo, Ninja, Engineer, Soldier. |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
46 |
Team 2: All-ninja team. |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
47 |
All other teams use the default settings. |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
48 |
|
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
49 |
]] |
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
50 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
51 |
-------------------- |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
52 |
-- TODO |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
53 |
-------------------- |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
54 |
-- 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
|
55 |
|
5277 | 56 |
|
8043 | 57 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
58 |
HedgewarsScriptLoad("/Scripts/Tracker.lua") |
|
14521 | 59 |
HedgewarsScriptLoad("/Scripts/Params.lua") |
60 |
||
61 |
-- default team values |
|
62 |
local currTeamIdx = 0; |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
63 |
local teamRoles = { |
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
64 |
{'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
|
65 |
{'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
|
66 |
{'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
|
67 |
{'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
|
68 |
{'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
|
69 |
{'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
|
70 |
{'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
|
71 |
{'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
|
72 |
}; |
5277 | 73 |
|
5382 | 74 |
local numhhs = 0 |
75 |
local hhs = {} |
|
5277 | 76 |
|
5362
5f0c46e78e50
Enable autoswitch on turn start for The Specialists Mode.
mikade
parents:
5277
diff
changeset
|
77 |
local started = false |
5457 | 78 |
|
14521 | 79 |
function onParameters() |
80 |
parseParams() |
|
14524
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
81 |
-- All teams |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
82 |
if params['t'] ~= nil then |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
83 |
for i = 1, 8 do |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
84 |
for j = 1, 8 do |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
85 |
if string.len(params['t']) >= j then |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
86 |
teamRoles[i][j] = string.upper(string.sub(params['t'],j,j)); |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
87 |
end |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
88 |
end |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
89 |
end |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
90 |
end |
213a636f57fe
TS: Add script param to set specialists for all teams at once
Wuzzy <Wuzzy2@mail.ru>
parents:
14523
diff
changeset
|
91 |
-- Specific team |
14521 | 92 |
for i = 1, 8 do |
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
93 |
if params['t'..i] ~= nil then |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
94 |
for j = 1, 8 do |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
95 |
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
|
96 |
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
|
97 |
end |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
98 |
end |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
99 |
end |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
100 |
end |
14521 | 101 |
end |
102 |
||
6747 | 103 |
function onNewAmmoStore(groupIndex, hogIndex) |
5277 | 104 |
|
6747 | 105 |
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
|
106 |
groupIndex = groupIndex + 1 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
107 |
hogIndex = hogIndex + 1 |
5277 | 108 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
109 |
if teamRoles[groupIndex][hogIndex] == 'S' then |
6747 | 110 |
SetAmmo(amBazooka, 1, 0, 0, 0) |
111 |
SetAmmo(amGrenade, 1, 0, 0, 0) |
|
112 |
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
|
113 |
elseif teamRoles[groupIndex][hogIndex] == 'E' then |
6747 | 114 |
SetAmmo(amGirder, 2, 0, 0, 0) |
115 |
SetAmmo(amBlowTorch, 1, 0, 0, 0) |
|
116 |
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
|
117 |
elseif teamRoles[groupIndex][hogIndex] == 'N' then |
6747 | 118 |
SetAmmo(amRope, 9, 0, 0, 0) |
119 |
SetAmmo(amParachute, 9, 0, 0, 0) |
|
120 |
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
|
121 |
elseif teamRoles[groupIndex][hogIndex] == 'D' then |
6747 | 122 |
SetAmmo(amDynamite, 1, 0, 0, 0) |
123 |
SetAmmo(amMine, 1, 0, 0, 0) |
|
124 |
SetAmmo(amDrill, 1, 0, 0, 0) |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
125 |
elseif teamRoles[groupIndex][hogIndex] == 'I' then |
6747 | 126 |
SetAmmo(amSniperRifle, 1, 0, 0, 0) |
127 |
SetAmmo(amDEagle, 1, 0, 0, 0) |
|
128 |
SetAmmo(amPortalGun, 2, 0, 0, 0) |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
129 |
elseif teamRoles[groupIndex][hogIndex] == 'A' then |
6747 | 130 |
SetAmmo(amSeduction, 9, 0, 0, 0) |
131 |
SetAmmo(amResurrector, 1, 0, 0, 0) |
|
132 |
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
|
133 |
SetAmmo(amLowGravity, 1, 0, 0, 0) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
134 |
elseif teamRoles[groupIndex][hogIndex] == 'P' then |
6747 | 135 |
SetAmmo(amFlamethrower, 1, 0, 0, 0) |
136 |
SetAmmo(amMolotov, 1, 0, 0, 0) |
|
137 |
SetAmmo(amNapalm, 1, 0, 0, 0) |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
138 |
elseif teamRoles[groupIndex][hogIndex] == 'L' then |
6747 | 139 |
SetAmmo(amBaseballBat, 1, 0, 0, 0) |
140 |
SetAmmo(amGasBomb, 1, 0, 0, 0) |
|
141 |
SetAmmo(amKamikaze, 1, 0, 0, 0) |
|
142 |
end |
|
5277 | 143 |
|
144 |
end |
|
145 |
||
6747 | 146 |
function CreateTeam() |
5277 | 147 |
|
6747 | 148 |
currTeam = "" |
149 |
lastTeam = "" |
|
150 |
z = 0 |
|
151 |
||
152 |
for i = 0, (numhhs-1) do |
|
5277 | 153 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
154 |
currTeam = GetHogTeamName(hhs[i]) |
5382 | 155 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
156 |
if currTeam == lastTeam then |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
157 |
z = z + 1 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
158 |
else |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
159 |
z = 1 |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
160 |
currTeamIdx = currTeamIdx + 1; |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
161 |
end |
5277 | 162 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
163 |
if teamRoles[currTeamIdx][z] == 'S' then |
5277 | 164 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
165 |
SetHogName(hhs[i],loc("Soldier")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
166 |
SetHogHat(hhs[i], "sf_vega") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
167 |
SetHealth(hhs[i],200) |
6747 | 168 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
169 |
elseif teamRoles[currTeamIdx][z] == 'E' then |
5382 | 170 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
171 |
SetHogHat(hhs[i], "Glasses") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
172 |
SetHogName(hhs[i],loc("Engineer")) |
5382 | 173 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
174 |
elseif teamRoles[currTeamIdx][z] == 'N' then |
5277 | 175 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
176 |
SetHogName(hhs[i],loc("Ninja")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
177 |
SetHogHat(hhs[i], "NinjaFull") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
178 |
SetHealth(hhs[i],80) |
5277 | 179 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
180 |
elseif teamRoles[currTeamIdx][z] == 'D' then |
6747 | 181 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
182 |
SetHogName(hhs[i],loc("Demo")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
183 |
SetHogHat(hhs[i], "Skull") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
184 |
SetHealth(hhs[i],200) |
6747 | 185 |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
186 |
elseif teamRoles[currTeamIdx][z] == 'I' then |
5277 | 187 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
188 |
SetHogName(hhs[i],loc("Sniper")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
189 |
SetHogHat(hhs[i], "Sniper") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
190 |
SetHealth(hhs[i],120) |
6747 | 191 |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
192 |
elseif teamRoles[currTeamIdx][z] == 'A' then |
6747 | 193 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
194 |
SetHogName(hhs[i],loc("Saint")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
195 |
SetHogHat(hhs[i], "angel") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
196 |
SetHealth(hhs[i],300) |
5277 | 197 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
198 |
elseif teamRoles[currTeamIdx][z] == 'P' then |
6747 | 199 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
200 |
SetHogName(hhs[i],loc("Pyro")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
201 |
SetHogHat(hhs[i], "Gasmask") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
202 |
SetHealth(hhs[i],150) |
6747 | 203 |
|
14523
a97216ff1c51
Document TS script param syntax, change some letters
Wuzzy <Wuzzy2@mail.ru>
parents:
14522
diff
changeset
|
204 |
elseif teamRoles[currTeamIdx][z] == 'L' then |
6747 | 205 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
206 |
SetHogName(hhs[i],loc("Loon")) |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
207 |
SetHogHat(hhs[i], "clown") |
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
208 |
SetHealth(hhs[i],100) |
6747 | 209 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
210 |
end |
6747 | 211 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
212 |
lastTeam = GetHogTeamName(hhs[i]) |
6747 | 213 |
|
214 |
end |
|
5277 | 215 |
|
216 |
end |
|
217 |
||
218 |
function onGameInit() |
|
10036 | 219 |
ClearGameFlags() |
14521 | 220 |
EnableGameFlags(gfResetWeps, gfInfAttack, gfPlaceHog, gfPerHogAmmo, gfSwitchHog) |
5817
70208e400a59
For now, don't spawn anything other than health crates.
mikade
parents:
5797
diff
changeset
|
221 |
HealthCaseProb = 100 |
14525
c96079ee4687
TS: Simplify mission panel, fix bad string concatenation
Wuzzy <Wuzzy2@mail.ru>
parents:
14524
diff
changeset
|
222 |
Goals = loc("The Specialists: Each hedgehog starts with its own weapon set") |
5277 | 223 |
end |
224 |
||
225 |
function onGameStart() |
|
5382 | 226 |
|
6747 | 227 |
CreateTeam() |
5457 | 228 |
trackTeams() |
229 |
||
5277 | 230 |
end |
231 |
||
232 |
||
233 |
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
|
234 |
|
6747 | 235 |
started = true |
14525
c96079ee4687
TS: Simplify mission panel, fix bad string concatenation
Wuzzy <Wuzzy2@mail.ru>
parents:
14524
diff
changeset
|
236 |
AddCaption(string.format(loc("Prepare yourself, %s!"), GetHogName(CurrentHedgehog))) |
5277 | 237 |
|
238 |
end |
|
239 |
||
240 |
function onGearAdd(gear) |
|
5382 | 241 |
|
14522
2fd8f4cd3aa4
Clean up indents and comments in The_Specialists.lua
Wuzzy <Wuzzy2@mail.ru>
parents:
14521
diff
changeset
|
242 |
if GetGearType(gear) == gtHedgehog then |
6747 | 243 |
hhs[numhhs] = gear |
244 |
numhhs = numhhs + 1 |
|
245 |
elseif (GetGearType(gear) == gtMine) and (started == true) then |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
246 |
SetTimer(gear,5000) |
5457 | 247 |
end |
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
248 |
|
5457 | 249 |
if (GetGearType(gear) == gtHedgehog) or (GetGearType(gear) == gtResurrector) then |
250 |
trackGear(gear) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
251 |
end |
5457 | 252 |
|
5277 | 253 |
end |
254 |
||
255 |
function onGearDelete(gear) |
|
5457 | 256 |
if (GetGearType(gear) == gtHedgehog) or (GetGearType(gear) == gtResurrector) then |
257 |
trackDeletion(gear) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5817
diff
changeset
|
258 |
end |
5277 | 259 |
end |
260 |