hedgewars/uGearsHandlersMess.pas
changeset 11170 22d8835beb4d
parent 11169 1b386b9e1be0
child 11191 ba192ec1f201
equal deleted inserted replaced
11169:1b386b9e1be0 11170:22d8835beb4d
  2673                 2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
  2673                 2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
  2674                 3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
  2674                 3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
  2675             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
  2675             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
  2676             //                 Gear^.Tag, _0, 5000);
  2676             //                 Gear^.Tag, _0, 5000);
  2677             end;
  2677             end;
  2678         Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag);
  2678         Gear^.dX := Gear^.dX + int2hwFloat(Gear^.Damage * Gear^.Tag);
  2679         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  2679         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  2680             FollowGear^.State:= FollowGear^.State or gstSubmersible;
  2680             FollowGear^.State:= FollowGear^.State or gstSubmersible;
  2681         StopSoundChan(Gear^.SoundChannel, 4000);
  2681         StopSoundChan(Gear^.SoundChannel, 4000);
  2682         end;
  2682         end;
  2683 
  2683 
  2706         Gear^.Tag := -1;
  2706         Gear^.Tag := -1;
  2707         Gear^.X := int2hwFloat(max(LAND_WIDTH,4096) + 2048);
  2707         Gear^.X := int2hwFloat(max(LAND_WIDTH,4096) + 2048);
  2708         end;
  2708         end;
  2709 
  2709 
  2710     Gear^.Y := int2hwFloat(topY-300);
  2710     Gear^.Y := int2hwFloat(topY-300);
  2711     Gear^.dX := int2hwFloat(Gear^.Target.X - 5 * Gear^.Tag * 15);
  2711     Gear^.dX := int2hwFloat(Gear^.Target.X) - int2hwFloat(Gear^.Tag * Gear^.Health * Gear^.Damage) / 2;
  2712 
  2712 
  2713     // calcs for Napalm Strike, so that it will hit the target (without wind at least :P)
  2713     // calcs for Napalm Strike, so that it will hit the target (without wind at least :P)
  2714     if (Gear^.State = 2) then
  2714     if (Gear^.State = 2) then
  2715         Gear^.dX := Gear^.dX - cBombsSpeed * Gear^.Tag * 900
  2715         Gear^.dX := Gear^.dX - cBombsSpeed * Gear^.Tag * 900
  2716     // calcs for regular falling gears
  2716     // calcs for regular falling gears