Fix in-flight colouring of land spray, make it use tint when added to land too (lua might find that handy), tweak climbhome cake delay slightly
authornemo
Tue, 09 Dec 2014 22:56:34 -0500
changeset 10645 b8c73bacb31e
parent 10644 3b8290381fcb
child 10646 0be6442946b1
Fix in-flight colouring of land spray, make it use tint when added to land too (lua might find that handy), tweak climbhome cake delay slightly
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsList.pas
share/hedgewars/Data/Maps/ClimbHome/map.lua
--- a/hedgewars/uGearsHandlersMess.pas	Mon Dec 08 21:57:06 2014 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Dec 09 22:56:34 2014 -0500
@@ -882,7 +882,10 @@
                                 end
                             else Land[ly, lx]:= lf;
                         if gun then
-                            LandPixels[ry, rx]:= (ExplosionBorderColor and (not AMask)) or (p^[px] and AMask)
+                             LandPixels[ry, rx]:= (Gear^.Tint shr 24         shl RShift) or 
+                                                  (Gear^.Tint shr 16 and $FF shl GShift) or 
+                                                  (Gear^.Tint shr  8 and $FF shl BShift) or 
+                                                  (p^[px] and AMask)
                         else LandPixels[ry, rx]:= addBgColor(LandPixels[ry, rx], p^[px]);
                         end
                     else allpx:= false
--- a/hedgewars/uGearsList.pas	Mon Dec 08 21:57:06 2014 +0100
+++ b/hedgewars/uGearsList.pas	Tue Dec 09 22:56:34 2014 -0500
@@ -291,8 +291,13 @@
                         dy.isNegative:= false;
                         dy.QWordValue:= QWord($3AD3) * GetRandom(7000) * 8;
                         if GetRandom(2) = 0 then
-                            dx := -dx
-                        end;
+                            dx := -dx;
+                        Tint:= $FFFFFFFF
+                        end
+                    else
+                        Tint:= (ExplosionBorderColor shr RShift and $FF shl 24) or
+                               (ExplosionBorderColor shr GShift and $FF shl 16) or
+                               (ExplosionBorderColor shr BShift and $FF shl 8) or $FF;
                     State:= State or gstInvisible;
                     // use health field to store current frameticks
                     if vobFrameTicks > 0 then
@@ -301,10 +306,7 @@
                         Health:= 0;
                     // use timer to store currently displayed frame index
                     if gear^.Timer = 0 then Timer:= random(vobFramesCount);
-                    Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8;
-                    Tint:= ((ExplosionBorderColor and RMask) shl RShift) or
-                           ((ExplosionBorderColor and GMask) shl GShift) or
-                           ((ExplosionBorderColor and BMask) shl BShift) or $FF;
+                    Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8
                     end
                 end;
        gtGrave: begin
--- a/share/hedgewars/Data/Maps/ClimbHome/map.lua	Mon Dec 08 21:57:06 2014 +0100
+++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua	Tue Dec 09 22:56:34 2014 -0500
@@ -229,7 +229,7 @@
             Cake = nil
         end
 
-        if Cake ~= nil and GetHealth(Cake) < 999990 and gearIsInCircle(CurrentHedgehog,cx,cy,450) then
+        if Cake ~= nil and GetHealth(Cake) < 999980 and gearIsInCircle(CurrentHedgehog,cx,cy,450) then
             FireBoom(cx,cy,200) -- todo animate
             DeleteGear(Cake)
             Cake = nil