hedgewars/GSHandlers.inc
changeset 8744 6c87486fd89b
parent 8730 b39f433f8ab4
child 8751 4609823efc94
child 8817 0d3014097240
equal deleted inserted replaced
8743:0097855532f6 8744:6c87486fd89b
  2751 begin
  2751 begin
  2752     AllInactive := false;
  2752     AllInactive := false;
  2753 
  2753 
  2754     HHGear := Gear^.Hedgehog^.Gear;
  2754     HHGear := Gear^.Hedgehog^.Gear;
  2755     HHGear^.Message := HHGear^.Message and (not gmAttack);
  2755     HHGear^.Message := HHGear^.Message and (not gmAttack);
  2756     Gear^.CollisionMask:= $FF7F;
  2756     Gear^.CollisionMask:= lfCurrentMask;
  2757 
  2757 
  2758     FollowGear := Gear;
  2758     FollowGear := Gear;
  2759 
  2759 
  2760     Gear^.doStep := @doStepCakeFall
  2760     Gear^.doStep := @doStepCakeFall
  2761 end;
  2761 end;
  3023         begin
  3023         begin
  3024         rx := rndSign(getRandomf * _0_1);
  3024         rx := rndSign(getRandomf * _0_1);
  3025         ry := rndSign(getRandomf * _0_1);
  3025         ry := rndSign(getRandomf * _0_1);
  3026 
  3026 
  3027         ball:= AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0);
  3027         ball:= AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0);
  3028         ball^.CollisionMask:= $FF7F;
  3028         ball^.CollisionMask:= lfCurrentMask;
  3029 
  3029 
  3030         PlaySound(sndGun);
  3030         PlaySound(sndGun);
  3031         end;
  3031         end;
  3032 
  3032 
  3033     if (Gear^.Timer = 0) or ((HHGear^.State and gstHHDriven) = 0) then
  3033     if (Gear^.Timer = 0) or ((HHGear^.State and gstHHDriven) = 0) then
  4374             speed := _0_5 * (_10 / Gear^.Tag);
  4374             speed := _0_5 * (_10 / Gear^.Tag);
  4375     
  4375     
  4376             flame:= AddGear(gx, gy, gtFlame, gstTmpFlag,
  4376             flame:= AddGear(gx, gy, gtFlame, gstTmpFlag,
  4377                     SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4377                     SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4378                     AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4378                     AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4379             flame^.CollisionMask:= $FF7F;
  4379             flame^.CollisionMask:= lfCurrentMask;
  4380             
  4380             
  4381             if (Gear^.Health mod 30) = 0 then
  4381             if (Gear^.Health mod 30) = 0 then
  4382                 begin
  4382                 begin
  4383                 flame:= AddGear(gx, gy, gtFlame, 0,
  4383                 flame:= AddGear(gx, gy, gtFlame, 0,
  4384                         SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4384                         SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4385                         AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4385                         AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4386                 flame^.CollisionMask:= $FF7F;
  4386                 flame^.CollisionMask:= lfCurrentMask;
  4387                 end
  4387                 end
  4388             end;
  4388             end;
  4389         Gear^.Timer:= Gear^.Tag
  4389         Gear^.Timer:= Gear^.Tag
  4390         end;
  4390         end;
  4391 
  4391 
  4458         speed := (_3 / Gear^.Tag);
  4458         speed := (_3 / Gear^.Tag);
  4459 
  4459 
  4460         land:= AddGear(gx, gy, gtFlake, gstTmpFlag, 
  4460         land:= AddGear(gx, gy, gtFlake, gstTmpFlag, 
  4461                 SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, 
  4461                 SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, 
  4462                 AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4462                 AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4463         land^.CollisionMask:= $FF7F;
  4463         land^.CollisionMask:= lfCurrentMask;
  4464             
  4464             
  4465         Gear^.Timer:= Gear^.Tag
  4465         Gear^.Timer:= Gear^.Tag
  4466         end;
  4466         end;
  4467 
  4467 
  4468     if (Gear^.Health = 0) or ((HHGear^.State and gstHHDriven) = 0) or ((HHGear^.Message and gmAttack) <> 0) then
  4468     if (Gear^.Health = 0) or ((HHGear^.State and gstHHDriven) = 0) or ((HHGear^.Message and gmAttack) <> 0) then