Engine:
authorsmxx
Sun, 28 Mar 2010 18:26:31 +0000
changeset 3139 a075f5344796
parent 3138 1798518e1d73
child 3140 749682ae8926
Engine: * Added muffled underwater sound and splashes for homing bee.
hedgewars/GSHandlers.inc
hedgewars/uConsts.pas
share/hedgewars/Data/Sounds/beewater.ogg
--- 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)));
--- a/hedgewars/uConsts.pas	Sun Mar 28 16:46:26 2010 +0000
+++ b/hedgewars/uConsts.pas	Sun Mar 28 18:26:31 2010 +0000
@@ -115,7 +115,7 @@
             sndSwitchHog, sndVictory, sndSniperReload, sndSteps, sndLowGravity,
             sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4,
             sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket,
-            sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle);
+            sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater);
 
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer,
             amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
@@ -843,7 +843,8 @@
             (FileName:          'PoisonCough.ogg'; Path: ptVoices),// sndPoisonCough
             (FileName:           'PoisonMoan.ogg'; Path: ptVoices),// sndPoisonMoan
             (FileName:             'BirdyLay.ogg'; Path: ptSounds),// sndBirdyLay
-            (FileName:              'Whistle.ogg'; Path: ptSounds) // sndWhistle
+            (FileName:              'Whistle.ogg'; Path: ptSounds),// sndWhistle
+            (FileName:             'beewater.ogg'; Path: ptSounds) // sndBeeWater
             );
 
     Ammoz: array [TAmmoType] of record
Binary file share/hedgewars/Data/Sounds/beewater.ogg has changed