Since we are tweaking molotov. make the flame flickery and add a drowning frame
authornemo
Sun, 11 Sep 2011 21:30:42 -0400
changeset 5871 09daa06191d7
parent 5870 b9b9fb00c9dd
child 5872 454f246fe4c5
Since we are tweaking molotov. make the flame flickery and add a drowning frame
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
hedgewars/uGearsRender.pas
hedgewars/uVariables.pas
share/hedgewars/Data/Graphics/Molotov.png
--- a/hedgewars/GSHandlers.inc	Mon Sep 12 00:47:49 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Sun Sep 11 21:30:42 2011 -0400
@@ -512,6 +512,7 @@
     i, gX, gY: LongInt;
     dX, dY: hwFloat;
     Fire: PGear;
+    smoke: PVisualGear;
 begin
     AllInactive := false;
 
@@ -519,9 +520,12 @@
     CalcRotationDirAngle(Gear);
 
     // let's add some smoke depending on speed
-    i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120));
+    i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120))+random(10);
     if (GameTicks mod i) = 0 then
-        AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
+        begin
+        smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
+        if smoke <> nil then smoke^.Scale:= 0.75;
+        end;
 
     if (Gear^.State and gstCollision) <> 0 then
     begin
--- a/hedgewars/uGears.pas	Mon Sep 12 00:47:49 2011 +0200
+++ b/hedgewars/uGears.pas	Sun Sep 11 21:30:42 2011 -0400
@@ -1018,7 +1018,7 @@
 
     if (GameFlags and gfLowGravity) = 0 then
         begin
-        cGravity:= cMaxWindSpeed * 2;
+        cGravity:= cMaxWindSpeed / 100;
         cGravityf:= 0.00025 * 2
         end;
 
--- a/hedgewars/uGearsRender.pas	Mon Sep 12 00:47:49 2011 +0200
+++ b/hedgewars/uGearsRender.pas	Sun Sep 11 21:30:42 2011 -0400
@@ -886,7 +886,10 @@
           gtGrenade: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle);
       gtSnowball: DrawRotated(sprSnowball, x, y, 0, Gear^.DirAngle);
        gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle);
-       gtMolotov: DrawRotated(sprMolotov, x, y, 0, Gear^.DirAngle);
+                  
+       gtMolotov: if (Gear^.State and gstDrowning) = 0 then
+                       DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle)
+                  else DrawSprite(sprMolotov, x, y, 8);
 
        gtRCPlane: begin
                   if (Gear^.Tag = -1) then
--- a/hedgewars/uVariables.pas	Mon Sep 12 00:47:49 2011 +0200
+++ b/hedgewars/uVariables.pas	Sun Sep 11 21:30:42 2011 -0400
@@ -490,7 +490,7 @@
             (FileName:  'amMolotov'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),//sprHandMolotov
             (FileName:  'Molotov'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMolotov
+            Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMolotov
             (FileName: 'Smoke'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  22; Height: 22; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprSmoke
             (FileName: 'SmokeWhite'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
Binary file share/hedgewars/Data/Graphics/Molotov.png has changed