Add ice beam idle sound
authorWuzzy <Wuzzy2@mail.ru>
Fri, 26 Oct 2018 15:52:07 +0200
changeset 13989 817dc8b67b0d
parent 13988 cde9920150c6
child 13990 1670fc3957df
Add ice beam idle sound
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsList.pas
hedgewars/uSound.pas
hedgewars/uTypes.pas
--- a/hedgewars/uGearsHandlersMess.pas	Fri Oct 26 15:48:52 2018 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Oct 26 15:52:07 2018 +0200
@@ -6270,14 +6270,22 @@
     end;
     if Gear^.Message and (gmUp or gmDown) <> 0 then
         begin
-        StopSoundChan(Gear^.SoundChannel);
-        Gear^.SoundChannel:= -1;
+        if (Gear^.Tag <> 2) then
+            begin
+            StopSoundChan(Gear^.SoundChannel);
+            Gear^.SoundChannel:= LoopSound(sndIceBeamIdle);
+            Gear^.Tag:= 2;
+            end;
         if GameTicks mod 40 = 0 then dec(Gear^.Health)
         end
     else
         begin
-        if Gear^.SoundChannel = -1 then
-            Gear^.SoundChannel := LoopSound(sndIceBeam);
+        if (Gear^.Tag <> 1) then
+            begin
+            StopSoundChan(Gear^.SoundChannel);
+            Gear^.SoundChannel:= LoopSound(sndIceBeam);
+            Gear^.Tag:= 1;
+            end;
         if GameTicks mod 10 = 0 then dec(Gear^.Health)
         end
 end;
--- a/hedgewars/uGearsList.pas	Fri Oct 26 15:48:52 2018 +0200
+++ b/hedgewars/uGearsList.pas	Fri Oct 26 15:52:07 2018 +0200
@@ -733,6 +733,7 @@
                 gear^.Health:= 1000;
                 gear^.Radius:= 8;
                 gear^.Density:= _0;
+                gear^.Tag:= 0; // sound state: 0 = no sound, 1 = ice beam sound, 2 = idle sound
                 end;
      gtCreeper: begin
                 // TODO: Finish creeper initialization implementation
--- a/hedgewars/uSound.pas	Fri Oct 26 15:48:52 2018 +0200
+++ b/hedgewars/uSound.pas	Fri Oct 26 15:52:07 2018 +0200
@@ -298,7 +298,8 @@
             (FileName:              'custom7.ogg'; Path: ptSounds; AltPath: ptNone),// sndCustom7
             (FileName:              'custom8.ogg'; Path: ptSounds; AltPath: ptNone),// sndCustom8
             (FileName:              'minigun.ogg'; Path: ptSounds; AltPath: ptNone),// sndMinigun
-            (FileName:         'flamethrower.ogg'; Path: ptSounds; AltPath: ptNone) // sndFlamethrower
+            (FileName:         'flamethrower.ogg'; Path: ptSounds; AltPath: ptNone),// sndFlamethrower
+            (FileName:        'ice_beam_idle.ogg'; Path: ptSounds; AltPath: ptNone) // sndIceBeamIdle
             );
 
 
--- a/hedgewars/uTypes.pas	Fri Oct 26 15:48:52 2018 +0200
+++ b/hedgewars/uTypes.pas	Fri Oct 26 15:52:07 2018 +0200
@@ -151,7 +151,7 @@
             sndInvulnerable, sndJetpackLaunch, sndJetpackBoost, sndPortalShot, sndPortalSwitch,
             sndPortalOpen, sndBlowTorch, sndCountdown1, sndCountdown2, sndCountdown3, sndCountdown4,
             sndCreeperDrop, sndCreeperWater, sndCreeperDie, sndCustom1, sndCustom2, sndCustom3, sndCustom4,
-            sndCustom5, sndCustom6, sndCustom7, sndCustom8, sndMinigun, sndFlamethrower);
+            sndCustom5, sndCustom6, sndCustom7, sndCustom8, sndMinigun, sndFlamethrower, sndIceBeamIdle);
 
     // Available ammo types to be used by hedgehogs
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6