make the mine slippery too since it has the ice finish - add a gmDelete to the gear if you want it to *not* explode when hit ☺
authornemo
Sun, 27 May 2018 13:10:32 -0400
changeset 13410 4c813650fe17
parent 13409 8ce83caec236
child 13411 6a3f94fe2636
make the mine slippery too since it has the ice finish - add a gmDelete to the gear if you want it to *not* explode when hit ☺
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsRender.pas
hedgewars/uLandGraphics.pas
hedgewars/uVariables.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat May 26 10:54:17 2018 -0400
+++ b/hedgewars/uGearsHandlersMess.pas	Sun May 27 13:10:32 2018 -0400
@@ -6263,9 +6263,8 @@
                                 end
                             else if iter^.Kind = gtAirMine then
                                 begin
-                                AddCI(iter);
-                                iter^.Damage := 0;
-                                iter^.State:= iter^.State or gstFrozen
+								ForcePlaceOnLand(hwRound(iter^.X)-16, hwRound(iter^.Y)-16, sprFrozenAirMine, 0, lfIce, $FFFFFFFF, false, false, false);
+								iter^.State:= gstFrozen or gstInvisible;
                                 end
                             else // gtExplosives
                                 begin
@@ -6279,6 +6278,7 @@
                     // FillRoundInLandWithIce(Target.X, Target.Y, iceRadius);
                     SetAllHHToActive;
                     Timer := iceWaitCollision;
+					Power:= GameTicks
                     end;
 
                 if (Timer = iceCollideWithWater) and ((GameTicks - Power) > groundFreezingTime div 2) then
@@ -6338,13 +6338,17 @@
                 X:= HHGear^.X;
                 Y:= HHGear^.Y
                 end
-			else if CheckGearNear(Gear, gtAirMine, Gear^.Radius*2, Gear^.Radius*2) <> nil then
+			else
 				begin
-                Target.X:= gX;
-                Target.Y:= gY;
-                X:= HHGear^.X;
-                Y:= HHGear^.Y
-				end; 
+				iter:= CheckGearNear(Gear, gtAirMine, Gear^.Radius*2, Gear^.Radius*2);
+				if (iter <> nil) and (iter^.State <> gstFrozen) then
+					begin
+					Target.X:= gX;
+					Target.Y:= gY;
+					X:= HHGear^.X;
+					Y:= HHGear^.Y
+					end 
+				end;
             if (gX > max(LAND_WIDTH,4096)*2) or
                     (gX < -max(LAND_WIDTH,4096)) or
                     (gY < -max(LAND_HEIGHT,4096)) or
--- a/hedgewars/uGearsRender.pas	Sat May 26 10:54:17 2018 -0400
+++ b/hedgewars/uGearsRender.pas	Sun May 27 13:10:32 2018 -0400
@@ -1300,9 +1300,9 @@
                         untint
                         end
                     else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then  // mine is chasing a hog
-                         DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25) mod 16)
+                         DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25 + Gear^.Uid) mod 16)
                     else if Gear^.State and gstChooseTarget <> 0 then   // mine is seeking for hogs
-                         DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 125) mod 16)
+                         DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 125 + Gear^.Uid) mod 16)
                     else
                          DrawSprite(sprAirMine, x-16, y-16, 4);           // mine is active but not seeking
 
--- a/hedgewars/uLandGraphics.pas	Sat May 26 10:54:17 2018 -0400
+++ b/hedgewars/uLandGraphics.pas	Sun May 27 13:10:32 2018 -0400
@@ -795,9 +795,11 @@
                     begin
                     if (LandFlags and lfBasic <> 0) or 
                        ((LandPixels[gY, gX] and AMask shr AShift > 128) and  // This test assumes lfBasic and lfObject differ only graphically
-                         (LandFlags and lfObject = 0)) then
+                         (LandFlags and (lfObject or lfIce) = 0)) then
                          Land[cpY + y, cpX + x]:= lfBasic or LandFlags
-                    else Land[cpY + y, cpX + x]:= lfObject or LandFlags
+                    else if (LandFlags and lfIce = 0) then
+						 Land[cpY + y, cpX + x]:= lfObject or LandFlags
+					else Land[cpY + y, cpX + x]:= LandFlags
                     end;
                 if (not behind) or (LandPixels[gY, gX] = 0) then
                     begin
--- a/hedgewars/uVariables.pas	Sat May 26 10:54:17 2018 -0400
+++ b/hedgewars/uVariables.pas	Sun May 27 13:10:32 2018 -0400
@@ -762,7 +762,7 @@
             (FileName:       'custom8'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil;
             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: true; critical: true; checkSum: true; priority: tpLow; getDimensions: true; getImageDimensions: true), // sprCustom8
             (FileName:      'FrozenAirMine'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width:  32; Height: 32; imageWidth: 32; imageHeight: 32; saveSurf: false; critical: true; checkSum: false; priority: tpHighest; getDimensions: false; getImageDimensions: true), // sprFrozenAirMine
+            Width:  32; Height: 32; imageWidth: 32; imageHeight: 32; saveSurf: true; critical: true; checkSum: true; priority: tpHighest; getDimensions: false; getImageDimensions: true), // sprFrozenAirMine
             (FileName:      'AirMine'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpHighest; getDimensions: false; getImageDimensions: true), // sprAirMine
             (FileName:  'amAirMine'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;