hedgewars/CCHandlers.inc
changeset 3336 d7c1ffed1e15
parent 3236 4ab3917d7d44
child 3346 967fd96f7373
equal deleted inserted replaced
3335:2520ee7a5484 3336:d7c1ffed1e15
   249 CursorMovementX:= 0;
   249 CursorMovementX:= 0;
   250 end;
   250 end;
   251 
   251 
   252 procedure chLeft_p(var s: shortstring);
   252 procedure chLeft_p(var s: shortstring);
   253 begin
   253 begin
   254 if CheckNoTeamOrHH then exit;
   254 if CheckNoTeamOrHH or isPaused then exit;
   255 bShowFinger:= false;
   255 bShowFinger:= false;
   256 if not CurrentTeam^.ExtDriven then SendIPC('L');
   256 if not CurrentTeam^.ExtDriven then SendIPC('L');
   257 with CurrentHedgehog^.Gear^ do
   257 with CurrentHedgehog^.Gear^ do
   258     Message:= Message or gm_Left
   258     Message:= Message or gm_Left
   259 end;
   259 end;
   266     Message:= Message and not gm_Left
   266     Message:= Message and not gm_Left
   267 end;
   267 end;
   268 
   268 
   269 procedure chRight_p(var s: shortstring);
   269 procedure chRight_p(var s: shortstring);
   270 begin
   270 begin
   271 if CheckNoTeamOrHH then exit;
   271 if CheckNoTeamOrHH or isPaused then exit;
   272 bShowFinger:= false;
   272 bShowFinger:= false;
   273 if not CurrentTeam^.ExtDriven then SendIPC('R');
   273 if not CurrentTeam^.ExtDriven then SendIPC('R');
   274 with CurrentHedgehog^.Gear^ do
   274 with CurrentHedgehog^.Gear^ do
   275     Message:= Message or gm_Right
   275     Message:= Message or gm_Right
   276 end;
   276 end;
   283     Message:= Message and not gm_Right
   283     Message:= Message and not gm_Right
   284 end;
   284 end;
   285 
   285 
   286 procedure chUp_p(var s: shortstring);
   286 procedure chUp_p(var s: shortstring);
   287 begin
   287 begin
   288 if CheckNoTeamOrHH then exit;
   288 if CheckNoTeamOrHH or isPaused then exit;
   289 bShowFinger:= false;
   289 bShowFinger:= false;
   290 if not CurrentTeam^.ExtDriven then SendIPC('U');
   290 if not CurrentTeam^.ExtDriven then SendIPC('U');
   291 with CurrentHedgehog^.Gear^ do
   291 with CurrentHedgehog^.Gear^ do
   292     Message:= Message or gm_Up
   292     Message:= Message or gm_Up
   293 end;
   293 end;
   300     Message:= Message and not gm_Up
   300     Message:= Message and not gm_Up
   301 end;
   301 end;
   302 
   302 
   303 procedure chDown_p(var s: shortstring);
   303 procedure chDown_p(var s: shortstring);
   304 begin
   304 begin
   305 if CheckNoTeamOrHH then exit;
   305 if CheckNoTeamOrHH or isPaused then exit;
   306 bShowFinger:= false;
   306 bShowFinger:= false;
   307 if not CurrentTeam^.ExtDriven then SendIPC('D');
   307 if not CurrentTeam^.ExtDriven then SendIPC('D');
   308 with CurrentHedgehog^.Gear^ do
   308 with CurrentHedgehog^.Gear^ do
   309     Message:= Message or gm_Down
   309     Message:= Message or gm_Down
   310 end;
   310 end;
   317     Message:= Message and not gm_Down
   317     Message:= Message and not gm_Down
   318 end;
   318 end;
   319 
   319 
   320 procedure chPrecise_p(var s: shortstring);
   320 procedure chPrecise_p(var s: shortstring);
   321 begin
   321 begin
   322 if CheckNoTeamOrHH then exit;
   322 if CheckNoTeamOrHH or isPaused then exit;
   323 bShowFinger:= false;
   323 bShowFinger:= false;
   324 if not CurrentTeam^.ExtDriven then SendIPC('Z');
   324 if not CurrentTeam^.ExtDriven then SendIPC('Z');
   325 with CurrentHedgehog^.Gear^ do
   325 with CurrentHedgehog^.Gear^ do
   326     Message:= Message or gm_Precise
   326     Message:= Message or gm_Precise
   327 end;
   327 end;
   334     Message:= Message and not gm_Precise
   334     Message:= Message and not gm_Precise
   335 end;
   335 end;
   336 
   336 
   337 procedure chLJump(var s: shortstring);
   337 procedure chLJump(var s: shortstring);
   338 begin
   338 begin
   339 if CheckNoTeamOrHH then exit;
   339 if CheckNoTeamOrHH or isPaused then exit;
   340 bShowFinger:= false;
   340 bShowFinger:= false;
   341 if not CurrentTeam^.ExtDriven then SendIPC('j');
   341 if not CurrentTeam^.ExtDriven then SendIPC('j');
   342 with CurrentHedgehog^.Gear^ do
   342 with CurrentHedgehog^.Gear^ do
   343     Message:= Message or gm_LJump
   343     Message:= Message or gm_LJump
   344 end;
   344 end;
   345 
   345 
   346 procedure chHJump(var s: shortstring);
   346 procedure chHJump(var s: shortstring);
   347 begin
   347 begin
   348 if CheckNoTeamOrHH then exit;
   348 if CheckNoTeamOrHH or isPaused then exit;
   349 bShowFinger:= false;
   349 bShowFinger:= false;
   350 if not CurrentTeam^.ExtDriven then SendIPC('J');
   350 if not CurrentTeam^.ExtDriven then SendIPC('J');
   351 with CurrentHedgehog^.Gear^ do
   351 with CurrentHedgehog^.Gear^ do
   352     Message:= Message or gm_HJump
   352     Message:= Message or gm_HJump
   353 end;
   353 end;
   354 
   354 
   355 procedure chAttack_p(var s: shortstring);
   355 procedure chAttack_p(var s: shortstring);
   356 begin
   356 begin
   357 if CheckNoTeamOrHH then exit;
   357 if CheckNoTeamOrHH or isPaused then exit;
   358 bShowFinger:= false;
   358 bShowFinger:= false;
   359 with CurrentHedgehog^.Gear^ do
   359 with CurrentHedgehog^.Gear^ do
   360     begin
   360     begin
   361     {$IFDEF DEBUGFILE}AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));{$ENDIF}
   361     {$IFDEF DEBUGFILE}AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State));{$ENDIF}
   362     if ((State and gstHHDriven) <> 0) then
   362     if ((State and gstHHDriven) <> 0) then
   379     end
   379     end
   380 end;
   380 end;
   381 
   381 
   382 procedure chSwitch(var s: shortstring);
   382 procedure chSwitch(var s: shortstring);
   383 begin
   383 begin
   384 if CheckNoTeamOrHH then exit;
   384 if CheckNoTeamOrHH or isPaused then exit;
   385 if not CurrentTeam^.ExtDriven then SendIPC('S');
   385 if not CurrentTeam^.ExtDriven then SendIPC('S');
   386 with CurrentHedgehog^.Gear^ do
   386 with CurrentHedgehog^.Gear^ do
   387     Message:= Message or gm_Switch
   387     Message:= Message or gm_Switch
   388 end;
   388 end;
   389 
   389 
   506 
   506 
   507 end;
   507 end;
   508 
   508 
   509 procedure chNewGrave;
   509 procedure chNewGrave;
   510 begin
   510 begin
   511 if CheckNoTeamOrHH then exit;
   511 if CheckNoTeamOrHH or isPaused then exit;
   512 
   512 
   513 if not CurrentTeam^.ExtDriven then SendIPC('g');
   513 if not CurrentTeam^.ExtDriven then SendIPC('g');
   514 
   514 
   515 AddGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), gtGrave, 0, _0, _0, 0)
   515 AddGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), gtGrave, 0, _0, _0, 0)
   516 end;
   516 end;
   517 
   517 
   518 procedure doPut(putX, putY: LongInt; fromAI: boolean);
   518 procedure doPut(putX, putY: LongInt; fromAI: boolean);
   519 begin
   519 begin
   520 if CheckNoTeamOrHH then exit;
   520 if CheckNoTeamOrHH or isPaused then exit;
   521 if not CurrentTeam^.ExtDriven and bShowAmmoMenu then
   521 if not CurrentTeam^.ExtDriven and bShowAmmoMenu then
   522     begin
   522     begin
   523     bSelected:= true;
   523     bSelected:= true;
   524     exit
   524     exit
   525     end;
   525     end;
   705 dec(cVolumeDelta, 3)
   705 dec(cVolumeDelta, 3)
   706 end;
   706 end;
   707 
   707 
   708 procedure chFindhh(var s: shortstring);
   708 procedure chFindhh(var s: shortstring);
   709 begin
   709 begin
   710 if CheckNoTeamOrHH then exit;
   710 if CheckNoTeamOrHH or isPaused then exit;
   711 bShowFinger:= true;
   711 bShowFinger:= true;
   712 FollowGear:= CurrentHedgehog^.Gear
   712 FollowGear:= CurrentHedgehog^.Gear
   713 end;
   713 end;
   714 
   714 
   715 procedure chPause(var s: shortstring);
   715 procedure chPause(var s: shortstring);