Use the larger scaled airmine sprite originally intended, add some antidickery measures.
authornemo
Sun, 18 Jan 2015 16:57:32 -0500
changeset 10802 089e43d01f74
parent 10801 50bc2c75eee7
child 10803 df39aa3f6d4d
Use the larger scaled airmine sprite originally intended, add some antidickery measures.
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsList.pas
share/hedgewars/Data/Graphics/AirMine.png
--- a/hedgewars/uGearsHandlersMess.pas	Mon Jan 19 00:12:26 2015 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Sun Jan 18 16:57:32 2015 -0500
@@ -1783,13 +1783,15 @@
         tX:=Gear^.X-targ^.X;
         tY:=Gear^.Y-targ^.Y;
         // allow escaping - should maybe flag this too
-        if ((tX.Round+tY.Round > Gear^.Angle*4) and
-            (hwRound(hwSqr(tX) + hwSqr(tY)) > sqr(Gear^.Angle*4))) then
+        if (GameTicks > Gear^.FlightTime+10000) or 
+            ((tX.Round+tY.Round > Gear^.Angle*6) and
+            (hwRound(hwSqr(tX) + hwSqr(tY)) > sqr(Gear^.Angle*6))) then
             targ:= nil
         end;
 
     // todo, allow not finding new target, set timeout on target retention
-    if (Gear^.State and (gsttmpFlag or gstAttacking) =  gsttmpFlag) and
+    if (ReadyTimeLeft = 0) and (TurnTimeLeft > 0) and ((TurnTimeLeft > cHedgehogTurnTime) or (cHedgehogTurnTime-TurnTimeLeft > 5000)) and
+       (Gear^.State and (gsttmpFlag or gstAttacking) =  gsttmpFlag) and
        (Gear^.Angle > 0) and ((GameTicks and $FF) = 17) and
        (GameTicks > Gear^.FlightTime) then // recheck hunted hog
         begin
@@ -1818,7 +1820,7 @@
                                 end
                             end
                         end;
-        if targ <> nil then Gear^.FlightTime:= GameTicks + 10000
+        if targ <> nil then Gear^.FlightTime:= GameTicks + 5000
         end;
     if targ <> nil then
         begin
@@ -1831,7 +1833,7 @@
         if (Gear^.Y < targ^.Y) and (Gear^.dY < _0_1)  then
              Gear^.dY:= Gear^.dY+trackSpeed
         else if (Gear^.Y > targ^.Y) and (Gear^.dY > -_0_1) then
-            Gear^.dY:= Gear^.dY-trackSpeed;
+            Gear^.dY:= Gear^.dY-trackSpeed
         end
     else Gear^.Hedgehog:= nil;
 
--- a/hedgewars/uGearsList.pas	Mon Jan 19 00:12:26 2015 +0300
+++ b/hedgewars/uGearsList.pas	Sun Jan 18 16:57:32 2015 -0500
@@ -365,7 +365,7 @@
                 gear^.nImpactSounds:= 1;
                 gear^.Health:= 30;
                 gear^.State:= gear^.State or gstMoving or gstNoGravity;
-                gear^.Radius:= 7;
+                gear^.Radius:= 8;
                 gear^.Elasticity:= _0_55;
                 gear^.Friction:= _0_995;
                 gear^.Density:= _1;
Binary file share/hedgewars/Data/Graphics/AirMine.png has changed