fix and optimize kamikaze's png
authorsheepluva
Thu, 15 Sep 2011 17:19:49 +0200
changeset 5913 1791f776b726
parent 5912 d31eba29e706
child 5914 3a161fa1dd5a
child 5915 31ac063f47cb
child 5916 c76212c34192
fix and optimize kamikaze's png
hedgewars/GSHandlers.inc
hedgewars/uVariables.pas
share/hedgewars/Data/Graphics/Hedgehog/amKamikaze.png
--- a/hedgewars/GSHandlers.inc	Thu Sep 15 10:11:38 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Thu Sep 15 17:19:49 2011 +0200
@@ -2785,8 +2785,11 @@
     i: LongWord;
     HHGear: PGear;
     sparkles: PVisualGear;
+    hasWishes: boolean;
 begin
     AllInactive := false;
+    hasWishes:= ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch));
+    if hasWishes then Gear^.AdvBounce:= 1;
 
     HHGear := Gear^.Hedgehog^.Gear;
     HHGear^.State := HHGear^.State or gstNoDamage;
@@ -2794,7 +2797,7 @@
 
     Gear^.X := HHGear^.X;
     Gear^.Y := HHGear^.Y;
-    if (GameTicks mod 2 = 0) and ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch)) then
+    if (GameTicks mod 2 = 0) and hasWishes then
         begin
         sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
         if sparkles <> nil then sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
@@ -2819,7 +2822,13 @@
     inc(upd);
     if upd > 3 then
     begin
-        if Gear^.Health < 1500 then Gear^.Pos := 2;
+        if Gear^.Health < 1500 then
+        begin
+            if Gear^.AdvBounce <> 0 then
+                Gear^.Pos := 3
+            else
+                Gear^.Pos := 2;
+        end;
 
         AmmoShove(Gear, 30, 40);
 
--- a/hedgewars/uVariables.pas	Thu Sep 15 10:11:38 2011 +0200
+++ b/hedgewars/uVariables.pas	Thu Sep 15 17:19:49 2011 +0200
@@ -402,7 +402,7 @@
             (FileName:  'TurnsLeft'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprTurnsLeft
             (FileName: 'amKamikaze'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 256; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprKamikaze
+            Width: 128; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprKamikaze
             (FileName:     'amWhip'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 128; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWhip
             (FileName:     'Kowtow'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
Binary file share/hedgewars/Data/Graphics/Hedgehog/amKamikaze.png has changed