hedgewars/uCommandHandlers.pas
changeset 5247 bf6d4bc531d2
parent 5238 46ddaf14509d
child 5352 7f57d0c7816a
child 5356 bf058f0a77d6
equal deleted inserted replaced
5244:1b408b965c01 5247:bf6d4bc531d2
    24 
    24 
    25 procedure initModule;
    25 procedure initModule;
    26 procedure freeModule;
    26 procedure freeModule;
    27 
    27 
    28 implementation
    28 implementation
    29 uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom;
    29 uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions;
    30 
    30 
    31 procedure chGenCmd(var s: shortstring);
    31 procedure chGenCmd(var s: shortstring);
    32 begin
    32 begin
    33 case s[1] of
    33 case s[1] of
    34      'R': if ReadyTimeLeft > 1 then 
    34      'R': if ReadyTimeLeft > 1 then 
   329     if ((State and gstHHDriven) <> 0) then
   329     if ((State and gstHHDriven) <> 0) then
   330         begin
   330         begin
   331         FollowGear:= CurrentHedgehog^.Gear;
   331         FollowGear:= CurrentHedgehog^.Gear;
   332         if not CurrentTeam^.ExtDriven then SendIPC('A');
   332         if not CurrentTeam^.ExtDriven then SendIPC('A');
   333         Message:= Message or (gmAttack and InputMask);
   333         Message:= Message or (gmAttack and InputMask);
   334 	ScriptCall('onAttack');
   334         ScriptCall('onAttack');
   335         end
   335         end
   336     end
   336     end
   337 end;
   337 end;
   338 
   338 
   339 procedure chAttack_m(var s: shortstring);
   339 procedure chAttack_m(var s: shortstring);
   409 
   409 
   410     with CurrentHedgehog^.Gear^ do
   410     with CurrentHedgehog^.Gear^ do
   411     begin
   411     begin
   412         Message:= Message or (gmWeapon and InputMask);
   412         Message:= Message or (gmWeapon and InputMask);
   413         MsgParam:= byte(s[1]);
   413         MsgParam:= byte(s[1]);
   414 	ScriptCall('onSetWeapon');
   414     ScriptCall('onSetWeapon');
   415     end;
   415     end;
   416 end;
   416 end;
   417 
   417 
   418 procedure chTaunt(var s: shortstring);
   418 procedure chTaunt(var s: shortstring);
   419 begin
   419 begin
   508 
   508 
   509 procedure chFindhh(var s: shortstring);
   509 procedure chFindhh(var s: shortstring);
   510 begin
   510 begin
   511 s:= s; // avoid compiler hint
   511 s:= s; // avoid compiler hint
   512 if CheckNoTeamOrHH or isPaused then exit;
   512 if CheckNoTeamOrHH or isPaused then exit;
   513 bShowFinger:= true;
   513 
   514 FollowGear:= CurrentHedgehog^.Gear
   514 if FollowGear <> nil then
       
   515     begin
       
   516     AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume);
       
   517     autoCameraOn:= false
       
   518     end
       
   519     else begin
       
   520     AddCaption('Auto Camera On', $CCCCCC, capgrpVolume);
       
   521     bShowFinger:= true;
       
   522     FollowGear:= CurrentHedgehog^.Gear;
       
   523     autoCameraOn:= true
       
   524     end
   515 end;
   525 end;
   516 
   526 
   517 procedure chPause(var s: shortstring);
   527 procedure chPause(var s: shortstring);
   518 begin
   528 begin
   519 s:= s; // avoid compiler hint
   529 s:= s; // avoid compiler hint