add ice beam sound
authornemo
Tue, 28 May 2013 21:30:02 -0400
changeset 9072 e7bcdf4f492f
parent 9071 df85fad2c7f7
child 9073 6cffcbef02e4
add ice beam sound
hedgewars/GSHandlers.inc
hedgewars/uSound.pas
hedgewars/uTypes.pas
share/hedgewars/Data/Sounds/ice_beam.ogg
--- a/hedgewars/GSHandlers.inc	Tue May 28 14:09:19 2013 -0400
+++ b/hedgewars/GSHandlers.inc	Tue May 28 21:30:02 2013 -0400
@@ -5092,9 +5092,16 @@
     end;
     if Gear^.Message and (gmUp or gmDown) <> 0 then
         begin
+        StopSoundChan(Gear^.SoundChannel);
+        Gear^.SoundChannel:= -1;
         if GameTicks mod 40 = 0 then dec(Gear^.Health)
         end
-    else if GameTicks mod 10 = 0 then dec(Gear^.Health);
+    else 
+        begin
+        if Gear^.SoundChannel = -1 then
+            Gear^.SoundChannel := LoopSound(sndIceBeam);
+        if GameTicks mod 10 = 0 then dec(Gear^.Health)
+        end
 end;
 
 
@@ -5135,6 +5142,7 @@
     HHGear := Gear^.Hedgehog^.Gear;
     if (Gear^.Message and gmAttack <> 0) or (Gear^.Health = 0) or (HHGear = nil) or (HHGear^.Damage <> 0) then
         begin
+        StopSoundChan(Gear^.SoundChannel);
         DeleteGear(Gear);
         AfterAttack;
         exit
--- a/hedgewars/uSound.pas	Tue May 28 14:09:19 2013 -0400
+++ b/hedgewars/uSound.pas	Tue May 28 21:30:02 2013 -0400
@@ -249,7 +249,8 @@
             (FileName:            'hogchant3.ogg'; Path: ptSounds),// sndResurrector
             (FileName:                'plane.ogg'; Path: ptSounds),// sndPlane
             (FileName:               'TARDIS.ogg'; Path: ptSounds),// sndTardis
-            (FileName:    'frozen_hog_impact.ogg'; Path: ptSounds) // sndFrozenHogImpact
+            (FileName:    'frozen_hog_impact.ogg'; Path: ptSounds),// sndFrozenHogImpact
+            (FileName:             'ice_beam.ogg'; Path: ptSounds) // sndIceBeam
             );
 
 
--- a/hedgewars/uTypes.pas	Tue May 28 14:09:19 2013 -0400
+++ b/hedgewars/uTypes.pas	Tue May 28 21:30:02 2013 -0400
@@ -140,7 +140,7 @@
             sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
             sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
             sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
-            sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis, sndFrozenHogImpact);
+            sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis, sndFrozenHogImpact, sndIceBeam);
 
     // Available ammo types to be used by hedgehogs
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
Binary file share/hedgewars/Data/Sounds/ice_beam.ogg has changed