diff --git a/Readme.md b/Readme.md index 23915fe..ed4ab5a 100644 --- a/Readme.md +++ b/Readme.md @@ -73,7 +73,7 @@ This mod requires GZDoom 4.2.4 or later, and runs on top of Doom Tournament. ## In progress - - N/A, this is the 1.1 release. + - N/A, this is the 1.1.1 release. ## Planned diff --git a/cvarinfo.txt b/cvarinfo.txt index 3638c60..a58d736 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -79,7 +79,7 @@ server bool sting_msentry = true; // allows the new Minigun Sentry, which // is an original creation for this mod server bool sting_abonus = true; // allows the armor bonus pickup, which // is also original for this mod -server bool sting_dubious = true; // allows weapons of dubious origin +server bool sting_dubious = false; // allows weapons of dubious origin // (Demolisher, Razorclaw, Autocannon) server bool sting_autoscuba = true; // SCUBA gear toggles automatically // when needed @@ -94,7 +94,7 @@ server bool sting_flametspread = false; // targets on fire spread the flames // to anyone nearby (may be op) server bool sting_impself = false; // disable impaler beam self-hit user bool sting_zoomshader = true; // rifle scope shader -server bool sting_proto = true; // allow prototype content +server bool sting_proto = false; // allow prototype content server bool sting_allsuits = false; // allow the player to wear all three // types of suits simultaneously // (this is very unbalanced) diff --git a/language.txt b/language.txt index 0b65876..bd1e906 100644 --- a/language.txt +++ b/language.txt @@ -226,6 +226,7 @@ STING_UNREAL98 = "Unreal '98"; STING_UNREAL97 = "Unreal '97"; STING_UNREAL96 = "Unreal '96"; STING_UNREAL95 = "Unreal '95"; +STING_UNREAL95EXT = "Unreal '95 (Extended theme)"; STING_POPTS = "Prototype features"; STING_PROTO = "Enable prototype content"; STING_TELEHAND = "Teleport Capsules"; @@ -500,6 +501,7 @@ M_FFNOROOM = "No hay espacio para activar el Campo de Fuerza."; S_MINHUD = "Salud %d Puntuación %d Munición %d"; S_MINHUD2 = "Salud %d Puntuación %d Munición %d/%d"; /* Menus */ +STING_UNREAL95EXT = "Unreal '95 (Tema extendido)"; STING_MTITLE = "Opciones de Unreal"; STING_HOPTS = "Opciones de HUD"; STING_HUDMODE = "Modo de HUD"; diff --git a/menudef.txt b/menudef.txt index af1d420..ba9d707 100644 --- a/menudef.txt +++ b/menudef.txt @@ -4,6 +4,7 @@ OptionValue "IntroTypeMenu" 1, "$STING_UNREAL97" 2, "$STING_UNREAL96" 3, "$STING_UNREAL95" + 4, "$STING_UNREAL95EXT" } OptionMenu "UnrealOptionMenu" @@ -81,9 +82,9 @@ OptionMenu "UnrealCreditsMenu" StaticText "Epic Games, id Software, Bethesda Softworks" StaticText " " StaticText "$STING_CPATRON", "White" - StaticText "Aisamai, Alexa Jones-Gonzales, Jonas Höglund," - StaticText "Zard1084, Jonathan Nemo, NekoMithos, 3d0xp0xy" - StaticText "Xada Xephron, m8f, john" + StaticText "john, Alexa Jones-Gonzales, Jonas Höglund," + StaticText "Xada Xephron, Zard1084, Jonathan Nemo," + StaticText "NekoMithos, m8f, 3d0xp0xy" StaticText " " StaticText "$STING_CTHANK", "White" StaticText "KynikossDragonn, Raffine52, The Cutting Room Floor" diff --git a/music/Unreal_Extended.it b/music/Unreal_Extended.it new file mode 100644 index 0000000..316ac77 Binary files /dev/null and b/music/Unreal_Extended.it differ diff --git a/zscript.txt b/zscript.txt index 4b893bb..f3219b4 100644 --- a/zscript.txt +++ b/zscript.txt @@ -1,4 +1,4 @@ -version "4.2.4" +version "4.3" #include "zscript/unrealcommon.zsc" #include "zscript/dispersionpistol.zsc" diff --git a/zscript/asmd.zsc b/zscript/asmd.zsc index 0a5bc14..a0e5620 100644 --- a/zscript/asmd.zsc +++ b/zscript/asmd.zsc @@ -391,8 +391,8 @@ Class ASMDBall : Actor r.angle = atan2(HitNormal.y,HitNormal.x); r.pitch = asin(-HitNormal.z); r.scale *= 1.5; - A_PlaySound("asmd/hit",CHAN_VOICE); - A_PlaySound("asmd/ball",CHAN_WEAPON,pitch:FRandom[ASMD](0.5,1.5)); + A_StartSound("asmd/hit",CHAN_VOICE); + A_StartSound("asmd/ball",CHAN_WEAPON,pitch:FRandom[ASMD](0.5,1.5)); A_QuakeEx(4,4,4,30,0,200,"",QF_RELATIVE|QF_SCALEDOWN,falloff:70,rollIntensity:0.15); A_AlertMonsters(); int numpt = Random[ASMD](50,100); @@ -581,7 +581,7 @@ Class ASMDBeam : Actor let r = Spawn("ASMDBlastRing",b.pos); r.angle = atan2(t.Results.HitVector.y,t.Results.HitVector.x); r.pitch = asin(-t.Results.HitVector.z); - A_PlaySound("asmd/blast",CHAN_WEAPON,attenuation:0.5,pitch:0.6); + A_StartSound("asmd/blast",CHAN_WEAPON,attenuation:0.5,pitch:0.6); int numpt = Random[ASMD](200,300); for ( int i=0; i0)); @@ -559,7 +559,7 @@ Class Automag : UnrealWeapon c.pitch = pitch; c.vel = vel*.5+x*FRandom[Junk](-.5,.5)+y*FRandom[Junk](-.5,.5)-z*FRandom[Junk](1,2); } - AUTS A 0 A_PlaySound("automag/select",CHAN_WEAPON,!Dampener.Active(self)?1.:.1); + AUTS A 0 A_StartSound("automag/select",CHAN_WEAPON,CHANF_DEFAULT,!Dampener.Active(self)?1.:.1); Goto Ready; LeftReload: 2UTR A 0 @@ -571,7 +571,7 @@ Class Automag : UnrealWeapon } invoker.slaveclipout = true; A_Overlay(-9998,null); - A_PlaySound("automag/click",CHAN_6,!Dampener.Active(self)?1.:.1); + A_StartSound("automag/click",CHAN_LEFTWEAPONMISC,CHANF_DEFAULT,!Dampener.Active(self)?1.:.1); return ResolveState(null); } 2UTR ABCDEFGHIJKLMNOPQRSTUVWXY 1; @@ -583,7 +583,7 @@ Class Automag : UnrealWeapon invoker.slaveclipcount += aadd; if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) invoker.Ammo1.Amount -= aadd; - A_PlaySound("automag/reload",CHAN_6,!Dampener.Active(self)?1.:.1); + A_StartSound("automag/reload",CHAN_LEFTWEAPON,CHANF_DEFAULT,!Dampener.Active(self)?1.:.1); if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading(); invoker.slavereload = false; @@ -595,7 +595,7 @@ Class Automag : UnrealWeapon c.pitch = pitch; c.vel = vel*.5+x*FRandom[Junk](-.5,.5)+y*FRandom[Junk](-.5,.5)-z*FRandom[Junk](1,2); } - 2UTS A 0 A_PlaySound("automag/select",CHAN_6,!Dampener.Active(self)?1.:.1); + 2UTS A 0 A_StartSound("automag/select",CHAN_LEFTWEAPON,CHANF_DEFAULT,!Dampener.Active(self)?1.:.1); Goto LeftReady; Zoom: AUT2 A 1 diff --git a/zscript/betamag.zsc b/zscript/betamag.zsc index b223714..0863428 100644 --- a/zscript/betamag.zsc +++ b/zscript/betamag.zsc @@ -171,7 +171,7 @@ Class Betamag : UnrealWeapon player.setpsprite(2,ResolveState("LeftAltFire")); } } - private action bool TryWhip( double angle ) + private action bool TryWhip( double angle, bool slave = false ) { FTranslatedLineTarget t; double slope = AimLineAttack(angle,DEFMELEERANGE,t,0.,ALF_CHECK3D); @@ -194,16 +194,16 @@ Class Betamag : UnrealWeapon else if ( d.HitType == TRACE_HitWall ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation-d.HitDir*4); A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12); - A_PlaySound("betamag/hit",CHAN_WEAPON); + A_StartSound("betamag/hit",slave?CHAN_LEFTWEAPONMISC:CHAN_WEAPONMISC,CHANF_OVERLAP); A_AlertMonsters(); return true; } return false; } - action void A_BetamagWhip() + action void A_BetamagWhip( bool slave = false ) { invoker.FireEffect(); - for ( int i=0; i<16; i++ ) if ( TryWhip(angle+i*(45./16)) || TryWhip(angle-i*(45./16)) ) return; + for ( int i=0; i<16; i++ ) if ( TryWhip(angle+i*(45./16),slave) || TryWhip(angle-i*(45./16),slave) ) return; } action void A_BetamagFire( bool alt = false, bool slave = false ) { @@ -213,7 +213,7 @@ Class Betamag : UnrealWeapon if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(32,255,128,0),1); - A_PlaySound("betamag/fire",slave?CHAN_6:CHAN_WEAPON,!Dampener.Active(self)?1.:.2); + A_StartSound("betamag/fire",slave?CHAN_LEFTWEAPON:CHAN_WEAPON,CHANF_OVERLAP,!Dampener.Active(self)?1.:.2); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08); if ( slave ) @@ -389,7 +389,7 @@ Class Betamag : UnrealWeapon LeftReady: 2UTS A 0 { - A_PlaySound("betamag/select",CHAN_6,!Dampener.Active(self)?1.:.1); + A_StartSound("betamag/select",CHAN_LEFTWEAPON,CHANF_DEFAULT,!Dampener.Active(self)?1.:.1); invoker.slaveactive = true; } 2UTS ABCDEFGHIJK 2 A_JumpIf(invoker.slavedown,"LeftDeselect"); @@ -437,7 +437,7 @@ Class Betamag : UnrealWeapon } AUTF BCD 1; AUTF E 2; - AUTF F 0 A_PlaySound("betamag/slide",CHAN_ITEM,!Dampener.Active(self)?.3:.03); + AUTF F 0 A_StartSound("betamag/slide",CHAN_WEAPONMISC,CHANF_OVERLAP,!Dampener.Active(self)?.3:.03); AUTF FGHI 2; AUTF J 0 A_BetamagRefire("Hold"); AUTF J 2; @@ -454,7 +454,7 @@ Class Betamag : UnrealWeapon 2UTF A 1 A_BetamagFire(false,true); 2UTF BCD 1; 2UTF E 2; - 2UTF F 0 A_PlaySound("betamag/slide",CHAN_7,!Dampener.Active(self)?.3:.03); + 2UTF F 0 A_StartSound("betamag/slide",CHAN_LEFTWEAPONMISC,CHANF_OVERLAP,!Dampener.Active(self)?.3:.03); 2UTF FGHI 2; 2UTF J 0 A_BetamagRefire("LeftHold",true); 2UTF J 2; @@ -477,7 +477,7 @@ Class Betamag : UnrealWeapon AltHold: AUTA H 1 A_BetamagFire(true); AUTA I 1; - AUTA J 0 A_PlaySound("betamag/slide",CHAN_ITEM,!Dampener.Active(self)?.3:.03); + AUTA J 0 A_StartSound("betamag/slide",CHAN_WEAPONMISC,CHANF_OVERLAP,!Dampener.Active(self)?.3:.03); AUTA JKLM 1; AUTA N 0 A_BetamagRefire("AltHold"); AUTA NOPQ 2; @@ -491,7 +491,7 @@ Class Betamag : UnrealWeapon LeftAltHold: 2UTA H 1 A_BetamagFire(true,true); 2UTA I 1; - 2UTA J 0 A_PlaySound("betamag/slide",CHAN_7,!Dampener.Active(self)?.3:.03); + 2UTA J 0 A_StartSound("betamag/slide",CHAN_LEFTWEAPONMISC,CHANF_OVERLAP,!Dampener.Active(self)?.3:.03); 2UTA JKLM 1; 2UTA N 0 A_BetamagRefire("LeftAltHold",true); 2UTA NOPQ 2; @@ -508,7 +508,7 @@ Class Betamag : UnrealWeapon AUTW F 0 { if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); - A_PlaySound("betamag/whip",CHAN_ITEM); + A_StartSound("betamag/whip",CHAN_WEAPON,CHANF_OVERLAP); UTMainHandler.DoSwing(self,(FRandom[Betamag](-0.3,-0.2),FRandom[Betamag](-0.8,-0.5)),7,-1,8,SWING_Spring,2,0.5); } AUTW FGHIJ 2; @@ -540,7 +540,7 @@ Class Betamag : UnrealWeapon 2UTW F 0 { if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); - A_PlaySound("betamag/whip",CHAN_7); + A_StartSound("betamag/whip",CHAN_LEFTWEAPON,CHANF_OVERLAP); UTMainHandler.DoSwing(self,(FRandom[Betamag](0.2,0.3),FRandom[Betamag](-0.8,-0.5)),7,-1,8,SWING_Spring,2,0.5); } 2UTW FGHIJ 2; @@ -549,7 +549,7 @@ Class Betamag : UnrealWeapon UTMainHandler.DoSwing(self,(FRandom[Betamag](-0.3,-0.2),FRandom[Betamag](0.8,0.5)),3,0.5,6,SWING_Spring,3,3); } 2UTW KLM 1; - 2UTW N 0 A_BetamagWhip(); + 2UTW N 0 A_BetamagWhip(true); 2UTW NOPQR 1; 2UTW STUVWXYZ[\ 2; 2UTI A 0 A_JumpIf((invoker.Ammo1.Amount<=0)&&(player.cmd.buttons&(BT_ATTACK|BT_ALTATTACK))||(player.cmd.buttons&BT_RELOAD),"LeftReloadHold"); diff --git a/zscript/biggun.zsc b/zscript/biggun.zsc index fe09c57..d3c1908 100644 --- a/zscript/biggun.zsc +++ b/zscript/biggun.zsc @@ -128,7 +128,7 @@ Class BigBlast : Actor A_AlertMonsters(); A_Explode(50+special1,150); A_QuakeEx(4,4,4,10,0,300,"",QF_RELATIVE|QF_SCALEDOWN,falloff:150,rollintensity:0.2); - A_PlaySound("big/blast",CHAN_VOICE,pitch:FRandom[BigGun](0.8,1.2)); + A_StartSound("big/blast",CHAN_VOICE,pitch:FRandom[BigGun](0.8,1.2)); A_SprayDecal("RazorBlast",-172); UTMainHandler.DoBlast(self,150,80000); let r = Spawn("FatRing",pos); @@ -319,7 +319,7 @@ Class BigGun : UnrealWeapon if ( !weap ) return; if ( invoker.clipcount <= 0 ) return; invoker.clipcount--; - A_PlaySound("big/fire",CHAN_WEAPON); + A_StartSound("big/fire",CHAN_WEAPON,CHANF_OVERLAP); A_AlertMonsters(); A_Overlay(-2,"MuzzleFlash"); A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true); @@ -534,7 +534,7 @@ Class BigGun : UnrealWeapon BIGF AB 2; BIGF C 2 { - A_PlaySound("big/dry",CHAN_WEAPON,Dampener.Active(self)?.3:1.); + A_StartSound("big/dry",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.3:1.); if ( !Dampener.Active(self) ) A_AlertMonsters(); } BIGF LMNOP 2; @@ -552,7 +552,7 @@ Class BigGun : UnrealWeapon UTMainHandler.DoSwing(self,(FRandom[BigGun](0.3,0.4),FRandom[BigGun](0.6,0.8)),6,-1,3,SWING_Spring,2,3); invoker.clipout = true; A_QuakeEx(2,2,2,5,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollintensity:0.18); - A_PlaySound("big/punch",CHAN_WEAPON,Dampener.Active(self)?.3:1.); + A_StartSound("big/punch",CHAN_WEAPONMISC,CHANF_OVERLAP,Dampener.Active(self)?.3:1.); if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading(); } BIGR NOPQRSTUVW 2; @@ -577,7 +577,7 @@ Class BigGun : UnrealWeapon if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) invoker.Ammo1.Amount -= aadd; A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollintensity:0.12); - A_PlaySound("big/reload",CHAN_WEAPON,Dampener.Active(self)?.3:1.); + A_StartSound("big/reload",CHAN_WEAPONMISC,CHANF_OVERLAP,Dampener.Active(self)?.3:1.); if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading(); } BIR2 HIJKL 2; diff --git a/zscript/bonesaw.zsc b/zscript/bonesaw.zsc index 64acbb2..d7860d3 100644 --- a/zscript/bonesaw.zsc +++ b/zscript/bonesaw.zsc @@ -74,12 +74,12 @@ Class Bonesaw : UnrealWeapon A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12); if ( !d.HitActor || d.HitActor.bNOBLOOD ) { - A_PlaySound("ripper/hit",CHAN_6); + A_StartSound("ripper/hit",CHAN_WEAPON,CHANF_OVERLAP); let p = Spawn("SawImpact",d.HitLocation-d.HitDir*4); p.angle = atan2(d.HitDir.y,d.HitDir.x); p.pitch = asin(-d.HitDir.z); } - else A_PlaySound("ripper/flesh",CHAN_6); + else A_StartSound("ripper/flesh",CHAN_WEAPON,CHANF_OVERLAP); if ( invoker.bAltFire ) A_QuakeEx(3,3,3,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.13); else A_QuakeEx(1,1,1,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.06); return true; @@ -169,7 +169,7 @@ Class Bonesaw : UnrealWeapon #### # 2 { A_Overlay(-9999,"Null"); - A_PlaySound("bonesaw/spin",CHAN_WEAPON,Dampener.Active(self)?.1:1.,true); + A_StartSound("bonesaw/spin",CHAN_WEAPONMISC,CHANF_LOOPING,Dampener.Active(self)?.1:1.); invoker.special2 = 0; } CSWF ABCDEFGHIJKLMNO 1 @@ -185,7 +185,7 @@ Class Bonesaw : UnrealWeapon } Goto Hold; Hold: - CSWH A 0 A_SoundVolume(CHAN_WEAPON,Dampener.Active(self)?.1:1.); + CSWH A 0 A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); CSWH ABCDEFGHIJKLMNOPQR 1 { A_WeaponOffset(0+FRandom[Bonesaw](-0.1,0.1)*invoker.special2,32+FRandom[Bonesaw](-0.1,0.1)*invoker.special2,WOF_INTERPOLATE); @@ -194,7 +194,11 @@ Class Bonesaw : UnrealWeapon CSWH A 0 A_Refire("Hold"); Goto Release; Release: - CSWR A 0 A_PlaySound("bonesaw/spinend",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + CSWR A 0 + { + A_StopSound(CHAN_WEAPONMISC); + A_StartSound("bonesaw/spinend",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.1:1.); + } CSWR ABCDEFGHI 1 { A_WeaponOffset(0+FRandom[Bonesaw](-0.1,0.1)*invoker.special2,32+FRandom[Bonesaw](-0.1,0.1)*invoker.special2,WOF_INTERPOLATE); @@ -211,7 +215,7 @@ Class Bonesaw : UnrealWeapon #### # 1 { A_Overlay(-9999,"Null"); - A_PlaySound("bonesaw/claw",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_StartSound("bonesaw/claw",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.1:1.); UTMainHandler.DoSwing(self,(FRandom[Bonesaw](-0.1,0.1),FRandom[Bonesaw](-0.2,-0.3)),4,0.2,8,SWING_Spring,2,2.); } CSWA ABC 2; diff --git a/zscript/dispersionpistol.zsc b/zscript/dispersionpistol.zsc index 76dc1a4..2fa4bd4 100644 --- a/zscript/dispersionpistol.zsc +++ b/zscript/dispersionpistol.zsc @@ -353,7 +353,7 @@ Class DispersionAmmo : Actor override void PostBeginPlay() { Super.PostBeginPlay(); - A_PlaySound("dpistol/fly",CHAN_VOICE,.9,true,2.); + A_StartSound("dpistol/fly",CHAN_VOICE,CHANF_LOOPING,.9,2.); mult = max(1.,mult); } Default @@ -386,7 +386,7 @@ Class DispersionAmmo : Actor Death: TNT1 A 1 { - A_PlaySound("dpistol/hit",CHAN_VOICE); + A_StartSound("dpistol/hit",CHAN_VOICE); A_DispExpl(); } Stop; @@ -496,7 +496,7 @@ Class DispersionPistol : UnrealWeapon Weapon weap = Weapon(invoker); if ( !weap ) return; if ( weap.Ammo1.Amount <= 0 ) return; - A_PlaySound("dpistol/fire",CHAN_WEAPON,Dampener.Active(self)?.4:1.,pitch:1.2); + A_StartSound("dpistol/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.4:1.,pitch:1.2); double mult = Amplifier.GetMult(self,80); invoker.FireEffect(); Class proj, part; @@ -578,7 +578,8 @@ Class DispersionPistol : UnrealWeapon UTPlayer(self).PlayAttacking3(); DefaultAmmo(weap.Ammo1).rechargephase = (((weap.Ammo1.Amount>0)||!deathmatch)?0:30); DefaultAmmo(weap.Ammo1).rechargespeed = 1.1; - A_PlaySound("dpistol/altfire",CHAN_WEAPON,Dampener.Active(self)?.4:1.); + A_StopSound(CHAN_WEAPONMISC); + A_StartSound("dpistol/altfire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.4:1.); double mult = Amplifier.GetMult(self,int(invoker.ChargeSize*50)+50); invoker.FireEffect(); int ulevel = sting_dpistol?0:invoker.upgradelevel; @@ -675,6 +676,7 @@ Class DispersionPistol : UnrealWeapon DefaultAmmo(weap.Ammo1).rechargephase = 0; UTMainHandler.DoSwing(self,(FRandom[DPistol](-1,1),FRandom[DPistol](-1,1)),0.02*invoker.chargesize,0,2,SWING_Spring); A_WeaponOffset(FRandom[DPistol](-1,1)*1.2*invoker.chargesize,32+FRandom[DPistol](-1,1)*1.2*invoker.chargesize); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.4:1.); if ( !Dampener.Active(self) ) A_AlertMonsters(); invoker.chargesize += (2.-invoker.upgradelevel*0.15)/35.; invoker.count += 1./35.; @@ -838,7 +840,7 @@ Class DispersionPistol : UnrealWeapon // need to make sure player does the repeat fire anim if ( self is 'UPlayer' ) UPlayer(self).PlayAttacking(); - A_PlaySound("dpistol/charge",CHAN_WEAPON,Dampener.Active(self)?.4:1.); + A_StartSound("dpistol/charge",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.4:1.); A_Overlay(-9999,"Null"); if ( invoker.upgradelevel == 0 ) return ResolveState("AltFire1"); else if ( invoker.upgradelevel == 1 ) return ResolveState("AltFire2"); @@ -901,22 +903,22 @@ Class DispersionPistol : UnrealWeapon return ResolveState("Upgrade4"); } Upgrade1: - #### # 0 A_PlaySound("dpistol/up1",CHAN_6,Dampener.Active(self)?.2:1.); + #### # 0 A_StartSound("dpistol/up1",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.2:1.); DPU1 ABCD 9; DPI2 A 4 A_JumpIf(invoker.pendingupgrade>invoker.upgradelevel,"Upgrade"); Goto Idle; Upgrade2: - #### # 0 A_PlaySound("dpistol/up2",CHAN_6,Dampener.Active(self)?.2:1.); + #### # 0 A_StartSound("dpistol/up2",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.2:1.); DPU2 ABCDEFGHI 9; DPI3 A 4 A_JumpIf(invoker.pendingupgrade>invoker.upgradelevel,"Upgrade"); Goto Idle; Upgrade3: - #### # 0 A_PlaySound("dpistol/up3",CHAN_6,Dampener.Active(self)?.2:1.); + #### # 0 A_StartSound("dpistol/up3",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.2:1.); DPU3 ABCDEFGHI 9; DPI4 A 4 A_JumpIf(invoker.pendingupgrade>invoker.upgradelevel,"Upgrade"); Goto Idle; Upgrade4: - #### # 0 A_PlaySound("dpistol/up4",CHAN_6,Dampener.Active(self)?.2:1.); + #### # 0 A_StartSound("dpistol/up4",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.2:1.); DPU4 ABCDEFGHI 9; DPI5 A 4 A_JumpIf(invoker.pendingupgrade>invoker.upgradelevel,"Upgrade"); Goto Idle; diff --git a/zscript/flamegun.zsc b/zscript/flamegun.zsc index 98e080b..ad4e22a 100644 --- a/zscript/flamegun.zsc +++ b/zscript/flamegun.zsc @@ -77,7 +77,7 @@ Class UFireball : Actor let l = Spawn("UFireTrail",pos); l.target = self; Acceleration = vel.unit()*50; - A_PlaySound("eightball/fly",CHAN_VOICE,.6,true,3.,pitch:1.5); + A_StartSound("eightball/fly",CHAN_VOICE,CHANF_LOOPING,.6,3.,1.5); } action void A_Spread() { @@ -135,7 +135,7 @@ Class UFireball : Actor Spawn("UFireLight",pos); A_Explode(GetMissileDamage(0,0),60); UTMainHandler.DoBlast(self,60,9000); - A_PlaySound(DeathSound,CHAN_VOICE,attenuation:1.5,pitch:FRandom[ExploS](0.8,1.2)); + A_StartSound(DeathSound,CHAN_VOICE,attenuation:1.5,pitch:FRandom[ExploS](0.8,1.2)); } A_SprayDecal("SmallRocketBlast"); Scale *= FRandom[ExploS](0.6,0.9); @@ -205,7 +205,7 @@ Class UFireball2 : UFireball Super.PostBeginPlay(); Acceleration = vel.unit()*150; maxspeed = 50.; - A_PlaySound("eightball/fly",CHAN_VOICE,1.,true,1.5,pitch:.85); + A_StartSound("eightball/fly",CHAN_VOICE,CHANF_LOOPING,1.,1.5,.85); } action void A_FireballExplo2() { @@ -360,7 +360,7 @@ Class FlameGun : UnrealWeapon Weapon weap = Weapon(invoker); if ( !weap ) return; if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; - A_PlaySound(bAlt?"flamegun/alt":"flamegun/fire",CHAN_WEAPON,Dampener.Active(self)?.2:1.); + A_StartSound(bAlt?"flamegun/alt":"flamegun/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.2:1.); invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(32,96,255,0),1); if ( bAlt ) @@ -438,7 +438,7 @@ Class FlameGun : UnrealWeapon FGNI A 0 A_Jump(40,"Twiddle"); Goto Idle+1; Twiddle: - #### # 2 A_PlaySound("flamegun/idle",CHAN_6,Dampener.Active(self)?.1:1.); + #### # 2 A_StartSound("flamegun/idle",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.1:1.); FGNT ABCDEFGHIJKLM 3; Goto Idle+1; Fire: @@ -446,7 +446,7 @@ Class FlameGun : UnrealWeapon FGNF A 2 { invoker.special1 = 0; - A_PlaySound("flamegun/start",CHAN_6,Dampener.Active(self)?.1:1.); + A_StartSound("flamegun/start",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.1:1.); if ( !Dampener.Active(self) ) A_AlertMonsters(); } Hold: @@ -468,20 +468,20 @@ Class FlameGun : UnrealWeapon FGNT A 0 { invoker.special1 = 0; - A_PlaySound("flamegun/end",CHAN_6,Dampener.Active(self)?.1:1.); + A_StartSound("flamegun/end",CHAN_WEAPONMISC,CHANF_OVERLAP,Dampener.Active(self)?.1:1.); A_ClearRefire(); } FGNT ABCDEFGHIJKLM 2; Goto Idle; Refire: - FGNF H 2 A_PlaySound("flamegun/start",CHAN_6,Dampener.Active(self)?.1:1.); + FGNF H 2 A_StartSound("flamegun/start",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.1:1.); Goto Hold; AltFire: #### # 1 A_Overlay(-9999,"Null"); FGNF A 1 { invoker.special1 = 0; - A_PlaySound("flamegun/charge",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_StartSound("flamegun/charge",CHAN_WEAPONMISC,CHANF_DEFAULT,Dampener.Active(self)?.1:1.); if ( !Dampener.Active(self) ) A_AlertMonsters(); } FGNF A 1 diff --git a/zscript/gatling.zsc b/zscript/gatling.zsc index 3aff990..56dbf26 100644 --- a/zscript/gatling.zsc +++ b/zscript/gatling.zsc @@ -73,7 +73,7 @@ Class SMiniShell : FastProjectile A_NoGravity(); A_Explode(200,120,XF_HURTSOURCE|XF_EXPLICITDAMAGETYPE,damagetype:'exploded'); A_QuakeEx(4,4,4,10,0,250,"",QF_RELATIVE|QF_SCALEDOWN,falloff:120,rollintensity:0.2); - A_PlaySound("smini/explode",CHAN_VOICE,pitch:FRandom[SMini](0.8,1.2)); + A_StartSound("smini/explode",CHAN_VOICE,pitch:FRandom[SMini](0.8,1.2)); A_SprayDecal("SmallRocketBlast"); UTMainHandler.DoBlast(self,120,20000); Scale *= FRandom[ExploS](1.4,1.8); @@ -168,7 +168,7 @@ Class SMiniGun : UnrealWeapon invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(32,255,255,0),1); A_QuakeEx(2,2,2,bAlt?5:3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollintensity:0.12); - A_PlaySound(bAlt?"smini/altfire":"smini/fire",CHAN_WEAPON); + A_StartSound(bAlt?"smini/altfire":"smini/fire",CHAN_WEAPON,CHANF_OVERLAP); A_AlertMonsters(); if ( bAlt ) { @@ -332,7 +332,7 @@ Class SMiniGun : UnrealWeapon SMII A 0 { A_ClearRefire(); - A_PlaySound("smini/endfire",CHAN_ITEM); + A_StartSound("smini/endfire",CHAN_WEAPONMISC); A_Overlay(2,"Steam"); A_OverlayFlags(2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE|PSPF_ALPHA|PSPF_FORCEALPHA,true); A_OverlayRenderstyle(2,STYLE_Add); diff --git a/zscript/impaler.zsc b/zscript/impaler.zsc index 4dd7dc6..d282183 100644 --- a/zscript/impaler.zsc +++ b/zscript/impaler.zsc @@ -302,7 +302,7 @@ Class ImpalerBolt : Actor Super.PostBeginPlay(); t = new("ImpalerBoltTracer"); if ( !(GetClass() is 'StarterImpalerBolt') ) - A_PlaySound("impaler/beam",CHAN_BODY,.2,true,2.,pitch:.75); + A_StartSound("impaler/beam",CHAN_BODY,CHANF_LOOPING,.2,2.,.75); } void CheckBeam( Vector3 x ) { @@ -592,7 +592,7 @@ Class ImpalerProjectile : Actor override void PostBeginPlay() { Super.PostBeginPlay(); - A_PlaySound("impaler/fly",CHAN_BODY,1.,true,2.); + A_StartSound("impaler/fly",CHAN_BODY,CHANF_LOOPING,1.,2.); } action void A_ImpalerHit() { @@ -605,7 +605,7 @@ Class ImpalerProjectile : Actor A_Explode(50+special1/2,80+special1/5); UTMainHandler.DoBlast(self,80+special1/5,40000); A_QuakeEx(2,2,2,5,0,150+special1/5,"",QF_RELATIVE|QF_SCALEDOWN,falloff:80+special1/2,rollintensity:0.2); - A_PlaySound("impaler/hit",CHAN_VOICE); + A_StartSound("impaler/hit",CHAN_VOICE); A_SprayDecal("ShockMark",20); let l = Spawn("ImpalerBurstLight",pos); l.Args[3] += special1/5; @@ -786,7 +786,8 @@ Class Impaler : UnrealWeapon A_Overlay(-9999,"Null"); A_Overlay(-3,"Null"); A_Overlay(-2,"Null"); - A_PlaySound("impaler/fire",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_StopSound(CHAN_WEAPONMISC); + A_StartSound("impaler/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.1:1.); invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(16,224,64,255),1); UTMainHandler.DoSwing(self,(FRandom[Impaler](-0.1,-0.2),FRandom[Impaler](-0.1,0.1)),4,-1.5,2,SWING_Spring,2,2); @@ -872,7 +873,7 @@ Class Impaler : UnrealWeapon } action void A_StopBeam() { - A_StopSound(CHAN_WEAPON); + A_StopSound(CHAN_WEAPONMISC); if ( invoker.beam ) invoker.beam.Destroy(); } override void OwnerDied() @@ -919,12 +920,12 @@ Class Impaler : UnrealWeapon A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12); if ( !d.HitActor || d.HitActor.bNOBLOOD ) { - A_PlaySound("impaler/wall",CHAN_WEAPON); + A_StartSound("impaler/wall",CHAN_WEAPONMISC,CHANF_OVERLAP); let p = Spawn("SawImpact",d.HitLocation-d.HitDir*4); p.angle = atan2(d.HitDir.y,d.HitDir.x); p.pitch = asin(-d.HitDir.z); } - else A_PlaySound("impaler/flesh",CHAN_WEAPON); + else A_StartSound("impaler/flesh",CHAN_WEAPONMISC,CHANF_OVERLAP); A_AlertMonsters(); A_QuakeEx(1,1,1,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.06); return true; @@ -940,6 +941,7 @@ Class Impaler : UnrealWeapon override void DoEffect() { Super.DoEffect(); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(Owner)?.4:1.); if ( (Ammo1.Amount <= 0) && (ClipCount <= 0) ) SelectionOrder = 6600; else SelectionOrder = default.SelectionOrder; if ( Owner.player.ReadyWeapon != self ) return; @@ -1011,7 +1013,7 @@ Class Impaler : UnrealWeapon IMPM A 2 { A_Overlay(-9999,"Null"); - A_PlaySound("impaler/stab",CHAN_WEAPON); + A_StartSound("impaler/stab",CHAN_WEAPON,CHANF_OVERLAP); } IMPM BC 2; IMPM D 2 A_Stab(); @@ -1041,7 +1043,7 @@ Class Impaler : UnrealWeapon IMPA ABCDEFGH 2; IMPA I 0 { - A_PlaySound("impaler/altfire",CHAN_WEAPON,looping:true); + A_StartSound("impaler/altfire",CHAN_WEAPONMISC,CHANF_LOOPING); A_StartBeam(); invoker.special1 = 0; } @@ -1060,7 +1062,7 @@ Class Impaler : UnrealWeapon player.SetPSprite(-3,invoker.FindState("GemAltRelease")); player.SetPSprite(-2,invoker.FindState("ZapAltRelease")); A_StopBeam(); - A_PlaySound("impaler/altend",CHAN_WEAPON,looping:true); + A_StartSound("impaler/altend",CHAN_WEAPONMISC,CHANF_LOOPING); } IMPA QRSTUVWX 2; Goto Idle; @@ -1081,13 +1083,13 @@ Class Impaler : UnrealWeapon A_Overlay(-2,"ZapUp"); A_OverlayFlags(-2,PSPF_RenderStyle|PSPF_ForceStyle|PSPF_Alpha|PSPF_ForceAlpha,true); A_OverlayRenderStyle(-2,STYLE_Add); - A_PlaySound("impaler/gem",CHAN_WEAPON,looping:true); + A_StartSound("impaler/gem",CHAN_WEAPONMISC,CHANF_LOOPING); } else { player.SetPSprite(-3,invoker.FindState("GemDown")); player.SetPSprite(-2,invoker.FindState("ZapDown")); - A_PlaySound("impaler/gemdown",CHAN_WEAPON); + A_StartSound("impaler/gemdown",CHAN_WEAPONMISC); } if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading(); } @@ -1101,7 +1103,7 @@ Class Impaler : UnrealWeapon invoker.HasGem = false; player.SetPSprite(-3,invoker.FindState("GemDown")); player.SetPSprite(-2,invoker.FindState("ZapDown")); - A_PlaySound("impaler/gemdown",CHAN_WEAPON); + A_StartSound("impaler/gemdown",CHAN_WEAPONMISC); } IMPG ABCDE 2; Goto FullDeselect; diff --git a/zscript/miscitems.zsc b/zscript/miscitems.zsc index 424556e..680339f 100644 --- a/zscript/miscitems.zsc +++ b/zscript/miscitems.zsc @@ -118,7 +118,7 @@ Class TranslatorEvent : Actor { if ( special2 ) Console.Printf(StringTable.Localize("$TR_MSG")); else Console.Printf(StringTable.Localize("$TR_NEWMSG")); - S_Sound("translator/event",CHAN_VOICE|CHAN_UI); + S_StartSound("translator/event",CHAN_VOICE,CHANF_UI); } Translator.AddMessage(user_message,user_hint); if ( special2 ) Translator.bNotNewMessage = true; @@ -273,7 +273,7 @@ Class VoiceBoxActive : Actor "automag/shot" }; if ( invoker.b ) invoker.b.A_AlertMonsters(0,AMF_TARGETEMITTER); - for ( int i=0; i<10; i++ ) if ( !Random[Voicebox](0,30) ) A_PlaySound(BattleSounds[i],CHAN_AUTO,FRandom[Voicebox](0.5,1.0)); + for ( int i=0; i<10; i++ ) if ( !Random[Voicebox](0,30) ) A_StartSound(BattleSounds[i],CHAN_VOICE,CHANF_OVERLAP,FRandom[Voicebox](0.5,1.0)); } override void Tick() { @@ -314,7 +314,7 @@ Class VoiceBoxActive : Actor VBOX A 30 { invoker.anglevel *= 0; - A_PlaySound("voice/activate"); + A_StartSound("voice/activate"); } VBOX ABCDEFGHIJ 1 { @@ -327,7 +327,7 @@ Class VoiceBoxActive : Actor VBOX A 0 { if ( invoker.b ) invoker.b.Destroy(); - A_PlaySound("flare/explode",CHAN_VOICE); + A_StartSound("flare/explode",CHAN_VOICE); A_NoGravity(); A_Stop(); A_SetRenderStyle(1.,STYLE_Add); @@ -481,8 +481,8 @@ Class FlareThrown : Actor } if ( !b ) { - A_PlaySound("flare/on"); - A_PlaySound("flare/loop",CHAN_VOICE,.5,true); + A_StartSound("flare/on"); + A_StartSound("flare/loop",CHAN_VOICE,CHANF_LOOPING,.5); tracer = Spawn("FlareThrownX",pos); tracer.angle = angle; tracer.pitch = pitch; @@ -534,7 +534,7 @@ Class FlareThrown : Actor return ResolveState("Fizz"); } A_StopSound(CHAN_VOICE); - A_PlaySound("flare/explode"); + A_StartSound("flare/explode"); A_Explode(50,50); A_NoGravity(); A_Stop(); @@ -797,8 +797,8 @@ Class BetaFlareThrown : Actor } if ( !b ) { - A_PlaySound("flare/on"); - A_PlaySound("flare/loop",CHAN_VOICE,.5,true); + A_StartSound("flare/on"); + A_StartSound("flare/loop",CHAN_VOICE,CHANF_LOOPING,.5); b = Spawn("FlareHitbox",pos); b.master = self; } @@ -847,7 +847,7 @@ Class BetaFlareThrown : Actor if ( waterlevel > 0 ) return ResolveState("Fizz"); A_RemoveLight('PLight'); A_StopSound(CHAN_VOICE); - A_PlaySound("flare/explode"); + A_StartSound("flare/explode"); A_Explode(50,50); A_NoGravity(); A_Stop(); @@ -980,7 +980,7 @@ Class Dampener : UnrealInventory { if ( pickup ) return false; bActive = !bActive; - Owner.A_PlaySound(bActive?"dampener/on":"dampener/off",CHAN_ITEM); + Owner.A_StartSound(bActive?"dampener/on":"dampener/off",CHAN_ITEM); return false; } override void DoEffect() @@ -989,7 +989,7 @@ Class Dampener : UnrealInventory if ( !bActive ) return; if ( DrainCharge(1) ) { - Owner.A_PlaySound("dampener/off",CHAN_ITEM); + Owner.A_StartSound("dampener/off",CHAN_ITEM); if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_DAMPENER")); if ( Amount <= 0 ) DepleteOrDestroy(); } @@ -1127,14 +1127,14 @@ Class ForcefieldEffect : Actor } override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle ) { - A_PlaySound("ffield/hit",CHAN_BODY); + A_StartSound("ffield/hit",flags:CHANF_OVERLAP); return Super.DamageMobj(inflictor,source,damage,mod,flags,angle); } override void PostBeginPlay() { Super.PostBeginPlay(); - A_PlaySound("ffield/on",CHAN_ITEM); - A_PlaySound("ffield/active",CHAN_VOICE,0.6,true); + A_StartSound("ffield/on",CHAN_ITEM); + A_StartSound("ffield/active",CHAN_VOICE,CHANF_LOOPING,.6); let tracer = Spawn("ForceFieldLight",pos); tracer.target = self; lct = 24; @@ -1149,7 +1149,7 @@ Class ForcefieldEffect : Actor A_UnsetShootable(); A_UnsetSolid(); } - FFLD A 1 Bright A_PlaySound("ffield/hit",CHAN_VOICE); + FFLD A 1 Bright A_StartSound("ffield/hit",CHAN_VOICE); Stop; } } @@ -1243,7 +1243,7 @@ Class UFlashlight : UnrealInventory { if ( pickup ) return false; bActive = !bActive; - Owner.A_PlaySound(bActive?"lite/pickup":"lite/off",CHAN_ITEM); + Owner.A_StartSound(bActive?"lite/pickup":"lite/off",CHAN_ITEM); if ( bActive ) { if ( !lt[0] ) lt[0] = UFlashLight1(Spawn("UFlashLight1",owner.pos)); @@ -1267,7 +1267,7 @@ Class UFlashlight : UnrealInventory if ( !bActive ) return; if ( DrainCharge(1) ) { - Owner.A_PlaySound("lite/off",CHAN_ITEM); + Owner.A_StartSound("lite/off",CHAN_ITEM); if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_FLASHLIGHT")); if ( Amount <= 0 ) DepleteOrDestroy(); else @@ -1326,7 +1326,7 @@ Class USearchlight : UFlashlight if ( !bActive ) return; if ( DrainCharge(1) ) { - Owner.A_PlaySound("lite/off",CHAN_ITEM); + Owner.A_StartSound("lite/off",CHAN_ITEM); if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_SEARCHLIGHT")); if ( Amount <= 0 ) DepleteOrDestroy(); else @@ -1668,7 +1668,7 @@ Class MinigunSentry : Actor if ( (special1 <= 0) && master.master && master.master.CheckLocalView() ) Console.Printf(StringTable.Localize("$M_SENTRYDRY")); A_SentryFaceTarget(); master.A_AlertMonsters(0,AMF_TARGETEMITTER); - A_PlaySound("sentry/fire",CHAN_WEAPON); + A_StartSound("sentry/fire",CHAN_WEAPON,CHANF_OVERLAP); Vector3 x, y, z, origin; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); origin = level.Vec3Offset(pos,x*24+z*8); @@ -1724,7 +1724,7 @@ Class MinigunSentry : Actor SENT A 15; SENT A 0 { - A_PlaySound("sentry/raise"); + A_StartSound("sentry/raise"); if ( master ) master.A_AlertMonsters(0,AMF_TARGETEMITTER); } SENR ABCDEFGHIJKLMNO 3; @@ -1732,7 +1732,7 @@ Class MinigunSentry : Actor Idle: SENI A 0 { - A_PlaySound("sentry/move",CHAN_BODY,0.4,true,pitch:0.8); + A_StartSound("sentry/move",flags:CHANF_LOOPING,.4,pitch:.8); if ( specialf1 > 0 ) specialf1 = -maxangle; else specialf1 = maxangle; special2 = 0; @@ -1745,7 +1745,7 @@ Class MinigunSentry : Actor } Wait; IdleStop: - SENI A 0 A_PlaySound("sentry/movestop",CHAN_BODY,0.4,pitch:0.8); + SENI A 0 A_StartSound("sentry/movestop",volume:.4,pitch:.8); SENI A 1 { A_LookEx(LOF_NOSOUNDCHECK|LOF_NOJUMP); @@ -1754,7 +1754,7 @@ Class MinigunSentry : Actor } Wait; See: - SENI A 0 A_PlaySound("sentry/movestop",CHAN_BODY,0.4,pitch:0.8); + SENI A 0 A_StartSound("sentry/movestop",volume:.4,pitch:.8); SENI A 1 { if ( !TargetVisible() ) @@ -1770,7 +1770,7 @@ Class MinigunSentry : Actor Missile: SENW A 0 { - A_PlaySound("sentry/wind",looping:true); + A_StartSound("sentry/wind",flags:CHANF_LOOPING); if ( master ) { master.A_AlertMonsters(0,AMF_TARGETEMITTER); @@ -1812,7 +1812,7 @@ Class MinigunSentry : Actor { A_LookEx(LOF_NOSOUNDCHECK|LOF_NOJUMP); if ( TargetVisible() && (special1>0) ) return ResolveState("MissileLoop"); - A_PlaySound("sentry/unwind"); + A_StartSound("sentry/unwind"); if ( master ) master.SetStateLabel("MissileEnd"); return ResolveState(null); } @@ -1824,7 +1824,7 @@ Class MinigunSentry : Actor Wait; SENI A 0 { - A_PlaySound("sentry/raise"); + A_StartSound("sentry/raise"); if ( master ) { master.A_AlertMonsters(0,AMF_TARGETEMITTER); @@ -1903,7 +1903,7 @@ Class SentryFragment : Actor pitchvel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1); rollvel = FRandom[Junk](10,30)*RandomPick[Junk](-1,1); vel = (vel.unit()+(FRandom[Junk](-.2,.2),FRandom[Junk](-.2,.2),FRandom[Junk](-.2,.2))).unit()*vel.length(); - A_PlaySound("vfrag/bounce",CHAN_BODY,min(1.,vel.length()*0.1),pitch:FRandom[Junk](0.6,1.4)); + A_StartSound("vfrag/bounce",volume:min(1.,vel.length()*0.1),pitch:FRandom[Junk](0.6,1.4)); } Goto Spawn; Death: @@ -1944,7 +1944,7 @@ Class SentryBoom : Actor { Super.PostBeginPlay(); A_Explode(80,250); - A_PlaySound("sentry/explode"); + A_StartSound("sentry/explode"); UTMainHandler.DoBlast(self,250,70000); double ang, pt; for ( int i=0; i<16; i++ ) @@ -2102,7 +2102,7 @@ Class MinigunSentryBase : Actor } let amo = user.FindInventory("UMiniAmmo"); if ( !amo || (amo.Amount <= 0) || (tracer.special1 >= sentryammo) ) return false; - A_PlaySound("misc/i_pkup",CHAN_ITEM); + A_StartSound("misc/i_pkup",CHAN_ITEM); int xammo = min(sentryammo-tracer.special1,amo.Amount); special1 = tracer.special1 += xammo; amo.Amount -= xammo; @@ -2409,7 +2409,7 @@ Class SentryGun : Actor return; } A_AlertMonsters(0,AMF_TARGETEMITTER); - A_PlaySound("sentry/fire",CHAN_WEAPON,pitch:1.6); + A_StartSound("sentry/fire",CHAN_WEAPON,CHANF_OVERLAP,pitch:1.6); Vector3 x, y, z, origin; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); origin = level.Vec3Offset(pos,x*12+z*16); @@ -2471,7 +2471,7 @@ Class SentryGun : Actor StartUp: SENR A 0 { - A_PlaySound("sentry/raise",pitch:1.6); + A_StartSound("sentry/raise",pitch:1.6); A_AlertMonsters(0,AMF_TARGETEMITTER); } SENR ABCDE 4; @@ -2482,7 +2482,7 @@ Class SentryGun : Actor WindUp: SENW A 0 { - A_PlaySound("sentry/wind",looping:true,pitch:1.6); + A_StartSound("sentry/wind",flags:CHANF_LOOPING,pitch:1.6); A_AlertMonsters(0,AMF_TARGETEMITTER); } SENW ABCDEFGHIJKLMN 1; @@ -2502,11 +2502,11 @@ Class SentryGun : Actor SENU A 0; // tweening hack Loop; Unwind: - SENU A 0 A_PlaySound("sentry/unwind",pitch:1.6); + SENU A 0 A_StartSound("sentry/unwind",pitch:1.6); SENU ABCDEFGHIJKLMN 1; Goto Idle; ShutDown: - SEND A 0 A_PlaySound("sentry/raise",pitch:1.6); + SEND A 0 A_StartSound("sentry/raise",pitch:1.6); SEND ABCDE 4; SEND E 20; SEND E -1 A_Die(); @@ -2515,7 +2515,7 @@ Class SentryGun : Actor TNT1 A 0 { A_StopSound(CHAN_BODY); - A_PlaySound("flare/explode",CHAN_VOICE); + A_StartSound("flare/explode",CHAN_VOICE); A_NoGravity(); A_Stop(); A_SetRenderStyle(1.,STYLE_Add); diff --git a/zscript/napalm.zsc b/zscript/napalm.zsc index 9d36fd3..66346e7 100644 --- a/zscript/napalm.zsc +++ b/zscript/napalm.zsc @@ -656,7 +656,7 @@ Class UNapalm : Actor if ( waterlevel > 0 ) hittype = HIT_FLOOR; else hittype = HIT_WALL; } - A_PlaySound("napalm/hit",CHAN_BODY,min(1.,scale.x)); + A_StartSound("napalm/hit",volume:min(1.,scale.x)); } action void A_DropDrip() { @@ -833,16 +833,9 @@ Class UFlamethrower : UnrealWeapon } override void DetachFromOwner() { - Owner.A_StopSound(CHAN_6); - A_PlaySound("flamet/down",CHAN_6); + A_StartSound("flamet/down",CHAN_WEAPONMISC); Super.DetachFromOwner(); } - override void OwnerDied() - { - if ( Owner.player && (Owner.player.ReadyWeapon == self) ) - Owner.A_StopSound(CHAN_6); - Super.OwnerDied(); - } override void DoEffect() { Super.DoEffect(); @@ -907,7 +900,7 @@ Class UFlamethrower : UnrealWeapon weap.DepleteAmmo(weap.bAltFire,true,1); invoker.count = 0; invoker.special1 = 0; - A_PlaySound("flamet/fire",CHAN_WEAPON,Dampener.Active(self)?.1:1.,true); + A_StartSound("flamet/fire",CHAN_WEAPON,CHANF_LOOPING,Dampener.Active(self)?.1:1.); A_Overlay(-9999,"Dummy2"); } action void A_BeginCharge() @@ -915,7 +908,7 @@ Class UFlamethrower : UnrealWeapon let weap = Weapon(invoker); weap.DepleteAmmo(weap.bAltFire,true,1); invoker.count = invoker.chargesize = 0; - A_PlaySound("flamet/charge",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_StartSound("flamet/charge",CHAN_WEAPON,volume:Dampener.Active(self)?.1:1.); A_Overlay(-9999,"Dummy3"); } action void A_ChargeUp() @@ -956,7 +949,7 @@ Class UFlamethrower : UnrealWeapon A_WeaponOffset(0,32); A_OverlayOffset(-2,0,0); invoker.bCharging = false; - A_PlaySound("flamet/altfire",CHAN_WEAPON,Dampener.Active(self)?.1:1.,pitch:max(.5,1.2-invoker.chargesize/10.)); + A_StartSound("flamet/altfire",CHAN_WEAPON,volume:Dampener.Active(self)?.1:1.,pitch:max(.5,1.2-invoker.chargesize/10.)); if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); A_QuakeEx(1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),5+int(1.2*invoker.chargesize),0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05+0.01*invoker.chargesize); Vector3 x, y, z; @@ -1009,7 +1002,7 @@ Class UFlamethrower : UnrealWeapon FLMS ABCDEF 2 A_WeaponReady(WRF_NOFIRE); FLMS G 0 { - A_PlaySound("flamet/idle",CHAN_6,Dampener.Active(self)?.1:1.,true); + A_StartSound("flamet/idle",CHAN_WEAPONMISC,CHANF_LOOPING,Dampener.Active(self)?.1:1.); A_Overlay(-2,"FlameReady"); A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE|PSPF_ALPHA|PSPF_FORCEALPHA,true); A_OverlayRenderStyle(-2,STYLE_Add); @@ -1025,17 +1018,17 @@ Class UFlamethrower : UnrealWeapon Wait; Idle: FLMI A 0 A_Overlay(-9999,"Dummy"); - FLMI ABCDEFG 12 A_SoundVolume(CHAN_6,Dampener.Active(self)?.1:1.); + FLMI ABCDEFG 12 A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); FLMI A 0 A_Jump(20,"Twiddle"); Goto Idle+1; Twiddle: #### # 2 { - A_SoundVolume(CHAN_6,Dampener.Active(self)?.1:1.); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); player.SetPSprite(-2,ResolveState("FlameTwiddle")); } - FLMT ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 2 A_SoundVolume(CHAN_6,Dampener.Active(self)?.1:1.); - FLT2 ABCDEF 2 A_SoundVolume(CHAN_6,Dampener.Active(self)?.1:1.); + FLMT ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] 2 A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); + FLT2 ABCDEF 2 A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); Goto Idle+1; Fire: #### # 2 @@ -1053,7 +1046,7 @@ Class UFlamethrower : UnrealWeapon FLMF FGHIJK 2 { A_SoundVolume(CHAN_WEAPON,Dampener.Active(self)?.1:1.); - A_SoundVolume(CHAN_6,Dampener.Active(self)?.02:.2); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.02:.2); } Loop; Release: @@ -1061,8 +1054,8 @@ Class UFlamethrower : UnrealWeapon { A_Overlay(-9999,"Null"); player.SetPSprite(-2,ResolveState("FlameRelease")); - A_PlaySound("flamet/fireend",CHAN_WEAPON,Dampener.Active(self)?.1:1.); - A_SoundVolume(CHAN_6,Dampener.Active(self)?.1:1.); + A_StartSound("flamet/fireend",CHAN_WEAPON,volume:Dampener.Active(self)?.1:1.); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); A_ClearRefire(); } FLMF MNOP 2; @@ -1111,7 +1104,7 @@ Class UFlamethrower : UnrealWeapon #### # 1 { A_Overlay(-9999,"Null"); - A_PlaySound("flamet/down",CHAN_6,Dampener.Active(self)?.1:1.); + A_StartSound("flamet/down",CHAN_WEAPONMISC,volume:Dampener.Active(self)?.1:1.); player.SetPSprite(-2,ResolveState("FlameDeselect")); } FLMD ABCDEFHIJ 1; diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc index bb1615e..7ec5572 100644 --- a/zscript/olsmp.zsc +++ b/zscript/olsmp.zsc @@ -118,14 +118,14 @@ Class OLSMP : UnrealWeapon } override void PlayUpSound( Actor origin ) { - origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.,pitch:0.8); + origin.A_StartSound(upsound,CHAN_WEAPON,volume:Dampener.Active(origin)?.1:1.,pitch:0.8); } action void A_OLSMPRefire( statelabel flash = null, bool slave = false ) { Weapon weap = Weapon(invoker); if ( !weap || !player ) return; if ( invoker.altaccuracy < 0.2 ) invoker.altaccuracy += 0.01; - if ( invoker.clipcount < 35 ) A_PlaySound("automag/click",CHAN_ITEM,!Dampener.Active(self)?1.:.35,pitch:1.6); + if ( invoker.clipcount < 35 ) A_StartSound("automag/click",CHAN_WEAPONMISC,CHANF_OVERLAP,!Dampener.Active(self)?1.:.35,pitch:1.6); if ( invoker.clipcount <= 0 ) { A_ClearRefire(); @@ -141,7 +141,7 @@ Class OLSMP : UnrealWeapon invoker.clipcount--; invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(32,255,128,0),1); - A_PlaySound("automag/fire",CHAN_WEAPON,!Dampener.Active(self)?1.:.2,pitch:FRandom[Automag](1.2,1.8)*(alt?2.5:1.)); + A_StartSound("automag/fire",CHAN_WEAPON,CHANF_OVERLAP,!Dampener.Active(self)?1.:.2,pitch:FRandom[Automag](1.2,1.8)*(alt?2.5:1.)); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(1,1,1,8,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.15); A_Overlay(-2,"MuzzleFlash"); @@ -338,7 +338,7 @@ Class OLSMP : UnrealWeapon invoker.clipout = true; A_Overlay(-9999,null); A_WeaponOffset(0,32); // fix sudden psprite lowering - A_PlaySound("automag/click",CHAN_ITEM,!Dampener.Active(self)?1.:.1,pitch:0.8); + A_StartSound("automag/click",CHAN_WEAPONMISC,volume:!Dampener.Active(self)?1.:.1,pitch:0.8); } AUTR ABCDEFGHIJKLMNOPQRSTUVWXY 1; AUTD ABCD 1; @@ -349,7 +349,7 @@ Class OLSMP : UnrealWeapon invoker.clipcount += aadd; if ( !sv_infiniteammo && !FindInventory('PowerInfiniteAmmo',true) ) invoker.Ammo1.Amount -= aadd; - A_PlaySound("automag/reload",CHAN_WEAPON,!Dampener.Active(self)?1.:.1,pitch:0.8); + A_StartSound("automag/reload",CHAN_WEAPONMISC,volume:!Dampener.Active(self)?1.:.1,pitch:0.8); if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading(); Vector3 x, y, z, origin; @@ -360,7 +360,7 @@ Class OLSMP : UnrealWeapon c.pitch = pitch; c.vel = vel*.5+x*FRandom[Junk](-.5,.5)+y*FRandom[Junk](-.5,.5)-z*FRandom[Junk](1,2); } - AUTS A 0 A_PlaySound("automag/select",CHAN_WEAPON,!Dampener.Active(self)?1.:.1,pitch:0.8); + AUTS A 0 A_StartSound("automag/select",CHAN_WEAPON,volume:!Dampener.Active(self)?1.:.1,pitch:0.8); Goto Ready; Deselect: AUTD A 1 A_Overlay(-9999,null); diff --git a/zscript/peacemaker.zsc b/zscript/peacemaker.zsc index a2df9bb..5437082 100644 --- a/zscript/peacemaker.zsc +++ b/zscript/peacemaker.zsc @@ -95,7 +95,7 @@ Class PeaceRocket : Actor Super.PostBeginPlay(); let l = Spawn("PeaceTrail",pos); l.target = self; - A_PlaySound("peace/fly",CHAN_VOICE,1.0,true,2.5,pitch:0.8); + A_StartSound("peace/fly",CHAN_VOICE,CHANF_LOOPING,1.,2.5,.8); Acceleration = vel*1.67; } action void A_CheckForTargets() @@ -128,7 +128,7 @@ Class PeaceRocket : Actor UTMainHandler.DoBlast(self,200,70000); A_Explode(100,200); A_QuakeEx(3,3,3,8,0,250,"",QF_RELATIVE|QF_SCALEDOWN,falloff:200,rollIntensity:0.2); - A_PlaySound("eightball/explode",CHAN_VOICE); + A_StartSound("eightball/explode",CHAN_VOICE); A_AlertMonsters(); Spawn("RocketExplLight",pos); int numpt = Random[Peace](15,30); @@ -230,7 +230,7 @@ Class PeaceBarrel : Actor } action void A_FireRocket( int n ) { - A_PlaySound("uflak/altfire",CHAN_AUTO); + A_StartSound("uflak/altfire",CHAN_WEAPON,CHANF_OVERLAP); A_AlertMonsters(); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); @@ -274,8 +274,8 @@ Class PeaceBarrel : Actor A_NoGravity(); A_SetScale(bAMBUSH?1.8:1.2); A_Explode(bAMBUSH?500:125,bAMBUSH?200:100); - A_PlaySound("sentry/explode",CHAN_BODY,pitch:0.6); - A_PlaySound("eightball/explode",CHAN_VOICE,pitch:0.8); + A_StartSound("sentry/explode",CHAN_VOICE,CHANF_OVERLAP,pitch:.6); + A_StartSound("eightball/explode",CHAN_VOICE,CHANF_OVERLAP,pitch:.8); A_AlertMonsters(); A_QuakeEx(4,4,4,10,0,400,"",QF_RELATIVE|QF_SCALEDOWN,falloff:300,rollIntensity:0.2); UTMainHandler.DoBlast(self,bAMBUSH?200:100,50000); @@ -356,42 +356,42 @@ Class PeaceBarrel : Actor PEMM A 4 A_AlignSelf(); PEMM A 35 { - A_PlaySound((special1<=0)?"eightball/seeklost":"eightball/seeklock",CHAN_AUTO); + A_StartSound((special1<=0)?"eightball/seeklost":"eightball/seeklock",CHAN_VOICE,CHANF_OVERLAP); A_AlertMonsters(); return A_JumpIf(--special1<0,1); } Wait; PEMM A 0 A_JumpIf(bAMBUSH,"Detonate"); - PEMM A 3 A_PlaySound("peace/open",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); + PEMM A 3 A_StartSound("peace/open",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); PEMM B 3; - PEMM C 3 A_PlaySound("peace/open",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); - PEMM D 3 A_PlaySound("transloc/bounce",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); - PEMM E 3 A_PlaySound("peace/open",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); + PEMM C 3 A_StartSound("peace/open",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); + PEMM D 3 A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); + PEMM E 3 A_StartSound("peace/open",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); PEMM F 3 { - A_PlaySound("transloc/bounce",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); - A_PlaySound("transloc/bounce",CHAN_AUTO,.5,pitch:FRandom[Peace](0.8,1.2)); + A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); + A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.5,pitch:FRandom[Peace](0.8,1.2)); } - PEMM G 3 A_PlaySound("peace/open",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); + PEMM G 3 A_StartSound("peace/open",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); PEMM H 3 { - A_PlaySound("transloc/bounce",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); - A_PlaySound("transloc/bounce",CHAN_AUTO,.5,pitch:FRandom[Peace](0.8,1.2)); + A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); + A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.5,pitch:FRandom[Peace](0.8,1.2)); } PEMM I 3; PEMM J 3 { - A_PlaySound("transloc/bounce",CHAN_AUTO,.8,pitch:FRandom[Peace](0.8,1.2)); - A_PlaySound("transloc/bounce",CHAN_AUTO,.5,pitch:FRandom[Peace](0.8,1.2)); + A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.8,pitch:FRandom[Peace](0.8,1.2)); + A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.5,pitch:FRandom[Peace](0.8,1.2)); } - PEMM K 3 A_PlaySound("eightball/rotate",CHAN_AUTO,.1); - PEMM L 3 A_PlaySound("transloc/bounce",CHAN_AUTO,.5,pitch:FRandom[Peace](0.8,1.2)); + PEMM K 3 A_StartSound("eightball/rotate",CHAN_BODY,CHANF_OVERLAP,.1); + PEMM L 3 A_StartSound("transloc/bounce",CHAN_BODY,CHANF_OVERLAP,.5,pitch:FRandom[Peace](0.8,1.2)); PEMM M 3; - PEMM N 3 A_PlaySound("eightball/rotate",CHAN_AUTO,.1); + PEMM N 3 A_StartSound("eightball/rotate",CHAN_BODY,CHANF_OVERLAP,.1); PEMM OPQ 3; - PEMM R 3 A_PlaySound("eightball/rotate",CHAN_AUTO,.1); + PEMM R 3 A_StartSound("eightball/rotate",CHAN_BODY,CHANF_OVERLAP,.1); PEMM STU 3; - PEMM V 3 A_PlaySound("eightball/rotate",CHAN_AUTO,.1); + PEMM V 3 A_StartSound("eightball/rotate",CHAN_BODY,CHANF_OVERLAP,.1); PEMM XYZ[\] 3; PEMM ] 35; PEMM ] 0 A_FireRocket(0); @@ -431,7 +431,7 @@ Class Peacemaker : UnrealWeapon if ( weap.Ammo1.Amount <= 0 ) return; if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; invoker.FireEffect(); - A_PlaySound("peace/throw",CHAN_WEAPON); + A_StartSound("peace/throw",CHAN_WEAPON); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*5-z*3); @@ -453,7 +453,7 @@ Class Peacemaker : UnrealWeapon action void A_StartCount() { invoker.special1 = invoker.special2 = 0; - A_PlaySound("peace/set",CHAN_ITEM,.4); + A_StartSound("peace/set",CHAN_WEAPONMISC,CHANF_OVERLAP,.4); } action void A_CountUp( Statelabel next ) { @@ -463,7 +463,7 @@ Class Peacemaker : UnrealWeapon invoker.special2++; if ( invoker.special2 <= 9 ) { - A_PlaySound("peace/set",CHAN_ITEM,.4); + A_StartSound("peace/set",CHAN_WEAPONMISC,CHANF_OVERLAP,.4); player.FindPSprite(PSP_WEAPON).frame = invoker.special2; } invoker.special1 = 0; @@ -501,7 +501,7 @@ Class Peacemaker : UnrealWeapon Wait; Ready: PEMS ABCDEFGHIJ 2 A_WeaponReady(WRF_NOFIRE); - PEMS K 0 A_PlaySound("peace/up",CHAN_ITEM,.4); + PEMS K 0 A_StartSound("peace/up",CHAN_WEAPONMISC,volume:.4); PEMS KLMNOPQRST 2 A_WeaponReady(WRF_NOFIRE); Idle: PEMI A 1 @@ -528,7 +528,7 @@ Class Peacemaker : UnrealWeapon PEMF ABCD 2; PEMF E 0 { - A_PlaySound("peace/down",CHAN_ITEM,.4); + A_StartSound("peace/down",CHAN_WEAPONMISC,volume:.4); UTMainHandler.DoSwing(self,(FRandom[Peace](-0.1,-0.04),FRandom[Peace](0.4,0.6)),3,0,7,SWING_Spring,3,0.8); } PEMF EFG 2; @@ -546,7 +546,7 @@ Class Peacemaker : UnrealWeapon PEMF ABCD 2; PEMF E 0 { - A_PlaySound("peace/down",CHAN_ITEM,.4); + A_StartSound("peace/down",CHAN_WEAPONMISC,volume:.4); UTMainHandler.DoSwing(self,(FRandom[Peace](-0.1,-0.04),FRandom[Peace](0.4,0.6)),3,0,7,SWING_Spring,3,0.8); } PEMF EFG 2; diff --git a/zscript/quadshot.zsc b/zscript/quadshot.zsc index 83816c5..003c43c 100644 --- a/zscript/quadshot.zsc +++ b/zscript/quadshot.zsc @@ -256,8 +256,8 @@ Class QuadShot : UnrealWeapon { A_QuakeEx(1,1,1,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.12); double blend = invoker.clipcount/4.; - A_PlaySound("quadshot/alt",CHAN_WEAPON,(!Dampener.Active(self)?1.:.2)*blend); - A_PlaySound("quadshot/fire",CHAN_7,(!Dampener.Active(self)?1.:.2)*(1.-blend)); + A_StartSound("quadshot/alt",CHAN_WEAPON,CHANF_OVERLAP,(!Dampener.Active(self)?1.:.2)*blend); + A_StartSound("quadshot/fire",CHAN_WEAPONMISC,CHANF_OVERLAP,(!Dampener.Active(self)?1.:.2)*(1.-blend)); double spread = invoker.clipcount; for ( int i=0; i 0 ) { vel *= 1.+.06+special1; - A_PlaySound("razorjack/hum",CHAN_VOICE,1.0,true,3.0,pitch:3.125+special1*.2); + A_StartSound("razorjack/hum",CHAN_VOICE,CHANF_LOOPING,1.,3.,3.125+special1*.2); } - else A_PlaySound("razorjack/hum",CHAN_VOICE,1.0,true,3.0,pitch:3.125); + else A_StartSound("razorjack/hum",CHAN_VOICE,CHANF_LOOPING,1.,3.,3.125); Vector3 dir = vel.unit(); A_SetAngle(atan2(dir.y,dir.x)); A_SetPitch(asin(-dir.z)); @@ -79,7 +79,7 @@ Class RazorBlade : Actor if ( !target.bNOBLOOD ) { target.SpawnBlood(pos,AngleTo(target),damage); - A_PlaySound("razorjack/flesh"); + A_StartSound("razorjack/flesh"); A_AlertMonsters(); } UTMainHandler.DoKnockback(target,vel.unit(),15000); @@ -120,7 +120,7 @@ Class RazorBlade : Actor } action void A_RazorHit() { - A_PlaySound("razorjack/hit"); + A_StartSound("razorjack/hit"); A_AlertMonsters(); A_SprayDecal("WallCrack",-20); int numpt = Random[Ripper](5,10); @@ -240,7 +240,7 @@ Class Razorjack : UnrealWeapon if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); - A_PlaySound("razorjack/fire",CHAN_WEAPON,pitch:bAlt?1.:(1.+invoker.special1*.1)); + A_StartSound("razorjack/fire",CHAN_WEAPON,CHANF_OVERLAP,pitch:bAlt?1.:(1.+invoker.special1*.1)); invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(16,255,0,255),1); A_AlertMonsters(); diff --git a/zscript/rifle.zsc b/zscript/rifle.zsc index 8f12829..78244e2 100644 --- a/zscript/rifle.zsc +++ b/zscript/rifle.zsc @@ -84,7 +84,7 @@ Class URifle : UnrealWeapon action void A_ToggleLight() { invoker.bLightOn = !invoker.bLightOn; - A_PlaySound(invoker.bLightOn?"lite/pickup":"lite/off",CHAN_ITEM); + A_StartSound(invoker.bLightOn?"lite/pickup":"lite/off",CHAN_ITEM); if ( invoker.bLightOn ) { if ( !invoker.lt[0] ) invoker.lt[0] = UFlashLight1(Spawn("UFlashLight1",pos)); @@ -121,8 +121,8 @@ Class URifle : UnrealWeapon UTPlayer(self).PlayAttacking3(); invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(32,0,0,255),1); - if ( alt ) A_PlaySound("rifle/fire",CHAN_WEAPON,Dampener.Active(self)?.3:1.,pitch:FRandom[Sniper](0.9,1.1)); - else A_PlaySound("rifle/fire",CHAN_WEAPON,Dampener.Active(self)?.3:1.); + if ( alt ) A_StartSound("rifle/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.3:1.,pitch:FRandom[Sniper](0.9,1.1)); + else A_StartSound("rifle/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.3:1.); if ( !Dampener.Active(self) ) A_AlertMonsters(); if ( zoomed ) { @@ -306,7 +306,7 @@ Class URifle : UnrealWeapon Goto Idle; Zoom: SRSU A 0 A_JumpIf(invoker.sniperzoom>1.0,"ZoomOut"); - SRSU A 0 A_PlaySound("rifle/scopeon",CHAN_ITEM,.5); + SRSU A 0 A_StartSound("rifle/scopeon",CHAN_WEAPONMISC,volume:.5); SRSU ABCDEFGHIJKLMN 1; SRSI A 0; Goto ZoomHold; @@ -321,14 +321,14 @@ Class URifle : UnrealWeapon Goto ZoomedIdle; ZoomOut: SRSD A 0 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT); - SRSD A 0 A_PlaySound("rifle/scopeoff",CHAN_ITEM,.5); + SRSD A 0 A_StartSound("rifle/scopeoff",CHAN_WEAPONMISC,volume:.5); SRSI A 1; SRSD ABCDEFGHIJKLMNO 1; Goto Idle; Deselect: SRFD A 0 A_JumpIf(invoker.sniperzoom<=1.0,"Deselect2"); SRSD A 0 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT); - SRSD A 0 A_PlaySound("rifle/scopeoff",CHAN_ITEM,.5); + SRSD A 0 A_StartSound("rifle/scopeoff",CHAN_WEAPONMISC,volume:.5); SRSI A 1; SRSD ABCDEFGHIJKLMNO 1; Deselect2: diff --git a/zscript/stinger.zsc b/zscript/stinger.zsc index 38606be..4af4912 100644 --- a/zscript/stinger.zsc +++ b/zscript/stinger.zsc @@ -179,8 +179,8 @@ Class TarydiumExplosion : Actor // (just going off the novels here, it's supposed to be pretty strong) A_QuakeEx(clamp(special1/6,2,9),clamp(special1/6,2,9),clamp(special1/6,2,9),10,0,300+special1*2,"",QF_RELATIVE|QF_SCALEDOWN,falloff:200+special1*2,rollIntensity:0.12); SetOrigin(Vec3Offset(0,0,16),false); - A_PlaySound("stinger/explode",CHAN_VOICE,pitch:FRandom[Stinger](0.8,1.5)); - A_PlaySound("stinger/explode",CHAN_ITEM,pitch:FRandom[Stinger](0.8,1.5)); + A_StartSound("stinger/explode",CHAN_VOICE,pitch:FRandom[Stinger](0.8,1.5)); + A_StartSound("stinger/explode",CHAN_ITEM,pitch:FRandom[Stinger](0.8,1.5)); let l = Spawn("TarydiumExLight",pos); l.args[3] = int(60*scale.x); scale.x *= RandomPick[Stinger](-1,1); @@ -417,8 +417,8 @@ Class StingerProjectile : Actor ExplodeMissile(); return; } - if ( !Random[Stinger](0,2) ) A_PlaySound("stinger/hit2",CHAN_BODY,0.5,pitch:FRandom[Stinger](0.5,1.5)); - else A_PlaySound("stinger/hit",CHAN_BODY,0.6); + if ( !Random[Stinger](0,2) ) A_StartSound("stinger/hit2",volume:.5,pitch:FRandom[Stinger](0.5,1.5)); + else A_StartSound("stinger/hit",volume:.6); A_SprayDecal("WallCrack",-20); A_AlertMonsters(); let l = Spawn("StingerBurstLight",pos); @@ -451,7 +451,7 @@ Class StingerProjectile : Actor if ( !target.bNOBLOOD ) { target.SpawnBlood(pos,AngleTo(target),damage); - A_PlaySound("stinger/flesh"); + A_StartSound("stinger/flesh"); A_AlertMonsters(); if ( sting_stinger ) { @@ -463,8 +463,8 @@ Class StingerProjectile : Actor } action void A_StingerHit() { - if ( !Random[Stinger](0,2) ) A_PlaySound("stinger/hit2",CHAN_BODY,0.5,pitch:FRandom[Stinger](0.5,1.5)); - else A_PlaySound("stinger/hit",CHAN_BODY,0.6); + if ( !Random[Stinger](0,2) ) A_StartSound("stinger/hit2",volume:.5,pitch:FRandom[Stinger](0.5,1.5)); + else A_StartSound("stinger/hit",volume:.6); A_SprayDecal("WallCrack",20); A_AlertMonsters(); Spawn("StingerBurstLight",pos); @@ -547,12 +547,12 @@ Class Stinger : UnrealWeapon if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; if ( hold ) { - A_SoundVolume(CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.1:1.); A_Overlay(PSP_FLASH,"MFlashHold"); } else { - A_PlaySound("stinger/fire",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_StartSound("stinger/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.1:1.); A_Overlay(PSP_FLASH,"MFlash"); } A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true); @@ -598,7 +598,7 @@ Class Stinger : UnrealWeapon Weapon weap = Weapon(invoker); if ( !weap ) return; if ( weap.Ammo1.Amount <= 0 ) return; - A_PlaySound("stinger/altfire",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + A_StartSound("stinger/altfire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.1:1.); A_Overlay(PSP_FLASH,"MFlash"); A_OverlayFlags(PSP_FLASH,PSPF_RenderStyle,true); A_OverlayRenderstyle(PSP_FLASH,STYLE_Add); @@ -677,7 +677,7 @@ Class Stinger : UnrealWeapon Goto Idle; STNI A 0 { - A_PlaySound("stinger/hold",CHAN_WEAPON,Dampener.Active(self)?.1:1.,true); + A_StartSound("stinger/hold",CHAN_WEAPONMISC,CHANF_LOOPING,Dampener.Active(self)?.1:1.); invoker.flashnum = Random[Stinger](0,3); } Hold: @@ -692,7 +692,11 @@ Class Stinger : UnrealWeapon STNH BCDEFG 1; STNH A 0 A_JumpIfNoAmmo(1); STNH A 0 A_Refire(); - STNH A 2 A_PlaySound("stinger/release",CHAN_WEAPON,Dampener.Active(self)?.1:1.); + STNH A 2 + { + A_StopSound(CHAN_WEAPONMISC); + A_StartSound("stinger/release",CHAN_WEAPON,volume:Dampener.Active(self)?.1:1.); + } Goto Idle; AltFire: STNF A 2 A_StingerAltFire(); diff --git a/zscript/stunner.zsc b/zscript/stunner.zsc index a7a583b..14cb24d 100644 --- a/zscript/stunner.zsc +++ b/zscript/stunner.zsc @@ -209,7 +209,7 @@ Class StunProj : Actor moving = false; SetStateLabel("Death"); A_QuakeEx(1,1,1,3,0,250,"",QF_RELATIVE|QF_SCALEDOWN,falloff:120,rollintensity:0.2); - A_PlaySound("stun/hit",CHAN_VOICE,pitch:FRandom[Stunner](1.5,1.9)-0.08*specialf1); + A_StartSound("stun/hit",CHAN_VOICE,pitch:FRandom[Stunner](1.5,1.9)-0.08*specialf1); A_AlertMonsters(gameinfo.gametype&GAME_Strife?100:0); Vector3 dir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)); int numpt = Random[ExploS](10,15); @@ -355,7 +355,8 @@ Class Stunner : UnrealWeapon UTPlayer(self).PlayAttacking3(); StunnerAmmo(weap.Ammo1).rechargephase = (((weap.Ammo1.Amount>0)||!deathmatch)?0:5); StunnerAmmo(weap.Ammo1).rechargespeed = 2.; - A_PlaySound("stun/fire",CHAN_WEAPON,Dampener.Active(self)?.4:1.,pitch:1.2-invoker.chargesize*0.06); + A_StopSound(CHAN_WEAPONMISC); + A_StartSound("stun/fire",CHAN_WEAPON,CHANF_OVERLAP,Dampener.Active(self)?.4:1.,pitch:1.2-invoker.chargesize*0.06); double mult = Amplifier.GetMult(self,int(invoker.ChargeSize*50)+50); invoker.FireEffect(); A_QuakeEx(1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),5+int(1.2*invoker.chargesize),0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05+0.01*invoker.chargesize); @@ -406,7 +407,7 @@ Class Stunner : UnrealWeapon weap.DepleteAmmo(weap.bAltFire,true,1); invoker.count = 0; invoker.chargesize = .6; - A_PlaySound("stun/charge",CHAN_WEAPON,Dampener.Active(self)?.15:1.); + A_StartSound("stun/charge",CHAN_WEAPONMISC,volume:Dampener.Active(self)?.15:1.); A_Overlay(-2,"Sparks"); A_OverlayFlags(-2,PSPF_RenderStyle,true); A_OverlayRenderStyle(-2,STYLE_Add); @@ -422,6 +423,7 @@ Class Stunner : UnrealWeapon StunnerAmmo(weap.Ammo1).rechargephase = 0; UTMainHandler.DoSwing(self,(FRandom[Stunner](-1,1),FRandom[Stunner](-1,1)),0.02*invoker.chargesize,0,2,SWING_Spring); A_WeaponOffset(FRandom[Stunner](-1,1)*1.2*invoker.chargesize,32+FRandom[Stunner](-1,1)*1.2*invoker.chargesize); + A_SoundVolume(CHAN_WEAPONMISC,Dampener.Active(self)?.15:1.); if ( !Dampener.Active(self) && !(gameinfo.gametype&GAME_Strife) ) A_AlertMonsters(); if ( invoker.chargesize >= 5. ) { diff --git a/zscript/uarmoritems.zsc b/zscript/uarmoritems.zsc index 8db907e..02d7a96 100644 --- a/zscript/uarmoritems.zsc +++ b/zscript/uarmoritems.zsc @@ -140,7 +140,7 @@ Class ShieldBelt : UnrealArmor { if ( (damage > 0) && (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) ) { - Owner.A_PlaySound("belt/absorb",CHAN_7); + Owner.A_StartSound("belt/absorb",CHAN_POWERUP4); UTMainHandler.DoFlash(Owner,Color(80,255,224,0),5); } Super.AbsorbDamage(damage,damageType,newdamage); @@ -184,7 +184,7 @@ Class PowerShield : UnrealArmor { if ( (damage > 0) && (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) ) { - Owner.A_PlaySound("belt/absorb",CHAN_7); + Owner.A_StartSound("belt/absorb",CHAN_POWERUP4); UTMainHandler.DoFlash(Owner,Color(80,224,0,255),5); if ( !sting_pshield ) { diff --git a/zscript/ubiorifle.zsc b/zscript/ubiorifle.zsc index db7f8b8..2fb4544 100644 --- a/zscript/ubiorifle.zsc +++ b/zscript/ubiorifle.zsc @@ -406,7 +406,7 @@ Class UBioGel : Actor } b = Spawn("BioHitbox",pos); b.target = self; - A_PlaySound("ges/hit"); + A_StartSound("ges/hit"); A_SprayDecal("BioSplat",-172); int numpt = Min(100,int(Scale.x*10))+Random[GES](-5,5); for ( int i=0; i 0) ) { @@ -673,7 +675,7 @@ Class UBioRifle : UnrealWeapon invoker.bCharging = true; weap.DepleteAmmo(weap.bAltFire,true,1); invoker.count = invoker.chargesize = 0; - A_PlaySound("ges/load",CHAN_WEAPON,Dampener.Active(self)?.13:1.,true); + A_StartSound("ges/load",CHAN_WEAPONMISC,CHANF_LOOPING,Dampener.Active(self)?.13:1.); A_Overlay(-9999,"Dummy2"); } override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount ) @@ -731,7 +733,7 @@ Class UBioRifle : UnrealWeapon Drip: #### # 4; BIOT ABC 6; - BIOT D 6 A_PlaySound("ges/drip",CHAN_ITEM,Dampener.Active(self)?.05:.5); + BIOT D 6 A_StartSound("ges/drip",CHAN_WEAPONMISC,volume:Dampener.Active(self)?.05:.5); BIOT EFG 6; BIOI A 4; Goto Idle; diff --git a/zscript/ueightball.zsc b/zscript/ueightball.zsc index 7cc136b..c9127e2 100644 --- a/zscript/ueightball.zsc +++ b/zscript/ueightball.zsc @@ -114,7 +114,7 @@ Class URocket : Actor Super.PostBeginPlay(); let l = Spawn("URocketTrail",pos); l.target = self; - A_PlaySound("eightball/fly",CHAN_VOICE,1.0,true,2.5); + A_StartSound("eightball/fly",CHAN_VOICE,CHANF_LOOPING,1.,2.5); if ( tracer ) vel *= 0.9; Acceleration = vel.unit()*50; } @@ -128,7 +128,7 @@ Class URocket : Actor UTMainHandler.DoBlast(self,rad,80000); A_Explode(dmg,rad); A_QuakeEx(3,3,3,8,0,rad+50,"",QF_RELATIVE|QF_SCALEDOWN,falloff:rad,rollIntensity:0.2); - A_PlaySound("eightball/explode",CHAN_VOICE); + A_StartSound("eightball/explode",CHAN_VOICE); A_AlertMonsters(); Spawn("RocketExplLight",pos); int numpt = Random[Eightball](15,30); @@ -303,7 +303,7 @@ Class UGrenade : URocket RCKT A 0 { bHITOWNER = true; - A_PlaySound("utrl/bounce"); + A_StartSound("utrl/bounce"); rollvel = FRandom[Eightball](-16,16); pitchvel = FRandom[Eightball](-16,16); anglevel = FRandom[Eightball](-16,16); @@ -363,7 +363,7 @@ Class Eightball : UnrealWeapon LockedOn = false; if ( Owner.player.ReadyWeapon == self ) { - Owner.A_PlaySound("eightball/seeklost",CHAN_WEAPON,Dampener.Active(Owner)?.1:1.); + Owner.A_StartSound("eightball/seeklost",CHAN_WEAPONMISC,CHANF_OVERLAP,Dampener.Active(Owner)?.1:1.); if ( !Dampener.Active(Owner) ) Owner.A_AlertMonsters(); } } @@ -405,12 +405,14 @@ Class Eightball : UnrealWeapon invoker.special1 = 0; if ( weap.bAltFire ) { - A_PlaySound("eightball/altfire",CHAN_WEAPON,Dampener.Active(self)?.3:3.); + for ( int i=0; i 0 ) A_PlaySound("u1/metalfootstep",CHAN_5,min(1.,vol*2)); - else A_PlaySound("ut/playerfootstep",CHAN_5,vol); + if ( sin(ang) > 0 ) A_StartSound("u1/metalfootstep",CHAN_FOOTSTEP,CHANF_OVERLAP,min(1.,vol*2)); + else A_StartSound("ut/playerfootstep",CHAN_FOOTSTEP,CHANF_OVERLAP,vol); } } Default @@ -783,7 +783,7 @@ Class UTeleportFog : Actor { Super.PostBeginPlay(); Spawn("UTTeleportLight",Vec3Offset(0,0,16)); - A_PlaySound("misc/teleport",volume:.5); + A_StartSound("misc/teleport",volume:.5); Spawn("UTeleportParticles",Vec3Offset(0,0,16)); } States @@ -848,7 +848,7 @@ Class UnrealWeapon : UTWeapon } override void PlayUpSound( Actor origin ) { - origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.); + origin.A_StartSound(upsound,CHAN_WEAPON,volume:Dampener.Active(origin)?.1:1.); } } @@ -871,11 +871,12 @@ Class UnrealStaticHandler : StaticEventHandler tex[5] = TexMan.CheckForTexture("graphics/97Bg.png",TexMan.Type_Any); tex[6] = TexMan.CheckForTexture("graphics/96Bg.png",TexMan.Type_Any); tex[7] = TexMan.CheckForTexture("graphics/95Bg.png",TexMan.Type_Any); - if ( proto > 2 ) S_ChangeMusic("Unreal"); - else if ( proto == 2 ) S_ChangeMusic("Isotox96"); - else if ( proto == 1 ) S_ChangeMusic("Unreal2"); - else S_ChangeMusic("FlyBy"); - cur = proto; + if ( proto > 3 ) S_ChangeMusic("music/Unreal_Extended.it"); + else if ( proto == 3 ) S_ChangeMusic("music/Unreal.it"); + else if ( proto == 2 ) S_ChangeMusic("music/isotox96.s3m"); + else if ( proto == 1 ) S_ChangeMusic("music/Unreal2.it"); + else S_ChangeMusic("music/FlyBy.it"); + cur = clamp(proto,0,3); } override void OnRegister() @@ -1226,7 +1227,7 @@ Class UnrealMainHandler : EventHandler else if ( e.Replacee == 'RadSuit' ) e.Replacement = 'UJumpBoots'; else if ( (e.Replacee == 'ArtiFly') || (e.Replacee == 'ArtiSpeedBoots') ) e.Replacement = 'UJumpBoots'; else if ( (e.Replacee == 'Backpack') || (e.Replacee == 'BagOfHolding') || (e.Replacee == 'ArtiHealingRadius') ) e.Replacement = 'UnrealBackpack'; - else if ( (e.Replacee == 'ArmorBonus') || (e.Replacee == 'ArtiTimeBomb') || (e.Replacee is 'ArtiPoisonBag') || (e.Replacee is 'ArtiBlastRadius') ) + else if ( (e.Replacee == 'ArmorBonus') || (e.Replacee == 'ArtiTimeBomb') || (e.Replacee == 'ArtiBlastRadius') ) { if ( sting_abonus && Random[Replacements](0,3) ) e.Replacement = 'UArmorBonus'; else e.Replacement = 'Flare'; diff --git a/zscript/upowerups.zsc b/zscript/upowerups.zsc index 3bf1b7e..a4dbeb1 100644 --- a/zscript/upowerups.zsc +++ b/zscript/upowerups.zsc @@ -18,7 +18,7 @@ Class UInvisibility : UnrealInventory bActive = !bActive; if ( bActive ) { - Owner.A_PlaySound("uinvis/toggle",CHAN_ITEM); + Owner.A_StartSound("uinvis/toggle",CHAN_ITEM); Owner.GiveInventory("PowerUInvisibility",1); } else Owner.TakeInventory("PowerUInvisibility",1); @@ -118,7 +118,7 @@ Class Amplifier : UnrealInventory double Multiplier = max(1,4*(double(d.Charge-val)/d.DefaultCharge)); if ( d.DrainCharge(val) ) { - d.Owner.A_PlaySound("amplifier/unset",CHAN_ITEM); + d.Owner.A_StartSound("amplifier/unset",CHAN_ITEM); if ( d.Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_AMPLIFIER")); if ( d.tracer ) d.tracer.Destroy(); if ( d.Amount <= 0 ) d.DepleteOrDestroy(); @@ -129,7 +129,7 @@ Class Amplifier : UnrealInventory { if ( pickup ) return false; bActive = !bActive; - Owner.A_PlaySound(bActive?"amplifier/set":"amplifier/unset",CHAN_ITEM); + Owner.A_StartSound(bActive?"amplifier/set":"amplifier/unset",CHAN_ITEM); return false; } override void DoEffect() @@ -145,7 +145,7 @@ Class Amplifier : UnrealInventory if ( !bActive ) return; if ( !(level.maptime%35) && DrainCharge(2) ) { - Owner.A_PlaySound("amplifier/unset",CHAN_ITEM); + Owner.A_StartSound("amplifier/unset",CHAN_ITEM); if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_AMPLIFIER")); if ( tracer ) tracer.Destroy(); if ( Amount <= 0 ) DepleteOrDestroy(); @@ -189,8 +189,8 @@ Class AmpSound : Actor override void PostBeginPlay() { Super.PostBeginPlay(); - A_PlaySound("amplifier/act",CHAN_VOICE,0.25,true,1.5); - A_PlaySound("amplifier/act",CHAN_7,1.0,true,ATTN_NONE); + A_StartSound("amplifier/act",CHAN_VOICE,CHANF_LOOPING,.25,1.5); + A_StartSound("amplifier/act",CHAN_7,CHANF_LOOPING,1.,ATTN_NONE); } override void OnDestroy() { @@ -220,7 +220,7 @@ Class UJumpBoots : UnrealInventory { if ( pickup ) return false; bActive = !bActive; - Owner.A_PlaySound("boot/pickup",CHAN_ITEM); + Owner.A_StartSound("boot/pickup",CHAN_ITEM); if ( bActive ) Owner.GiveInventory("PowerJumpBoots_HighJump",1); else Owner.TakeInventory("PowerJumpBoots_HighJump",1); return false; @@ -234,7 +234,7 @@ Class UJumpBoots : UnrealInventory { draincnt = 0; charge--; - Owner.A_PlaySound("boot/jump",CHAN_BODY); + Owner.A_StartSound("boot/jump",CHAN_POWERUP3,CHANF_OVERLAP); } else if ( (charge <= 0) && owner.player.onground ) { @@ -444,8 +444,8 @@ Class MotionDetector : UnrealInventory { if ( pickup ) return false; bActive = !bActive; - if ( bActive ) Owner.A_PlaySound("detector/start",CHAN_ITEM); - else Owner.A_PlaySound("detector/stop",CHAN_ITEM,0.1,false,3.); + if ( bActive ) Owner.A_StartSound("detector/start",CHAN_ITEM); + else Owner.A_StartSound("detector/stop",CHAN_ITEM,volume:.1,attenuation:3.); return false; } override void DoEffect() @@ -468,7 +468,7 @@ Class MotionDetector : UnrealInventory } if ( (Charge <= 0) || DrainCharge(1) ) { - Owner.A_PlaySound("detector/stop",CHAN_ITEM,0.1,false,3.); + Owner.A_StartSound("detector/stop",CHAN_ITEM,volume:.1,attenuation:3.); if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_DETECTOR")); if ( tracer ) tracer.Destroy(); DepleteOrDestroy(); @@ -505,8 +505,8 @@ Class DetectorSound : Actor override void PostBeginPlay() { Super.PostBeginPlay(); - A_PlaySound("detector/active",CHAN_VOICE,0.1,true,ATTN_NONE); - A_PlaySound("detector/active",CHAN_7,0.1,true,3.); + A_StartSound("detector/active",CHAN_VOICE,CHANF_LOOPING,.1,ATTN_NONE); + A_StartSound("detector/active",CHAN_7,CHANF_LOOPING,.1,3.); } override void OnDestroy() { @@ -532,7 +532,7 @@ Class SCUBAGear : UnrealInventory { if ( pickup ) return false; bActive = !bActive; - if ( !bActive ) Owner.A_PlaySound("scuba/stop",CHAN_ITEM); + if ( !bActive ) Owner.A_StartSound("scuba/stop",CHAN_ITEM); return false; } override void AttachToOwner( Actor other ) @@ -569,7 +569,7 @@ Class SCUBAGear : UnrealInventory if ( PlayerPawn(Owner) ) PlayerPawn(Owner).ResetAirSupply(); if ( (Charge <= 0) || DrainCharge(1) ) { - Owner.A_PlaySound("scuba/stop",CHAN_ITEM); + Owner.A_StartSound("scuba/stop",CHAN_ITEM); if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$D_SCUBA")); if ( tracer ) tracer.Destroy(); DepleteOrDestroy(); @@ -617,10 +617,10 @@ Class SCUBASound : Actor override void PostBeginPlay() { Super.PostBeginPlay(); - A_PlaySound("scuba/air",CHAN_VOICE,0.25,true,1.5); - A_PlaySound("scuba/water",CHAN_5,0.25,true,1.5); - A_PlaySound("scuba/air",CHAN_6,1.0,true,ATTN_NONE); - A_PlaySound("scuba/water",CHAN_7,1.0,true,ATTN_NONE); + A_StartSound("scuba/air",CHAN_VOICE,CHANF_LOOPING,.25,1.5); + A_StartSound("scuba/water",CHAN_5,CHANF_LOOPING,.25,1.5); + A_StartSound("scuba/air",CHAN_6,CHANF_LOOPING,1.,ATTN_NONE); + A_StartSound("scuba/water",CHAN_7,CHANF_LOOPING,1.,ATTN_NONE); } override void OnDestroy() { diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index d5ae93d..9f18f8f 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -70,7 +70,7 @@ Class UTranslocatorModule : Actor Super.Tick(); if ( bAMBUSH && !Random[Transloc](0,40) ) { - A_PlaySound("telehand/spark"); + A_StartSound("telehand/spark"); int numpt = Random[Transloc](20,40); for ( int i=0; i= tracer.pos.z+tracer.height) && tracer.bACTLIKEBRIDGE) ) alreadyhit = true; } } @@ -153,7 +153,7 @@ Class UTranslocator : UnrealWeapon { Weapon weap = Weapon(invoker); if ( !weap ) return; - A_PlaySound("telehand/throw",CHAN_WEAPON); + A_StartSound("telehand/throw",CHAN_WEAPON); invoker.FireEffect(); UTMainHandler.DoSwing(self,(FRandom[Translocator](0.2,-0.4),FRandom[Translocator](0.2,-0.7)),2,-0.3,3,SWING_Spring,2,3); Vector3 x, y, z; @@ -173,13 +173,13 @@ Class UTranslocator : UnrealWeapon { Weapon weap = Weapon(invoker); if ( !weap ) return; - A_PlaySound("transloc/return",CHAN_WEAPON); + A_StartSound("transloc/return",CHAN_WEAPON); invoker.FireEffect(); UTMainHandler.DoSwing(self,(FRandom[Translocator](-0.2,-0.4),FRandom[Translocator](-0.2,0.7)),3,-1,2,SWING_Spring,2,2); if ( invoker.module && invoker.module.bAMBUSH ) { UTMainHandler.DoFlash(self,Color(255,255,255,255),50); - A_PlaySound("transloc/spark",CHAN_WEAPON); + A_StartSound("transloc/spark",CHAN_WEAPON); DamageMobj(invoker,self,int.max,'Telefrag',DMG_THRUSTLESS); } if ( invoker.module ) invoker.module.Destroy(); @@ -191,7 +191,7 @@ Class UTranslocator : UnrealWeapon if ( !invoker.module ) { invoker.FireEffect(); - A_PlaySound("transloc/return",CHAN_WEAPON); + A_StartSound("transloc/return",CHAN_WEAPON); return; } // check if there's enough space @@ -213,12 +213,12 @@ Class UTranslocator : UnrealWeapon } if ( Warp(self,newpos.x,newpos.y,newpos.z,flags:WARPF_ABSOLUTEPOSITION|WARPF_TESTONLY) && TeleportMove(newpos,true) ) { - A_PlaySound("flak/click",CHAN_WEAPON); + A_StartSound("flak/click",CHAN_WEAPON); SpawnTeleportFog(oldpos,true,false); SpawnTeleportFog(newpos,false,false); player.fov = min(175,player.desiredfov+60); } - else A_PlaySound("transloc/return",CHAN_WEAPON); + else A_StartSound("transloc/return",CHAN_WEAPON); for ( int i=0; i