190 valueStr:= valueStr + ConsoleLines[i].s; |
98 valueStr:= valueStr + ConsoleLines[i].s; |
191 |
99 |
192 GetLastConsoleLine:= valueStr; |
100 GetLastConsoleLine:= valueStr; |
193 end; |
101 end; |
194 |
102 |
195 procedure StopMessages(Message: Longword); |
|
196 begin |
|
197 if (Message and gmLeft) <> 0 then ParseCommand('/-left', true) else |
|
198 if (Message and gmRight) <> 0 then ParseCommand('/-right', true) else |
|
199 if (Message and gmUp) <> 0 then ParseCommand('/-up', true) else |
|
200 if (Message and gmDown) <> 0 then ParseCommand('/-down', true) else |
|
201 if (Message and gmAttack) <> 0 then ParseCommand('/-attack', true) |
|
202 end; |
|
203 |
|
204 {$INCLUDE "CCHandlers.inc"} |
|
205 procedure initModule; |
103 procedure initModule; |
206 var i: LongInt; |
104 var i: LongInt; |
207 begin |
105 begin |
208 CurrLine:= 0; |
106 CurrLine:= 0; |
209 Variables:= nil; |
|
210 isDeveloperMode:= true; |
|
211 |
107 |
212 // initConsole |
108 // initConsole |
213 cLineWidth:= cScreenWidth div 10; |
109 cLineWidth:= cScreenWidth div 10; |
214 if cLineWidth > 255 then |
110 if cLineWidth > 255 then |
215 cLineWidth:= 255; |
111 cLineWidth:= 255; |
216 for i:= 0 to Pred(cLinesCount) do |
112 for i:= 0 to Pred(cLinesCount) do |
217 PByte(@ConsoleLines[i])^:= 0; |
113 PByte(@ConsoleLines[i])^:= 0; |
218 |
|
219 // NOTE: please, keep most frequently used commands on bottom |
|
220 RegisterVariable('flag' , vtCommand, @chFlag , false); |
|
221 RegisterVariable('script' , vtCommand, @chScript , false); |
|
222 RegisterVariable('proto' , vtCommand, @chCheckProto , true ); |
|
223 RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); |
|
224 RegisterVariable('capture' , vtCommand, @chCapture , true ); |
|
225 RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); |
|
226 RegisterVariable('addteam' , vtCommand, @chAddTeam , false); |
|
227 RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); |
|
228 RegisterVariable('map' , vtCommand, @chSetMap , false); |
|
229 RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
|
230 RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
|
231 RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
|
232 RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); |
|
233 RegisterVariable('maze_size',vtLongInt, @cMazeSize , false); |
|
234 RegisterVariable('delay' , vtLongInt, @cInactDelay , false); |
|
235 RegisterVariable('ready' , vtLongInt, @cReadyDelay , false); |
|
236 RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); |
|
237 RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false); |
|
238 RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false); |
|
239 RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns , false); |
|
240 RegisterVariable('waterrise', vtLongInt, @cWaterRise , false); |
|
241 RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false); |
|
242 RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false); |
|
243 RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false); |
|
244 RegisterVariable('minesnum', vtLongInt, @cLandMines , false); |
|
245 RegisterVariable('explosives',vtLongInt,@cExplosives , false); |
|
246 RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); |
|
247 RegisterVariable('trflags' , vtLongInt, @TrainingFlags , false); |
|
248 RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); |
|
249 RegisterVariable('minestime',vtLongInt, @cMinesTime , false); |
|
250 RegisterVariable('fort' , vtCommand, @chFort , false); |
|
251 RegisterVariable('voicepack',vtCommand, @chVoicepack , false); |
|
252 RegisterVariable('grave' , vtCommand, @chGrave , false); |
|
253 RegisterVariable('bind' , vtCommand, @chBind , true ); |
|
254 RegisterVariable('addhh' , vtCommand, @chAddHH , false); |
|
255 RegisterVariable('hat' , vtCommand, @chSetHat , false); |
|
256 RegisterVariable('hhcoords', vtCommand, @chSetHHCoords , false); |
|
257 RegisterVariable('ammloadt', vtCommand, @chSetAmmoLoadout, false); |
|
258 RegisterVariable('ammdelay', vtCommand, @chSetAmmoDelay, false); |
|
259 RegisterVariable('ammprob', vtCommand, @chSetAmmoProbability, false); |
|
260 RegisterVariable('ammreinf', vtCommand, @chSetAmmoReinforcement, false); |
|
261 RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false); |
|
262 RegisterVariable('quit' , vtCommand, @chQuit , true ); |
|
263 RegisterVariable('confirm' , vtCommand, @chConfirm , true ); |
|
264 RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); |
|
265 RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); |
|
266 RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); |
|
267 RegisterVariable('zoomout' , vtCommand, @chZoomOut , true ); |
|
268 RegisterVariable('zoomreset',vtCommand, @chZoomReset , true ); |
|
269 RegisterVariable('skip' , vtCommand, @chSkip , false); |
|
270 RegisterVariable('history' , vtCommand, @chHistory , true ); |
|
271 RegisterVariable('chat' , vtCommand, @chChat , true ); |
|
272 RegisterVariable('say' , vtCommand, @chSay , true ); |
|
273 RegisterVariable('hogsay' , vtCommand, @chHogSay , true ); |
|
274 RegisterVariable('team' , vtCommand, @chTeamSay , true ); |
|
275 RegisterVariable('ammomenu', vtCommand, @chAmmoMenu , true); |
|
276 RegisterVariable('+precise', vtCommand, @chPrecise_p , false); |
|
277 RegisterVariable('-precise', vtCommand, @chPrecise_m , false); |
|
278 RegisterVariable('+left' , vtCommand, @chLeft_p , false); |
|
279 RegisterVariable('-left' , vtCommand, @chLeft_m , false); |
|
280 RegisterVariable('+right' , vtCommand, @chRight_p , false); |
|
281 RegisterVariable('-right' , vtCommand, @chRight_m , false); |
|
282 RegisterVariable('+up' , vtCommand, @chUp_p , false); |
|
283 RegisterVariable('-up' , vtCommand, @chUp_m , false); |
|
284 RegisterVariable('+down' , vtCommand, @chDown_p , false); |
|
285 RegisterVariable('-down' , vtCommand, @chDown_m , false); |
|
286 RegisterVariable('+attack' , vtCommand, @chAttack_p , false); |
|
287 RegisterVariable('-attack' , vtCommand, @chAttack_m , false); |
|
288 RegisterVariable('switch' , vtCommand, @chSwitch , false); |
|
289 RegisterVariable('nextturn', vtCommand, @chNextTurn , false); |
|
290 RegisterVariable('timer' , vtCommand, @chTimer , false); |
|
291 RegisterVariable('taunt' , vtCommand, @chTaunt , false); |
|
292 RegisterVariable('setweap' , vtCommand, @chSetWeapon , false); |
|
293 RegisterVariable('slot' , vtCommand, @chSlot , false); |
|
294 RegisterVariable('put' , vtCommand, @chPut , false); |
|
295 RegisterVariable('ljump' , vtCommand, @chLJump , false); |
|
296 RegisterVariable('hjump' , vtCommand, @chHJump , false); |
|
297 RegisterVariable('fullscr' , vtCommand, @chFullScr , true ); |
|
298 RegisterVariable('+volup' , vtCommand, @chVol_p , true ); |
|
299 RegisterVariable('-volup' , vtCommand, @chVol_m , true ); |
|
300 RegisterVariable('+voldown', vtCommand, @chVol_m , true ); |
|
301 RegisterVariable('-voldown', vtCommand, @chVol_p , true ); |
|
302 RegisterVariable('findhh' , vtCommand, @chFindhh , true ); |
|
303 RegisterVariable('pause' , vtCommand, @chPause , true ); |
|
304 RegisterVariable('+cur_u' , vtCommand, @chCurU_p , true ); |
|
305 RegisterVariable('-cur_u' , vtCommand, @chCurU_m , true ); |
|
306 RegisterVariable('+cur_d' , vtCommand, @chCurD_p , true ); |
|
307 RegisterVariable('-cur_d' , vtCommand, @chCurD_m , true ); |
|
308 RegisterVariable('+cur_l' , vtCommand, @chCurL_p , true ); |
|
309 RegisterVariable('-cur_l' , vtCommand, @chCurL_m , true ); |
|
310 RegisterVariable('+cur_r' , vtCommand, @chCurR_p , true ); |
|
311 RegisterVariable('-cur_r' , vtCommand, @chCurR_m , true ); |
|
312 end; |
114 end; |
313 |
115 |
314 procedure freeModule; |
116 procedure freeModule; |
315 var t, tt: PVariable; |
|
316 begin |
117 begin |
317 tt:= Variables; |
118 |
318 Variables:= nil; |
|
319 while tt <> nil do |
|
320 begin |
|
321 t:= tt; |
|
322 tt:= tt^.Next; |
|
323 Dispose(t) |
|
324 end; |
|
325 end; |
119 end; |
326 |
120 |
327 end. |
121 end. |