Birdy's falling feathers
authormbait
Sun, 28 Mar 2010 23:10:33 +0000
changeset 3145 a9af6bf223cf
parent 3144 f1ba655a6941
child 3146 53ba22975536
Birdy's falling feathers
cmake_modules/FindLua.cmake
hedgewars/GSHandlers.inc
hedgewars/uConsts.pas
hedgewars/uVisualGears.pas
share/hedgewars/Data/Graphics/Feather.png
--- a/cmake_modules/FindLua.cmake	Sun Mar 28 23:05:33 2010 +0000
+++ b/cmake_modules/FindLua.cmake	Sun Mar 28 23:10:33 2010 +0000
@@ -10,7 +10,7 @@
 		#locate the system's lua library
 		FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
 		IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
-			UNSET(LUA_DEFAULT)
+			#UNSET(LUA_DEFAULT)
 			MESSAGE(FATAL_ERROR "Couldn't find Lua 5.1 library!")
 		ENDIF()
 		#remove the path (fpc doesn't like it - why?)
@@ -18,4 +18,4 @@
 	ENDIF(APPLE)
 ENDIF(WIN32)
 SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
-UNSET(LUA_DEFAULT)
+#UNSET(LUA_DEFAULT)
--- a/hedgewars/GSHandlers.inc	Sun Mar 28 23:05:33 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Mar 28 23:10:33 2010 +0000
@@ -2833,6 +2833,8 @@
 if Gear^.Health < 0 then Gear^.Health:= 0;
 if (GameTicks and $3F) = 0 then
        begin
+       if Gear^.Timer < 500 then
+         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFeather);
        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
        Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall)
        end;
--- a/hedgewars/uConsts.pas	Sun Mar 28 23:05:33 2010 +0000
+++ b/hedgewars/uConsts.pas	Sun Mar 28 23:10:33 2010 +0000
@@ -76,7 +76,8 @@
             sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
             sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
             sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
-            sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee);
+            sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee, 
+            sprFeather);
 
     TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag, // 3
             gtGrave, gtBee, gtShotgunShot, gtPickHammer, gtRope, // 8
@@ -93,7 +94,8 @@
     TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
             vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
             vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
-            vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg);
+            vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
+            vgtFeather);
 
     TGearsType = set of TGearType;
 
@@ -733,7 +735,9 @@
             (FileName:  'TargetBee'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false), // sprTargetBee
             (FileName:  'amBee'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width:  128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false) // sprHandBee
+            Width:  128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false), // sprHandBee
+            (FileName:  'Feather'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  8; Height: 8; imageWidth: 0; imageHeight: 0; saveSurf: false) // sprFeather
             );
 
     Wavez: array [TWave] of record
@@ -1843,4 +1847,4 @@
 
 end;
 
-end.
\ No newline at end of file
+end.
--- a/hedgewars/uVisualGears.pas	Sun Mar 28 23:05:33 2010 +0000
+++ b/hedgewars/uVisualGears.pas	Sun Mar 28 23:10:33 2010 +0000
@@ -344,6 +344,20 @@
     end;
 end;
 
+procedure doStepFeather(Gear: PVisualGear; Steps: Longword);
+begin
+Gear^.X:= Gear^.X + Gear^.dX * Steps;
+
+Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+Gear^.dY:= Gear^.dY + cGravity * Steps;
+
+Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle;
+
+if Gear^.FrameTicks <= Steps then
+    DeleteVisualGear(Gear)
+else
+    dec(Gear^.FrameTicks, Steps)
+end;
 ////////////////////////////////////////////////////////////////////////////////
 const cSorterWorkTime = 640;
 var thexchar: array[0..cMaxTeams] of
@@ -486,7 +500,8 @@
             @doStepDroplet,
             @doStepSmokeRing,
             @doStepBeeTrace,
-            @doStepEgg
+            @doStepEgg,
+            @doStepFeather
         );
 
 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
@@ -649,6 +664,16 @@
                 alpha:= 1;
                 angle:= random(360);
                 end;
+     vgtFeather: begin
+                t:= random(1024);
+                sp:= _0_001 * (random(85) + 95);
+                dx:= AngleSin(t) * sp;
+                dx.isNegative:= random(2) = 0;
+                dy:= AngleCos(t) * sp;
+                dy.isNegative:= random(2) = 0;
+                FrameTicks:= 650 + random(250);
+                Frame:= 1
+                end;
         end;
 
 if VisualGearsList <> nil then
@@ -789,6 +814,13 @@
                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
                             glColor4f(1, 1, 1, 1);
                             end;
+                 vgtFeather: begin
+                            if Gear^.FrameTicks < 250 then
+                                glColor4f(1, 1, 1, Gear^.FrameTicks / 250);
+                            DrawRotatedF(sprFeather, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                            if Gear^.FrameTicks < 250 then
+                                glColor4f(1, 1, 1, 1);
+                            end;
             end;
         case Gear^.Kind of
             vgtSmallDamageTag: DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
Binary file share/hedgewars/Data/Graphics/Feather.png has changed