Give snorkel to air plane pilot in weSea
authorWuzzy <Wuzzy2@mail.ru>
Thu, 11 Jul 2019 22:31:29 +0200
changeset 15258 5c91c5191085
parent 15257 afda6c9711cf
child 15259 df5890e5a12a
Give snorkel to air plane pilot in weSea
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsRender.pas
share/hedgewars/Data/Graphics/Airplane.png
--- a/ChangeLog.txt	Thu Jul 11 21:23:57 2019 +0200
+++ b/ChangeLog.txt	Thu Jul 11 22:31:29 2019 +0200
@@ -109,7 +109,7 @@
  + Animate drill rockets
  + New idle shoryuken animation
  + Scatter molotov cocktail pieces
- + Add water effects for air plane
+ + Improve air plane effects when used with wrap or ocean world edge
  * Fix speech bubbles overlapping in the wrong order
  * Fix wrong ice beam angle if it goes diagonally up out of map through world wrap
  * Fix double water splash when flying saucer drowns
--- a/hedgewars/uGearsHandlersMess.pas	Thu Jul 11 21:23:57 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Jul 11 22:31:29 2019 +0200
@@ -3081,6 +3081,7 @@
 procedure doStepAirAttackWork(Gear: PGear);
 var uw, nuw: boolean;
     tmpFloat: hwFloat;
+    i: LongInt;
 begin
     AllInactive := false;
     if (WorldEdge = weWrap) then
@@ -3122,8 +3123,16 @@
     // Particles
     if (GameTicks and $3F) = 0 then
         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
-            AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
+            begin
+            // air plane bubbles
+            for i:=1 to 3 do
+                AddVisualGear(hwRound(Gear^.X) - 8 + Random(16), hwRound(Gear^.Y) - 8 + Random(16), vgtBubble);
+            // pilot's snorkel bubbles
+            if random(2) = 0 then
+                AddVisualGear(hwRound(Gear^.X) + 10, hwRound(Gear^.Y) - 50, vgtBubble);
+            end
         else
+            // smoke
             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
 
     // Get rid of gear and cleanup
--- a/hedgewars/uGearsRender.pas	Thu Jul 11 21:23:57 2019 +0200
+++ b/hedgewars/uGearsRender.pas	Thu Jul 11 22:31:29 2019 +0200
@@ -1526,6 +1526,10 @@
                     DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
                     untint;
                     DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
+                    if WorldEdge <> weSea then
+                        DrawSpriteRotatedF(sprAirplane, x, y, 2, Gear^.Tag, 0)
+                    else
+                        DrawSpriteRotatedF(sprAirplane, x, y, 3, Gear^.Tag, 0);
                     end;
          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
         gtTeleport: begin
Binary file share/hedgewars/Data/Graphics/Airplane.png has changed