hedgewars/uCommandHandlers.pas
changeset 4413 46caab3a8f84
child 4437 05192cdbce9b
equal deleted inserted replaced
4412:c9a78ba03679 4413:46caab3a8f84
       
     1 {$INCLUDE "options.inc"}
       
     2 unit uCommandHandlers;
       
     3 
       
     4 interface
       
     5 
       
     6 procedure initModule;
       
     7 procedure freeModule;
       
     8 
       
     9 implementation
       
    10 uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uMobile, uRandom;
       
    11 
       
    12 procedure chQuit(var s: shortstring);
       
    13 const prevGState: TGameState = gsConfirm;
       
    14 begin
       
    15 s:= s; // avoid compiler hint
       
    16 if GameState <> gsConfirm then
       
    17         begin
       
    18         prevGState:= GameState;
       
    19         GameState:= gsConfirm
       
    20         end else
       
    21         GameState:= prevGState
       
    22 end;
       
    23 
       
    24 procedure chConfirm(var s: shortstring);
       
    25 begin
       
    26 s:= s; // avoid compiler hint
       
    27 if GameState = gsConfirm then
       
    28     begin
       
    29     SendIPC('Q');
       
    30     GameState:= gsExit
       
    31     end
       
    32 else
       
    33     ParseCommand('chat team', true);
       
    34 end;
       
    35 
       
    36 procedure chCheckProto(var s: shortstring);
       
    37 var i, c: LongInt;
       
    38 begin
       
    39 if isDeveloperMode then
       
    40 begin
       
    41 val(s, i, c);
       
    42 if (c <> 0) or (i = 0) then exit;
       
    43 TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old', true);
       
    44 TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new', true)
       
    45 end
       
    46 end;
       
    47 
       
    48 procedure chTeamLocal(var s: shortstring);
       
    49 begin
       
    50 s:= s; // avoid compiler hint
       
    51 if not isDeveloperMode then exit;
       
    52 if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/rdriven"', true);
       
    53 CurrentTeam^.ExtDriven:= true
       
    54 end;
       
    55 
       
    56 procedure chGrave(var s: shortstring);
       
    57 begin
       
    58 if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/grave"', true);
       
    59 if s[1]='"' then Delete(s, 1, 1);
       
    60 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
    61 CurrentTeam^.GraveName:= s
       
    62 end;
       
    63 
       
    64 procedure chFort(var s: shortstring);
       
    65 begin
       
    66 if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/fort"', true);
       
    67 if s[1]='"' then Delete(s, 1, 1);
       
    68 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
    69 CurrentTeam^.FortName:= s
       
    70 end;
       
    71 
       
    72 procedure chFlag(var s: shortstring);
       
    73 begin
       
    74 if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/flag"', true);
       
    75 if s[1]='"' then Delete(s, 1, 1);
       
    76 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
    77 CurrentTeam^.flag:= s
       
    78 end;
       
    79 
       
    80 procedure chScript(var s: shortstring);
       
    81 begin
       
    82 if s[1]='"' then Delete(s, 1, 1);
       
    83 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
    84 ScriptLoad(s)
       
    85 end;
       
    86 
       
    87 procedure chSetHat(var s: shortstring);
       
    88 begin
       
    89 if (not isDeveloperMode) or (CurrentTeam = nil) then exit;
       
    90 with CurrentTeam^ do
       
    91     begin
       
    92     if not CurrentHedgehog^.King then
       
    93     if (s = '') or
       
    94         (((GameFlags and gfKing) <> 0) and (s = 'crown')) or
       
    95         ((Length(s) > 39) and (Copy(s,1,8) = 'Reserved') and (Copy(s,9,32) <> PlayerHash)) then
       
    96         CurrentHedgehog^.Hat:= 'NoHat'
       
    97     else
       
    98         CurrentHedgehog^.Hat:= s
       
    99     end;
       
   100 end;
       
   101 
       
   102 procedure chCurU_p(var s: shortstring);
       
   103 begin
       
   104 s:= s; // avoid compiler hint
       
   105 CursorMovementY:= -1;
       
   106 end;
       
   107 
       
   108 procedure chCurU_m(var s: shortstring);
       
   109 begin
       
   110 s:= s; // avoid compiler hint
       
   111 CursorMovementY:= 0;
       
   112 end;
       
   113 
       
   114 procedure chCurD_p(var s: shortstring);
       
   115 begin
       
   116 s:= s; // avoid compiler hint
       
   117 CursorMovementY:= 1;
       
   118 end;
       
   119 
       
   120 procedure chCurD_m(var s: shortstring);
       
   121 begin
       
   122 s:= s; // avoid compiler hint
       
   123 CursorMovementY:= 0;
       
   124 end;
       
   125 
       
   126 procedure chCurL_p(var s: shortstring);
       
   127 begin
       
   128 s:= s; // avoid compiler hint
       
   129 CursorMovementX:= -1;
       
   130 end;
       
   131 
       
   132 procedure chCurL_m(var s: shortstring);
       
   133 begin
       
   134 s:= s; // avoid compiler hint
       
   135 CursorMovementX:= 0;
       
   136 end;
       
   137 
       
   138 procedure chCurR_p(var s: shortstring);
       
   139 begin
       
   140 s:= s; // avoid compiler hint
       
   141 CursorMovementX:= 1;
       
   142 end;
       
   143 
       
   144 procedure chCurR_m(var s: shortstring);
       
   145 begin
       
   146 s:= s; // avoid compiler hint
       
   147 CursorMovementX:= 0;
       
   148 end;
       
   149 
       
   150 procedure chLeft_p(var s: shortstring);
       
   151 begin
       
   152 s:= s; // avoid compiler hint
       
   153 if CheckNoTeamOrHH or isPaused then exit;
       
   154 if not CurrentTeam^.ExtDriven then SendIPC('L');
       
   155 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   156 bShowFinger:= false;
       
   157 with CurrentHedgehog^.Gear^ do
       
   158     Message:= Message or gmLeft
       
   159 end;
       
   160 
       
   161 procedure chLeft_m(var s: shortstring);
       
   162 begin
       
   163 s:= s; // avoid compiler hint
       
   164 if CheckNoTeamOrHH then exit;
       
   165 if not CurrentTeam^.ExtDriven then SendIPC('l');
       
   166 with CurrentHedgehog^.Gear^ do
       
   167     Message:= Message and not gmLeft
       
   168 end;
       
   169 
       
   170 procedure chRight_p(var s: shortstring);
       
   171 begin
       
   172 s:= s; // avoid compiler hint
       
   173 if CheckNoTeamOrHH or isPaused then exit;
       
   174 if not CurrentTeam^.ExtDriven then SendIPC('R');
       
   175 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   176 bShowFinger:= false;
       
   177 with CurrentHedgehog^.Gear^ do
       
   178     Message:= Message or gmRight
       
   179 end;
       
   180 
       
   181 procedure chRight_m(var s: shortstring);
       
   182 begin
       
   183 s:= s; // avoid compiler hint
       
   184 if CheckNoTeamOrHH then exit;
       
   185 if not CurrentTeam^.ExtDriven then SendIPC('r');
       
   186 with CurrentHedgehog^.Gear^ do
       
   187     Message:= Message and not gmRight
       
   188 end;
       
   189 
       
   190 procedure chUp_p(var s: shortstring);
       
   191 begin
       
   192 s:= s; // avoid compiler hint
       
   193 if CheckNoTeamOrHH or isPaused then exit;
       
   194 if not CurrentTeam^.ExtDriven then SendIPC('U');
       
   195 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   196 bShowFinger:= false;
       
   197 with CurrentHedgehog^.Gear^ do
       
   198     Message:= Message or gmUp
       
   199 end;
       
   200 
       
   201 procedure chUp_m(var s: shortstring);
       
   202 begin
       
   203 s:= s; // avoid compiler hint
       
   204 if CheckNoTeamOrHH then exit;
       
   205 if not CurrentTeam^.ExtDriven then SendIPC('u');
       
   206 with CurrentHedgehog^.Gear^ do
       
   207     Message:= Message and not gmUp
       
   208 end;
       
   209 
       
   210 procedure chDown_p(var s: shortstring);
       
   211 begin
       
   212 s:= s; // avoid compiler hint
       
   213 if CheckNoTeamOrHH or isPaused then exit;
       
   214 if not CurrentTeam^.ExtDriven then SendIPC('D');
       
   215 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   216 bShowFinger:= false;
       
   217 with CurrentHedgehog^.Gear^ do
       
   218     Message:= Message or gmDown
       
   219 end;
       
   220 
       
   221 procedure chDown_m(var s: shortstring);
       
   222 begin
       
   223 s:= s; // avoid compiler hint
       
   224 if CheckNoTeamOrHH then exit;
       
   225 if not CurrentTeam^.ExtDriven then SendIPC('d');
       
   226 with CurrentHedgehog^.Gear^ do
       
   227     Message:= Message and not gmDown
       
   228 end;
       
   229 
       
   230 procedure chPrecise_p(var s: shortstring);
       
   231 begin
       
   232 s:= s; // avoid compiler hint
       
   233 if CheckNoTeamOrHH or isPaused then exit;
       
   234 if not CurrentTeam^.ExtDriven then SendIPC('Z');
       
   235 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   236 bShowFinger:= false;
       
   237 with CurrentHedgehog^.Gear^ do
       
   238     Message:= Message or gmPrecise
       
   239 end;
       
   240 
       
   241 procedure chPrecise_m(var s: shortstring);
       
   242 begin
       
   243 s:= s; // avoid compiler hint
       
   244 if CheckNoTeamOrHH then exit;
       
   245 if not CurrentTeam^.ExtDriven then SendIPC('z');
       
   246 with CurrentHedgehog^.Gear^ do
       
   247     Message:= Message and not gmPrecise
       
   248 end;
       
   249 
       
   250 procedure chLJump(var s: shortstring);
       
   251 begin
       
   252 s:= s; // avoid compiler hint
       
   253 if CheckNoTeamOrHH or isPaused then exit;
       
   254 if not CurrentTeam^.ExtDriven then SendIPC('j');
       
   255 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   256 bShowFinger:= false;
       
   257 with CurrentHedgehog^.Gear^ do
       
   258     Message:= Message or gmLJump
       
   259 end;
       
   260 
       
   261 procedure chHJump(var s: shortstring);
       
   262 begin
       
   263 s:= s; // avoid compiler hint
       
   264 if CheckNoTeamOrHH or isPaused then exit;
       
   265 if not CurrentTeam^.ExtDriven then SendIPC('J');
       
   266 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   267 bShowFinger:= false;
       
   268 with CurrentHedgehog^.Gear^ do
       
   269     Message:= Message or gmHJump
       
   270 end;
       
   271 
       
   272 procedure chAttack_p(var s: shortstring);
       
   273 begin
       
   274 s:= s; // avoid compiler hint
       
   275 if CheckNoTeamOrHH or isPaused then exit;
       
   276 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   277 bShowFinger:= false;
       
   278 with CurrentHedgehog^.Gear^ do
       
   279     begin
       
   280     {$IFDEF DEBUGFILE}AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));{$ENDIF}
       
   281     if ((State and gstHHDriven) <> 0) then
       
   282         begin
       
   283         FollowGear:= CurrentHedgehog^.Gear;
       
   284         if not CurrentTeam^.ExtDriven then SendIPC('A');
       
   285         Message:= Message or gmAttack
       
   286         end
       
   287     end
       
   288 end;
       
   289 
       
   290 procedure chAttack_m(var s: shortstring);
       
   291 begin
       
   292 s:= s; // avoid compiler hint
       
   293 if CheckNoTeamOrHH then exit;
       
   294 with CurrentHedgehog^.Gear^ do
       
   295     begin
       
   296     if not CurrentTeam^.ExtDriven and
       
   297         ((Message and gmAttack) <> 0) then SendIPC('a');
       
   298     Message:= Message and not gmAttack
       
   299     end
       
   300 end;
       
   301 
       
   302 procedure chSwitch(var s: shortstring);
       
   303 begin
       
   304 s:= s; // avoid compiler hint
       
   305 if CheckNoTeamOrHH or isPaused then exit;
       
   306 if not CurrentTeam^.ExtDriven then SendIPC('S');
       
   307 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   308 bShowFinger:= false;
       
   309 with CurrentHedgehog^.Gear^ do
       
   310     Message:= Message or gmSwitch
       
   311 end;
       
   312 
       
   313 procedure chNextTurn(var s: shortstring);
       
   314 begin
       
   315     s:= s; // avoid compiler hint
       
   316     TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
       
   317 
       
   318     if not CurrentTeam^.ExtDriven then SendIPC('N');
       
   319 {$IFDEF DEBUGFILE}
       
   320     AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));
       
   321 {$ENDIF}
       
   322     perfExt_NewTurnBeginning();
       
   323 end;
       
   324 
       
   325 procedure chTimer(var s: shortstring);
       
   326 begin
       
   327 if (s[0] <> #1) or (s[1] < '1') or (s[1] > '5') or CheckNoTeamOrHH then exit;
       
   328 
       
   329 if not CurrentTeam^.ExtDriven then SendIPC(s);
       
   330 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   331 bShowFinger:= false;
       
   332 with CurrentHedgehog^.Gear^ do
       
   333     begin
       
   334     Message:= Message or gmTimer;
       
   335     MsgParam:= byte(s[1]) - ord('0')
       
   336     end
       
   337 end;
       
   338 
       
   339 procedure chSlot(var s: shortstring);
       
   340 var slot: LongWord;
       
   341 begin
       
   342 if (s[0] <> #1) or CheckNoTeamOrHH then exit;
       
   343 slot:= byte(s[1]) - 49;
       
   344 if slot > cMaxSlotIndex then exit;
       
   345 if not CurrentTeam^.ExtDriven then SendIPC(char(byte(s[1]) + 79));
       
   346 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   347 bShowFinger:= false;
       
   348 with CurrentHedgehog^.Gear^ do
       
   349     begin
       
   350     Message:= Message or gmSlot;
       
   351     MsgParam:= slot
       
   352     end
       
   353 end;
       
   354 
       
   355 procedure chSetWeapon(var s: shortstring);
       
   356 begin
       
   357     if (s[0] <> #1) or CheckNoTeamOrHH then exit;
       
   358 
       
   359     if TAmmoType(s[1]) > High(TAmmoType) then exit;
       
   360 
       
   361     if not CurrentTeam^.ExtDriven then SendIPC('w' + s);
       
   362 
       
   363     with CurrentHedgehog^.Gear^ do
       
   364     begin
       
   365         Message:= Message or gmWeapon;
       
   366         MsgParam:= byte(s[1]);
       
   367     end;
       
   368 end;
       
   369 
       
   370 procedure chTaunt(var s: shortstring);
       
   371 begin
       
   372 if (s[0] <> #1) or CheckNoTeamOrHH then exit;
       
   373 
       
   374 if TWave(s[1]) > High(TWave) then exit;
       
   375 
       
   376 if not CurrentTeam^.ExtDriven then SendIPC('t' + s);
       
   377 
       
   378 with CurrentHedgehog^.Gear^ do
       
   379     begin
       
   380     Message:= Message or gmAnimate;
       
   381     MsgParam:= byte(s[1])
       
   382     end
       
   383 end;
       
   384 
       
   385 procedure chPut(var s: shortstring);
       
   386 begin
       
   387     s:= s; // avoid compiler hint
       
   388     doPut(0, 0, false);
       
   389 end;
       
   390 
       
   391 procedure chCapture(var s: shortstring);
       
   392 begin
       
   393 s:= s; // avoid compiler hint
       
   394 flagMakeCapture:= true
       
   395 end;
       
   396 
       
   397 procedure chSetMap(var s: shortstring);
       
   398 begin
       
   399 if isDeveloperMode then
       
   400 begin
       
   401 Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
       
   402 InitStepsFlags:= InitStepsFlags or cifMap
       
   403 end
       
   404 end;
       
   405 
       
   406 procedure chSetTheme(var s: shortstring);
       
   407 begin
       
   408 if isDeveloperMode then
       
   409 begin
       
   410 Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s;
       
   411 InitStepsFlags:= InitStepsFlags or cifTheme
       
   412 end
       
   413 end;
       
   414 
       
   415 procedure chSetSeed(var s: shortstring);
       
   416 begin
       
   417 if isDeveloperMode then
       
   418 begin
       
   419 SetRandomSeed(s);
       
   420 cSeed:= s;
       
   421 InitStepsFlags:= InitStepsFlags or cifRandomize
       
   422 end
       
   423 end;
       
   424 
       
   425 procedure chAmmoMenu(var s: shortstring);
       
   426 begin
       
   427 s:= s; // avoid compiler hint
       
   428 if CheckNoTeamOrHH then
       
   429     bShowAmmoMenu:= true
       
   430 else
       
   431     begin
       
   432     with CurrentTeam^ do
       
   433         with Hedgehogs[CurrHedgehog] do
       
   434             begin
       
   435             bSelected:= false;
       
   436 
       
   437             if bShowAmmoMenu then bShowAmmoMenu:= false
       
   438             else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or
       
   439                     ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or
       
   440                     ((Gear^.State and gstHHDriven) = 0) then else bShowAmmoMenu:= true
       
   441             end;
       
   442     if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1
       
   443     end
       
   444 end;
       
   445 
       
   446 procedure chVol_p(var s: shortstring);
       
   447 begin
       
   448 s:= s; // avoid compiler hint
       
   449 inc(cVolumeDelta, 3)
       
   450 end;
       
   451 
       
   452 procedure chVol_m(var s: shortstring);
       
   453 begin
       
   454 s:= s; // avoid compiler hint
       
   455 dec(cVolumeDelta, 3)
       
   456 end;
       
   457 
       
   458 procedure chFindhh(var s: shortstring);
       
   459 begin
       
   460 s:= s; // avoid compiler hint
       
   461 if CheckNoTeamOrHH or isPaused then exit;
       
   462 bShowFinger:= true;
       
   463 FollowGear:= CurrentHedgehog^.Gear
       
   464 end;
       
   465 
       
   466 procedure chPause(var s: shortstring);
       
   467 begin
       
   468 s:= s; // avoid compiler hint
       
   469 if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
       
   470 if gameType <> gmtNet then
       
   471     isPaused:= not isPaused;
       
   472 SDL_ShowCursor(ord(isPaused))
       
   473 end;
       
   474 
       
   475 procedure chRotateMask(var s: shortstring);
       
   476 begin
       
   477 s:= s; // avoid compiler hint
       
   478 if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask];
       
   479 end;
       
   480 
       
   481 procedure chSpeedup_p(var s: shortstring);
       
   482 begin
       
   483 s:= s; // avoid compiler hint
       
   484 isSpeed:= true
       
   485 end;
       
   486 
       
   487 procedure chSpeedup_m(var s: shortstring);
       
   488 begin
       
   489 s:= s; // avoid compiler hint
       
   490 isSpeed:= false
       
   491 end;
       
   492 
       
   493 procedure chZoomIn(var s: shortstring);
       
   494 begin
       
   495     s:= s; // avoid compiler hint
       
   496     if ZoomValue < cMinZoomLevel then
       
   497         ZoomValue:= ZoomValue + cZoomDelta;
       
   498 end;
       
   499 
       
   500 procedure chZoomOut(var s: shortstring);
       
   501 begin
       
   502     s:= s; // avoid compiler hint
       
   503     if ZoomValue > cMaxZoomLevel then
       
   504         ZoomValue:= ZoomValue - cZoomDelta;
       
   505 end;
       
   506 
       
   507 procedure chZoomReset(var s: shortstring);
       
   508 begin
       
   509     s:= s; // avoid compiler hint
       
   510     ZoomValue:= cDefaultZoomLevel;
       
   511 end;
       
   512 
       
   513 
       
   514 procedure initModule;
       
   515 begin
       
   516     RegisterVariable('flag'    , vtCommand, @chFlag         , false);
       
   517     RegisterVariable('script'  , vtCommand, @chScript       , false);
       
   518     RegisterVariable('proto'   , vtCommand, @chCheckProto   , true );
       
   519     RegisterVariable('spectate', vtBoolean, @fastUntilLag   , false);
       
   520     RegisterVariable('capture' , vtCommand, @chCapture      , true );
       
   521     RegisterVariable('rotmask' , vtCommand, @chRotateMask   , true );
       
   522     RegisterVariable('rdriven' , vtCommand, @chTeamLocal    , false);
       
   523     RegisterVariable('map'     , vtCommand, @chSetMap       , false);
       
   524     RegisterVariable('theme'   , vtCommand, @chSetTheme     , false);
       
   525     RegisterVariable('seed'    , vtCommand, @chSetSeed      , false);
       
   526     RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false);
       
   527     RegisterVariable('mapgen'  , vtLongInt, @cMapGen        , false);
       
   528     RegisterVariable('maze_size',vtLongInt, @cMazeSize      , false);
       
   529     RegisterVariable('delay'   , vtLongInt, @cInactDelay    , false);
       
   530     RegisterVariable('ready'   , vtLongInt, @cReadyDelay    , false);
       
   531     RegisterVariable('casefreq', vtLongInt, @cCaseFactor    , false);
       
   532     RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false);
       
   533     RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false);
       
   534     RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns  , false);
       
   535     RegisterVariable('waterrise', vtLongInt, @cWaterRise    , false);
       
   536     RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false);
       
   537     RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false);
       
   538     RegisterVariable('ropepct' , vtLongInt, @cRopePercent   , false);
       
   539     RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false);
       
   540     RegisterVariable('minesnum', vtLongInt, @cLandMines     , false);
       
   541     RegisterVariable('explosives',vtLongInt,@cExplosives    , false);
       
   542     RegisterVariable('gmflags' , vtLongInt, @GameFlags      , false);
       
   543     RegisterVariable('trflags' , vtLongInt, @TrainingFlags  , false);
       
   544     RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false);
       
   545     RegisterVariable('minestime',vtLongInt, @cMinesTime     , false);
       
   546     RegisterVariable('fort'    , vtCommand, @chFort         , false);
       
   547     RegisterVariable('grave'   , vtCommand, @chGrave        , false);
       
   548     RegisterVariable('hat'     , vtCommand, @chSetHat       , false);
       
   549     RegisterVariable('quit'    , vtCommand, @chQuit         , true );
       
   550     RegisterVariable('confirm' , vtCommand, @chConfirm      , true );
       
   551     RegisterVariable('+speedup', vtCommand, @chSpeedup_p    , true );
       
   552     RegisterVariable('-speedup', vtCommand, @chSpeedup_m    , true );
       
   553     RegisterVariable('zoomin'  , vtCommand, @chZoomIn       , true );
       
   554     RegisterVariable('zoomout' , vtCommand, @chZoomOut      , true );
       
   555     RegisterVariable('zoomreset',vtCommand, @chZoomReset    , true );
       
   556     RegisterVariable('ammomenu', vtCommand, @chAmmoMenu     , true);
       
   557     RegisterVariable('+precise', vtCommand, @chPrecise_p    , false);
       
   558     RegisterVariable('-precise', vtCommand, @chPrecise_m    , false);
       
   559     RegisterVariable('+left'   , vtCommand, @chLeft_p       , false);
       
   560     RegisterVariable('-left'   , vtCommand, @chLeft_m       , false);
       
   561     RegisterVariable('+right'  , vtCommand, @chRight_p      , false);
       
   562     RegisterVariable('-right'  , vtCommand, @chRight_m      , false);
       
   563     RegisterVariable('+up'     , vtCommand, @chUp_p         , false);
       
   564     RegisterVariable('-up'     , vtCommand, @chUp_m         , false);
       
   565     RegisterVariable('+down'   , vtCommand, @chDown_p       , false);
       
   566     RegisterVariable('-down'   , vtCommand, @chDown_m       , false);
       
   567     RegisterVariable('+attack' , vtCommand, @chAttack_p     , false);
       
   568     RegisterVariable('-attack' , vtCommand, @chAttack_m     , false);
       
   569     RegisterVariable('switch'  , vtCommand, @chSwitch       , false);
       
   570     RegisterVariable('nextturn', vtCommand, @chNextTurn     , false);
       
   571     RegisterVariable('timer'   , vtCommand, @chTimer        , false);
       
   572     RegisterVariable('taunt'   , vtCommand, @chTaunt        , false);
       
   573     RegisterVariable('setweap' , vtCommand, @chSetWeapon    , false);
       
   574     RegisterVariable('slot'    , vtCommand, @chSlot         , false);
       
   575     RegisterVariable('put'     , vtCommand, @chPut          , false);
       
   576     RegisterVariable('ljump'   , vtCommand, @chLJump        , false);
       
   577     RegisterVariable('hjump'   , vtCommand, @chHJump        , false);
       
   578     RegisterVariable('+volup'  , vtCommand, @chVol_p        , true );
       
   579     RegisterVariable('-volup'  , vtCommand, @chVol_m        , true );
       
   580     RegisterVariable('+voldown', vtCommand, @chVol_m        , true );
       
   581     RegisterVariable('-voldown', vtCommand, @chVol_p        , true );
       
   582     RegisterVariable('findhh'  , vtCommand, @chFindhh       , true );
       
   583     RegisterVariable('pause'   , vtCommand, @chPause        , true );
       
   584     RegisterVariable('+cur_u'  , vtCommand, @chCurU_p       , true );
       
   585     RegisterVariable('-cur_u'  , vtCommand, @chCurU_m       , true );
       
   586     RegisterVariable('+cur_d'  , vtCommand, @chCurD_p       , true );
       
   587     RegisterVariable('-cur_d'  , vtCommand, @chCurD_m       , true );
       
   588     RegisterVariable('+cur_l'  , vtCommand, @chCurL_p       , true );
       
   589     RegisterVariable('-cur_l'  , vtCommand, @chCurL_m       , true );
       
   590     RegisterVariable('+cur_r'  , vtCommand, @chCurR_p       , true );
       
   591     RegisterVariable('-cur_r'  , vtCommand, @chCurR_m       , true );
       
   592 end;
       
   593 
       
   594 procedure freeModule;
       
   595 begin
       
   596 end;
       
   597 
       
   598 end.