author | nemo |
Thu, 30 Aug 2012 22:13:42 -0400 | |
changeset 7633 | d4251e519062 |
parent 7629 | d624030abf24 |
child 7671 | 43f38923bc6e |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
6700 | 3 |
* Copyright (c) 2004-2012 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 |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
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 |
|
7629 | 29 |
uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions |
30 |
{$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}; |
|
4413 | 31 |
|
7028 | 32 |
var prevGState: TGameState = gsConfirm; |
33 |
||
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
34 |
procedure chGenCmd(var s: shortstring); |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
35 |
begin |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
36 |
case s[1] of |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
37 |
'R': if ReadyTimeLeft > 1 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
38 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
39 |
ReadyTimeLeft:= 1; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
40 |
if not CurrentTeam^.ExtDriven then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
41 |
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
|
42 |
end |
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
43 |
end |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
44 |
end; |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
45 |
|
4413 | 46 |
procedure chQuit(var s: shortstring); |
47 |
begin |
|
4751 | 48 |
s:= s; // avoid compiler hint |
5555
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
49 |
if (GameState = gsGame) or (GameState = gsChat) then |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
50 |
begin |
4413 | 51 |
prevGState:= GameState; |
5523 | 52 |
GameState:= gsConfirm; |
53 |
SDL_ShowCursor(1) |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
54 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
55 |
else |
5555
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
56 |
if GameState = gsConfirm then |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
57 |
begin |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
58 |
GameState:= prevGState; |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
59 |
SDL_ShowCursor(ord(isPaused)) |
38e3d9347910
Don't switch to gsConfirm state (which is pretty same as gsGame) when not in gsGame or gsChat state. Prevents crashes and other possible kinds of wierd behaviour.
unc0rr
parents:
5524
diff
changeset
|
60 |
end |
4413 | 61 |
end; |
62 |
||
4744
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
63 |
procedure chForceQuit(var s: shortstring); |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
64 |
begin |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
65 |
s:= s; // avoid compiler hint |
4751 | 66 |
GameState:= gsConfirm; |
67 |
ParseCommand('confirm', true); |
|
4413 | 68 |
end; |
69 |
||
70 |
procedure chConfirm(var s: shortstring); |
|
71 |
begin |
|
4751 | 72 |
s:= s; // avoid compiler hint |
73 |
if GameState = gsConfirm then |
|
4413 | 74 |
begin |
7068 | 75 |
SendIPC(_S'Q'); |
4751 | 76 |
GameState:= gsExit |
4413 | 77 |
end |
78 |
else |
|
79 |
ParseCommand('chat team', true); |
|
80 |
end; |
|
81 |
||
4751 | 82 |
procedure chHalt (var s: shortstring); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
83 |
begin |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
84 |
s:= s; // avoid compiler hint |
7068 | 85 |
SendIPC(_S'H'); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
86 |
GameState:= gsExit |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
87 |
end; |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
88 |
|
4413 | 89 |
procedure chCheckProto(var s: shortstring); |
7151 | 90 |
var i, c: LongInt; |
4413 | 91 |
begin |
6001 | 92 |
if isDeveloperMode then |
93 |
begin |
|
7151 | 94 |
val(s, i, c); |
6001 | 95 |
TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
96 |
TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
|
7058 | 97 |
end |
4413 | 98 |
end; |
99 |
||
100 |
procedure chTeamLocal(var s: shortstring); |
|
101 |
begin |
|
102 |
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
|
103 |
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
|
104 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
105 |
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
|
106 |
OutError(errmsgIncorrectUse + ' "/rdriven"', true); |
4413 | 107 |
CurrentTeam^.ExtDriven:= true |
108 |
end; |
|
109 |
||
110 |
procedure chGrave(var s: shortstring); |
|
111 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
112 |
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
|
113 |
OutError(errmsgIncorrectUse + ' "/grave"', true); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
114 |
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
|
115 |
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
|
116 |
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
|
117 |
Delete(s, byte(s[0]), 1); |
4413 | 118 |
CurrentTeam^.GraveName:= s |
119 |
end; |
|
120 |
||
121 |
procedure chFort(var s: shortstring); |
|
122 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
123 |
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
|
124 |
OutError(errmsgIncorrectUse + ' "/fort"', true); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
125 |
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
|
126 |
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
|
127 |
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
|
128 |
Delete(s, byte(s[0]), 1); |
4413 | 129 |
CurrentTeam^.FortName:= s |
130 |
end; |
|
131 |
||
132 |
procedure chFlag(var s: shortstring); |
|
133 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
134 |
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
|
135 |
OutError(errmsgIncorrectUse + ' "/flag"', true); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
136 |
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
|
137 |
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
|
138 |
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
|
139 |
Delete(s, byte(s[0]), 1); |
4413 | 140 |
CurrentTeam^.flag:= s |
141 |
end; |
|
142 |
||
143 |
procedure chScript(var s: shortstring); |
|
144 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
145 |
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
|
146 |
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
|
147 |
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
|
148 |
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
|
149 |
cScriptName:= s; |
4413 | 150 |
ScriptLoad(s) |
151 |
end; |
|
152 |
||
153 |
procedure chSetHat(var s: shortstring); |
|
154 |
begin |
|
155 |
if (not isDeveloperMode) or (CurrentTeam = nil) then exit; |
|
156 |
with CurrentTeam^ do |
|
157 |
begin |
|
158 |
if not CurrentHedgehog^.King then |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
159 |
if (s = '') |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
160 |
or (((GameFlags and gfKing) <> 0) and (s = 'crown')) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
161 |
or ((Length(s) > 39) and (Copy(s,1,8) = 'Reserved') and (Copy(s,9,32) <> PlayerHash)) then |
4413 | 162 |
CurrentHedgehog^.Hat:= 'NoHat' |
163 |
else |
|
164 |
CurrentHedgehog^.Hat:= s |
|
165 |
end; |
|
166 |
end; |
|
167 |
||
168 |
procedure chCurU_p(var s: shortstring); |
|
169 |
begin |
|
170 |
s:= s; // avoid compiler hint |
|
171 |
CursorMovementY:= -1; |
|
172 |
end; |
|
173 |
||
174 |
procedure chCurU_m(var s: shortstring); |
|
175 |
begin |
|
176 |
s:= s; // avoid compiler hint |
|
177 |
CursorMovementY:= 0; |
|
178 |
end; |
|
179 |
||
180 |
procedure chCurD_p(var s: shortstring); |
|
181 |
begin |
|
182 |
s:= s; // avoid compiler hint |
|
183 |
CursorMovementY:= 1; |
|
184 |
end; |
|
185 |
||
186 |
procedure chCurD_m(var s: shortstring); |
|
187 |
begin |
|
188 |
s:= s; // avoid compiler hint |
|
189 |
CursorMovementY:= 0; |
|
190 |
end; |
|
191 |
||
192 |
procedure chCurL_p(var s: shortstring); |
|
193 |
begin |
|
194 |
s:= s; // avoid compiler hint |
|
195 |
CursorMovementX:= -1; |
|
196 |
end; |
|
197 |
||
198 |
procedure chCurL_m(var s: shortstring); |
|
199 |
begin |
|
200 |
s:= s; // avoid compiler hint |
|
201 |
CursorMovementX:= 0; |
|
202 |
end; |
|
203 |
||
204 |
procedure chCurR_p(var s: shortstring); |
|
205 |
begin |
|
206 |
s:= s; // avoid compiler hint |
|
207 |
CursorMovementX:= 1; |
|
208 |
end; |
|
209 |
||
210 |
procedure chCurR_m(var s: shortstring); |
|
211 |
begin |
|
212 |
s:= s; // avoid compiler hint |
|
213 |
CursorMovementX:= 0; |
|
214 |
end; |
|
215 |
||
216 |
procedure chLeft_p(var s: shortstring); |
|
217 |
begin |
|
218 |
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
|
219 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
220 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
221 |
if not CurrentTeam^.ExtDriven then |
7068 | 222 |
SendIPC(_S'L'); |
4413 | 223 |
bShowFinger:= false; |
224 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
225 |
Message:= Message or (gmLeft and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
226 |
ScriptCall('onLeft'); |
4413 | 227 |
end; |
228 |
||
229 |
procedure chLeft_m(var s: shortstring); |
|
230 |
begin |
|
231 |
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
|
232 |
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
|
233 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
234 |
if not CurrentTeam^.ExtDriven then |
7068 | 235 |
SendIPC(_S'l'); |
4413 | 236 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
237 |
Message:= Message and (not (gmLeft and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
238 |
ScriptCall('onLeftUp'); |
4413 | 239 |
end; |
240 |
||
241 |
procedure chRight_p(var s: shortstring); |
|
242 |
begin |
|
243 |
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
|
244 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
245 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
246 |
if not CurrentTeam^.ExtDriven then |
7068 | 247 |
SendIPC(_S'R'); |
4413 | 248 |
bShowFinger:= false; |
249 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
250 |
Message:= Message or (gmRight and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
251 |
ScriptCall('onRight'); |
4413 | 252 |
end; |
253 |
||
254 |
procedure chRight_m(var s: shortstring); |
|
255 |
begin |
|
256 |
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
|
257 |
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
|
258 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
259 |
if not CurrentTeam^.ExtDriven then |
7068 | 260 |
SendIPC(_S'r'); |
4413 | 261 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
262 |
Message:= Message and (not (gmRight and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
263 |
ScriptCall('onRightUp'); |
4413 | 264 |
end; |
265 |
||
266 |
procedure chUp_p(var s: shortstring); |
|
267 |
begin |
|
268 |
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
|
269 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
270 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
271 |
if not CurrentTeam^.ExtDriven then |
7068 | 272 |
SendIPC(_S'U'); |
4413 | 273 |
bShowFinger:= false; |
274 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
275 |
Message:= Message or (gmUp and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
276 |
ScriptCall('onUp'); |
4413 | 277 |
end; |
278 |
||
279 |
procedure chUp_m(var s: shortstring); |
|
280 |
begin |
|
281 |
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
|
282 |
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
|
283 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
284 |
if not CurrentTeam^.ExtDriven then |
7068 | 285 |
SendIPC(_S'u'); |
4413 | 286 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
287 |
Message:= Message and (not (gmUp and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
288 |
ScriptCall('onUpUp'); |
4413 | 289 |
end; |
290 |
||
291 |
procedure chDown_p(var s: shortstring); |
|
292 |
begin |
|
293 |
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
|
294 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
295 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
296 |
if not CurrentTeam^.ExtDriven then |
7068 | 297 |
SendIPC(_S'D'); |
4413 | 298 |
bShowFinger:= false; |
299 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
300 |
Message:= Message or (gmDown and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
301 |
ScriptCall('onDown'); |
4413 | 302 |
end; |
303 |
||
304 |
procedure chDown_m(var s: shortstring); |
|
305 |
begin |
|
306 |
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
|
307 |
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
|
308 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
309 |
if not CurrentTeam^.ExtDriven then |
7068 | 310 |
SendIPC(_S'd'); |
4413 | 311 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
312 |
Message:= Message and (not (gmDown and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
313 |
ScriptCall('onDownUp'); |
4413 | 314 |
end; |
315 |
||
316 |
procedure chPrecise_p(var s: shortstring); |
|
317 |
begin |
|
318 |
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
|
319 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
320 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
321 |
if not CurrentTeam^.ExtDriven then |
7068 | 322 |
SendIPC(_S'Z'); |
4413 | 323 |
bShowFinger:= false; |
324 |
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
|
325 |
Message:= Message or (gmPrecise and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
326 |
ScriptCall('onPrecise'); |
4413 | 327 |
end; |
328 |
||
329 |
procedure chPrecise_m(var s: shortstring); |
|
330 |
begin |
|
331 |
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
|
332 |
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
|
333 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
334 |
if not CurrentTeam^.ExtDriven then |
7068 | 335 |
SendIPC(_S'z'); |
4413 | 336 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
337 |
Message:= Message and (not (gmPrecise and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
338 |
ScriptCall('onPreciseUp'); |
4413 | 339 |
end; |
340 |
||
341 |
procedure chLJump(var s: shortstring); |
|
342 |
begin |
|
343 |
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
|
344 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
345 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
346 |
if not CurrentTeam^.ExtDriven then |
7068 | 347 |
SendIPC(_S'j'); |
4413 | 348 |
bShowFinger:= false; |
349 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
350 |
Message:= Message or (gmLJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
351 |
ScriptCall('onLJump'); |
4413 | 352 |
end; |
353 |
||
354 |
procedure chHJump(var s: shortstring); |
|
355 |
begin |
|
356 |
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
|
357 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
358 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
359 |
if not CurrentTeam^.ExtDriven then |
7068 | 360 |
SendIPC(_S'J'); |
4413 | 361 |
bShowFinger:= false; |
362 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
363 |
Message:= Message or (gmHJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
364 |
ScriptCall('onHJump'); |
4413 | 365 |
end; |
366 |
||
367 |
procedure chAttack_p(var s: shortstring); |
|
368 |
begin |
|
369 |
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
|
370 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
371 |
exit; |
4413 | 372 |
bShowFinger:= false; |
373 |
with CurrentHedgehog^.Gear^ do |
|
374 |
begin |
|
4900 | 375 |
AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State)); |
4413 | 376 |
if ((State and gstHHDriven) <> 0) then |
377 |
begin |
|
378 |
FollowGear:= CurrentHedgehog^.Gear; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
379 |
if not CurrentTeam^.ExtDriven then |
7068 | 380 |
SendIPC(_S'A'); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
381 |
Message:= Message or (gmAttack and InputMask); |
5247 | 382 |
ScriptCall('onAttack'); |
4413 | 383 |
end |
384 |
end |
|
385 |
end; |
|
386 |
||
387 |
procedure chAttack_m(var s: shortstring); |
|
388 |
begin |
|
389 |
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
|
390 |
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
|
391 |
exit; |
4413 | 392 |
with CurrentHedgehog^.Gear^ do |
393 |
begin |
|
394 |
if not CurrentTeam^.ExtDriven and |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
395 |
((Message and gmAttack) <> 0) then |
7068 | 396 |
SendIPC(_S'a'); |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
397 |
Message:= Message and (not (gmAttack and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
398 |
ScriptCall('onAttackUp'); |
4413 | 399 |
end |
400 |
end; |
|
401 |
||
402 |
procedure chSwitch(var s: shortstring); |
|
403 |
begin |
|
404 |
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
|
405 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
406 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
407 |
if not CurrentTeam^.ExtDriven then |
7068 | 408 |
SendIPC(_S'S'); |
4413 | 409 |
bShowFinger:= false; |
410 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
411 |
Message:= Message or (gmSwitch and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
412 |
ScriptCall('onSwitch'); |
4413 | 413 |
end; |
414 |
||
415 |
procedure chNextTurn(var s: shortstring); |
|
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
|
416 |
var i: Longword; |
7104 | 417 |
gi: PGear; |
4413 | 418 |
begin |
419 |
s:= s; // avoid compiler hint |
|
7103 | 420 |
|
4413 | 421 |
TryDo(AllInactive, '/nextturn called when not all gears are inactive', true); |
422 |
||
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
|
423 |
CheckSum:= CheckSum xor GameTicks; |
7104 | 424 |
gi := GearsList; |
425 |
while gi <> nil do |
|
426 |
begin |
|
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
|
427 |
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; |
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
|
428 |
AddRandomness(CheckSum); |
7104 | 429 |
gi := gi^.NextGear |
430 |
end; |
|
7103 | 431 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
432 |
if not CurrentTeam^.ExtDriven then |
7103 | 433 |
begin |
434 |
s[0]:= #5; |
|
435 |
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
|
436 |
SDLNet_Write32(CheckSum, @s[2]); |
7103 | 437 |
SendIPC(s) |
438 |
end |
|
439 |
else |
|
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
|
440 |
TryDo(CheckSum = lastTurnChecksum, 'Desync detected', true); |
7187
aff30d80bd7b
- Allow camera movement while current hedgehog is falling
unc0rr
parents:
7151
diff
changeset
|
441 |
AddFileLog('Next turn: time '+inttostr(GameTicks)); |
4413 | 442 |
end; |
443 |
||
444 |
procedure chTimer(var s: shortstring); |
|
445 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
446 |
if (s[0] <> #1) or (s[1] < '1') or (s[1] > '5') 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
|
447 |
exit; |
4413 | 448 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
449 |
if not CurrentTeam^.ExtDriven then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
450 |
SendIPC(s); |
4413 | 451 |
bShowFinger:= false; |
452 |
with CurrentHedgehog^.Gear^ do |
|
453 |
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
|
454 |
Message:= Message or (gmTimer and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
455 |
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
|
456 |
ScriptCall('onTimer', MsgParam); |
4413 | 457 |
end |
458 |
end; |
|
459 |
||
460 |
procedure chSlot(var s: shortstring); |
|
461 |
var slot: LongWord; |
|
7068 | 462 |
ss: shortstring; |
4413 | 463 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
464 |
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
|
465 |
exit; |
4413 | 466 |
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
|
467 |
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
|
468 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
469 |
if not CurrentTeam^.ExtDriven then |
7068 | 470 |
begin |
471 |
ss[0]:= #1; |
|
472 |
ss[1]:= char(byte(s[1]) + 79); |
|
473 |
SendIPC(ss); |
|
474 |
end; |
|
4413 | 475 |
bShowFinger:= false; |
476 |
with CurrentHedgehog^.Gear^ do |
|
477 |
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
|
478 |
Message:= Message or (gmSlot and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
479 |
MsgParam:= slot; |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
480 |
ScriptCall('onSlot', MsgParam); |
4413 | 481 |
end |
482 |
end; |
|
483 |
||
484 |
procedure chSetWeapon(var s: shortstring); |
|
485 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
486 |
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
|
487 |
exit; |
4413 | 488 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
489 |
if TAmmoType(s[1]) > High(TAmmoType) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
490 |
exit; |
4413 | 491 |
|
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 not CurrentTeam^.ExtDriven then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
493 |
SendIPC('w' + s); |
4413 | 494 |
|
495 |
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
|
496 |
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
|
497 |
Message:= Message or (gmWeapon and InputMask); |
4413 | 498 |
MsgParam:= byte(s[1]); |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
499 |
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
|
500 |
end; |
4413 | 501 |
end; |
502 |
||
503 |
procedure chTaunt(var s: shortstring); |
|
504 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
505 |
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
|
506 |
exit; |
4413 | 507 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
508 |
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
|
509 |
exit; |
4413 | 510 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
511 |
if not CurrentTeam^.ExtDriven then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
512 |
SendIPC('t' + s); |
4413 | 513 |
|
514 |
with CurrentHedgehog^.Gear^ do |
|
515 |
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
|
516 |
Message:= Message or (gmAnimate and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
517 |
MsgParam:= byte(s[1]) ; |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
518 |
ScriptCall('onTaunt', MsgParam); |
4413 | 519 |
end |
520 |
end; |
|
521 |
||
522 |
procedure chPut(var s: shortstring); |
|
523 |
begin |
|
524 |
s:= s; // avoid compiler hint |
|
525 |
doPut(0, 0, false); |
|
526 |
end; |
|
527 |
||
528 |
procedure chCapture(var s: shortstring); |
|
529 |
begin |
|
530 |
s:= s; // avoid compiler hint |
|
531 |
flagMakeCapture:= true |
|
532 |
end; |
|
533 |
||
7629 | 534 |
procedure chRecord(var s: shortstring); |
535 |
begin |
|
536 |
s:= s; // avoid compiler hint |
|
537 |
{$IFDEF USE_VIDEO_RECORDING} |
|
538 |
if flagPrerecording then |
|
539 |
StopPreRecording() |
|
540 |
else |
|
541 |
BeginPreRecording(); |
|
542 |
{$ENDIF} |
|
543 |
end; |
|
544 |
||
4413 | 545 |
procedure chSetMap(var s: shortstring); |
546 |
begin |
|
5679
505c6448069b
accidentally reverted this when reverting the rest of the override changes.
nemo
parents:
5555
diff
changeset
|
547 |
if isDeveloperMode then |
6088 | 548 |
begin |
6339 | 549 |
if s = '' then |
550 |
begin |
|
551 |
UserPathz[ptMapCurrent]:= s; |
|
552 |
Pathz[ptMapCurrent]:= s; |
|
553 |
end |
|
554 |
else |
|
555 |
begin |
|
556 |
UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; |
|
557 |
Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; |
|
558 |
end; |
|
6088 | 559 |
InitStepsFlags:= InitStepsFlags or cifMap |
560 |
end; |
|
6828
6a5d33bff0b0
At mikade's request. give scripting access to the map name prior to override.
nemo
parents:
6818
diff
changeset
|
561 |
cMapName:= s; |
6245 | 562 |
ScriptLoad('Maps/' + s + '/map.lua') |
4413 | 563 |
end; |
564 |
||
565 |
procedure chSetTheme(var s: shortstring); |
|
566 |
begin |
|
567 |
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
|
568 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
569 |
UserPathz[ptCurrTheme]:= UserPathz[ptThemes] + '/' + s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
570 |
Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
571 |
Theme:= s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
572 |
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
|
573 |
end |
4413 | 574 |
end; |
575 |
||
576 |
procedure chSetSeed(var s: shortstring); |
|
577 |
begin |
|
578 |
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
|
579 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
580 |
SetRandomSeed(s); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
581 |
cSeed:= s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
582 |
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
|
583 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
584 |
end; |
4413 | 585 |
|
586 |
procedure chAmmoMenu(var s: shortstring); |
|
587 |
begin |
|
588 |
s:= s; // avoid compiler hint |
|
589 |
if CheckNoTeamOrHH then |
|
590 |
bShowAmmoMenu:= true |
|
591 |
else |
|
592 |
begin |
|
593 |
with CurrentTeam^ do |
|
594 |
with Hedgehogs[CurrHedgehog] do |
|
595 |
begin |
|
596 |
bSelected:= false; |
|
597 |
||
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
598 |
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
|
599 |
bShowAmmoMenu:= false |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
600 |
else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
601 |
or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
602 |
or ((Gear^.State and gstHHDriven) = 0) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
603 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
604 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
605 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
606 |
bShowAmmoMenu:= true |
4413 | 607 |
end; |
608 |
end |
|
609 |
end; |
|
610 |
||
611 |
procedure chVol_p(var s: shortstring); |
|
612 |
begin |
|
613 |
s:= s; // avoid compiler hint |
|
614 |
inc(cVolumeDelta, 3) |
|
615 |
end; |
|
616 |
||
617 |
procedure chVol_m(var s: shortstring); |
|
618 |
begin |
|
619 |
s:= s; // avoid compiler hint |
|
620 |
dec(cVolumeDelta, 3) |
|
621 |
end; |
|
622 |
||
623 |
procedure chFindhh(var s: shortstring); |
|
624 |
begin |
|
625 |
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
|
626 |
if CheckNoTeamOrHH or isPaused then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
627 |
exit; |
5247 | 628 |
|
7629 | 629 |
if autoCameraOn then |
5247 | 630 |
begin |
7629 | 631 |
FollowGear:= nil; |
5247 | 632 |
AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume); |
633 |
autoCameraOn:= false |
|
634 |
end |
|
7629 | 635 |
else |
636 |
begin |
|
5247 | 637 |
AddCaption('Auto Camera On', $CCCCCC, capgrpVolume); |
638 |
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
|
639 |
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
|
640 |
FollowGear:= CurrentHedgehog^.Gear; |
5247 | 641 |
autoCameraOn:= true |
642 |
end |
|
4413 | 643 |
end; |
644 |
||
645 |
procedure chPause(var s: shortstring); |
|
646 |
begin |
|
647 |
s:= s; // avoid compiler hint |
|
648 |
if gameType <> gmtNet then |
|
649 |
isPaused:= not isPaused; |
|
5524
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
650 |
|
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
651 |
if isPaused then |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
652 |
SDL_ShowCursor(1) |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
653 |
else |
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
654 |
SDL_ShowCursor(ord(GameState = gsConfirm)) |
4413 | 655 |
end; |
656 |
||
657 |
procedure chRotateMask(var s: shortstring); |
|
658 |
begin |
|
659 |
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
|
660 |
if ((GameFlags and gfInvulnerable) = 0) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
661 |
cTagsMask:= cTagsMasks[cTagsMask] |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
662 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
663 |
cTagsMask:= cTagsMasksNoHealth[cTagsMask]; |
4413 | 664 |
end; |
665 |
||
666 |
procedure chSpeedup_p(var s: shortstring); |
|
667 |
begin |
|
668 |
s:= s; // avoid compiler hint |
|
7629 | 669 |
SpeedStart:= RealTicks; |
4413 | 670 |
isSpeed:= true |
671 |
end; |
|
672 |
||
673 |
procedure chSpeedup_m(var s: shortstring); |
|
674 |
begin |
|
675 |
s:= s; // avoid compiler hint |
|
676 |
isSpeed:= false |
|
677 |
end; |
|
678 |
||
679 |
procedure chZoomIn(var s: shortstring); |
|
680 |
begin |
|
681 |
s:= s; // avoid compiler hint |
|
682 |
if ZoomValue < cMinZoomLevel then |
|
683 |
ZoomValue:= ZoomValue + cZoomDelta; |
|
684 |
end; |
|
685 |
||
686 |
procedure chZoomOut(var s: shortstring); |
|
687 |
begin |
|
688 |
s:= s; // avoid compiler hint |
|
689 |
if ZoomValue > cMaxZoomLevel then |
|
690 |
ZoomValue:= ZoomValue - cZoomDelta; |
|
691 |
end; |
|
692 |
||
693 |
procedure chZoomReset(var s: shortstring); |
|
694 |
begin |
|
695 |
s:= s; // avoid compiler hint |
|
696 |
ZoomValue:= cDefaultZoomLevel; |
|
697 |
end; |
|
698 |
||
6898 | 699 |
procedure chMapGen(var s: shortstring); |
700 |
begin |
|
7151 | 701 |
cMapGen:= StrToInt(s) |
6898 | 702 |
end; |
703 |
||
704 |
procedure chTemplateFilter(var s: shortstring); |
|
705 |
begin |
|
7151 | 706 |
cTemplateFilter:= StrToInt(s) |
6898 | 707 |
end; |
708 |
||
709 |
procedure chInactDelay(var s: shortstring); |
|
710 |
begin |
|
7151 | 711 |
cInactDelay:= StrToInt(s) |
6898 | 712 |
end; |
713 |
||
714 |
procedure chReadyDelay(var s: shortstring); |
|
715 |
begin |
|
7151 | 716 |
cReadyDelay:= StrToInt(s) |
6898 | 717 |
end; |
718 |
||
719 |
procedure chCaseFactor(var s: shortstring); |
|
720 |
begin |
|
7151 | 721 |
cCaseFactor:= StrToInt(s) |
6898 | 722 |
end; |
723 |
||
724 |
procedure chHealthCaseProb(var s: shortstring); |
|
725 |
begin |
|
7151 | 726 |
cHealthCaseProb:= StrToInt(s) |
6898 | 727 |
end; |
728 |
||
729 |
procedure chHealthCaseAmount(var s: shortstring); |
|
730 |
begin |
|
7151 | 731 |
cHealthCaseAmount:= StrToInt(s) |
6898 | 732 |
end; |
733 |
||
734 |
procedure chSuddenDTurns(var s: shortstring); |
|
735 |
begin |
|
7151 | 736 |
cSuddenDTurns:= StrToInt(s) |
6898 | 737 |
end; |
738 |
||
739 |
procedure chWaterRise(var s: shortstring); |
|
740 |
begin |
|
7151 | 741 |
cWaterRise:= StrToInt(s) |
6898 | 742 |
end; |
743 |
||
744 |
procedure chHealthDecrease(var s: shortstring); |
|
745 |
begin |
|
7151 | 746 |
cHealthDecrease:= StrToInt(s) |
6898 | 747 |
end; |
748 |
||
749 |
procedure chDamagePercent(var s: shortstring); |
|
750 |
begin |
|
7151 | 751 |
cDamagePercent:= StrToInt(s) |
6898 | 752 |
end; |
753 |
||
754 |
procedure chRopePercent(var s: shortstring); |
|
755 |
begin |
|
7151 | 756 |
cRopePercent:= StrToInt(s) |
6898 | 757 |
end; |
758 |
||
759 |
procedure chGetAwayTime(var s: shortstring); |
|
760 |
begin |
|
7151 | 761 |
cGetAwayTime:= StrToInt(s) |
6898 | 762 |
end; |
763 |
||
764 |
procedure chMineDudPercent(var s: shortstring); |
|
765 |
begin |
|
7151 | 766 |
cMineDudPercent:= StrToInt(s) |
6898 | 767 |
end; |
768 |
||
769 |
procedure chLandMines(var s: shortstring); |
|
770 |
begin |
|
7151 | 771 |
cLandMines:= StrToInt(s) |
6898 | 772 |
end; |
773 |
||
774 |
procedure chExplosives(var s: shortstring); |
|
775 |
begin |
|
7151 | 776 |
cExplosives:= StrToInt(s) |
6898 | 777 |
end; |
778 |
||
779 |
procedure chGameFlags(var s: shortstring); |
|
780 |
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
|
781 |
GameFlags:= StrToInt(s); |
7629 | 782 |
if GameFlags and gfSharedAmmo <> 0 then GameFlags:= GameFlags and (not gfPerHogAmmo) |
6898 | 783 |
end; |
784 |
||
785 |
procedure chHedgehogTurnTime(var s: shortstring); |
|
786 |
begin |
|
7151 | 787 |
cHedgehogTurnTime:= StrToInt(s) |
6898 | 788 |
end; |
789 |
||
790 |
procedure chMinesTime(var s: shortstring); |
|
791 |
begin |
|
7151 | 792 |
cMinesTime:= StrToInt(s) |
6898 | 793 |
end; |
794 |
||
795 |
procedure chFastUntilLag(var s: shortstring); |
|
796 |
begin |
|
7151 | 797 |
fastUntilLag:= StrToInt(s) <> 0 |
6898 | 798 |
end; |
4413 | 799 |
|
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
800 |
procedure chCampVar(var s:shortstring); |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
801 |
begin |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
802 |
CampaignVariable := s; |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
803 |
end; |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
804 |
|
4413 | 805 |
procedure initModule; |
806 |
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
|
807 |
//////// Begin top sorted by freq analysis not including chatmsg |
7407 | 808 |
RegisterVariable('+right' , @chRight_p , false, true); |
809 |
RegisterVariable('-right' , @chRight_m , false, true); |
|
810 |
RegisterVariable('+up' , @chUp_p , false, true); |
|
811 |
RegisterVariable('-up' , @chUp_m , false, true); |
|
812 |
RegisterVariable('+left' , @chLeft_p , false, true); |
|
813 |
RegisterVariable('-left' , @chLeft_m , false, true); |
|
7629 | 814 |
RegisterVariable('+attack' , @chAttack_p , false); |
7407 | 815 |
RegisterVariable('+down' , @chDown_p , false, true); |
816 |
RegisterVariable('-down' , @chDown_m , false, true); |
|
817 |
RegisterVariable('hjump' , @chHJump , false, true); |
|
818 |
RegisterVariable('ljump' , @chLJump , false, true); |
|
7629 | 819 |
RegisterVariable('nextturn', @chNextTurn , false); |
820 |
RegisterVariable('-attack' , @chAttack_m , false); |
|
821 |
RegisterVariable('slot' , @chSlot , false); |
|
7407 | 822 |
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
|
823 |
//////// End top by freq analysis |
7629 | 824 |
RegisterVariable('gencmd' , @chGenCmd , false); |
6898 | 825 |
RegisterVariable('flag' , @chFlag , false); |
826 |
RegisterVariable('script' , @chScript , false); |
|
827 |
RegisterVariable('proto' , @chCheckProto , true ); |
|
828 |
RegisterVariable('spectate', @chFastUntilLag , false); |
|
829 |
RegisterVariable('capture' , @chCapture , true ); |
|
830 |
RegisterVariable('rotmask' , @chRotateMask , true ); |
|
831 |
RegisterVariable('rdriven' , @chTeamLocal , false); |
|
832 |
RegisterVariable('map' , @chSetMap , false); |
|
833 |
RegisterVariable('theme' , @chSetTheme , false); |
|
834 |
RegisterVariable('seed' , @chSetSeed , false); |
|
835 |
RegisterVariable('template_filter', @chTemplateFilter, false); |
|
836 |
RegisterVariable('mapgen' , @chMapGen , false); |
|
837 |
RegisterVariable('maze_size',@chTemplateFilter, false); |
|
838 |
RegisterVariable('delay' , @chInactDelay , false); |
|
839 |
RegisterVariable('ready' , @chReadyDelay , false); |
|
840 |
RegisterVariable('casefreq', @chCaseFactor , false); |
|
841 |
RegisterVariable('healthprob', @chHealthCaseProb, false); |
|
842 |
RegisterVariable('hcaseamount', @chHealthCaseAmount, false); |
|
843 |
RegisterVariable('sd_turns', @chSuddenDTurns , false); |
|
844 |
RegisterVariable('waterrise', @chWaterRise , false); |
|
845 |
RegisterVariable('healthdec', @chHealthDecrease, false); |
|
846 |
RegisterVariable('damagepct',@chDamagePercent , false); |
|
847 |
RegisterVariable('ropepct' , @chRopePercent , false); |
|
848 |
RegisterVariable('getawaytime' , @chGetAwayTime , false); |
|
849 |
RegisterVariable('minedudpct',@chMineDudPercent, false); |
|
850 |
RegisterVariable('minesnum', @chLandMines , false); |
|
851 |
RegisterVariable('explosives',@chExplosives , false); |
|
852 |
RegisterVariable('gmflags' , @chGameFlags , false); |
|
853 |
RegisterVariable('turntime', @chHedgehogTurnTime, false); |
|
854 |
RegisterVariable('minestime',@chMinesTime , false); |
|
855 |
RegisterVariable('fort' , @chFort , false); |
|
856 |
RegisterVariable('grave' , @chGrave , false); |
|
857 |
RegisterVariable('hat' , @chSetHat , false); |
|
858 |
RegisterVariable('quit' , @chQuit , true ); |
|
859 |
RegisterVariable('forcequit', @chForceQuit , true ); |
|
860 |
RegisterVariable('confirm' , @chConfirm , true ); |
|
861 |
RegisterVariable('halt', @chHalt , true ); |
|
862 |
RegisterVariable('+speedup', @chSpeedup_p , true ); |
|
863 |
RegisterVariable('-speedup', @chSpeedup_m , true ); |
|
864 |
RegisterVariable('zoomin' , @chZoomIn , true ); |
|
865 |
RegisterVariable('zoomout' , @chZoomOut , true ); |
|
866 |
RegisterVariable('zoomreset',@chZoomReset , true ); |
|
867 |
RegisterVariable('ammomenu', @chAmmoMenu , true); |
|
7629 | 868 |
RegisterVariable('+precise', @chPrecise_p , false, true); |
869 |
RegisterVariable('-precise', @chPrecise_m , false, true); |
|
6898 | 870 |
RegisterVariable('switch' , @chSwitch , false); |
7629 | 871 |
RegisterVariable('timer' , @chTimer , false, true); |
6898 | 872 |
RegisterVariable('taunt' , @chTaunt , false); |
873 |
RegisterVariable('put' , @chPut , false); |
|
874 |
RegisterVariable('+volup' , @chVol_p , true ); |
|
875 |
RegisterVariable('-volup' , @chVol_m , true ); |
|
876 |
RegisterVariable('+voldown', @chVol_m , true ); |
|
877 |
RegisterVariable('-voldown', @chVol_p , true ); |
|
7404 | 878 |
RegisterVariable('findhh' , @chFindhh , true ); |
6898 | 879 |
RegisterVariable('pause' , @chPause , true ); |
880 |
RegisterVariable('+cur_u' , @chCurU_p , true ); |
|
881 |
RegisterVariable('-cur_u' , @chCurU_m , true ); |
|
882 |
RegisterVariable('+cur_d' , @chCurD_p , true ); |
|
883 |
RegisterVariable('-cur_d' , @chCurD_m , true ); |
|
884 |
RegisterVariable('+cur_l' , @chCurL_p , true ); |
|
885 |
RegisterVariable('-cur_l' , @chCurL_m , true ); |
|
886 |
RegisterVariable('+cur_r' , @chCurR_p , true ); |
|
887 |
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
|
888 |
RegisterVariable('campvar' , @chCampVar , true ); |
7629 | 889 |
RegisterVariable('record' , @chRecord , true ); |
4413 | 890 |
end; |
891 |
||
892 |
procedure freeModule; |
|
893 |
begin |
|
894 |
end; |
|
895 |
||
896 |
end. |