hedgewars/GSHandlers.inc
changeset 7296 fb5b7cb58a67
parent 7293 468cf6d561e5
child 7305 b242e91a92a9
equal deleted inserted replaced
7293:468cf6d561e5 7296:fb5b7cb58a67
  3435 end;
  3435 end;
  3436 
  3436 
  3437 ////////////////////////////////////////////////////////////////////////////////
  3437 ////////////////////////////////////////////////////////////////////////////////
  3438 procedure doStepBallgunWork(Gear: PGear);
  3438 procedure doStepBallgunWork(Gear: PGear);
  3439 var 
  3439 var 
  3440     HHGear: PGear;
  3440     HHGear, ball: PGear;
  3441     rx, ry: hwFloat;
  3441     rx, ry: hwFloat;
  3442     gX, gY: LongInt;
  3442     gX, gY: LongInt;
  3443 begin
  3443 begin
  3444     AllInactive := false;
  3444     AllInactive := false;
  3445     dec(Gear^.Timer);
  3445     dec(Gear^.Timer);
  3450     if (Gear^.Timer mod 100) = 0 then
  3450     if (Gear^.Timer mod 100) = 0 then
  3451         begin
  3451         begin
  3452         rx := rndSign(getRandomf * _0_1);
  3452         rx := rndSign(getRandomf * _0_1);
  3453         ry := rndSign(getRandomf * _0_1);
  3453         ry := rndSign(getRandomf * _0_1);
  3454 
  3454 
  3455         AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0);
  3455         ball:= AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0);
       
  3456         ball^.CollisionMask:= $FF7F;
  3456 
  3457 
  3457         PlaySound(sndGun);
  3458         PlaySound(sndGun);
  3458         end;
  3459         end;
  3459 
  3460 
  3460     if (Gear^.Timer = 0) or ((HHGear^.State and gstHHDriven) = 0) then
  3461     if (Gear^.Timer = 0) or ((HHGear^.State and gstHHDriven) = 0) then