author | smxx |
Thu, 29 Apr 2010 19:39:58 +0000 | |
changeset 3379 | f73e0e8e55c2 |
parent 3346 | 967fd96f7373 |
child 3407 | dcc129c4352e |
permissions | -rw-r--r-- |
4 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
883 | 3 |
* Copyright (c) 2004-2008 Andrey Korotaev <unC0Rr@gmail.com> |
4 | 4 |
* |
183 | 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 |
|
4 | 8 |
* |
183 | 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. |
|
4 | 13 |
* |
183 | 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 |
|
4 | 17 |
*) |
18 |
||
2630 | 19 |
{$INCLUDE "options.inc"} |
20 |
||
4 | 21 |
unit uConsole; |
22 |
interface |
|
988 | 23 |
uses uFloat; |
2630 | 24 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
25 |
var isDeveloperMode: boolean; |
371 | 26 |
type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean); |
4 | 27 |
TCommandHandler = procedure (var params: shortstring); |
28 |
||
3038 | 29 |
procedure initModule; |
30 |
procedure freeModule; |
|
4 | 31 |
procedure WriteToConsole(s: shortstring); |
32 |
procedure WriteLnToConsole(s: shortstring); |
|
351 | 33 |
procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); |
936
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
34 |
procedure StopMessages(Message: Longword); |
53 | 35 |
function GetLastConsoleLine: shortstring; |
4 | 36 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
539
diff
changeset
|
37 |
procedure doPut(putX, putY: LongInt; fromAI: boolean); |
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
539
diff
changeset
|
38 |
|
4 | 39 |
implementation |
288 | 40 |
uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uLand, |
2990 | 41 |
uRandom, uAmmos, uStats, uGame, uChat, SDLh, uSound, uVisualGears, uScript; |
950 | 42 |
|
371 | 43 |
const cLineWidth: LongInt = 0; |
4 | 44 |
cLinesCount = 256; |
351 | 45 |
|
4 | 46 |
type PVariable = ^TVariable; |
47 |
TVariable = record |
|
48 |
Next: PVariable; |
|
49 |
Name: string[15]; |
|
50 |
VType: TVariableType; |
|
51 |
Handler: pointer; |
|
167 | 52 |
Trusted: boolean; |
4 | 53 |
end; |
785 | 54 |
TTextLine = record |
55 |
s: shortstring; |
|
56 |
end; |
|
4 | 57 |
|
785 | 58 |
var ConsoleLines: array[byte] of TTextLine; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
59 |
CurrLine: LongInt; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
60 |
Variables: PVariable; |
4 | 61 |
|
785 | 62 |
procedure SetLine(var tl: TTextLine; str: shortstring); |
63 |
begin |
|
64 |
with tl do |
|
65 |
s:= str; |
|
66 |
end; |
|
67 |
||
2905 | 68 |
function RegisterVariable(Name: shortstring; VType: TVariableType; p: pointer; Trusted: boolean): PVariable; |
2695 | 69 |
var value: PVariable; |
4 | 70 |
begin |
2695 | 71 |
New(value); |
72 |
TryDo(value <> nil, 'RegisterVariable: value = nil', true); |
|
73 |
FillChar(value^, sizeof(TVariable), 0); |
|
74 |
value^.Name:= Name; |
|
75 |
value^.VType:= VType; |
|
76 |
value^.Handler:= p; |
|
77 |
value^.Trusted:= Trusted; |
|
167 | 78 |
|
2695 | 79 |
if Variables = nil then Variables:= value |
4 | 80 |
else begin |
2695 | 81 |
value^.Next:= Variables; |
82 |
Variables:= value |
|
351 | 83 |
end; |
84 |
||
2695 | 85 |
RegisterVariable:= value; |
4 | 86 |
end; |
87 |
||
88 |
procedure FreeVariablesList; |
|
89 |
var t, tt: PVariable; |
|
90 |
begin |
|
91 |
tt:= Variables; |
|
92 |
Variables:= nil; |
|
351 | 93 |
while tt <> nil do |
4 | 94 |
begin |
95 |
t:= tt; |
|
351 | 96 |
tt:= tt^.Next; |
4 | 97 |
Dispose(t) |
98 |
end; |
|
99 |
end; |
|
100 |
||
101 |
procedure WriteToConsole(s: shortstring); |
|
371 | 102 |
var Len: LongInt; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
103 |
done: boolean; |
4 | 104 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
105 |
{$IFDEF DEBUGFILE}AddFileLog('Console write: ' + s);{$ENDIF} |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
106 |
Write(s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
107 |
done:= false; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
108 |
|
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
109 |
while not done do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
110 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
111 |
Len:= cLineWidth - Length(ConsoleLines[CurrLine].s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
112 |
SetLine(ConsoleLines[CurrLine], ConsoleLines[CurrLine].s + copy(s, 1, Len)); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
113 |
Delete(s, 1, Len); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
114 |
if byte(ConsoleLines[CurrLine].s[0]) = cLineWidth then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
115 |
begin |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
116 |
inc(CurrLine); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
117 |
if CurrLine = cLinesCount then CurrLine:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
118 |
PByte(@ConsoleLines[CurrLine].s)^:= 0 |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
119 |
end; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
120 |
done:= (Length(s) = 0); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
121 |
end; |
4 | 122 |
end; |
123 |
||
124 |
procedure WriteLnToConsole(s: shortstring); |
|
125 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
126 |
WriteToConsole(s); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
127 |
WriteLn; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
128 |
inc(CurrLine); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
129 |
if CurrLine = cLinesCount then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
130 |
CurrLine:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
131 |
PByte(@ConsoleLines[CurrLine].s)^:= 0 |
4 | 132 |
end; |
133 |
||
351 | 134 |
procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); |
135 |
type PhwFloat = ^hwFloat; |
|
495 | 136 |
var ii: LongInt; |
4 | 137 |
s: shortstring; |
138 |
t: PVariable; |
|
139 |
c: char; |
|
140 |
begin |
|
141 |
//WriteLnToConsole(CmdStr); |
|
142 |
if CmdStr[0]=#0 then exit; |
|
143 |
{$IFDEF DEBUGFILE}AddFileLog('ParseCommand "' + CmdStr + '"');{$ENDIF} |
|
144 |
c:= CmdStr[1]; |
|
145 |
if c in ['/', '$'] then Delete(CmdStr, 1, 1) else c:= '/'; |
|
146 |
SplitBySpace(CmdStr, s); |
|
147 |
t:= Variables; |
|
148 |
while t <> nil do |
|
149 |
begin |
|
351 | 150 |
if t^.Name = CmdStr then |
4 | 151 |
begin |
351 | 152 |
if TrustedSource or t^.Trusted then |
153 |
case t^.VType of |
|
4 | 154 |
vtCommand: if c='/' then |
155 |
begin |
|
351 | 156 |
TCommandHandler(t^.Handler)(s); |
4 | 157 |
end; |
371 | 158 |
vtLongInt: if c='$' then |
4 | 159 |
if s[0]=#0 then |
160 |
begin |
|
371 | 161 |
str(PLongInt(t^.Handler)^, s); |
4 | 162 |
WriteLnToConsole('$' + CmdStr + ' is "' + s + '"'); |
495 | 163 |
end else val(s, PLongInt(t^.Handler)^); |
164 |
vthwFloat: if c='$' then |
|
4 | 165 |
if s[0]=#0 then |
166 |
begin |
|
351 | 167 |
//str(PhwFloat(t^.Handler)^:4:6, s); |
4 | 168 |
WriteLnToConsole('$' + CmdStr + ' is "' + s + '"'); |
351 | 169 |
end else; //val(s, PhwFloat(t^.Handler)^, i); |
4 | 170 |
vtBoolean: if c='$' then |
171 |
if s[0]=#0 then |
|
172 |
begin |
|
351 | 173 |
str(ord(boolean(t^.Handler^)), s); |
4 | 174 |
WriteLnToConsole('$' + CmdStr + ' is "' + s + '"'); |
175 |
end else |
|
176 |
begin |
|
495 | 177 |
val(s, ii); |
351 | 178 |
boolean(t^.Handler^):= not (ii = 0) |
4 | 179 |
end; |
180 |
end; |
|
181 |
exit |
|
351 | 182 |
end else t:= t^.Next |
4 | 183 |
end; |
184 |
case c of |
|
185 |
'$': WriteLnToConsole(errmsgUnknownVariable + ': "$' + CmdStr + '"') |
|
186 |
else WriteLnToConsole(errmsgUnknownCommand + ': "/' + CmdStr + '"') end |
|
187 |
end; |
|
188 |
||
53 | 189 |
function GetLastConsoleLine: shortstring; |
2695 | 190 |
var valueStr: shortstring; |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
191 |
i: LongWord; |
53 | 192 |
begin |
1242 | 193 |
i:= (CurrLine + cLinesCount - 2) mod cLinesCount; |
2695 | 194 |
valueStr:= ConsoleLines[i].s; |
1242 | 195 |
|
2695 | 196 |
valueStr:= valueStr + #10; |
1242 | 197 |
|
198 |
i:= (CurrLine + cLinesCount - 1) mod cLinesCount; |
|
2695 | 199 |
valueStr:= valueStr + ConsoleLines[i].s; |
1242 | 200 |
|
2695 | 201 |
GetLastConsoleLine:= valueStr; |
53 | 202 |
end; |
203 |
||
936
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
204 |
procedure StopMessages(Message: Longword); |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
205 |
begin |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
206 |
if (Message and gm_Left) <> 0 then ParseCommand('/-left', true) else |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
207 |
if (Message and gm_Right) <> 0 then ParseCommand('/-right', true) else |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
208 |
if (Message and gm_Up) <> 0 then ParseCommand('/-up', true) else |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
209 |
if (Message and gm_Down) <> 0 then ParseCommand('/-down', true) else |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
210 |
if (Message and gm_Attack) <> 0 then ParseCommand('/-attack', true) |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
211 |
end; |
ba582673db7d
Fix 'AI may break demos playing' message while loading saves
unc0rr
parents:
917
diff
changeset
|
212 |
|
2599 | 213 |
{$INCLUDE "CCHandlers.inc"} |
3038 | 214 |
procedure initModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
215 |
var i: LongInt; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
216 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
217 |
CurrLine:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
218 |
Variables:= nil; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
219 |
isDeveloperMode:= true; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
220 |
|
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
221 |
// initConsole |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
222 |
cLineWidth:= cScreenWidth div 10; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
223 |
if cLineWidth > 255 then |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
224 |
cLineWidth:= 255; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
225 |
for i:= 0 to Pred(cLinesCount) do |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
226 |
PByte(@ConsoleLines[i])^:= 0; |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
227 |
|
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
228 |
RegisterVariable('proto' , vtCommand, @chCheckProto , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
229 |
RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
230 |
RegisterVariable('capture' , vtCommand, @chCapture , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
231 |
RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
232 |
RegisterVariable('addteam' , vtCommand, @chAddTeam , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
233 |
RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
234 |
RegisterVariable('map' , vtCommand, @chSetMap , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
235 |
RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
236 |
RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
237 |
RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
3133 | 238 |
RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); |
239 |
RegisterVariable('maze_size',vtLongInt, @cMazeSize , false); |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
240 |
RegisterVariable('delay' , vtLongInt, @cInactDelay , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
241 |
RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
242 |
RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
243 |
RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
244 |
RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
245 |
RegisterVariable('landadds', vtLongInt, @cLandAdditions , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
246 |
RegisterVariable('explosives',vtLongInt,@cExplosives , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
247 |
RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
248 |
RegisterVariable('trflags' , vtLongInt, @TrainingFlags , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
249 |
RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
250 |
RegisterVariable('minestime',vtLongInt, @cMinesTime , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
251 |
RegisterVariable('fort' , vtCommand, @chFort , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
252 |
RegisterVariable('voicepack',vtCommand, @chVoicepack , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
253 |
RegisterVariable('grave' , vtCommand, @chGrave , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
254 |
RegisterVariable('bind' , vtCommand, @chBind , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
255 |
RegisterVariable('addhh' , vtCommand, @chAddHH , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
256 |
RegisterVariable('hat' , vtCommand, @chSetHat , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
257 |
RegisterVariable('hhcoords', vtCommand, @chSetHHCoords , false); |
3346 | 258 |
RegisterVariable('ammloadt', vtCommand, @chSetAmmoLoadout, false); |
259 |
RegisterVariable('ammdelay', vtCommand, @chSetAmmoDelay, false); |
|
260 |
RegisterVariable('ammprob', vtCommand, @chSetAmmoProbability, false); |
|
261 |
RegisterVariable('ammreinf', vtCommand, @chSetAmmoReinforcement, false); |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
262 |
RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
263 |
RegisterVariable('quit' , vtCommand, @chQuit , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
264 |
RegisterVariable('confirm' , vtCommand, @chConfirm , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
265 |
RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
266 |
RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
267 |
RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
268 |
RegisterVariable('zoomout' , vtCommand, @chZoomOut , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
269 |
RegisterVariable('zoomreset',vtCommand, @chZoomReset , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
270 |
RegisterVariable('skip' , vtCommand, @chSkip , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
271 |
RegisterVariable('history' , vtCommand, @chHistory , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
272 |
RegisterVariable('chat' , vtCommand, @chChat , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
273 |
RegisterVariable('newgrave', vtCommand, @chNewGrave , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
274 |
RegisterVariable('say' , vtCommand, @chSay , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
275 |
RegisterVariable('hogsay' , vtCommand, @chHogSay , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
276 |
RegisterVariable('team' , vtCommand, @chTeamSay , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
277 |
RegisterVariable('ammomenu', vtCommand, @chAmmoMenu , true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
278 |
RegisterVariable('+precise', vtCommand, @chPrecise_p , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
279 |
RegisterVariable('-precise', vtCommand, @chPrecise_m , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
280 |
RegisterVariable('+left' , vtCommand, @chLeft_p , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
281 |
RegisterVariable('-left' , vtCommand, @chLeft_m , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
282 |
RegisterVariable('+right' , vtCommand, @chRight_p , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
283 |
RegisterVariable('-right' , vtCommand, @chRight_m , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
284 |
RegisterVariable('+up' , vtCommand, @chUp_p , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
285 |
RegisterVariable('-up' , vtCommand, @chUp_m , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
286 |
RegisterVariable('+down' , vtCommand, @chDown_p , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
287 |
RegisterVariable('-down' , vtCommand, @chDown_m , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
288 |
RegisterVariable('+attack' , vtCommand, @chAttack_p , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
289 |
RegisterVariable('-attack' , vtCommand, @chAttack_m , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
290 |
RegisterVariable('switch' , vtCommand, @chSwitch , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
291 |
RegisterVariable('nextturn', vtCommand, @chNextTurn , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
292 |
RegisterVariable('timer' , vtCommand, @chTimer , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
293 |
RegisterVariable('taunt' , vtCommand, @chTaunt , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
294 |
RegisterVariable('setweap' , vtCommand, @chSetWeapon , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
295 |
RegisterVariable('slot' , vtCommand, @chSlot , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
296 |
RegisterVariable('put' , vtCommand, @chPut , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
297 |
RegisterVariable('ljump' , vtCommand, @chLJump , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
298 |
RegisterVariable('hjump' , vtCommand, @chHJump , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
299 |
RegisterVariable('fullscr' , vtCommand, @chFullScr , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
300 |
RegisterVariable('+volup' , vtCommand, @chVol_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
301 |
RegisterVariable('-volup' , vtCommand, @chVol_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
302 |
RegisterVariable('+voldown', vtCommand, @chVol_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
303 |
RegisterVariable('-voldown', vtCommand, @chVol_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
304 |
RegisterVariable('findhh' , vtCommand, @chFindhh , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
305 |
RegisterVariable('pause' , vtCommand, @chPause , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
306 |
RegisterVariable('+cur_u' , vtCommand, @chCurU_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
307 |
RegisterVariable('-cur_u' , vtCommand, @chCurU_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
308 |
RegisterVariable('+cur_d' , vtCommand, @chCurD_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
309 |
RegisterVariable('-cur_d' , vtCommand, @chCurD_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
310 |
RegisterVariable('+cur_l' , vtCommand, @chCurL_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
311 |
RegisterVariable('-cur_l' , vtCommand, @chCurL_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
312 |
RegisterVariable('+cur_r' , vtCommand, @chCurR_p , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
313 |
RegisterVariable('-cur_r' , vtCommand, @chCurR_m , true ); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
314 |
RegisterVariable('flag' , vtCommand, @chFlag , false); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
315 |
RegisterVariable('script' , vtCommand, @chScript , false); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
316 |
end; |
4 | 317 |
|
3038 | 318 |
procedure freeModule; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
319 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2915
diff
changeset
|
320 |
FreeVariablesList(); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2695
diff
changeset
|
321 |
end; |
4 | 322 |
|
323 |
end. |