Trying to improve rendering, sliding and thawing. Messing around w/ making fire thaw faster. icegun
authornemo
Sun, 24 Feb 2013 23:07:46 -0500
branchicegun
changeset 8563 4d9d8287e601
parent 8560 134a098235fa
child 8565 a431fa208a45
Trying to improve rendering, sliding and thawing. Messing around w/ making fire thaw faster.
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
hedgewars/uGearsHedgehog.pas
hedgewars/uGearsRender.pas
--- a/hedgewars/GSHandlers.inc	Sun Feb 24 21:44:40 2013 -0500
+++ b/hedgewars/GSHandlers.inc	Sun Feb 24 23:07:46 2013 -0500
@@ -2382,7 +2382,9 @@
 
         repeat
             CurrentTeam^.CurrHedgehog := Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber);
-        until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen]=0);
+        until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and 
+              (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0) and 
+              (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen]=0);
 
         SwitchCurrentHedgehog(@CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
         AmmoMenuInvalidated:= true; 
@@ -5074,6 +5076,7 @@
     X:= Hedgehog^.Gear^.X;
     Y:= Hedgehog^.Gear^.Y;
     //unfreeze all semifrozen hogs - make this generic hog cleanup
+(*
     iter := GearsList;
     while iter <> nil do
         begin
@@ -5082,6 +5085,7 @@
         iter^.Hedgehog^.Effects[heFrozen]:= 0;
         iter:= iter^.NextGear
         end 
+*)
   end;
 end;
 
@@ -5243,11 +5247,14 @@
                     begin
                         if hogs.ar^[i] <> HHGear then
                         begin
-                            if GameTicks mod 10 = 0 then 
+                            if GameTicks mod 5 = 0 then 
                             if hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] < 256 then
                                 hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] := hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] + 1
                             else if hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] = 256 then
+                                begin
                                 hogs.ar^[i]^.Hedgehog^.Effects[heFrozen]:= 100000;
+                                hogs.ar^[i]^.Active:= true
+                                end;
                         end;                        
                     end;
                 inc(Pos)
--- a/hedgewars/uGears.pas	Sun Feb 24 21:44:40 2013 -0500
+++ b/hedgewars/uGears.pas	Sun Feb 24 23:07:46 2013 -0500
@@ -765,6 +765,8 @@
     begin
     dec(i);
     Gear:= t^.ar[i];
+    if (Ammo^.Kind = gtFlame) and (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then
+        Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
     tmpDmg:= ModifyDamage(Damage, Gear);
     if (Gear^.State and gstNoDamage) = 0 then
         begin
@@ -779,6 +781,7 @@
         if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then
             Gear^.FlightTime:= 1;
 
+
         case Gear^.Kind of
             gtHedgehog,
             gtMine,
--- a/hedgewars/uGearsHedgehog.pas	Sun Feb 24 21:44:40 2013 -0500
+++ b/hedgewars/uGearsHedgehog.pas	Sun Feb 24 23:07:46 2013 -0500
@@ -695,7 +695,6 @@
 var PrevdX: LongInt;
     CurWeapon: PAmmo;
 begin
-if Gear^.Hedgehog^.Effects[heFrozen] > 0 then exit;
 CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^);
 if ((Gear^.State and (gstAttacking or gstMoving)) = 0) then
     begin
@@ -1204,7 +1203,7 @@
     if Gear^.Timer = 0 then
         begin
         Gear^.State:= Gear^.State and (not (gstWait or gstLoser or gstWinner or gstAttacked or gstNotKickable or gstHHChooseTarget));
-        Gear^.Active:= false;
+        if Gear^.Hedgehog^.Effects[heFrozen] = 0 then Gear^.Active:= false;
         AddGearCI(Gear);
         exit
         end
@@ -1228,7 +1227,13 @@
     DeleteGear(Gear);
     exit
     end;
-
+if Gear^.Hedgehog^.Effects[heFrozen] > 0 then 
+    begin
+    if Gear^.Hedgehog^.Effects[heFrozen] > 256 then
+        dec(Gear^.Hedgehog^.Effects[heFrozen])
+    else if GameTicks mod 10 = 0 then
+        dec(Gear^.Hedgehog^.Effects[heFrozen])
+    end;
 if (Gear^.State and gstHHDriven) = 0 then
     doStepHedgehogFree(Gear)
 else
--- a/hedgewars/uGearsRender.pas	Sun Feb 24 21:44:40 2013 -0500
+++ b/hedgewars/uGearsRender.pas	Sun Feb 24 23:07:46 2013 -0500
@@ -954,7 +954,7 @@
         r.w := 64;
         r.h := iceOffset;
         //DrawTextureFromRect(sx-32, sy-iceoffset+32, @r, SpritesData[sprFrozenHog].texture);
-        DrawTextureFromRectDir(sx-18, sy+48-iceoffset, r.w, r.h, @r, HHTexture, sign);
+        DrawTextureFromRectDir(sx-16+sign*2, sy+48-iceoffset, r.w, r.h, @r, HHTexture, sign);
 
         Tint($FF, $FF, $FF, $FF);
         end;