hedgewars/uCommandHandlers.pas
changeset 6453 11c578d30bd3
parent 6415 af2047bb4f70
child 6580 6155187bf599
equal deleted inserted replaced
6452:7c6f9b6672dc 6453:11c578d30bd3
   212 begin
   212 begin
   213 s:= s; // avoid compiler hint
   213 s:= s; // avoid compiler hint
   214 if CheckNoTeamOrHH then exit;
   214 if CheckNoTeamOrHH then exit;
   215 if not CurrentTeam^.ExtDriven then SendIPC('l');
   215 if not CurrentTeam^.ExtDriven then SendIPC('l');
   216 with CurrentHedgehog^.Gear^ do
   216 with CurrentHedgehog^.Gear^ do
   217     Message:= Message and not (gmLeft and InputMask);
   217     Message:= Message and (not (gmLeft and InputMask));
   218     ScriptCall('onLeftUp');
   218     ScriptCall('onLeftUp');
   219 end;
   219 end;
   220 
   220 
   221 procedure chRight_p(var s: shortstring);
   221 procedure chRight_p(var s: shortstring);
   222 begin
   222 begin
   233 begin
   233 begin
   234 s:= s; // avoid compiler hint
   234 s:= s; // avoid compiler hint
   235 if CheckNoTeamOrHH then exit;
   235 if CheckNoTeamOrHH then exit;
   236 if not CurrentTeam^.ExtDriven then SendIPC('r');
   236 if not CurrentTeam^.ExtDriven then SendIPC('r');
   237 with CurrentHedgehog^.Gear^ do
   237 with CurrentHedgehog^.Gear^ do
   238     Message:= Message and not (gmRight and InputMask);
   238     Message:= Message and (not (gmRight and InputMask));
   239     ScriptCall('onRightUp');
   239     ScriptCall('onRightUp');
   240 end;
   240 end;
   241 
   241 
   242 procedure chUp_p(var s: shortstring);
   242 procedure chUp_p(var s: shortstring);
   243 begin
   243 begin
   254 begin
   254 begin
   255 s:= s; // avoid compiler hint
   255 s:= s; // avoid compiler hint
   256 if CheckNoTeamOrHH then exit;
   256 if CheckNoTeamOrHH then exit;
   257 if not CurrentTeam^.ExtDriven then SendIPC('u');
   257 if not CurrentTeam^.ExtDriven then SendIPC('u');
   258 with CurrentHedgehog^.Gear^ do
   258 with CurrentHedgehog^.Gear^ do
   259     Message:= Message and not (gmUp and InputMask);
   259     Message:= Message and (not (gmUp and InputMask));
   260     ScriptCall('onUpUp');
   260     ScriptCall('onUpUp');
   261 end;
   261 end;
   262 
   262 
   263 procedure chDown_p(var s: shortstring);
   263 procedure chDown_p(var s: shortstring);
   264 begin
   264 begin
   275 begin
   275 begin
   276 s:= s; // avoid compiler hint
   276 s:= s; // avoid compiler hint
   277 if CheckNoTeamOrHH then exit;
   277 if CheckNoTeamOrHH then exit;
   278 if not CurrentTeam^.ExtDriven then SendIPC('d');
   278 if not CurrentTeam^.ExtDriven then SendIPC('d');
   279 with CurrentHedgehog^.Gear^ do
   279 with CurrentHedgehog^.Gear^ do
   280     Message:= Message and not (gmDown and InputMask);
   280     Message:= Message and (not (gmDown and InputMask));
   281     ScriptCall('onDownUp');
   281     ScriptCall('onDownUp');
   282 end;
   282 end;
   283 
   283 
   284 procedure chPrecise_p(var s: shortstring);
   284 procedure chPrecise_p(var s: shortstring);
   285 begin
   285 begin
   296 begin
   296 begin
   297 s:= s; // avoid compiler hint
   297 s:= s; // avoid compiler hint
   298 if CheckNoTeamOrHH then exit;
   298 if CheckNoTeamOrHH then exit;
   299 if not CurrentTeam^.ExtDriven then SendIPC('z');
   299 if not CurrentTeam^.ExtDriven then SendIPC('z');
   300 with CurrentHedgehog^.Gear^ do
   300 with CurrentHedgehog^.Gear^ do
   301     Message:= Message and not (gmPrecise and InputMask);
   301     Message:= Message and (not (gmPrecise and InputMask));
   302     ScriptCall('onPreciseUp');
   302     ScriptCall('onPreciseUp');
   303 end;
   303 end;
   304 
   304 
   305 procedure chLJump(var s: shortstring);
   305 procedure chLJump(var s: shortstring);
   306 begin
   306 begin
   348 if CheckNoTeamOrHH then exit;
   348 if CheckNoTeamOrHH then exit;
   349 with CurrentHedgehog^.Gear^ do
   349 with CurrentHedgehog^.Gear^ do
   350     begin
   350     begin
   351     if not CurrentTeam^.ExtDriven and
   351     if not CurrentTeam^.ExtDriven and
   352         ((Message and gmAttack) <> 0) then SendIPC('a');
   352         ((Message and gmAttack) <> 0) then SendIPC('a');
   353     Message:= Message and not (gmAttack and InputMask);
   353     Message:= Message and (not (gmAttack and InputMask));
   354     ScriptCall('onAttackUp');
   354     ScriptCall('onAttackUp');
   355     end
   355     end
   356 end;
   356 end;
   357 
   357 
   358 procedure chSwitch(var s: shortstring);
   358 procedure chSwitch(var s: shortstring);
   503             bSelected:= false;
   503             bSelected:= false;
   504 
   504 
   505             if bShowAmmoMenu then bShowAmmoMenu:= false
   505             if bShowAmmoMenu then bShowAmmoMenu:= false
   506             else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or
   506             else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or
   507                     ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or
   507                     ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or
   508                     ((Gear^.State and gstHHDriven) = 0) then else bShowAmmoMenu:= true
   508                     ((Gear^.State and gstHHDriven) = 0) then begin end else bShowAmmoMenu:= true
   509             end;
   509             end;
   510     end
   510     end
   511 end;
   511 end;
   512 
   512 
   513 procedure chVol_p(var s: shortstring);
   513 procedure chVol_p(var s: shortstring);