Engine:
authorsmaxx
Tue, 03 Aug 2010 01:33:20 +0200
changeset 3713 f8778904600d
parent 3712 de2026031833
child 3714 c407f00d2851
Engine: * Added modifications to Limburger, Poison Cloud and Sticky Mine
hedgewars/GSHandlers.inc
hedgewars/GearDrawing.inc
hedgewars/uGears.pas
--- a/hedgewars/GSHandlers.inc	Tue Aug 03 00:36:36 2010 +0200
+++ b/hedgewars/GSHandlers.inc	Tue Aug 03 01:33:20 2010 +0200
@@ -1441,31 +1441,15 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
-procedure doStepSMine(Gear: PGear);
+procedure doStepSMine(Gear: PGear); forward;
+procedure doStepSMineSticked(Gear: PGear);
 begin
-    if (Gear^.State and gstMoving) <> 0 then
+    if (hwAbs(Gear^.dX) > _0) or (hwAbs(Gear^.dY) > _0) then // moving - "unstick" (better solution?)
     begin
-        if ((Gear^.State and gstCollision) <> 0) and (Gear^.dX < _0_2) and (Gear^.dY < _0_2) then
-        begin
-            Gear^.dX := _0;
-            Gear^.dY := _0
-            // TODO: calc attach dir
-        end
-        else
-            CalcRotationDirAngle(Gear);
-
-        DeleteCI(Gear);
-        doStepFallingGear(Gear);
-        if (Gear^.State and gstMoving) = 0 then
-            AddGearCI(Gear);
-        AllInactive := false
-    end
-    else
-    begin
-        if ((GameTicks and $3F) = 25) then
-            doStepFallingGear(Gear);
+        Gear^.doStep:= @doStepSMine;
+        Gear^.doStep(Gear);
+        exit;
     end;
-
     if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then
         if ((Gear^.State and gstAttacking) = 0) then
         begin
@@ -1489,6 +1473,27 @@
         if TurnTimeLeft = 0 then Gear^.State := Gear^.State or gsttmpFlag;
 end;
 
+procedure doStepSMine(Gear: PGear);
+begin
+    if ((Gear^.State and gstCollision) <> 0) and (Gear^.dX < _0_2) and (Gear^.dY < _0_2) then
+    begin
+        Gear^.dX:= _0;
+        Gear^.dY:= _0;
+        Gear^.doStep:= @doStepSMineSticked;
+        Gear^.doStep(Gear);
+        exit
+    end;
+    if (Gear^.State and gstMoving) <> 0 then
+    begin
+        DeleteCI(Gear);
+        doStepFallingGear(Gear);
+        if (Gear^.State and gstMoving) = 0 then
+            AddGearCI(Gear);
+    end;
+    CalcRotationDirAngle(Gear);
+    AllInactive := false
+end;
+
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepDynamite(Gear: PGear);
 begin
@@ -3879,9 +3884,9 @@
     dec(Gear^.Timer);
     Gear^.X:= Gear^.X + Gear^.dX;
     Gear^.Y:= Gear^.Y + Gear^.dY;
-    Gear^.dX := Gear^.dX + cWindSpeed / 2;
+    Gear^.dX := Gear^.dX + cWindSpeed / 4;
     Gear^.dY := Gear^.dY + cGravity / 100;
     if (GameTicks mod 250) = 0 then
-        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned);
+        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned);
     AllInactive:= false;
 end;
\ No newline at end of file
--- a/hedgewars/GearDrawing.inc	Tue Aug 03 00:36:36 2010 +0200
+++ b/hedgewars/GearDrawing.inc	Tue Aug 03 01:33:20 2010 +0200
@@ -801,14 +801,13 @@
                     DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 128, 128, 0);
                     end;
      gtPoisonCloud: begin
-                    Tint($00, $FF, $40, $80);
-                    if Gear^.Timer < 1000 then
-                        i:= Gear^.Timer
-                    else if Gear^.Timer > 4000 then
-                        i:= 5000 - Gear^.Timer
+                    if Gear^.Timer < 1020 then
+                        Tint($C0, $C0, $00, Gear^.Timer div 8)
+                    else if Gear^.Timer > 3980 then
+                        Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
                     else
-                        i:= 1000;
-                    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, i / 250, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
+                        Tint($C0, $C0, $00, $C0);
+                    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
                     Tint($FF, $FF, $FF, $FF)
                     end;
          end;
--- a/hedgewars/uGears.pas	Tue Aug 03 00:36:36 2010 +0200
+++ b/hedgewars/uGears.pas	Tue Aug 03 01:33:20 2010 +0200
@@ -520,6 +520,7 @@
                 end;
  gtPoisonCloud: begin
                 gear^.Timer:= 5000;
+                gear^.dY:= int2hwfloat((-4 + getRandom(8))) / 1000;
                 end;
      end;
 InsertGearToList(gear);