hedgewars/GSHandlers.inc
changeset 3149 08c4d9670b54
parent 3146 53ba22975536
child 3150 d212e612c08e
--- a/hedgewars/GSHandlers.inc	Sun Mar 28 23:21:07 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Mar 28 23:37:28 2010 +0000
@@ -2781,16 +2781,17 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
-procedure doStepBirdyVanish(Gear: PGear);
+procedure doStepBirdyDisappear(Gear: PGear);
 begin
+AllInactive:= false;
 Gear^.Pos:= 0;
-if Gear^.Timer < 500 then
+if Gear^.Timer < 2000 then
     inc(Gear^.Timer, 1)
 else
     begin
     DeleteGear(Gear);
-    AfterAttack
-    end
+    AfterAttack;
+    end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2873,7 +2874,23 @@
         Active:= true;
         State:= State or gstMoving
         end;
-    Gear^.doStep:= @doStepBirdyVanish;
+    if Gear^.Tag = -1 then
+        begin
+        Gear^.dX:= Gear^.X + int2hwFloat(LAND_WIDTH + 1024);
+        Gear^.dY:= int2hwFloat(256);
+        Gear^.X:= int2hwFloat(-LAND_WIDTH -1024);
+        Gear^.Y:= Gear^.Y + int2hwFloat(-256);
+        end
+    else
+        begin
+        Gear^.dX:= Gear^.X - int2hwFloat(LAND_WIDTH + 1024);
+        Gear^.dY:= int2hwFloat(256);
+        Gear^.X:= int2hwFloat(+LAND_WIDTH +1024);
+        Gear^.Y:= Gear^.Y + int2hwFloat(-256);
+        end;
+    Gear^.State:= Gear^.State or gstAnimation or gstTmpFlag;
+    Gear^.Timer:= 0;
+    Gear^.doStep:= @doStepBirdyDisappear;
     isCursorVisible:= false;
     end
 end;
@@ -2887,7 +2904,7 @@
     dec(Gear^.Timer, 1)
 else if CurrentHedgehog = nil then
     begin
-    Gear^.doStep:= @doStepBirdyVanish;
+    DeleteGear(Gear);
     exit
     end;
 HHGear:= CurrentHedgehog^.Gear;
@@ -2904,11 +2921,27 @@
     end
 end;
 
+procedure doStepBirdyAppear(Gear: PGear);
+begin
+Gear^.Pos:= 0;
+if Gear^.Timer < 2000 then
+    inc(Gear^.Timer, 1)
+else
+    begin
+    Gear^.Timer:= 500;
+    Gear^.dX:= _0;
+    Gear^.dY:= _0;
+    Gear^.State:=  Gear^.State and not gstAnimation;
+    Gear^.doStep:= @doStepBirdyDescend;
+    end
+end;
+
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBirdy(Gear: PGear);
 var HHGear: PGear;
 begin
-Gear^.doStep:= @doStepBirdyDescend;
+gear^.State:=  gear^.State or gstAnimation and not gstTmpFlag;
+Gear^.doStep:= @doStepBirdyAppear;
 if CurrentHedgehog = nil then
     begin
     DeleteGear(Gear);