hedgewars/GSHandlers.inc
changeset 987 0fcd3fadda41
parent 984 dd5f16f69926
child 992 c16355b0c982
--- a/hedgewars/GSHandlers.inc	Tue Jun 10 20:40:43 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Wed Jun 11 15:42:53 2008 +0000
@@ -1387,8 +1387,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepKamikazeWork(Gear: PGear);
 const upd: Longword = 0;
-var i, x, y: LongWord;
-    oX, oY: hwFloat;
+var i: LongWord;
     HHGear: PGear;
 begin
 AllInactive:= false;
@@ -1398,8 +1397,6 @@
 DeleteCI(HHGear);
 
 i:= 2;
-oX:= Gear^.X;
-oY:= Gear^.Y;
 repeat
 	Gear^.X:= Gear^.X + HHGear^.dX;
 	Gear^.Y:= Gear^.Y + HHGear^.dY;
@@ -1418,6 +1415,8 @@
 inc(upd);
 if upd > 3 then
 	begin
+	if Gear^.Health < 1500 then Gear^.Pos:= 2;
+	
 	AmmoShove(Gear, 30, 40);
 	
 	DrawTunnel(HHGear^.X - HHGear^.dX * 10,
@@ -1443,6 +1442,17 @@
 	end
 end;
 
+procedure doStepKamikazeIdle(Gear: PGear);
+begin
+AllInactive:= false;
+dec(Gear^.Timer);
+if Gear^.Timer = 0 then
+	begin
+	Gear^.Pos:= 1;
+	Gear^.doStep:= @doStepKamikazeWork
+	end
+end;
+
 procedure doStepKamikaze(Gear: PGear);
 var HHGear: PGear;
 begin
@@ -1456,6 +1466,8 @@
 Gear^.dX:= SignAs(_0_45, Gear^.dX);
 Gear^.dY:= - _0_9;
 
-Gear^.doStep:= @doStepKamikazeWork
+Gear^.Timer:= 550;
+
+Gear^.doStep:= @doStepKamikazeIdle
 end;