hedgewars/GSHandlers.inc
changeset 543 465e2ec8f05f
parent 542 ec26095f1bed
child 545 f527450337c1
--- a/hedgewars/GSHandlers.inc	Sun Jun 17 14:48:15 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Jul 01 11:02:47 2007 +0000
@@ -1047,22 +1047,18 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
-const cAirPlaneSpeed: hwFloat = (isNegative: false; QWordValue: 6012954214); // 1.4
-      cBombsDistance: hwFloat = (isNegative: false; QWordValue: 128849018880); // 30
-      cBombsSpeed   : hwFloat = (isNegative: false; QWordValue:  429496729);
-
 procedure doStepAirAttackWork(Gear: PGear);
 begin
 AllInactive:= false;
 Gear^.X:= Gear^.X + cAirPlaneSpeed * Gear^.Tag;
-if (Gear^.Health > 0)and( not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then
+if (Gear^.Health > 0)and(not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then
    begin
    dec(Gear^.Health);
    case Gear^.State of
         0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
         1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed * Gear^.Tag, _0, 0);
         end;
-   Gear^.dX:= Gear^.dX + cBombsDistance * Gear^.Tag
+   Gear^.dX:= Gear^.dX + int2hwFloat(30 * Gear^.Tag)
    end;
 if (hwRound(Gear^.X) > 3072) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear)
 end;
@@ -1070,15 +1066,17 @@
 procedure doStepAirAttack(Gear: PGear);
 begin
 AllInactive:= false;
+
 if Gear^.X.QWordValue = 0 then Gear^.Tag:=  1
                           else Gear^.Tag:= -1;
 Gear^.X:= _1024 - _2048 * Gear^.Tag;
 Gear^.Y:= -_128;
-Gear^.dX:= int2hwFloat(TargetPoint.X) -
-           cBombsDistance * _5 * Gear^.Tag / _2;
+Gear^.dX:= int2hwFloat(TargetPoint.X - 5 * Gear^.Tag * 15);
 
-if TargetPoint.Y - hwRound(Gear^.Y) > 0 then
+if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then
    Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag;
+addfilelog('attack: x = '+floattostr(gear^.dx));
+
 Gear^.Health:= 6;
 Gear^.doStep:= @doStepAirAttackWork
 end;