1 ---------------------------------- |
1 ---------------------------------- |
2 -- THE SPECIALISTS |
2 -- THE SPECIALISTS |
3 -- original style by mikade |
3 -- original style by mikade |
4 ---------------------------------- |
4 ---------------------------------- |
5 |
5 |
|
6 -- SCRIPT PARAMETER SYNTAX |
|
7 --[[ |
|
8 With the script parameter, you can change the order of specialists per team. |
|
9 |
|
10 Valid keys: t1, t2, ... t8 |
|
11 One per team (team 1, team 2, ... team 8) |
|
12 |
|
13 The value is a sequence of “specialist letters”. |
|
14 Each letter stands for a hedgehog. |
|
15 |
|
16 Specialist letters: |
|
17 |
|
18 S = Soldier |
|
19 E = Engineer |
|
20 N = Ninja |
|
21 D = Demo |
|
22 I = Sniper |
|
23 A = Saint |
|
24 P = Pyro |
|
25 L = Loon |
|
26 |
|
27 Example 1: |
|
28 |
|
29 t1=SENDIAPL,t2=SENDIAPL |
|
30 |
|
31 Team 1 and team 2 have the standard specialists. |
|
32 |
|
33 Example 2: |
|
34 |
|
35 t1=SSSSPPPP |
|
36 |
|
37 4 soldiers and 4 pyros for team 1. |
|
38 |
|
39 |
|
40 ]] |
|
41 |
6 -------------------- |
42 -------------------- |
7 -- TODO |
43 -- TODO |
8 -------------------- |
44 -------------------- |
9 -- add proper gameflag checking, maybe (so that we can throw in a .cfg and let the users break everything) |
45 -- add proper gameflag checking, maybe (so that we can throw in a .cfg and let the users break everything) |
10 |
46 |
11 |
47 |
12 HedgewarsScriptLoad("/Scripts/Locale.lua") |
48 HedgewarsScriptLoad("/Scripts/Locale.lua") |
13 HedgewarsScriptLoad("/Scripts/Tracker.lua") |
49 HedgewarsScriptLoad("/Scripts/Tracker.lua") |
14 HedgewarsScriptLoad("/Scripts/Params.lua") |
50 HedgewarsScriptLoad("/Scripts/Params.lua") |
15 |
51 |
16 --[[ |
|
17 Specialist letters: |
|
18 |
|
19 S=[S]oldier |
|
20 E=[E]ngineer |
|
21 N=[N]inja |
|
22 D=[D]emo |
|
23 X=Sniper |
|
24 H=Saint ([H]oly) |
|
25 P=[P]yro |
|
26 C=Loon ([C]lown) |
|
27 ]] |
|
28 -- default team values |
52 -- default team values |
29 local currTeamIdx = 0; |
53 local currTeamIdx = 0; |
30 local teamRoles = { |
54 local teamRoles = { |
31 {'S','E','N','D','X','H','P','C'}, |
55 {'S','E','N','D','I','A','P','L'}, |
32 {'S','E','N','D','X','H','P','C'}, |
56 {'S','E','N','D','I','A','P','L'}, |
33 {'S','E','N','D','X','H','P','C'}, |
57 {'S','E','N','D','I','A','P','L'}, |
34 {'S','E','N','D','X','H','P','C'}, |
58 {'S','E','N','D','I','A','P','L'}, |
35 {'S','E','N','D','X','H','P','C'}, |
59 {'S','E','N','D','I','A','P','L'}, |
36 {'S','E','N','D','X','H','P','C'}, |
60 {'S','E','N','D','I','A','P','L'}, |
37 {'S','E','N','D','X','H','P','C'}, |
61 {'S','E','N','D','I','A','P','L'}, |
38 {'S','E','N','D','X','H','P','C'} |
62 {'S','E','N','D','I','A','P','L'} |
39 }; |
63 }; |
40 |
64 |
41 local numhhs = 0 |
65 local numhhs = 0 |
42 local hhs = {} |
66 local hhs = {} |
43 |
67 |
76 SetAmmo(amFirePunch, 1, 0, 0, 0) |
100 SetAmmo(amFirePunch, 1, 0, 0, 0) |
77 elseif teamRoles[groupIndex][hogIndex] == 'D' then |
101 elseif teamRoles[groupIndex][hogIndex] == 'D' then |
78 SetAmmo(amDynamite, 1, 0, 0, 0) |
102 SetAmmo(amDynamite, 1, 0, 0, 0) |
79 SetAmmo(amMine, 1, 0, 0, 0) |
103 SetAmmo(amMine, 1, 0, 0, 0) |
80 SetAmmo(amDrill, 1, 0, 0, 0) |
104 SetAmmo(amDrill, 1, 0, 0, 0) |
81 elseif teamRoles[groupIndex][hogIndex] == 'X' then |
105 elseif teamRoles[groupIndex][hogIndex] == 'I' then |
82 SetAmmo(amSniperRifle, 1, 0, 0, 0) |
106 SetAmmo(amSniperRifle, 1, 0, 0, 0) |
83 SetAmmo(amDEagle, 1, 0, 0, 0) |
107 SetAmmo(amDEagle, 1, 0, 0, 0) |
84 SetAmmo(amPortalGun, 2, 0, 0, 0) |
108 SetAmmo(amPortalGun, 2, 0, 0, 0) |
85 elseif teamRoles[groupIndex][hogIndex] == 'H' then |
109 elseif teamRoles[groupIndex][hogIndex] == 'A' then |
86 SetAmmo(amSeduction, 9, 0, 0, 0) |
110 SetAmmo(amSeduction, 9, 0, 0, 0) |
87 SetAmmo(amResurrector, 1, 0, 0, 0) |
111 SetAmmo(amResurrector, 1, 0, 0, 0) |
88 SetAmmo(amInvulnerable, 1, 0, 0, 0) |
112 SetAmmo(amInvulnerable, 1, 0, 0, 0) |
89 SetAmmo(amLowGravity, 1, 0, 0, 0) |
113 SetAmmo(amLowGravity, 1, 0, 0, 0) |
90 elseif teamRoles[groupIndex][hogIndex] == 'P' then |
114 elseif teamRoles[groupIndex][hogIndex] == 'P' then |
91 SetAmmo(amFlamethrower, 1, 0, 0, 0) |
115 SetAmmo(amFlamethrower, 1, 0, 0, 0) |
92 SetAmmo(amMolotov, 1, 0, 0, 0) |
116 SetAmmo(amMolotov, 1, 0, 0, 0) |
93 SetAmmo(amNapalm, 1, 0, 0, 0) |
117 SetAmmo(amNapalm, 1, 0, 0, 0) |
94 elseif teamRoles[groupIndex][hogIndex] == 'C' then |
118 elseif teamRoles[groupIndex][hogIndex] == 'L' then |
95 SetAmmo(amBaseballBat, 1, 0, 0, 0) |
119 SetAmmo(amBaseballBat, 1, 0, 0, 0) |
96 SetAmmo(amGasBomb, 1, 0, 0, 0) |
120 SetAmmo(amGasBomb, 1, 0, 0, 0) |
97 SetAmmo(amKamikaze, 1, 0, 0, 0) |
121 SetAmmo(amKamikaze, 1, 0, 0, 0) |
98 end |
122 end |
99 |
123 |
137 |
161 |
138 SetHogName(hhs[i],loc("Demo")) |
162 SetHogName(hhs[i],loc("Demo")) |
139 SetHogHat(hhs[i], "Skull") |
163 SetHogHat(hhs[i], "Skull") |
140 SetHealth(hhs[i],200) |
164 SetHealth(hhs[i],200) |
141 |
165 |
142 elseif teamRoles[currTeamIdx][z] == 'X' then |
166 elseif teamRoles[currTeamIdx][z] == 'I' then |
143 |
167 |
144 SetHogName(hhs[i],loc("Sniper")) |
168 SetHogName(hhs[i],loc("Sniper")) |
145 SetHogHat(hhs[i], "Sniper") |
169 SetHogHat(hhs[i], "Sniper") |
146 SetHealth(hhs[i],120) |
170 SetHealth(hhs[i],120) |
147 |
171 |
148 elseif teamRoles[currTeamIdx][z] == 'H' then |
172 elseif teamRoles[currTeamIdx][z] == 'A' then |
149 |
173 |
150 SetHogName(hhs[i],loc("Saint")) |
174 SetHogName(hhs[i],loc("Saint")) |
151 SetHogHat(hhs[i], "angel") |
175 SetHogHat(hhs[i], "angel") |
152 SetHealth(hhs[i],300) |
176 SetHealth(hhs[i],300) |
153 |
177 |