hedgewars/uGearsHandlersMess.pas
changeset 13464 7b4643ff60ea
parent 13463 f1d349a52bc7
child 13566 acc69f506914
equal deleted inserted replaced
13463:f1d349a52bc7 13464:7b4643ff60ea
  3830         StopSoundChan(Gear^.SoundChannel);
  3830         StopSoundChan(Gear^.SoundChannel);
  3831         exit
  3831         exit
  3832     end;
  3832     end;
  3833 
  3833 
  3834     tempColl:= Gear^.CollisionMask;
  3834     tempColl:= Gear^.CollisionMask;
  3835     Gear^.CollisionMask:= $007F;
  3835     Gear^.CollisionMask:= lfObjMask;
  3836     if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) <> 0) or (TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) <> 0) or (GameTicks > Gear^.FlightTime) then
  3836     if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) <> 0) or (TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) <> 0) or (GameTicks > Gear^.FlightTime) then
  3837         t := CheckGearsCollision(Gear)
  3837         t := CheckGearsCollision(Gear)
  3838     else t := nil;
  3838     else t := nil;
  3839     Gear^.CollisionMask:= tempColl;
  3839     Gear^.CollisionMask:= tempColl;
  3840     //fixes drill not exploding when touching HH bug
  3840     //fixes drill not exploding when touching HH bug
  6586 //var ox, oy: LongInt;
  6586 //var ox, oy: LongInt;
  6587 //    la: hwFloat;
  6587 //    la: hwFloat;
  6588 var   a: real;
  6588 var   a: real;
  6589 begin
  6589 begin
  6590     // Gear is shrunk so it can actually escape the hog without carving into the terrain
  6590     // Gear is shrunk so it can actually escape the hog without carving into the terrain
  6591     if (Gear^.Radius = 4) and (Gear^.CollisionMask = $FFFF) then Gear^.Radius:= 7;
  6591     if (Gear^.Radius = 4) and (Gear^.CollisionMask = lfAll) then Gear^.Radius:= 7;
  6592     if Gear^.Damage > 100 then Gear^.CollisionMask:= 0
  6592     if Gear^.Damage > 100 then Gear^.CollisionMask:= 0
  6593     else if Gear^.Damage > 30 then
  6593     else if Gear^.Damage > 30 then
  6594         if GetRandom(max(4,18-Gear^.Damage div 10)) < 3 then Gear^.CollisionMask:= 0;
  6594         if GetRandom(max(4,18-Gear^.Damage div 10)) < 3 then Gear^.CollisionMask:= 0;
  6595     Gear^.Damage:= 0;
  6595     Gear^.Damage:= 0;
  6596     if Gear^.Timer > 0 then dec(Gear^.Timer);
  6596     if Gear^.Timer > 0 then dec(Gear^.Timer);