Show symbols at bottom right while extra damage / low grav. are active
authorWuzzy <almikes@aol.com>
Tue, 15 Nov 2016 03:00:56 +0100
changeset 11892 083c12795632
parent 11891 b27d2351ec16
child 11893 618d99523933
Show symbols at bottom right while extra damage / low grav. are active PC version only. No change for touch interface.
ChangeLog.txt
hedgewars/uGears.pas
hedgewars/uGearsHedgehog.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
--- a/ChangeLog.txt	Tue Nov 15 02:30:35 2016 +0100
+++ b/ChangeLog.txt	Tue Nov 15 03:00:56 2016 +0100
@@ -14,8 +14,9 @@
  + Fort Mode will now work with more than 2 teams
  + Added "Forts" to map type selection. This makes the mode easier selectable/discoverable. Also the slider can be used to adjust the distance between forts.
  + Render graves behind everything else, so that they can't hide mines etc.
+ + Show indicator symbols at bottom right while extra damage or low gravity are active
  + Several new sound effects for weapons and utilities
- * Simplified hat format for unanimated hats; a single 32×32 image is enough. For clan hats, use size 64×32, with the color overlay at the right
+ + Simplified hat format for unanimated hats; a single 32×32 image is enough. For clan hats, use size 64×32, with the color overlay at the right
  + Small visual effects enhancements
  + Briefly show theme and music authors in chat at start of game
  * Fixed air-strikes drops being off-center
--- a/hedgewars/uGears.pas	Tue Nov 15 02:30:35 2016 +0100
+++ b/hedgewars/uGears.pas	Tue Nov 15 03:00:56 2016 +0100
@@ -505,7 +505,8 @@
     if (GameFlags and gfLowGravity) = 0 then
         begin
         cGravity:= cMaxWindSpeed * 2;
-        cGravityf:= 0.00025 * 2
+        cGravityf:= 0.00025 * 2;
+        cLowGravity:= false
         end;
 
     if (GameFlags and gfVampiric) = 0 then
@@ -696,7 +697,8 @@
 if (GameFlags and gfLowGravity) <> 0 then
     begin
     cGravity:= cMaxWindSpeed;
-    cGravityf:= 0.00025
+    cGravityf:= 0.00025;
+    cLowGravity:= true
     end;
 
 if (GameFlags and gfVampiric) <> 0 then
--- a/hedgewars/uGearsHedgehog.pas	Tue Nov 15 02:30:35 2016 +0100
+++ b/hedgewars/uGearsHedgehog.pas	Tue Nov 15 03:00:56 2016 +0100
@@ -378,7 +378,8 @@
                    amLowGravity: begin
                                  PlaySound(sndLowGravity);
                                  cGravity:= cMaxWindSpeed;
-                                 cGravityf:= 0.00025
+                                 cGravityf:= 0.00025;
+                                 cLowGravity := true
                                  end;
                   amExtraDamage: begin
                                  PlaySound(sndHellishImpact4);
--- a/hedgewars/uVariables.pas	Tue Nov 15 02:30:35 2016 +0100
+++ b/hedgewars/uVariables.pas	Tue Nov 15 03:00:56 2016 +0100
@@ -181,6 +181,7 @@
     cElastic        : hwFloat;
     cGravity        : hwFloat;
     cGravityf       : real;
+    cLowGravity     : boolean;
     cBuildMaxDist   : LongInt;
     cDamageModifier : hwFloat;
     cLaserSighting  : boolean;
@@ -2611,6 +2612,7 @@
     cElastic                := _0_9;
     cGravity                := cMaxWindSpeed * 2;
     cGravityf               := 0.00025 * 2;
+    cLowGravity             := false;
     cBuildMaxDist           := cDefaultBuildMaxDist;
     cDamageModifier         := _1;
     TargetPoint             := cTargetPointRef;
--- a/hedgewars/uWorld.pas	Tue Nov 15 02:30:35 2016 +0100
+++ b/hedgewars/uWorld.pas	Tue Nov 15 03:00:56 2016 +0100
@@ -1506,6 +1506,28 @@
         end
     end;
 
+{$IFNDEF USE_TOUCH_INTERFACE}
+// Indicators for global effects (extra damage, low gravity)
+// TODO: Add support for touch interface (need to find out correct offset)
+if UIDisplay <> uiNone then
+    begin
+    offsetX:= 45;
+    offsetY:= 51;
+
+    if cDamageModifier = _1_5 then
+        begin
+            DrawTextureF(ropeIconTex, 1, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, 0, 1, 32, 32);
+            DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.90, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, ord(amExtraDamage) - 1, 1, 32, 32);
+            offsetX := offsetX + 33
+        end;
+    if (cLowGravity) or ((GameFlags and gfLowGravity) <> 0) then
+        begin
+            DrawTextureF(ropeIconTex, 1, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, 0, 1, 32, 32);
+            DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.90, (cScreenWidth shr 1) - offsetX, cScreenHeight - offsetY, ord(amLowGravity) - 1, 1, 32, 32);
+        end;
+    end;
+{$ENDIF}
+
 // AmmoMenu
 if bShowAmmoMenu and ((AMState = AMHidden) or (AMState = AMHiding)) then
     begin