author | Wuzzy <Wuzzy2@mail.ru> |
Sat, 21 Jul 2018 00:34:32 +0200 | |
changeset 13538 | 0c8001e43fd3 |
parent 13466 | 854caa3c9212 |
child 13646 | 007813b81f1b |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
4976 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
10015
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
4976 | 17 |
*) |
18 |
||
4413 | 19 |
{$INCLUDE "options.inc"} |
4976 | 20 |
|
4413 | 21 |
unit uCommandHandlers; |
22 |
||
23 |
interface |
|
24 |
||
25 |
procedure initModule; |
|
26 |
procedure freeModule; |
|
27 |
||
28 |
implementation |
|
13003
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
13002
diff
changeset
|
29 |
uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions |
12820
92218a06c9ff
Don't send taunt message for automatically happening taunt animation
unc0rr
parents:
12495
diff
changeset
|
30 |
, uVisualGearsList, uGearsHedgehog |
7629 | 31 |
{$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}; |
4413 | 32 |
|
13112
7b3bc9a4dfb9
uCommandHandlers: Remove unused variable
Wuzzy <Wuzzy2@mail.ru>
parents:
13082
diff
changeset
|
33 |
var cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 0, 4, 5, 6, 15, 8, 8, 8, 8, 12, 13, 14); |
13003
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
13002
diff
changeset
|
34 |
cTagsMasksNoHealth: array[0..15] of byte = (3, 0, 1, 2, 0, 0, 0, 0, 11, 8, 9, 10, 8, 8, 8, 8); |
7028 | 35 |
|
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
36 |
procedure chGenCmd(var s: shortstring); |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
37 |
begin |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
38 |
case s[1] of |
11924
e0476802c8b5
When doing something, set ready time to 0 instead of 1
Wuzzy <almikes@aol.com>
parents:
11537
diff
changeset
|
39 |
'R': if ReadyTimeLeft > 0 then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
40 |
begin |
11924
e0476802c8b5
When doing something, set ready time to 0 instead of 1
Wuzzy <almikes@aol.com>
parents:
11537
diff
changeset
|
41 |
ReadyTimeLeft:= 0; |
7805 | 42 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
43 |
SendIPC('c'+s); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
44 |
end |
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
45 |
end |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
46 |
end; |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
47 |
|
4413 | 48 |
procedure chQuit(var s: shortstring); |
49 |
begin |
|
4751 | 50 |
s:= s; // avoid compiler hint |
13082 | 51 |
if (GameState = gsGame) then |
52 |
begin |
|
53 |
isInChatMode:= false; |
|
5523 | 54 |
GameState:= gsConfirm; |
13082 | 55 |
end |
56 |
else begin |
|
10510 | 57 |
if GameState = gsConfirm then |
13082 | 58 |
GameState:= gsGame; |
59 |
end; |
|
10510 | 60 |
|
10392 | 61 |
updateCursorVisibility; |
4413 | 62 |
end; |
63 |
||
4744
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
64 |
procedure chForceQuit(var s: shortstring); |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
65 |
begin |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
66 |
s:= s; // avoid compiler hint |
4751 | 67 |
GameState:= gsConfirm; |
68 |
ParseCommand('confirm', true); |
|
4413 | 69 |
end; |
70 |
||
71 |
procedure chConfirm(var s: shortstring); |
|
72 |
begin |
|
4751 | 73 |
s:= s; // avoid compiler hint |
74 |
if GameState = gsConfirm then |
|
7722 | 75 |
begin |
7068 | 76 |
SendIPC(_S'Q'); |
4751 | 77 |
GameState:= gsExit |
7722 | 78 |
end |
4413 | 79 |
end; |
80 |
||
4751 | 81 |
procedure chHalt (var s: shortstring); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
82 |
begin |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
83 |
s:= s; // avoid compiler hint |
7068 | 84 |
SendIPC(_S'H'); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
85 |
GameState:= gsExit |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
86 |
end; |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
87 |
|
4413 | 88 |
procedure chCheckProto(var s: shortstring); |
8370 | 89 |
var i: LongInt; |
4413 | 90 |
begin |
6001 | 91 |
if isDeveloperMode then |
92 |
begin |
|
8370 | 93 |
i:= StrToInt(s); |
11537 | 94 |
checkFails(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
95 |
checkFails(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
|
7058 | 96 |
end |
4413 | 97 |
end; |
98 |
||
99 |
procedure chTeamLocal(var s: shortstring); |
|
100 |
begin |
|
101 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
102 |
if not isDeveloperMode then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
103 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
104 |
if CurrentTeam = nil then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
105 |
OutError(errmsgIncorrectUse + ' "/rdriven"', true); |
4413 | 106 |
CurrentTeam^.ExtDriven:= true |
107 |
end; |
|
108 |
||
109 |
procedure chScript(var s: shortstring); |
|
110 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
111 |
if s[1]='"' then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
112 |
Delete(s, 1, 1); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
113 |
if s[byte(s[0])]='"' then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
114 |
Delete(s, byte(s[0]), 1); |
6254
e90fb60cb46d
Force a desync if there is a script name mismatch. This avoids playing until the game desyncs due to script differences.
nemo
parents:
6245
diff
changeset
|
115 |
cScriptName:= s; |
4413 | 116 |
ScriptLoad(s) |
117 |
end; |
|
118 |
||
9902 | 119 |
procedure chScriptParam(var s: shortstring); |
120 |
begin |
|
9985
42cd42e44c9a
GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents:
9902
diff
changeset
|
121 |
ScriptSetString('ScriptParam', s); |
42cd42e44c9a
GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents:
9902
diff
changeset
|
122 |
ScriptCall('onParameters'); |
9902 | 123 |
end; |
124 |
||
4413 | 125 |
procedure chCurU_p(var s: shortstring); |
126 |
begin |
|
127 |
s:= s; // avoid compiler hint |
|
128 |
CursorMovementY:= -1; |
|
129 |
end; |
|
130 |
||
131 |
procedure chCurU_m(var s: shortstring); |
|
132 |
begin |
|
133 |
s:= s; // avoid compiler hint |
|
134 |
CursorMovementY:= 0; |
|
135 |
end; |
|
136 |
||
137 |
procedure chCurD_p(var s: shortstring); |
|
138 |
begin |
|
139 |
s:= s; // avoid compiler hint |
|
140 |
CursorMovementY:= 1; |
|
141 |
end; |
|
142 |
||
143 |
procedure chCurD_m(var s: shortstring); |
|
144 |
begin |
|
145 |
s:= s; // avoid compiler hint |
|
146 |
CursorMovementY:= 0; |
|
147 |
end; |
|
148 |
||
149 |
procedure chCurL_p(var s: shortstring); |
|
150 |
begin |
|
151 |
s:= s; // avoid compiler hint |
|
152 |
CursorMovementX:= -1; |
|
153 |
end; |
|
154 |
||
155 |
procedure chCurL_m(var s: shortstring); |
|
156 |
begin |
|
157 |
s:= s; // avoid compiler hint |
|
158 |
CursorMovementX:= 0; |
|
159 |
end; |
|
160 |
||
161 |
procedure chCurR_p(var s: shortstring); |
|
162 |
begin |
|
163 |
s:= s; // avoid compiler hint |
|
164 |
CursorMovementX:= 1; |
|
165 |
end; |
|
166 |
||
167 |
procedure chCurR_m(var s: shortstring); |
|
168 |
begin |
|
169 |
s:= s; // avoid compiler hint |
|
170 |
CursorMovementX:= 0; |
|
171 |
end; |
|
172 |
||
173 |
procedure chLeft_p(var s: shortstring); |
|
174 |
begin |
|
175 |
s:= s; // avoid compiler hint |
|
10392 | 176 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
177 |
exit; |
7805 | 178 |
if not isExternalSource then |
7068 | 179 |
SendIPC(_S'L'); |
4413 | 180 |
bShowFinger:= false; |
181 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
182 |
Message:= Message or (gmLeft and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
183 |
ScriptCall('onLeft'); |
4413 | 184 |
end; |
185 |
||
186 |
procedure chLeft_m(var s: shortstring); |
|
187 |
begin |
|
188 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
189 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
190 |
exit; |
7805 | 191 |
if not isExternalSource then |
7068 | 192 |
SendIPC(_S'l'); |
4413 | 193 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
194 |
Message:= Message and (not (gmLeft and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
195 |
ScriptCall('onLeftUp'); |
4413 | 196 |
end; |
197 |
||
198 |
procedure chRight_p(var s: shortstring); |
|
199 |
begin |
|
200 |
s:= s; // avoid compiler hint |
|
10392 | 201 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
202 |
exit; |
7805 | 203 |
if not isExternalSource then |
7068 | 204 |
SendIPC(_S'R'); |
4413 | 205 |
bShowFinger:= false; |
206 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
207 |
Message:= Message or (gmRight and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
208 |
ScriptCall('onRight'); |
4413 | 209 |
end; |
210 |
||
211 |
procedure chRight_m(var s: shortstring); |
|
212 |
begin |
|
213 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
214 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
215 |
exit; |
7805 | 216 |
if not isExternalSource then |
7068 | 217 |
SendIPC(_S'r'); |
4413 | 218 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
219 |
Message:= Message and (not (gmRight and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
220 |
ScriptCall('onRightUp'); |
4413 | 221 |
end; |
222 |
||
223 |
procedure chUp_p(var s: shortstring); |
|
224 |
begin |
|
225 |
s:= s; // avoid compiler hint |
|
10392 | 226 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
227 |
exit; |
7805 | 228 |
if not isExternalSource then |
7068 | 229 |
SendIPC(_S'U'); |
4413 | 230 |
bShowFinger:= false; |
231 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
232 |
Message:= Message or (gmUp and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
233 |
ScriptCall('onUp'); |
4413 | 234 |
end; |
235 |
||
236 |
procedure chUp_m(var s: shortstring); |
|
237 |
begin |
|
238 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
239 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
240 |
exit; |
7805 | 241 |
if not isExternalSource then |
7068 | 242 |
SendIPC(_S'u'); |
4413 | 243 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
244 |
Message:= Message and (not (gmUp and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
245 |
ScriptCall('onUpUp'); |
4413 | 246 |
end; |
247 |
||
248 |
procedure chDown_p(var s: shortstring); |
|
249 |
begin |
|
250 |
s:= s; // avoid compiler hint |
|
10392 | 251 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
252 |
exit; |
7805 | 253 |
if not isExternalSource then |
7068 | 254 |
SendIPC(_S'D'); |
4413 | 255 |
bShowFinger:= false; |
256 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
257 |
Message:= Message or (gmDown and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
258 |
ScriptCall('onDown'); |
4413 | 259 |
end; |
260 |
||
261 |
procedure chDown_m(var s: shortstring); |
|
262 |
begin |
|
263 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
264 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
265 |
exit; |
7805 | 266 |
if not isExternalSource then |
7068 | 267 |
SendIPC(_S'd'); |
4413 | 268 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
269 |
Message:= Message and (not (gmDown and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
270 |
ScriptCall('onDownUp'); |
4413 | 271 |
end; |
272 |
||
273 |
procedure chPrecise_p(var s: shortstring); |
|
274 |
begin |
|
275 |
s:= s; // avoid compiler hint |
|
10392 | 276 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
277 |
exit; |
7805 | 278 |
if not isExternalSource then |
7068 | 279 |
SendIPC(_S'Z'); |
4413 | 280 |
bShowFinger:= false; |
281 |
with CurrentHedgehog^.Gear^ do |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
282 |
Message:= Message or (gmPrecise and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
283 |
ScriptCall('onPrecise'); |
4413 | 284 |
end; |
285 |
||
286 |
procedure chPrecise_m(var s: shortstring); |
|
287 |
begin |
|
288 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
289 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
290 |
exit; |
7805 | 291 |
if not isExternalSource then |
7068 | 292 |
SendIPC(_S'z'); |
4413 | 293 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
294 |
Message:= Message and (not (gmPrecise and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
295 |
ScriptCall('onPreciseUp'); |
4413 | 296 |
end; |
297 |
||
298 |
procedure chLJump(var s: shortstring); |
|
299 |
begin |
|
300 |
s:= s; // avoid compiler hint |
|
10392 | 301 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
302 |
exit; |
7805 | 303 |
if not isExternalSource then |
7068 | 304 |
SendIPC(_S'j'); |
4413 | 305 |
bShowFinger:= false; |
306 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
307 |
Message:= Message or (gmLJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
308 |
ScriptCall('onLJump'); |
4413 | 309 |
end; |
310 |
||
311 |
procedure chHJump(var s: shortstring); |
|
312 |
begin |
|
313 |
s:= s; // avoid compiler hint |
|
10392 | 314 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
315 |
exit; |
7805 | 316 |
if not isExternalSource then |
7068 | 317 |
SendIPC(_S'J'); |
4413 | 318 |
bShowFinger:= false; |
319 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
320 |
Message:= Message or (gmHJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
321 |
ScriptCall('onHJump'); |
4413 | 322 |
end; |
323 |
||
324 |
procedure chAttack_p(var s: shortstring); |
|
10672 | 325 |
var inbtwnTrgtAttks: Boolean; |
4413 | 326 |
begin |
327 |
s:= s; // avoid compiler hint |
|
10392 | 328 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
329 |
exit; |
4413 | 330 |
bShowFinger:= false; |
331 |
with CurrentHedgehog^.Gear^ do |
|
332 |
begin |
|
4900 | 333 |
AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State)); |
4413 | 334 |
if ((State and gstHHDriven) <> 0) then |
335 |
begin |
|
10672 | 336 |
inbtwnTrgtAttks:= ((GameFlags and gfInfAttack) <> 0) and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0); |
337 |
if (not inbtwnTrgtAttks) then |
|
338 |
FollowGear:= CurrentHedgehog^.Gear; |
|
7805 | 339 |
if not isExternalSource then |
7068 | 340 |
SendIPC(_S'A'); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
341 |
Message:= Message or (gmAttack and InputMask); |
10228 | 342 |
ScriptCall('onAttack'); // so if I fire airstrike, it doesn't count as attack? fine, fine |
4413 | 343 |
end |
344 |
end |
|
345 |
end; |
|
346 |
||
347 |
procedure chAttack_m(var s: shortstring); |
|
348 |
begin |
|
349 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
350 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
351 |
exit; |
4413 | 352 |
with CurrentHedgehog^.Gear^ do |
353 |
begin |
|
7805 | 354 |
if not isExternalSource and |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
355 |
((Message and gmAttack) <> 0) then |
7068 | 356 |
SendIPC(_S'a'); |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
357 |
Message:= Message and (not (gmAttack and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
358 |
ScriptCall('onAttackUp'); |
4413 | 359 |
end |
360 |
end; |
|
361 |
||
362 |
procedure chSwitch(var s: shortstring); |
|
363 |
begin |
|
364 |
s:= s; // avoid compiler hint |
|
10392 | 365 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
366 |
exit; |
7805 | 367 |
if not isExternalSource then |
7068 | 368 |
SendIPC(_S'S'); |
4413 | 369 |
bShowFinger:= false; |
370 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
371 |
Message:= Message or (gmSwitch and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
372 |
ScriptCall('onSwitch'); |
4413 | 373 |
end; |
374 |
||
375 |
procedure chNextTurn(var s: shortstring); |
|
7671 | 376 |
var gi: PGear; |
4413 | 377 |
begin |
378 |
s:= s; // avoid compiler hint |
|
7103 | 379 |
|
11537 | 380 |
if checkFails(AllInactive, '/nextturn called when not all gears are inactive', true) then exit; |
4413 | 381 |
|
7389
15c3fb4882df
Sorry about the slight delay in pickup. You can blame a few lame cheaters. This is to make their cheating a bit harder.
nemo
parents:
7218
diff
changeset
|
382 |
CheckSum:= CheckSum xor GameTicks; |
7104 | 383 |
gi := GearsList; |
384 |
while gi <> nil do |
|
385 |
begin |
|
9797
1fdc1507e42d
remove state from check, just to see if this was why we just desynced
nemo
parents:
9796
diff
changeset
|
386 |
with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac; |
7389
15c3fb4882df
Sorry about the slight delay in pickup. You can blame a few lame cheaters. This is to make their cheating a bit harder.
nemo
parents:
7218
diff
changeset
|
387 |
AddRandomness(CheckSum); |
7104 | 388 |
gi := gi^.NextGear |
389 |
end; |
|
7103 | 390 |
|
7805 | 391 |
if not isExternalSource then |
7103 | 392 |
begin |
393 |
s[0]:= #5; |
|
394 |
s[1]:= 'N'; |
|
7389
15c3fb4882df
Sorry about the slight delay in pickup. You can blame a few lame cheaters. This is to make their cheating a bit harder.
nemo
parents:
7218
diff
changeset
|
395 |
SDLNet_Write32(CheckSum, @s[2]); |
7103 | 396 |
SendIPC(s) |
397 |
end |
|
398 |
else |
|
11537 | 399 |
checkFails(CurrentTeam^.hasGone or (CheckSum = lastTurnChecksum), 'Desync detected', true); |
7831 | 400 |
|
7187
aff30d80bd7b
- Allow camera movement while current hedgehog is falling
unc0rr
parents:
7151
diff
changeset
|
401 |
AddFileLog('Next turn: time '+inttostr(GameTicks)); |
4413 | 402 |
end; |
403 |
||
404 |
procedure chTimer(var s: shortstring); |
|
405 |
begin |
|
7790 | 406 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
407 |
exit; |
4413 | 408 |
|
11537 | 409 |
if checkFails((s[0] = #1) and (s[1] >= '1') and (s[1] <= '5'), 'Malformed /timer', true) then exit; |
7790 | 410 |
|
7805 | 411 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
412 |
SendIPC(s); |
4413 | 413 |
bShowFinger:= false; |
414 |
with CurrentHedgehog^.Gear^ do |
|
415 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
416 |
Message:= Message or (gmTimer and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
417 |
MsgParam:= byte(s[1]) - ord('0'); |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
418 |
ScriptCall('onTimer', MsgParam); |
4413 | 419 |
end |
420 |
end; |
|
421 |
||
13538
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
422 |
// Increment timer or bounciness |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
423 |
procedure chTimerU(var s: shortstring); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
424 |
var t: LongWord; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
425 |
tb: Byte; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
426 |
begin |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
427 |
s:= s; // avoid compiler hint |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
428 |
if CheckNoTeamOrHH then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
429 |
exit; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
430 |
// We grab the current timer first so we can increment it |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
431 |
if (CurrentHedgehog^.Gear^.Message and gmPrecise) = 0 then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
432 |
t:= HHGetTimerMsg(CurrentHedgehog^.Gear) |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
433 |
else |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
434 |
// Use bounciness if Precise is pressed |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
435 |
t:= HHGetBouncinessMsg(CurrentHedgehog^.Gear); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
436 |
if t <> MSGPARAM_INVALID then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
437 |
begin |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
438 |
// Calculate new timer |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
439 |
Inc(t); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
440 |
if t > 5 then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
441 |
t:= 1; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
442 |
tb:= t mod 255; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
443 |
// Delegate the actual change to /timer |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
444 |
ParseCommand('timer ' + Chr(tb + Ord('0')), true); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
445 |
end; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
446 |
end; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
447 |
|
4413 | 448 |
procedure chSlot(var s: shortstring); |
449 |
var slot: LongWord; |
|
7068 | 450 |
ss: shortstring; |
4413 | 451 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
452 |
if (s[0] <> #1) or CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
453 |
exit; |
4413 | 454 |
slot:= byte(s[1]) - 49; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
455 |
if slot > cMaxSlotIndex then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
456 |
exit; |
7805 | 457 |
if not isExternalSource then |
7068 | 458 |
begin |
459 |
ss[0]:= #1; |
|
460 |
ss[1]:= char(byte(s[1]) + 79); |
|
461 |
SendIPC(ss); |
|
462 |
end; |
|
4413 | 463 |
bShowFinger:= false; |
464 |
with CurrentHedgehog^.Gear^ do |
|
465 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
466 |
Message:= Message or (gmSlot and InputMask); |
8924 | 467 |
MsgParam:= slot; |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
468 |
ScriptCall('onSlot', MsgParam); |
4413 | 469 |
end |
470 |
end; |
|
471 |
||
472 |
procedure chSetWeapon(var s: shortstring); |
|
473 |
begin |
|
7790 | 474 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
475 |
exit; |
4413 | 476 |
|
11537 | 477 |
if checkFails((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true) then exit; |
4413 | 478 |
|
7805 | 479 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
480 |
SendIPC('w' + s); |
4413 | 481 |
|
482 |
with CurrentHedgehog^.Gear^ do |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
483 |
begin |
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
484 |
Message:= Message or (gmWeapon and InputMask); |
4413 | 485 |
MsgParam:= byte(s[1]); |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
486 |
ScriptCall('onSetWeapon', MsgParam); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
487 |
end; |
4413 | 488 |
end; |
489 |
||
490 |
procedure chTaunt(var s: shortstring); |
|
491 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
492 |
if (s[0] <> #1) or CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
493 |
exit; |
4413 | 494 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
495 |
if TWave(s[1]) > High(TWave) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
496 |
exit; |
4413 | 497 |
|
7805 | 498 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
499 |
SendIPC('t' + s); |
4413 | 500 |
|
12820
92218a06c9ff
Don't send taunt message for automatically happening taunt animation
unc0rr
parents:
12495
diff
changeset
|
501 |
PlayTaunt(byte(s[1])) |
4413 | 502 |
end; |
503 |
||
504 |
procedure chPut(var s: shortstring); |
|
505 |
begin |
|
506 |
s:= s; // avoid compiler hint |
|
507 |
doPut(0, 0, false); |
|
508 |
end; |
|
509 |
||
510 |
procedure chCapture(var s: shortstring); |
|
511 |
begin |
|
512 |
s:= s; // avoid compiler hint |
|
10633
2f062fac5791
Add that "make screenshots of Land/LandPixels" thing for map creators
nemo
parents:
10603
diff
changeset
|
513 |
flagMakeCapture:= true; |
11025
999afa63035f
just disable landpixels w/ blurry land instead. the mask can be helpful for debugging at least.
nemo
parents:
11024
diff
changeset
|
514 |
flagDumpLand:= (LocalMessage and gmPrecise <> 0); |
4413 | 515 |
end; |
516 |
||
7629 | 517 |
procedure chRecord(var s: shortstring); |
518 |
begin |
|
519 |
s:= s; // avoid compiler hint |
|
520 |
{$IFDEF USE_VIDEO_RECORDING} |
|
521 |
if flagPrerecording then |
|
522 |
StopPreRecording() |
|
523 |
else |
|
524 |
BeginPreRecording(); |
|
525 |
{$ENDIF} |
|
526 |
end; |
|
527 |
||
4413 | 528 |
procedure chSetMap(var s: shortstring); |
529 |
begin |
|
5679
505c6448069b
accidentally reverted this when reverting the rest of the override changes.
nemo
parents:
5555
diff
changeset
|
530 |
if isDeveloperMode then |
6088 | 531 |
begin |
6339 | 532 |
if s = '' then |
8025 | 533 |
cPathz[ptMapCurrent]:= s |
6339 | 534 |
else |
8025 | 535 |
cPathz[ptMapCurrent]:= cPathz[ptMaps] + '/' + s; |
6088 | 536 |
InitStepsFlags:= InitStepsFlags or cifMap |
537 |
end; |
|
6828
6a5d33bff0b0
At mikade's request. give scripting access to the map name prior to override.
nemo
parents:
6818
diff
changeset
|
538 |
cMapName:= s; |
6245 | 539 |
ScriptLoad('Maps/' + s + '/map.lua') |
4413 | 540 |
end; |
541 |
||
542 |
procedure chSetTheme(var s: shortstring); |
|
543 |
begin |
|
544 |
if isDeveloperMode then |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
545 |
begin |
8025 | 546 |
cPathz[ptCurrTheme]:= cPathz[ptThemes] + '/' + s; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
547 |
Theme:= s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
548 |
InitStepsFlags:= InitStepsFlags or cifTheme |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
549 |
end |
4413 | 550 |
end; |
551 |
||
552 |
procedure chSetSeed(var s: shortstring); |
|
553 |
begin |
|
554 |
if isDeveloperMode then |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
555 |
begin |
8912 | 556 |
SetRandomSeed(s, true); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
557 |
cSeed:= s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
558 |
InitStepsFlags:= InitStepsFlags or cifRandomize |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
559 |
end |
12852
1aba77b2e4ac
This is a desyncing change. But... We might need a new release anyway. ☹
nemo
parents:
12820
diff
changeset
|
560 |
end; |
4413 | 561 |
|
562 |
procedure chAmmoMenu(var s: shortstring); |
|
563 |
begin |
|
564 |
s:= s; // avoid compiler hint |
|
565 |
if CheckNoTeamOrHH then |
|
10439
7de934f2247c
allow toggling ammo menu while NoTeamOrHH, as suggested by unC0Rr
sheepluva
parents:
10392
diff
changeset
|
566 |
bShowAmmoMenu:= (not bShowAmmoMenu) |
4413 | 567 |
else |
568 |
begin |
|
569 |
with CurrentTeam^ do |
|
570 |
with Hedgehogs[CurrHedgehog] do |
|
571 |
begin |
|
572 |
bSelected:= false; |
|
573 |
||
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
574 |
if bShowAmmoMenu then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
575 |
bShowAmmoMenu:= false |
12221
5b525d041fb4
Fix crash when trying to open ammo menu with current team hog gear = nil
Wuzzy <almikes@aol.com>
parents:
11924
diff
changeset
|
576 |
else if not(CurrentTeam^.Extdriven) and ((Gear = nil) or ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) |
7946
a99a79bbd857
Simplify ammo menu conditions so it shows up in more states. Should fix issue #465. The part w/ sliding in uworld is main #465 problem.
nemo
parents:
7831
diff
changeset
|
577 |
or ((Gear^.State and gstHHDriven) = 0)) then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
578 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
579 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
580 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
581 |
bShowAmmoMenu:= true |
4413 | 582 |
end; |
583 |
end |
|
584 |
end; |
|
585 |
||
586 |
procedure chVol_p(var s: shortstring); |
|
587 |
begin |
|
588 |
s:= s; // avoid compiler hint |
|
589 |
inc(cVolumeDelta, 3) |
|
590 |
end; |
|
591 |
||
592 |
procedure chVol_m(var s: shortstring); |
|
593 |
begin |
|
594 |
s:= s; // avoid compiler hint |
|
595 |
dec(cVolumeDelta, 3) |
|
596 |
end; |
|
597 |
||
13044
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
598 |
procedure chMute(var s: shortstring); |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
599 |
begin |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
600 |
s:= s; // avoid compiler hint |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
601 |
cMuteToggle:= true; |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
602 |
end; |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
603 |
|
4413 | 604 |
procedure chFindhh(var s: shortstring); |
605 |
begin |
|
606 |
s:= s; // avoid compiler hint |
|
10392 | 607 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
608 |
exit; |
5247 | 609 |
|
7629 | 610 |
if autoCameraOn then |
5247 | 611 |
begin |
7629 | 612 |
FollowGear:= nil; |
10455 | 613 |
AddCaption(trmsg[sidAutoCameraOff], $CCCCCC, capgrpVolume); |
5247 | 614 |
autoCameraOn:= false |
615 |
end |
|
7629 | 616 |
else |
617 |
begin |
|
10455 | 618 |
AddCaption(trmsg[sidAutoCameraOn], $CCCCCC, capgrpVolume); |
5247 | 619 |
bShowFinger:= true; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
620 |
if not CurrentHedgehog^.Unplaced then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
621 |
FollowGear:= CurrentHedgehog^.Gear; |
5247 | 622 |
autoCameraOn:= true |
623 |
end |
|
4413 | 624 |
end; |
625 |
||
626 |
procedure chPause(var s: shortstring); |
|
627 |
begin |
|
10392 | 628 |
if (gameType <> gmtNet) or (s = 'server') then |
9670
1954f692e8c6
Quick and simple implementation of afk mode (toggled by /pause)
unc0rr
parents:
9489
diff
changeset
|
629 |
isPaused:= not isPaused |
1954f692e8c6
Quick and simple implementation of afk mode (toggled by /pause)
unc0rr
parents:
9489
diff
changeset
|
630 |
else |
9671 | 631 |
if (CurrentTeam^.ExtDriven) or (CurrentHedgehog^.BotLevel > 0) then |
632 |
isAFK:= not isAFK |
|
633 |
else |
|
634 |
isAFK:= false; // for real ninjas |
|
5524
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
635 |
|
10392 | 636 |
updateCursorVisibility; |
4413 | 637 |
end; |
638 |
||
639 |
procedure chRotateMask(var s: shortstring); |
|
640 |
begin |
|
641 |
s:= s; // avoid compiler hint |
|
12495
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
642 |
// this is just for me, 'cause I thought it'd be fun. using the old precise + switch to keep it out of people's way |
9693 | 643 |
if LocalMessage and (gmPrecise or gmSwitch) = (gmPrecise or gmSwitch) then |
644 |
begin |
|
645 |
if UIDisplay <> uiNone then |
|
646 |
UIDisplay:= uiNone |
|
647 |
else UIDisplay:= uiAll |
|
648 |
end |
|
12495
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
649 |
else |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
650 |
begin |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
651 |
if UIDisplay <> uiNoTeams then |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
652 |
UIDisplay:= uiNoTeams |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
653 |
else UIDisplay:= uiAll |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12493
diff
changeset
|
654 |
end |
4413 | 655 |
end; |
656 |
||
13002
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12995
diff
changeset
|
657 |
procedure chRotateTags(var s: shortstring); |
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12995
diff
changeset
|
658 |
begin |
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12995
diff
changeset
|
659 |
s:= s; // avoid compiler hint |
13005
c5529aabdda9
Flip Switch/Precise key combintions with change hog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13004
diff
changeset
|
660 |
// Rotate Tags key + Switch: Toggle translucency only |
c5529aabdda9
Flip Switch/Precise key combintions with change hog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13004
diff
changeset
|
661 |
if LocalMessage and gmSwitch = gmSwitch then |
13003
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
13002
diff
changeset
|
662 |
if ((cTagsMask and htTransparent) = 0) then |
13006
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
663 |
begin |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
664 |
cTagsMask:= cTagsMask or htTransparent; |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
665 |
cPrevTagsMask:= cPrevTagsMask or htTransparent |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
666 |
end |
13003
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
13002
diff
changeset
|
667 |
else |
13006
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
668 |
begin |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
669 |
cTagsMask:= cTagsMask and (not htTransparent); |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
670 |
cPrevTagsMask:= cPrevTagsMask and (not htTransparent) |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13005
diff
changeset
|
671 |
end |
13012
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
672 |
// Rotate Tags key + Precise: Cycle through hog tags (keeping translucency) |
13005
c5529aabdda9
Flip Switch/Precise key combintions with change hog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13004
diff
changeset
|
673 |
else if LocalMessage and gmPrecise = gmPrecise then |
13012
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
674 |
begin |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
675 |
cPrevTagsMask:= cTagsMask; |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
676 |
if ((GameFlags and gfInvulnerable) = 0) then |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
677 |
cTagsMask:= cTagsMasks[cTagsMask] |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
678 |
else |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
679 |
cTagsMask:= cTagsMasksNoHealth[cTagsMask] |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
680 |
end |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
681 |
// Rotate Tags key only: Toggle all hog tags on and off |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
682 |
else |
13004
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13003
diff
changeset
|
683 |
if ((cTagsMask and (htTeamName or htName or htHealth)) = 0) then |
13018
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13012
diff
changeset
|
684 |
begin |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13012
diff
changeset
|
685 |
cTagsMask:= cPrevTagsMask; |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13012
diff
changeset
|
686 |
if ((GameFlags and gfInvulnerable) <> 0) then |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13012
diff
changeset
|
687 |
cTagsMask:= cTagsMask and (not htHealth); |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13012
diff
changeset
|
688 |
end |
13004
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13003
diff
changeset
|
689 |
else |
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13003
diff
changeset
|
690 |
begin |
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13003
diff
changeset
|
691 |
cPrevTagsMask:= cTagsMask; |
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13003
diff
changeset
|
692 |
cTagsMask:= cTagsMask and (not (htTeamName or htName or htHealth)) |
13012
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13006
diff
changeset
|
693 |
end; |
13004
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13003
diff
changeset
|
694 |
end; |
13002
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12995
diff
changeset
|
695 |
|
4413 | 696 |
procedure chSpeedup_p(var s: shortstring); |
697 |
begin |
|
698 |
s:= s; // avoid compiler hint |
|
7629 | 699 |
SpeedStart:= RealTicks; |
4413 | 700 |
isSpeed:= true |
701 |
end; |
|
702 |
||
703 |
procedure chSpeedup_m(var s: shortstring); |
|
704 |
begin |
|
705 |
s:= s; // avoid compiler hint |
|
706 |
isSpeed:= false |
|
707 |
end; |
|
708 |
||
709 |
procedure chZoomIn(var s: shortstring); |
|
710 |
begin |
|
711 |
s:= s; // avoid compiler hint |
|
712 |
if ZoomValue < cMinZoomLevel then |
|
713 |
ZoomValue:= ZoomValue + cZoomDelta; |
|
714 |
end; |
|
715 |
||
716 |
procedure chZoomOut(var s: shortstring); |
|
717 |
begin |
|
718 |
s:= s; // avoid compiler hint |
|
719 |
if ZoomValue > cMaxZoomLevel then |
|
720 |
ZoomValue:= ZoomValue - cZoomDelta; |
|
721 |
end; |
|
722 |
||
723 |
procedure chZoomReset(var s: shortstring); |
|
724 |
begin |
|
725 |
s:= s; // avoid compiler hint |
|
726 |
ZoomValue:= cDefaultZoomLevel; |
|
727 |
end; |
|
728 |
||
6898 | 729 |
procedure chMapGen(var s: shortstring); |
730 |
begin |
|
10603
bda5c7caf396
switch mapgen to enum. should still try and make sure the values are backwards compatible if possible.
nemo
parents:
10510
diff
changeset
|
731 |
cMapGen:= TMapGen(StrToInt(s)) |
6898 | 732 |
end; |
733 |
||
734 |
procedure chTemplateFilter(var s: shortstring); |
|
735 |
begin |
|
7151 | 736 |
cTemplateFilter:= StrToInt(s) |
6898 | 737 |
end; |
738 |
||
10472
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
739 |
procedure chFeatureSize(var s: shortstring); |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
740 |
begin |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
741 |
cFeatureSize:= StrToInt(s) |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
742 |
end; |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
743 |
|
6898 | 744 |
procedure chInactDelay(var s: shortstring); |
745 |
begin |
|
7151 | 746 |
cInactDelay:= StrToInt(s) |
6898 | 747 |
end; |
748 |
||
749 |
procedure chReadyDelay(var s: shortstring); |
|
750 |
begin |
|
7151 | 751 |
cReadyDelay:= StrToInt(s) |
6898 | 752 |
end; |
753 |
||
754 |
procedure chCaseFactor(var s: shortstring); |
|
755 |
begin |
|
7151 | 756 |
cCaseFactor:= StrToInt(s) |
6898 | 757 |
end; |
758 |
||
759 |
procedure chHealthCaseProb(var s: shortstring); |
|
760 |
begin |
|
7151 | 761 |
cHealthCaseProb:= StrToInt(s) |
6898 | 762 |
end; |
763 |
||
764 |
procedure chHealthCaseAmount(var s: shortstring); |
|
765 |
begin |
|
7151 | 766 |
cHealthCaseAmount:= StrToInt(s) |
6898 | 767 |
end; |
768 |
||
769 |
procedure chSuddenDTurns(var s: shortstring); |
|
770 |
begin |
|
7151 | 771 |
cSuddenDTurns:= StrToInt(s) |
6898 | 772 |
end; |
773 |
||
774 |
procedure chWaterRise(var s: shortstring); |
|
775 |
begin |
|
7151 | 776 |
cWaterRise:= StrToInt(s) |
6898 | 777 |
end; |
778 |
||
779 |
procedure chHealthDecrease(var s: shortstring); |
|
780 |
begin |
|
7151 | 781 |
cHealthDecrease:= StrToInt(s) |
6898 | 782 |
end; |
783 |
||
784 |
procedure chDamagePercent(var s: shortstring); |
|
785 |
begin |
|
7151 | 786 |
cDamagePercent:= StrToInt(s) |
6898 | 787 |
end; |
788 |
||
789 |
procedure chRopePercent(var s: shortstring); |
|
790 |
begin |
|
7151 | 791 |
cRopePercent:= StrToInt(s) |
6898 | 792 |
end; |
793 |
||
794 |
procedure chGetAwayTime(var s: shortstring); |
|
795 |
begin |
|
7151 | 796 |
cGetAwayTime:= StrToInt(s) |
6898 | 797 |
end; |
798 |
||
799 |
procedure chMineDudPercent(var s: shortstring); |
|
800 |
begin |
|
7151 | 801 |
cMineDudPercent:= StrToInt(s) |
6898 | 802 |
end; |
803 |
||
804 |
procedure chLandMines(var s: shortstring); |
|
805 |
begin |
|
7151 | 806 |
cLandMines:= StrToInt(s) |
6898 | 807 |
end; |
808 |
||
10818
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
809 |
procedure chAirMines(var s: shortstring); |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
810 |
begin |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
811 |
cAirMines:= StrToInt(s) |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
812 |
end; |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
813 |
|
6898 | 814 |
procedure chExplosives(var s: shortstring); |
815 |
begin |
|
7151 | 816 |
cExplosives:= StrToInt(s) |
6898 | 817 |
end; |
818 |
||
819 |
procedure chGameFlags(var s: shortstring); |
|
820 |
begin |
|
7218
9ecd5bc9810b
Ensure that Clan ammo always takes precedence over Per Hog Ammo in the flags. It'd be best for the user sake if these buttons acted more like radio buttons.
nemo
parents:
7187
diff
changeset
|
821 |
GameFlags:= StrToInt(s); |
7629 | 822 |
if GameFlags and gfSharedAmmo <> 0 then GameFlags:= GameFlags and (not gfPerHogAmmo) |
6898 | 823 |
end; |
824 |
||
825 |
procedure chHedgehogTurnTime(var s: shortstring); |
|
826 |
begin |
|
7151 | 827 |
cHedgehogTurnTime:= StrToInt(s) |
6898 | 828 |
end; |
829 |
||
830 |
procedure chMinesTime(var s: shortstring); |
|
831 |
begin |
|
7151 | 832 |
cMinesTime:= StrToInt(s) |
6898 | 833 |
end; |
834 |
||
835 |
procedure chFastUntilLag(var s: shortstring); |
|
836 |
begin |
|
10862
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
837 |
fastUntilLag:= StrToInt(s) <> 0; |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
838 |
|
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
839 |
if not fastUntilLag then |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
840 |
begin |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
841 |
// update health bars and the wind indicator |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
842 |
AddVisualGear(0, 0, vgtTeamHealthSorter); |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
843 |
AddVisualGear(0, 0, vgtSmoothWindBar) |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
844 |
end |
6898 | 845 |
end; |
4413 | 846 |
|
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
847 |
procedure chCampVar(var s:shortstring); |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
848 |
begin |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
849 |
CampaignVariable := s; |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
850 |
end; |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
851 |
|
9489 | 852 |
procedure chWorldEdge(var s: shortstring); |
853 |
begin |
|
854 |
WorldEdge:= TWorldEdge(StrToInt(s)) |
|
855 |
end; |
|
856 |
||
10237 | 857 |
procedure chAdvancedMapGenMode(var s:shortstring); |
858 |
begin |
|
10249 | 859 |
s:= s; // avoid compiler hint |
10237 | 860 |
cAdvancedMapGenMode:= true; |
861 |
end; |
|
862 |
||
13464
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
863 |
procedure chShowMission_p(var s: shortstring); |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
864 |
begin |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
865 |
s:= s; // avoid compiler hint |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
866 |
isShowMission:= true; |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
867 |
end; |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
868 |
|
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
869 |
procedure chShowMission_m(var s: shortstring); |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
870 |
begin |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
871 |
s:= s; // avoid compiler hint |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
872 |
isShowMission:= false; |
13466
854caa3c9212
Lua API: Add parameter forceDisplay to ShowMission to prevent manual hiding
Wuzzy <Wuzzy2@mail.ru>
parents:
13464
diff
changeset
|
873 |
if (not isForceMission) then |
854caa3c9212
Lua API: Add parameter forceDisplay to ShowMission to prevent manual hiding
Wuzzy <Wuzzy2@mail.ru>
parents:
13464
diff
changeset
|
874 |
HideMission(); |
13464
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
875 |
end; |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
876 |
|
4413 | 877 |
procedure initModule; |
878 |
begin |
|
4528
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
879 |
//////// Begin top sorted by freq analysis not including chatmsg |
7407 | 880 |
RegisterVariable('+right' , @chRight_p , false, true); |
881 |
RegisterVariable('-right' , @chRight_m , false, true); |
|
882 |
RegisterVariable('+up' , @chUp_p , false, true); |
|
883 |
RegisterVariable('-up' , @chUp_m , false, true); |
|
884 |
RegisterVariable('+left' , @chLeft_p , false, true); |
|
885 |
RegisterVariable('-left' , @chLeft_m , false, true); |
|
7629 | 886 |
RegisterVariable('+attack' , @chAttack_p , false); |
7407 | 887 |
RegisterVariable('+down' , @chDown_p , false, true); |
888 |
RegisterVariable('-down' , @chDown_m , false, true); |
|
889 |
RegisterVariable('hjump' , @chHJump , false, true); |
|
890 |
RegisterVariable('ljump' , @chLJump , false, true); |
|
7629 | 891 |
RegisterVariable('nextturn', @chNextTurn , false); |
892 |
RegisterVariable('-attack' , @chAttack_m , false); |
|
893 |
RegisterVariable('slot' , @chSlot , false); |
|
7407 | 894 |
RegisterVariable('setweap' , @chSetWeapon , false, true); |
4528
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
895 |
//////// End top by freq analysis |
7629 | 896 |
RegisterVariable('gencmd' , @chGenCmd , false); |
6898 | 897 |
RegisterVariable('script' , @chScript , false); |
9902 | 898 |
RegisterVariable('scriptparam', @chScriptParam, false); |
6898 | 899 |
RegisterVariable('proto' , @chCheckProto , true ); |
900 |
RegisterVariable('spectate', @chFastUntilLag , false); |
|
901 |
RegisterVariable('capture' , @chCapture , true ); |
|
902 |
RegisterVariable('rotmask' , @chRotateMask , true ); |
|
13002
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12995
diff
changeset
|
903 |
RegisterVariable('rottags' , @chRotateTags , true ); |
6898 | 904 |
RegisterVariable('rdriven' , @chTeamLocal , false); |
905 |
RegisterVariable('map' , @chSetMap , false); |
|
906 |
RegisterVariable('theme' , @chSetTheme , false); |
|
907 |
RegisterVariable('seed' , @chSetSeed , false); |
|
908 |
RegisterVariable('template_filter', @chTemplateFilter, false); |
|
909 |
RegisterVariable('mapgen' , @chMapGen , false); |
|
910 |
RegisterVariable('maze_size',@chTemplateFilter, false); |
|
10472
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
911 |
RegisterVariable('feature_size',@chFeatureSize, false); |
6898 | 912 |
RegisterVariable('delay' , @chInactDelay , false); |
913 |
RegisterVariable('ready' , @chReadyDelay , false); |
|
914 |
RegisterVariable('casefreq', @chCaseFactor , false); |
|
915 |
RegisterVariable('healthprob', @chHealthCaseProb, false); |
|
916 |
RegisterVariable('hcaseamount', @chHealthCaseAmount, false); |
|
917 |
RegisterVariable('sd_turns', @chSuddenDTurns , false); |
|
918 |
RegisterVariable('waterrise', @chWaterRise , false); |
|
919 |
RegisterVariable('healthdec', @chHealthDecrease, false); |
|
920 |
RegisterVariable('damagepct',@chDamagePercent , false); |
|
921 |
RegisterVariable('ropepct' , @chRopePercent , false); |
|
922 |
RegisterVariable('getawaytime' , @chGetAwayTime , false); |
|
923 |
RegisterVariable('minedudpct',@chMineDudPercent, false); |
|
924 |
RegisterVariable('minesnum', @chLandMines , false); |
|
10822 | 925 |
RegisterVariable('airmines', @chAirMines , false); |
6898 | 926 |
RegisterVariable('explosives',@chExplosives , false); |
927 |
RegisterVariable('gmflags' , @chGameFlags , false); |
|
928 |
RegisterVariable('turntime', @chHedgehogTurnTime, false); |
|
929 |
RegisterVariable('minestime',@chMinesTime , false); |
|
930 |
RegisterVariable('quit' , @chQuit , true ); |
|
931 |
RegisterVariable('forcequit', @chForceQuit , true ); |
|
932 |
RegisterVariable('confirm' , @chConfirm , true ); |
|
933 |
RegisterVariable('halt', @chHalt , true ); |
|
934 |
RegisterVariable('+speedup', @chSpeedup_p , true ); |
|
935 |
RegisterVariable('-speedup', @chSpeedup_m , true ); |
|
936 |
RegisterVariable('zoomin' , @chZoomIn , true ); |
|
937 |
RegisterVariable('zoomout' , @chZoomOut , true ); |
|
938 |
RegisterVariable('zoomreset',@chZoomReset , true ); |
|
939 |
RegisterVariable('ammomenu', @chAmmoMenu , true); |
|
7629 | 940 |
RegisterVariable('+precise', @chPrecise_p , false, true); |
941 |
RegisterVariable('-precise', @chPrecise_m , false, true); |
|
6898 | 942 |
RegisterVariable('switch' , @chSwitch , false); |
7629 | 943 |
RegisterVariable('timer' , @chTimer , false, true); |
6898 | 944 |
RegisterVariable('taunt' , @chTaunt , false); |
945 |
RegisterVariable('put' , @chPut , false); |
|
946 |
RegisterVariable('+volup' , @chVol_p , true ); |
|
947 |
RegisterVariable('-volup' , @chVol_m , true ); |
|
948 |
RegisterVariable('+voldown', @chVol_m , true ); |
|
949 |
RegisterVariable('-voldown', @chVol_p , true ); |
|
13044
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13018
diff
changeset
|
950 |
RegisterVariable('mute' , @chMute , true ); |
7404 | 951 |
RegisterVariable('findhh' , @chFindhh , true ); |
6898 | 952 |
RegisterVariable('pause' , @chPause , true ); |
953 |
RegisterVariable('+cur_u' , @chCurU_p , true ); |
|
954 |
RegisterVariable('-cur_u' , @chCurU_m , true ); |
|
955 |
RegisterVariable('+cur_d' , @chCurD_p , true ); |
|
956 |
RegisterVariable('-cur_d' , @chCurD_m , true ); |
|
957 |
RegisterVariable('+cur_l' , @chCurL_p , true ); |
|
958 |
RegisterVariable('-cur_l' , @chCurL_m , true ); |
|
959 |
RegisterVariable('+cur_r' , @chCurR_p , true ); |
|
960 |
RegisterVariable('-cur_r' , @chCurR_m , true ); |
|
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
961 |
RegisterVariable('campvar' , @chCampVar , true ); |
7629 | 962 |
RegisterVariable('record' , @chRecord , true ); |
9489 | 963 |
RegisterVariable('worldedge',@chWorldEdge , false); |
10237 | 964 |
RegisterVariable('advmapgen',@chAdvancedMapGenMode, false); |
13464
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
965 |
RegisterVariable('+mission', @chShowMission_p, true); |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13112
diff
changeset
|
966 |
RegisterVariable('-mission', @chShowMission_m, true); |
13538
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13466
diff
changeset
|
967 |
RegisterVariable('timer_u' , @chTimerU , true ); |
4413 | 968 |
end; |
969 |
||
970 |
procedure freeModule; |
|
971 |
begin |
|
972 |
end; |
|
973 |
||
974 |
end. |