Skip to content

Commit

Permalink
- deprecated A_PlaySound for real and transitoned the internal script…
Browse files Browse the repository at this point in the history
…s to A_StartSound
  • Loading branch information
coelckers committed Jan 4, 2020
1 parent b7e1a35 commit 4a67bfc
Show file tree
Hide file tree
Showing 102 changed files with 251 additions and 250 deletions.
8 changes: 4 additions & 4 deletions wadsrc/static/zscript/actors/actor.zs
Expand Up @@ -1055,7 +1055,7 @@ class Actor : Thinker native
deprecated("2.3") native void A_BulletAttack();
native void A_WolfAttack(int flags = 0, sound whattoplay = "weapons/pistol", double snipe = 1.0, int maxdamage = 64, int blocksize = 128, int pointblank = 2, int longrange = 4, double runspeed = 160.0, class<Actor> pufftype = "BulletPuff");
deprecated("4.3") native clearscope void A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, double volume = 1.0, bool looping = false, double attenuation = ATTN_NORM, bool local = false, double pitch = 0.0);
native clearscope void A_StartSound(sound whattoplay, int slot, int flags = 0, double volume = 1.0, double attenuation = ATTN_NORM, double pitch = 0.0);
native clearscope void A_StartSound(sound whattoplay, int slot = CHAN_BODY, int flags = 0, double volume = 1.0, double attenuation = ATTN_NORM, double pitch = 0.0);
native void A_SoundVolume(int slot, double volume);
native void A_SoundPitch(int slot, double pitch);
deprecated("2.3") void A_PlayWeaponSound(sound whattoplay) { A_StartSound(whattoplay, CHAN_WEAPON); }
Expand Down Expand Up @@ -1215,20 +1215,20 @@ class Actor : Thinker native
{
if (DeathSound)
{
A_PlaySound(DeathSound, CHAN_VOICE, 1, false, bBoss? ATTN_NONE : ATTN_NORM);
A_StartSound(DeathSound, CHAN_VOICE, CHANF_DEFAULT, 1, bBoss? ATTN_NONE : ATTN_NORM);
}
}

void A_XScream()
{
A_PlaySound(player? Sound("*gibbed") : Sound("misc/gibbed"), CHAN_VOICE);
A_StartSound(player? Sound("*gibbed") : Sound("misc/gibbed"), CHAN_VOICE);
}

void A_ActiveSound()
{
if (ActiveSound)
{
A_PlaySound(ActiveSound, CHAN_VOICE);
A_StartSound(ActiveSound, CHAN_VOICE);
}
}

Expand Down
6 changes: 3 additions & 3 deletions wadsrc/static/zscript/actors/attacks.zs
Expand Up @@ -67,7 +67,7 @@ extend class Actor
if (!(flags & CBAF_NOPITCH)) bslope = AimLineAttack (bangle, MISSILERANGE);
if (pufftype == null) pufftype = 'BulletPuff';

A_PlaySound(AttackSound, CHAN_WEAPON);
A_StartSound(AttackSound, CHAN_WEAPON);
for (i = 0; i < numbullets; i++)
{
double pangle = bangle;
Expand Down Expand Up @@ -162,7 +162,7 @@ extend class Actor
looker.target = target;
if (looker.SeeSound)
{
looker.A_PlaySound(looker.SeeSound, CHAN_VOICE);
looker.A_StartSound(looker.SeeSound, CHAN_VOICE);
}
looker.SetState(looker.SeeState);
looker.bInCombat = true;
Expand Down Expand Up @@ -662,7 +662,7 @@ extend class Actor
if (domelee && MeleeDamage>0 && CheckMeleeRange ())
{
int damage = random[CustomMelee](1, 8) * MeleeDamage;
if (MeleeSound) A_PlaySound (MeleeSound, CHAN_WEAPON);
if (MeleeSound) A_StartSound (MeleeSound, CHAN_WEAPON);
int newdam = targ.DamageMobj (self, self, damage, 'Melee');
targ.TraceBleed (newdam > 0 ? newdam : damage, self);
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/arachnotron.zs
Expand Up @@ -109,7 +109,7 @@ extend class Actor

void A_BabyMetal()
{
A_PlaySound("baby/walk", CHAN_BODY, 1, false, ATTN_IDLE);
A_StartSound("baby/walk", CHAN_BODY, CHANF_DEFAULT, 1, ATTN_IDLE);
A_Chase();
}
}
Expand Down
8 changes: 4 additions & 4 deletions wadsrc/static/zscript/actors/doom/archvile.zs
Expand Up @@ -103,7 +103,7 @@ extend class Actor

void A_VileStart()
{
A_PlaySound ("vile/start", CHAN_VOICE);
A_StartSound ("vile/start", CHAN_VOICE);
}

//
Expand Down Expand Up @@ -134,7 +134,7 @@ extend class Actor
{
A_FaceTarget();
if (!CheckSight(targ, 0)) return;
A_PlaySound(snd, CHAN_WEAPON);
A_StartSound(snd, CHAN_WEAPON);
int newdam = targ.DamageMobj (self, self, initialdmg, (flags & VAF_DMGTYPEAPPLYTODIRECT)? damagetype : 'none');

targ.TraceBleed (newdam > 0 ? newdam : initialdmg, self);
Expand All @@ -155,7 +155,7 @@ extend class Actor

void A_StartFire()
{
A_PlaySound ("vile/firestrt", CHAN_BODY);
A_StartSound ("vile/firestrt", CHAN_BODY);
A_Fire();
}

Expand All @@ -176,7 +176,7 @@ extend class Actor

void A_FireCrackle()
{
A_PlaySound ("vile/firecrkl", CHAN_BODY);
A_StartSound ("vile/firecrkl", CHAN_BODY);
A_Fire();
}
}
14 changes: 7 additions & 7 deletions wadsrc/static/zscript/actors/doom/bossbrain.zs
Expand Up @@ -143,12 +143,12 @@ extend class Actor

void A_BrainAwake()
{
A_PlaySound("brain/sight", CHAN_VOICE, 1, false, ATTN_NONE);
A_StartSound("brain/sight", CHAN_VOICE, CHANF_DEFAULT, 1, ATTN_NONE);
}

void A_BrainPain()
{
A_PlaySound("brain/pain", CHAN_VOICE, 1, false, ATTN_NONE);
A_StartSound("brain/pain", CHAN_VOICE, CHANF_DEFAULT, 1, ATTN_NONE);
}

private static void BrainishExplosion(vector3 pos)
Expand All @@ -174,7 +174,7 @@ extend class Actor
// (1 / 512.) is actually what the original value of 128 did, even though it probably meant 128 map units.
BrainishExplosion(Vec2OffsetZ(x, -320, (1 / 512.) + random[BrainExplode](0, 255) * 2));
}
A_PlaySound("brain/death", CHAN_VOICE, 1, false, ATTN_NONE);
A_StartSound("brain/death", CHAN_VOICE, CHANF_DEFAULT, 1., ATTN_NONE);
}

void A_BrainExplode()
Expand Down Expand Up @@ -267,12 +267,12 @@ extend class Actor

if (!isdefault)
{
A_PlaySound(self.AttackSound, CHAN_WEAPON, 1., false, ATTN_NONE);
A_StartSound(self.AttackSound, CHAN_WEAPON, CHANF_DEFAULT, 1., ATTN_NONE);
}
else
{
// compatibility fallback
A_PlaySound("brain/spit", CHAN_WEAPON, 1., false, ATTN_NONE);
A_StartSound("brain/spit", CHAN_WEAPON, CHANF_DEFAULT, 1., ATTN_NONE);
}
}
}
Expand Down Expand Up @@ -306,7 +306,7 @@ extend class Actor
if (spawntype)
{
fog = Spawn (spawntype, targ.pos, ALLOW_REPLACE);
if (fog) A_PlaySound(snd, CHAN_BODY);
if (fog) A_StartSound(snd, CHAN_BODY);
}

class<Actor> SpawnName = null;
Expand Down Expand Up @@ -428,7 +428,7 @@ extend class Actor
void A_SpawnSound()
{
// travelling cube sound
A_PlaySound("brain/cube", CHAN_BODY);
A_StartSound("brain/cube", CHAN_BODY);
SpawnFly("SpawnFire", "brain/spawn");
}
}
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/bruiser.zs
Expand Up @@ -157,7 +157,7 @@ extend class Actor
if (CheckMeleeRange())
{
int damage = random[pr_bruisattack](1, 8) * 10;
A_PlaySound ("baron/melee", CHAN_WEAPON);
A_StartSound ("baron/melee", CHAN_WEAPON);
int newdam = target.DamageMobj (self, self, damage, "Melee");
targ.TraceBleed (newdam > 0 ? newdam : damage, self);
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/cacodemon.zs
Expand Up @@ -106,7 +106,7 @@ extend class Actor
if (CheckMeleeRange())
{
int damage = random[pr_headattack](1, 6) * 10;
A_PlaySound (AttackSound, CHAN_WEAPON);
A_StartSound (AttackSound, CHAN_WEAPON);
int newdam = target.DamageMobj (self, self, damage, "Melee");
targ.TraceBleed (newdam > 0 ? newdam : damage, self);
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/cyberdemon.zs
Expand Up @@ -83,7 +83,7 @@ extend class Actor

void A_Hoof()
{
A_PlaySound("cyber/hoof", CHAN_BODY, 1, false, ATTN_IDLE);
A_StartSound("cyber/hoof", CHAN_BODY, CHANF_DEFAULT, 1, ATTN_IDLE);
A_Chase();
}

Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/doomimp.zs
Expand Up @@ -111,7 +111,7 @@ extend class Actor
if (CheckMeleeRange())
{
int damage = random[pr_troopattack](1, 8) * 3;
A_PlaySound ("imp/melee", CHAN_WEAPON);
A_StartSound ("imp/melee", CHAN_WEAPON);
int newdam = targ.DamageMobj (self, self, damage, "Melee");
targ.TraceBleed (newdam > 0 ? newdam : damage, self);
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/fatso.zs
Expand Up @@ -108,7 +108,7 @@ extend class Actor
void A_FatRaise()
{
A_FaceTarget();
A_PlaySound("fatso/raiseguns", CHAN_WEAPON);
A_StartSound("fatso/raiseguns", CHAN_WEAPON);
}

//
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/actors/doom/lostsoul.zs
Expand Up @@ -100,7 +100,7 @@ extend class Actor
if (skullspeed <= 0) skullspeed = DEFSKULLSPEED;

bSkullfly = true;
A_PlaySound(AttackSound, CHAN_VOICE);
A_StartSound(AttackSound, CHAN_VOICE);
A_FaceTarget();
VelFromAngle(skullspeed);
Vel.Z = (target.pos.Z + target.Height/2 - pos.Z) / DistanceBySpeed(target, skullspeed);
Expand All @@ -110,7 +110,7 @@ extend class Actor
{
if (target == null || target.GetSpecies() == self.GetSpecies()) return;

A_PlaySound(AttackSound, CHAN_WEAPON);
A_StartSound(AttackSound, CHAN_WEAPON);
A_FaceTarget();

int damage = GetMissileDamage(7,1);
Expand Down
8 changes: 4 additions & 4 deletions wadsrc/static/zscript/actors/doom/possessed.zs
Expand Up @@ -271,7 +271,7 @@ extend class Actor
A_FaceTarget();
double ang = angle;
double slope = AimLineAttack(ang, MISSILERANGE);
A_PlaySound("grunt/attack", CHAN_WEAPON);
A_StartSound("grunt/attack", CHAN_WEAPON);
ang += Random2[PosAttack]() * (22.5/256);
int damage = Random[PosAttack](1, 5) * 3;
LineAttack(ang, MISSILERANGE, slope, damage, "Hitscan", "Bulletpuff");
Expand Down Expand Up @@ -300,7 +300,7 @@ extend class Actor
{
if (target)
{
A_PlaySound(AttackSound, CHAN_WEAPON);
A_StartSound(AttackSound, CHAN_WEAPON);
A_SPosAttackInternal();
}
}
Expand All @@ -310,7 +310,7 @@ extend class Actor
{
if (target)
{
A_PlaySound("shotguy/attack", CHAN_WEAPON);
A_StartSound("shotguy/attack", CHAN_WEAPON);
A_SPosAttackInternal();
}
}
Expand All @@ -320,7 +320,7 @@ extend class Actor
if (target)
{
if (bStealth) visdir = 1;
A_PlaySound(AttackSound, CHAN_WEAPON);
A_StartSound(AttackSound, CHAN_WEAPON);
A_FaceTarget();
double slope = AimLineAttack(angle, MISSILERANGE);
double ang = angle + Random2[CPosAttack]() * (22.5/256);
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/actors/doom/revenant.zs
Expand Up @@ -150,7 +150,7 @@ extend class Actor
{
if (target == null) return;
A_FaceTarget();
A_PlaySound("skeleton/swing", CHAN_WEAPON);
A_StartSound("skeleton/swing", CHAN_WEAPON);
}

void A_SkelFist()
Expand All @@ -162,7 +162,7 @@ extend class Actor
if (CheckMeleeRange ())
{
int damage = random[SkelFist](1, 10) * 6;
A_PlaySound("skeleton/melee", CHAN_WEAPON);
A_StartSound("skeleton/melee", CHAN_WEAPON);
int newdam = targ.DamageMobj (self, self, damage, 'Melee');
targ.TraceBleed (newdam > 0 ? newdam : damage, self);
}
Expand Down
26 changes: 13 additions & 13 deletions wadsrc/static/zscript/actors/doom/scriptedmarine.zs
Expand Up @@ -247,13 +247,13 @@ class ScriptedMarine : Actor
switch (ticks)
{
case 14:
A_PlaySound ("weapons/sshoto", CHAN_WEAPON);
A_StartSound ("weapons/sshoto", CHAN_WEAPON);
break;
case 28:
A_PlaySound ("weapons/sshotl", CHAN_WEAPON);
A_StartSound ("weapons/sshotl", CHAN_WEAPON);
break;
case 41:
A_PlaySound ("weapons/sshotc", CHAN_WEAPON);
A_StartSound ("weapons/sshotc", CHAN_WEAPON);
break;
}
}
Expand Down Expand Up @@ -329,7 +329,7 @@ class ScriptedMarine : Actor
{
if (CurrentWeapon == WEAPON_Chainsaw)
{
A_PlaySound ("weapons/sawidle", CHAN_WEAPON);
A_StartSound ("weapons/sawidle", CHAN_WEAPON);
}
}

Expand Down Expand Up @@ -380,7 +380,7 @@ class ScriptedMarine : Actor
// turn to face target
if (t.linetarget)
{
A_PlaySound ("*fist", CHAN_WEAPON);
A_StartSound ("*fist", CHAN_WEAPON);
angle = t.angleFromSource;
}
}
Expand Down Expand Up @@ -415,7 +415,7 @@ class ScriptedMarine : Actor
if (target == null)
return;

A_PlaySound ("weapons/pistol", CHAN_WEAPON);
A_StartSound ("weapons/pistol", CHAN_WEAPON);
A_FaceTarget ();
GunShot2 (accurate, AimLineAttack (angle, MISSILERANGE), "BulletPuff");
}
Expand All @@ -431,7 +431,7 @@ class ScriptedMarine : Actor
if (target == null)
return;

A_PlaySound ("weapons/shotgf", CHAN_WEAPON);
A_StartSound ("weapons/shotgf", CHAN_WEAPON);
A_FaceTarget ();
double pitch = AimLineAttack (angle, MISSILERANGE);
for (int i = 0; i < 7; ++i)
Expand Down Expand Up @@ -470,7 +470,7 @@ class ScriptedMarine : Actor
if (target == null)
return;

A_PlaySound ("weapons/sshotf", CHAN_WEAPON);
A_StartSound ("weapons/sshotf", CHAN_WEAPON);
A_FaceTarget ();
double pitch = AimLineAttack (angle, MISSILERANGE);
for (int i = 0; i < 20; ++i)
Expand All @@ -494,7 +494,7 @@ class ScriptedMarine : Actor
if (target == null)
return;

A_PlaySound ("weapons/chngun", CHAN_WEAPON);
A_StartSound ("weapons/chngun", CHAN_WEAPON);
A_FaceTarget ();
GunShot2 (accurate, AimLineAttack (angle, MISSILERANGE), "BulletPuff");
}
Expand Down Expand Up @@ -574,7 +574,7 @@ class ScriptedMarine : Actor
else
{
A_FaceTarget ();
A_PlaySound ("weapons/bfgf", CHAN_WEAPON);
A_StartSound ("weapons/bfgf", CHAN_WEAPON);
// Don't interrupt the firing sequence
PainChance = 0;
}
Expand Down Expand Up @@ -670,10 +670,10 @@ extend class Actor

if (!t.linetarget)
{
A_PlaySound (fullsound, 1, CHAN_WEAPON);
A_StartSound (fullsound, 1, CHAN_WEAPON);
return;
}
A_PlaySound (hitsound, CHAN_WEAPON);
A_StartSound (hitsound, CHAN_WEAPON);

// turn to face target
ang = t.angleFromSource;
Expand All @@ -696,7 +696,7 @@ extend class Actor
}
else
{
A_PlaySound (fullsound, 1, CHAN_WEAPON);
A_StartSound (fullsound, 1, CHAN_WEAPON);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/spidermaster.zs
Expand Up @@ -87,7 +87,7 @@ extend class Actor

void A_Metal()
{
A_PlaySound("spider/walk", CHAN_BODY, 1, false, ATTN_IDLE);
A_StartSound("spider/walk", CHAN_BODY, CHANF_DEFAULT, 1, ATTN_IDLE);
A_Chase();
}
}
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/doom/weaponbfg.zs
Expand Up @@ -60,7 +60,7 @@ extend class StateProvider
{
action void A_BFGsound()
{
A_PlaySound("weapons/bfgf", CHAN_WEAPON);
A_StartSound("weapons/bfgf", CHAN_WEAPON);
}


Expand Down

0 comments on commit 4a67bfc

Please sign in to comment.