hedgewars/GSHandlers.inc
changeset 3139 a075f5344796
parent 3136 326a8cb7d9b7
child 3143 682bc7f99c63
--- a/hedgewars/GSHandlers.inc	Sun Mar 28 16:46:26 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Mar 28 18:26:31 2010 +0000
@@ -472,8 +472,31 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBeeWork(Gear: PGear);
 var t: hwFloat;
+    nuw: boolean;
+const uw: boolean = false;
 begin
 AllInactive:= false;
+nuw:= (cWaterLine < hwRound(Gear^.Y) + Gear^.Radius);
+if nuw and not uw then
+    begin
+    AddVisualGear(hwRound(Gear^.X), cWaterLine, vgtSplash);
+    AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), cWaterLine, vgtDroplet);
+    AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), cWaterLine, vgtDroplet);
+    AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), cWaterLine, vgtDroplet);
+    AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), cWaterLine, vgtDroplet);
+    StopSound(Gear^.SoundChannel);
+    Gear^.SoundChannel:= LoopSound(sndBeeWater);
+    uw:= nuw
+    end
+else if not nuw and uw then
+    begin
+    AddVisualGear(hwRound(Gear^.X), cWaterLine, vgtSplash);
+    StopSound(Gear^.SoundChannel);
+    Gear^.SoundChannel:= LoopSound(sndBee);
+    uw:= nuw
+    end;
+
+
 t:= Distance(Gear^.dX, Gear^.dY);
 Gear^.dX:= Gear^.Elasticity * (Gear^.dX + _0_000004 * (TargetPoint.X - hwRound(Gear^.X)));
 Gear^.dY:= Gear^.Elasticity * (Gear^.dY + _0_000004 * (TargetPoint.Y - hwRound(Gear^.Y)));