# HG changeset patch # User Wuzzy # Date 1540561927 -7200 # Node ID 817dc8b67b0d312de0018512fafefbc1c17865da # Parent cde9920150c650bb1c2354ba11095d6b35d8929b Add ice beam idle sound diff -r cde9920150c6 -r 817dc8b67b0d hedgewars/uGearsHandlersMess.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; diff -r cde9920150c6 -r 817dc8b67b0d hedgewars/uGearsList.pas --- 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 diff -r cde9920150c6 -r 817dc8b67b0d hedgewars/uSound.pas --- 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 ); diff -r cde9920150c6 -r 817dc8b67b0d hedgewars/uTypes.pas --- 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