- sfxPlay3DSound calls partially migrated.

This commit is contained in:
Christoph Oelckers 2021-09-16 21:34:16 +02:00
parent 741d24b9df
commit 3ab636a13a
11 changed files with 94 additions and 94 deletions

View file

@ -2736,7 +2736,7 @@ static void actNapalmMove(DBloodActor* actor)
seqSpawn(9, actor); seqSpawn(9, actor);
if (Chance(0x8000)) pSprite->cstat |= 4; if (Chance(0x8000)) pSprite->cstat |= 4;
sfxPlay3DSound(pSprite, 303, 24 + (pSprite->flags & 3), 1); sfxPlay3DSound(actor, 303, 24 + (pSprite->flags & 3), 1);
actRadiusDamage(pOwner, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128, 0, 60, kDamageExplode, 15, 120); actRadiusDamage(pOwner, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128, 0, 60, kDamageExplode, 15, 120);
if (pXSprite->data4 > 1) if (pXSprite->data4 > 1)
@ -3216,13 +3216,13 @@ static int checkDamageType(DBloodActor* actor, DAMAGE_TYPE damageType)
case kDudeCultistBeast: case kDudeCultistBeast:
case kDudeTinyCaleb: case kDudeTinyCaleb:
case kDudeBurningTinyCaleb: case kDudeBurningTinyCaleb:
sfxPlay3DSound(pSprite, 717, -1, 0); sfxPlay3DSound(actor, 717, -1, 0);
break; break;
} }
break; break;
case kDamageBurn: case kDamageBurn:
nSeq = 3; nSeq = 3;
sfxPlay3DSound(pSprite, 351, -1, 0); sfxPlay3DSound(actor, 351, -1, 0);
break; break;
case kDamageSpirit: case kDamageSpirit:
switch (pSprite->type) { switch (pSprite->type) {
@ -3283,7 +3283,7 @@ static void zombieAxeNormalDeath(DBloodActor* actor, int nSeq)
auto pSprite = &actor->s(); auto pSprite = &actor->s();
int nType = pSprite->type - kDudeBase; int nType = pSprite->type - kDudeBase;
sfxPlay3DSound(pSprite, 1107 + Random(2), -1, 0); sfxPlay3DSound(actor, 1107 + Random(2), -1, 0);
if (nSeq == 2) if (nSeq == 2)
{ {
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nDudeToGibClient1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nDudeToGibClient1);
@ -3293,7 +3293,7 @@ static void zombieAxeNormalDeath(DBloodActor* actor, int nSeq)
{ {
seqSpawn(dudeInfo[nType].seqStartID + 7, actor, nDudeToGibClient1); seqSpawn(dudeInfo[nType].seqStartID + 7, actor, nDudeToGibClient1);
evPost(actor, 0, kCallbackFXZombieSpurt); evPost(actor, 0, kCallbackFXZombieSpurt);
sfxPlay3DSound(pSprite, 362, -1, 0); sfxPlay3DSound(actor, 362, -1, 0);
actor->x().data1 = 35; actor->x().data1 = 35;
actor->x().data2 = 5; actor->x().data2 = 5;
@ -3313,8 +3313,8 @@ static void zombieAxeNormalDeath(DBloodActor* actor, int nSeq)
static void burningCultistDeath(DBloodActor* actor, int nSeq) static void burningCultistDeath(DBloodActor* actor, int nSeq)
{ {
auto pSprite = &actor->s(); auto pSprite = &actor->s();
if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(pSprite, 718, -1, 0); if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(actor, 718, -1, 0);
else sfxPlay3DSound(pSprite, 1018 + Random(2), -1, 0); else sfxPlay3DSound(actor, 1018 + Random(2), -1, 0);
int nType = pSprite->type - kDudeBase; int nType = pSprite->type - kDudeBase;
if (Chance(0x8000)) if (Chance(0x8000))
@ -3393,9 +3393,9 @@ void zombieAxeBurningDeath(DBloodActor* actor, int nSeq)
int nType = pSprite->type - kDudeBase; int nType = pSprite->type - kDudeBase;
if (Chance(0x8000) && nSeq == 3) if (Chance(0x8000) && nSeq == 3)
sfxPlay3DSound(pSprite, 1109, -1, 0); sfxPlay3DSound(actor, 1109, -1, 0);
else else
sfxPlay3DSound(pSprite, 1107 + Random(2), -1, 0); sfxPlay3DSound(actor, 1107 + Random(2), -1, 0);
if (Chance(0x8000)) if (Chance(0x8000))
{ {
@ -3419,11 +3419,11 @@ static void zombieButcherDeath(DBloodActor* actor, int nSeq)
if (nSeq == 14) if (nSeq == 14)
{ {
sfxPlay3DSound(pSprite, 1206, -1, 0); sfxPlay3DSound(actor, 1206, -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + 11, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + 11, actor, -1);
return; return;
} }
sfxPlay3DSound(pSprite, 1204 + Random(2), -1, 0); sfxPlay3DSound(actor, 1204 + Random(2), -1, 0);
if (nSeq == 3) if (nSeq == 3)
seqSpawn(dudeInfo[nType].seqStartID + 10, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + 10, actor, -1);
else else
@ -3439,8 +3439,8 @@ static void zombieButcherDeath(DBloodActor* actor, int nSeq)
static void genericDeath(DBloodActor* actor, int nSeq, int sound1, int seqnum) static void genericDeath(DBloodActor* actor, int nSeq, int sound1, int seqnum)
{ {
auto pSprite = &actor->s(); auto pSprite = &actor->s();
if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(pSprite, sound1 + 2, -1, 0); if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(actor, sound1 + 2, -1, 0);
else sfxPlay3DSound(pSprite, sound1 + Random(2), -1, 0); else sfxPlay3DSound(actor, sound1 + Random(2), -1, 0);
seqSpawn(seqnum, actor, -1); seqSpawn(seqnum, actor, -1);
} }
@ -3493,7 +3493,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
case kDudeCultistShotgun: case kDudeCultistShotgun:
case kDudeCultistTesla: case kDudeCultistTesla:
case kDudeCultistTNT: case kDudeCultistTNT:
sfxPlay3DSound(pSprite, 1018 + Random(2), -1, 0); sfxPlay3DSound(actor, 1018 + Random(2), -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nSeq == 3 ? nDudeToGibClient2 : nDudeToGibClient1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nSeq == 3 ? nDudeToGibClient2 : nDudeToGibClient1);
break; break;
@ -3568,7 +3568,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
break; break;
case kDudeSpiderMother: case kDudeSpiderMother:
sfxPlay3DSound(pSprite, 1850, -1, 0); sfxPlay3DSound(actor, 1850, -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
break; break;
@ -3599,15 +3599,15 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
genericDeath(actor, nSeq, 2203, dudeInfo[nType].seqStartID + nSeq); genericDeath(actor, nSeq, 2203, dudeInfo[nType].seqStartID + nSeq);
break; break;
case kDudeTentacleGreen: case kDudeTentacleGreen:
sfxPlay3DSound(pSprite, damage == 5 ? 2471 : 2472, -1, 0); sfxPlay3DSound(actor, damage == 5 ? 2471 : 2472, -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
break; break;
case kDudePodFire: case kDudePodFire:
sfxPlay3DSound(pSprite, damage == 5 ? 2451 : 2452, -1, 0); sfxPlay3DSound(actor, damage == 5 ? 2451 : 2452, -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
break; break;
case kDudeTentacleFire: case kDudeTentacleFire:
sfxPlay3DSound(pSprite, 2501, -1, 0); sfxPlay3DSound(actor, 2501, -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
break; break;
} }
@ -3624,7 +3624,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
break; break;
case kDudeTchernobog: case kDudeTchernobog:
sfxPlay3DSound(pSprite, 2380, -1, 0); sfxPlay3DSound(actor, 2380, -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, -1);
break; break;
@ -3634,7 +3634,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
break; break;
case kDudeBeast: case kDudeBeast:
sfxPlay3DSound(pSprite, 9000 + Random(2), -1, 0); sfxPlay3DSound(actor, 9000 + Random(2), -1, 0);
seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nSeq == 3 ? nDudeToGibClient2 : nDudeToGibClient1); seqSpawn(dudeInfo[nType].seqStartID + nSeq, actor, nSeq == 3 ? nDudeToGibClient2 : nDudeToGibClient1);
break; break;
@ -3796,12 +3796,12 @@ static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, D
case 0: case 0:
seqSpawn(25, actor, nTreeToGibClient); seqSpawn(25, actor, nTreeToGibClient);
sfxPlay3DSound(pSprite, 351, -1, 0); sfxPlay3DSound(actor, 351, -1, 0);
break; break;
case 1: case 1:
seqSpawn(26, 3, pSprite->extra, nTreeToGibClient); seqSpawn(26, 3, pSprite->extra, nTreeToGibClient);
sfxPlay3DSound(pSprite, 351, -1, 0); sfxPlay3DSound(actor, 351, -1, 0);
break; break;
} }
break; break;
@ -4214,7 +4214,7 @@ static void actTouchFloor(DBloodActor* actor, int nSector)
if (tileGetSurfType(nSector + 0x4000) == kSurfLava) if (tileGetSurfType(nSector + 0x4000) == kSurfLava)
{ {
actDamageSprite(actor, actor, kDamageBurn, 16); actDamageSprite(actor, actor, kDamageBurn, 16);
sfxPlay3DSound(&actor->s(), 352, 5, 2); sfxPlay3DSound(actor, 352, 5, 2);
} }
} }
@ -4366,7 +4366,7 @@ static void checkHit(DBloodActor* actor)
if (mass1 > mass2) if (mass1 > mass2)
{ {
actKickObject(actor, actor2); actKickObject(actor, actor2);
sfxPlay3DSound(pSprite, 357, -1, 1); sfxPlay3DSound(actor, 357, -1, 1);
int dmg = (mass1 - mass2) + abs(FixedToInt(actor->xvel())); int dmg = (mass1 - mass2) + abs(FixedToInt(actor->xvel()));
if (dmg > 0) actDamageSprite(actor, actor2, (Chance(0x2000)) ? kDamageFall : kDamageBullet, dmg); if (dmg > 0) actDamageSprite(actor, actor2, (Chance(0x2000)) ? kDamageFall : kDamageBullet, dmg);
} }
@ -4465,7 +4465,7 @@ static void checkFloorHit(DBloodActor* actor)
} }
actKickObject(actor, actor2); actKickObject(actor, actor2);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum); sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
sfxPlay3DSound(pSprite, 374, 0, 0); sfxPlay3DSound(actor, 374, 0, 0);
break; break;
case kThingZombieHead: case kThingZombieHead:
if (pPlayer) if (pPlayer)
@ -4664,12 +4664,12 @@ int MoveThing(DBloodActor* actor)
switch (pSprite->type) switch (pSprite->type)
{ {
case kThingZombieHead: case kThingZombieHead:
sfxPlay3DSound(pSprite, 607, 0, 0); sfxPlay3DSound(actor, 607, 0, 0);
actDamageSprite(nullptr, actor, kDamageFall, 80); actDamageSprite(nullptr, actor, kDamageFall, 80);
break; break;
case kThingKickablePail: case kThingKickablePail:
sfxPlay3DSound(pSprite, 374, 0, 0); sfxPlay3DSound(actor, 374, 0, 0);
break; break;
} }
} }
@ -4744,14 +4744,14 @@ int MoveThing(DBloodActor* actor)
case kThingZombieHead: case kThingZombieHead:
if (abs(actor->zvel()) > 0x80000) if (abs(actor->zvel()) > 0x80000)
{ {
sfxPlay3DSound(pSprite, 607, 0, 0); sfxPlay3DSound(actor, 607, 0, 0);
actDamageSprite(nullptr, actor, kDamageFall, 80); actDamageSprite(nullptr, actor, kDamageFall, 80);
} }
break; break;
case kThingKickablePail: case kThingKickablePail:
if (abs(actor->zvel()) > 0x80000) if (abs(actor->zvel()) > 0x80000)
sfxPlay3DSound(pSprite, 374, 0, 0); sfxPlay3DSound(actor, 374, 0, 0);
break; break;
} }
@ -4784,14 +4784,14 @@ int MoveThing(DBloodActor* actor)
case kThingZombieHead: case kThingZombieHead:
if (abs(actor->zvel()) > 0x80000) if (abs(actor->zvel()) > 0x80000)
{ {
sfxPlay3DSound(pSprite, 607, 0, 0); sfxPlay3DSound(actor, 607, 0, 0);
actDamageSprite(nullptr, actor, kDamageFall, 80); actDamageSprite(nullptr, actor, kDamageFall, 80);
} }
break; break;
case kThingKickablePail: case kThingKickablePail:
if (abs(actor->zvel()) > 0x80000) if (abs(actor->zvel()) > 0x80000)
sfxPlay3DSound(pSprite, 374, 0, 0); sfxPlay3DSound(actor, 374, 0, 0);
break; break;
} }
} }
@ -5035,7 +5035,7 @@ void MoveDude(DBloodActor* actor)
if (playerAlive) if (playerAlive)
{ {
pPlayer->fallScream = 1; pPlayer->fallScream = 1;
sfxPlay3DSound(pSprite, 719, 0, 0); sfxPlay3DSound(actor, 719, 0, 0);
} }
} }
vec3_t const oldpos = pSprite->pos; vec3_t const oldpos = pSprite->pos;
@ -5067,7 +5067,7 @@ void MoveDude(DBloodActor* actor)
actor->zvel() = -0x6aaaa; actor->zvel() = -0x6aaaa;
pPlayer->cantJump = 1; pPlayer->cantJump = 1;
} }
sfxPlay3DSound(pSprite, 721, -1, 0); sfxPlay3DSound(actor, 721, -1, 0);
} }
else else
{ {
@ -5119,7 +5119,7 @@ void MoveDude(DBloodActor* actor)
pXSprite->burnTime = 0; pXSprite->burnTime = 0;
pPlayer->bubbleTime = abs(actor->zvel()) >> 12; pPlayer->bubbleTime = abs(actor->zvel()) >> 12;
evPost(actor, 0, kCallbackPlayerBubble); evPost(actor, 0, kCallbackPlayerBubble);
sfxPlay3DSound(pSprite, 720, -1, 0); sfxPlay3DSound(actor, 720, -1, 0);
} }
else else
{ {
@ -5129,7 +5129,7 @@ void MoveDude(DBloodActor* actor)
case kDudeCultistShotgun: case kDudeCultistShotgun:
pXSprite->burnTime = 0; pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble); evPost(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(pSprite, 720, -1, 0); sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &cultistSwimGoto); aiNewState(actor, &cultistSwimGoto);
break; break;
case kDudeBurningCultist: case kDudeBurningCultist:
@ -5143,26 +5143,26 @@ void MoveDude(DBloodActor* actor)
pSprite->type = pSprite->inittype; // restore back to spawned cultist type pSprite->type = pSprite->inittype; // restore back to spawned cultist type
pXSprite->burnTime = 0; pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble); evPost(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(pSprite, 720, -1, 0); sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &cultistSwimGoto); aiNewState(actor, &cultistSwimGoto);
break; break;
} }
case kDudeZombieAxeNormal: case kDudeZombieAxeNormal:
pXSprite->burnTime = 0; pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble); evPost(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(pSprite, 720, -1, 0); sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &zombieAGoto); aiNewState(actor, &zombieAGoto);
break; break;
case kDudeZombieButcher: case kDudeZombieButcher:
pXSprite->burnTime = 0; pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble); evPost(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(pSprite, 720, -1, 0); sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &zombieFGoto); aiNewState(actor, &zombieFGoto);
break; break;
case kDudeGillBeast: case kDudeGillBeast:
pXSprite->burnTime = 0; pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble); evPost(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(pSprite, 720, -1, 0); sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &gillBeastSwimGoto); aiNewState(actor, &gillBeastSwimGoto);
pSprite->flags &= ~6; pSprite->flags &= ~6;
@ -5229,7 +5229,7 @@ void MoveDude(DBloodActor* actor)
if (nDamage > (15 << 4) && (pSprite->flags & 4)) if (nDamage > (15 << 4) && (pSprite->flags & 4))
playerLandingSound(pPlayer); playerLandingSound(pPlayer);
if (nDamage > (30 << 4)) if (nDamage > (30 << 4))
sfxPlay3DSound(pSprite, 701, 0, 0); sfxPlay3DSound(actor, 701, 0, 0);
} }
nDamage -= 100 << 4; nDamage -= 100 << 4;
if (nDamage > 0) if (nDamage > 0)
@ -5513,7 +5513,7 @@ void actExplodeSprite(DBloodActor* actor)
nType = kExplosionNapalm; nType = kExplosionNapalm;
seqSpawn(4, actor, -1); seqSpawn(4, actor, -1);
if (Chance(0x8000)) pSprite->cstat |= 4; if (Chance(0x8000)) pSprite->cstat |= 4;
sfxPlay3DSound(pSprite, 303, -1, 0); sfxPlay3DSound(actor, 303, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
@ -5521,7 +5521,7 @@ void actExplodeSprite(DBloodActor* actor)
nType = kExplosionFireball; nType = kExplosionFireball;
seqSpawn(9, actor, -1); seqSpawn(9, actor, -1);
if (Chance(0x8000)) pSprite->cstat |= 4; if (Chance(0x8000)) pSprite->cstat |= 4;
sfxPlay3DSound(pSprite, 306, 24 + (pSprite->index & 3), FX_GlobalChannel); // ouch... sfxPlay3DSound(actor, 306, 24 + (pSprite->index & 3), FX_GlobalChannel); // ouch...
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
@ -5529,7 +5529,7 @@ void actExplodeSprite(DBloodActor* actor)
case kMissileFireballTchernobog: case kMissileFireballTchernobog:
nType = kExplosionFireball; nType = kExplosionFireball;
seqSpawn(5, actor, -1); seqSpawn(5, actor, -1);
sfxPlay3DSound(pSprite, 304, -1, 0); sfxPlay3DSound(actor, 304, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
@ -5537,7 +5537,7 @@ void actExplodeSprite(DBloodActor* actor)
nType = kExplosionSmall; nType = kExplosionSmall;
if (actor->hit().florhit == 0) seqSpawn(4, actor, -1); if (actor->hit().florhit == 0) seqSpawn(4, actor, -1);
else seqSpawn(3, actor, -1); else seqSpawn(3, actor, -1);
sfxPlay3DSound(pSprite, 303, -1, 0); sfxPlay3DSound(actor, 303, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
@ -5551,14 +5551,14 @@ void actExplodeSprite(DBloodActor* actor)
if (actor->hit().florhit == 0) seqSpawn(4, actor, -1); if (actor->hit().florhit == 0) seqSpawn(4, actor, -1);
else else
seqSpawn(3, actor, -1); seqSpawn(3, actor, -1);
sfxPlay3DSound(pSprite, 304, -1, 0); sfxPlay3DSound(actor, 304, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
case kThingArmedSpray: case kThingArmedSpray:
nType = kExplosionSpray; nType = kExplosionSpray;
seqSpawn(5, actor, -1); seqSpawn(5, actor, -1);
sfxPlay3DSound(pSprite, 307, -1, 0); sfxPlay3DSound(actor, 307, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
@ -5579,7 +5579,7 @@ void actExplodeSprite(DBloodActor* actor)
pSprite = &spawned->s(); pSprite = &spawned->s();
pXSprite = &spawned->x(); pXSprite = &spawned->x();
sfxPlay3DSound(pSprite, 305, -1, 0); sfxPlay3DSound(actor, 305, -1, 0);
GibSprite(pSprite, GIBTYPE_14, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_14, nullptr, nullptr);
break; break;
} }
@ -5613,13 +5613,13 @@ void actExplodeSprite(DBloodActor* actor)
#endif #endif
if (getSequence(nSeq)) seqSpawn(nSeq, actor, -1); if (getSequence(nSeq)) seqSpawn(nSeq, actor, -1);
sfxPlay3DSound(pSprite, nSnd, -1, 0); sfxPlay3DSound(actor, nSnd, -1, 0);
break; break;
} }
case kThingPodFireBall: case kThingPodFireBall:
nType = kExplosionFireball; nType = kExplosionFireball;
seqSpawn(9, actor, -1); seqSpawn(9, actor, -1);
sfxPlay3DSound(pSprite, 307, -1, 0); sfxPlay3DSound(actor, 307, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
sub_746D4(pSprite, 240); sub_746D4(pSprite, 240);
break; break;
@ -5628,7 +5628,7 @@ void actExplodeSprite(DBloodActor* actor)
nType = kExplosionStandard; nType = kExplosionStandard;
seqSpawn(4, actor, -1); seqSpawn(4, actor, -1);
if (Chance(0x8000)) pSprite->cstat |= 4; if (Chance(0x8000)) pSprite->cstat |= 4;
sfxPlay3DSound(pSprite, 303, -1, 0); sfxPlay3DSound(actor, 303, -1, 0);
GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr); GibSprite(pSprite, GIBTYPE_5, nullptr, nullptr);
break; break;
} }
@ -6245,7 +6245,7 @@ static void actCheckDudes()
pPlayer->chokeEffect = 0; pPlayer->chokeEffect = 0;
if (actor->xvel() || actor->yvel()) if (actor->xvel() || actor->yvel())
sfxPlay3DSound(pSprite, 709, 100, 2); sfxPlay3DSound(actor, 709, 100, 2);
pPlayer->bubbleTime = ClipLow(pPlayer->bubbleTime - 4, 0); pPlayer->bubbleTime = ClipLow(pPlayer->bubbleTime - 4, 0);
} }
@ -6254,7 +6254,7 @@ static void actCheckDudes()
if (pPlayer->pXSprite->health > 0 && pPlayer->restTime >= 1200 && Chance(0x200)) if (pPlayer->pXSprite->health > 0 && pPlayer->restTime >= 1200 && Chance(0x200))
{ {
pPlayer->restTime = -1; pPlayer->restTime = -1;
sfxPlay3DSound(pSprite, 3100 + Random(11), 0, 2); sfxPlay3DSound(actor, 3100 + Random(11), 0, 2);
} }
} }
} }
@ -6604,11 +6604,11 @@ DBloodActor* actSpawnThing(int nSector, int x, int y, int z, int nThingType)
case kThingArmedTNTStick: case kThingArmedTNTStick:
evPost(nThing, 3, 0, kCallbackFXDynPuff); evPost(nThing, 3, 0, kCallbackFXDynPuff);
sfxPlay3DSound(pSprite, 450, 0, 0); sfxPlay3DSound(actor, 450, 0, 0);
break; break;
case kThingArmedTNTBundle: case kThingArmedTNTBundle:
sfxPlay3DSound(pSprite, 450, 0, 0); sfxPlay3DSound(actor, 450, 0, 0);
evPost(nThing, 3, 0, kCallbackFXDynPuff); evPost(nThing, 3, 0, kCallbackFXDynPuff);
break; break;
@ -7351,17 +7351,17 @@ void MakeSplash(DBloodActor* actor)
{ {
case kSurfWater: case kSurfWater:
seqSpawn(6, actor, -1); seqSpawn(6, actor, -1);
sfxPlay3DSound(pSprite, 356, -1, 0); sfxPlay3DSound(actor, 356, -1, 0);
break; break;
default: default:
seqSpawn(7, actor, -1); seqSpawn(7, actor, -1);
sfxPlay3DSound(pSprite, 354, -1, 0); sfxPlay3DSound(actor, 354, -1, 0);
break; break;
} }
break; break;
case kThingDripBlood: case kThingDripBlood:
seqSpawn(8, actor, -1); seqSpawn(8, actor, -1);
sfxPlay3DSound(pSprite, 354, -1, 0); sfxPlay3DSound(actor, 354, -1, 0);
break; break;
} }
} }

View file

@ -1013,7 +1013,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
if (powerupCheck(pPlayer, kPwUpShadowCloak)) pPlayer->pwUpTime[kPwUpShadowCloak] = 0; if (powerupCheck(pPlayer, kPwUpShadowCloak)) pPlayer->pwUpTime[kPwUpShadowCloak] = 0;
if (readyForCrit(pSource, pSprite)) if (readyForCrit(pSource, pSprite))
{ {
nDamage += aiDamageSprite(actor, source, nDmgType, nDamage * (10 - gGameOptions.nDifficulty)); nDamage += aiDamageSprite(actor, source, nDmgType, nDamage * (10 - gGameOptions.nDifficulty));
if (pXSprite->health > 0) if (pXSprite->health > 0)
{ {
int fullHp = (pXSprite->sysData2 > 0) ? ClipRange(pXSprite->sysData2 << 4, 1, 65535) : getDudeInfo(pSprite->type)->startHealth << 4; int fullHp = (pXSprite->sysData2 > 0) ? ClipRange(pXSprite->sysData2 << 4, 1, 65535) : getDudeInfo(pSprite->type)->startHealth << 4;

View file

@ -78,7 +78,7 @@ void SlashSeqCallback(int, DBloodActor* actor)
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash); actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash); actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash); actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash);
sfxPlay3DSound(pSprite, 9012+Random(2), -1, 0); sfxPlay3DSound(actor, 9012+Random(2), -1, 0);
} }
void StompSeqCallback(int, DBloodActor* actor1) void StompSeqCallback(int, DBloodActor* actor1)
@ -171,7 +171,7 @@ void StompSeqCallback(int, DBloodActor* actor1)
} }
} }
} }
sfxPlay3DSound(pSprite, 9015+Random(2), -1, 0); sfxPlay3DSound(actor1, 9015+Random(2), -1, 0);
} }
static void MorphToBeast(DBloodActor* actor) static void MorphToBeast(DBloodActor* actor)

View file

@ -75,11 +75,11 @@ void SeqAttackCallback(int, DBloodActor* actor)
actFireVector(actor, 0, 0, dx+r3, dy+r2, dz+r1, kVectorShell); actFireVector(actor, 0, 0, dx+r3, dy+r2, dz+r1, kVectorShell);
} }
if (Chance(0x8000)) if (Chance(0x8000))
sfxPlay3DSound(pSprite, 10000+Random(5), -1, 0); sfxPlay3DSound(actor, 10000+Random(5), -1, 0);
if (Chance(0x8000)) if (Chance(0x8000))
sfxPlay3DSound(pSprite, 1001, -1, 0); sfxPlay3DSound(actor, 1001, -1, 0);
else else
sfxPlay3DSound(pSprite, 1002, -1, 0); sfxPlay3DSound(actor, 1002, -1, 0);
} }
static void calebThinkSearch(DBloodActor* actor) static void calebThinkSearch(DBloodActor* actor)
@ -241,7 +241,7 @@ static void calebThinkChase(DBloodActor* actor)
else else
aiNewState(actor, &tinycalebGoto); aiNewState(actor, &tinycalebGoto);
if (Chance(0x2000)) if (Chance(0x2000))
sfxPlay3DSound(pSprite, 10000 + Random(5), -1, 0); sfxPlay3DSound(actor, 10000 + Random(5), -1, 0);
actor->SetTarget(nullptr); actor->SetTarget(nullptr);
} }

View file

@ -84,7 +84,7 @@ void TommySeqCallback(int, DBloodActor* actor)
dy += Random3((5-gGameOptions.nDifficulty)*1000); dy += Random3((5-gGameOptions.nDifficulty)*1000);
dz += Random3((5-gGameOptions.nDifficulty)*500); dz += Random3((5-gGameOptions.nDifficulty)*500);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorBullet); actFireVector(actor, 0, 0, dx, dy, dz, kVectorBullet);
sfxPlay3DSound(pSprite, 4001, -1, 0); sfxPlay3DSound(actor, 4001, -1, 0);
} }
void TeslaSeqCallback(int, DBloodActor* actor) void TeslaSeqCallback(int, DBloodActor* actor)
@ -100,7 +100,7 @@ void TeslaSeqCallback(int, DBloodActor* actor)
dy += Random3((5-gGameOptions.nDifficulty)*1000); dy += Random3((5-gGameOptions.nDifficulty)*1000);
dz += Random3((5-gGameOptions.nDifficulty)*500); dz += Random3((5-gGameOptions.nDifficulty)*500);
actFireMissile(pSprite, 0, 0, dx, dy, dz, kMissileTeslaRegular); actFireMissile(pSprite, 0, 0, dx, dy, dz, kMissileTeslaRegular);
sfxPlay3DSound(pSprite, 470, -1, 0); sfxPlay3DSound(actor, 470, -1, 0);
} }
} }
@ -122,9 +122,9 @@ void ShotSeqCallback(int, DBloodActor* actor)
actFireVector(actor, 0, 0, dx+r3, dy+r2, dz+r1, kVectorShell); actFireVector(actor, 0, 0, dx+r3, dy+r2, dz+r1, kVectorShell);
} }
if (Chance(0x8000)) if (Chance(0x8000))
sfxPlay3DSound(pSprite, 1001, -1, 0); sfxPlay3DSound(actor, 1001, -1, 0);
else else
sfxPlay3DSound(pSprite, 1002, -1, 0); sfxPlay3DSound(actor, 1002, -1, 0);
} }
void cultThrowSeqCallback(int, DBloodActor* actor) void cultThrowSeqCallback(int, DBloodActor* actor)
@ -135,7 +135,7 @@ void cultThrowSeqCallback(int, DBloodActor* actor)
if (gGameOptions.nDifficulty > 2) if (gGameOptions.nDifficulty > 2)
nMissile = kThingArmedTNTBundle; nMissile = kThingArmedTNTBundle;
char v4 = Chance(0x6000); char v4 = Chance(0x6000);
sfxPlay3DSound(pSprite, 455, -1, 0); sfxPlay3DSound(actor, 455, -1, 0);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
spritetype *pTarget = &actor->GetTarget()->s(); spritetype *pTarget = &actor->GetTarget()->s();
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
@ -160,7 +160,7 @@ void sub_68170(int, DBloodActor* actor)
int nMissile = kThingArmedTNTStick; int nMissile = kThingArmedTNTStick;
if (gGameOptions.nDifficulty > 2) if (gGameOptions.nDifficulty > 2)
nMissile = kThingArmedTNTBundle; nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(pSprite, 455, -1, 0); sfxPlay3DSound(actor, 455, -1, 0);
auto pMissile = actFireThing(actor, 0, 0, actor->dudeSlope - 9460, nMissile, 0x133333); auto pMissile = actFireThing(actor, 0, 0, actor->dudeSlope - 9460, nMissile, 0x133333);
evPost(pMissile, 120 * (2 + Random(2)), kCmdOn); evPost(pMissile, 120 * (2 + Random(2)), kCmdOn);
} }
@ -172,7 +172,7 @@ void sub_68230(int, DBloodActor* actor)
int nMissile = kThingArmedTNTStick; int nMissile = kThingArmedTNTStick;
if (gGameOptions.nDifficulty > 2) if (gGameOptions.nDifficulty > 2)
nMissile = kThingArmedTNTBundle; nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(pSprite, 455, -1, 0); sfxPlay3DSound(actor, 455, -1, 0);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
spritetype *pTarget = &actor->GetTarget()->s(); spritetype *pTarget = &actor->GetTarget()->s();
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);

View file

@ -407,7 +407,7 @@ static void gargThinkChase(DBloodActor* actor)
switch (hit) switch (hit)
{ {
case -1: case -1:
sfxPlay3DSound(pSprite, 1408, 0, 0); sfxPlay3DSound(actor, 1408, 0, 0);
aiNewState(actor, &gargoyleFThrow); aiNewState(actor, &gargoyleFThrow);
break; break;
case 0: case 0:
@ -416,12 +416,12 @@ static void gargThinkChase(DBloodActor* actor)
case 3: case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleStone) if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleStone)
{ {
sfxPlay3DSound(pSprite, 1408, 0, 0); sfxPlay3DSound(actor, 1408, 0, 0);
aiNewState(actor, &gargoyleFThrow); aiNewState(actor, &gargoyleFThrow);
} }
break; break;
default: default:
sfxPlay3DSound(pSprite, 1408, 0, 0); sfxPlay3DSound(actor, 1408, 0, 0);
aiNewState(actor, &gargoyleFThrow); aiNewState(actor, &gargoyleFThrow);
break; break;
} }
@ -432,7 +432,7 @@ static void gargThinkChase(DBloodActor* actor)
switch (hit) switch (hit)
{ {
case -1: case -1:
sfxPlay3DSound(pSprite, 1406, 0, 0); sfxPlay3DSound(actor, 1406, 0, 0);
aiNewState(actor, &gargoyleFSlash); aiNewState(actor, &gargoyleFSlash);
break; break;
case 0: case 0:
@ -441,12 +441,12 @@ static void gargThinkChase(DBloodActor* actor)
case 3: case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleStone) if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleStone)
{ {
sfxPlay3DSound(pSprite, 1406, 0, 0); sfxPlay3DSound(actor, 1406, 0, 0);
aiNewState(actor, &gargoyleFSlash); aiNewState(actor, &gargoyleFSlash);
} }
break; break;
default: default:
sfxPlay3DSound(pSprite, 1406, 0, 0); sfxPlay3DSound(actor, 1406, 0, 0);
aiNewState(actor, &gargoyleFSlash); aiNewState(actor, &gargoyleFSlash);
break; break;
} }
@ -466,7 +466,7 @@ static void gargThinkChase(DBloodActor* actor)
switch (hit) switch (hit)
{ {
case -1: case -1:
sfxPlay3DSound(pSprite, 1457, 0, 0); sfxPlay3DSound(actor, 1457, 0, 0);
aiNewState(actor, &gargoyleSBlast); aiNewState(actor, &gargoyleSBlast);
break; break;
case 0: case 0:
@ -475,12 +475,12 @@ static void gargThinkChase(DBloodActor* actor)
case 3: case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleFlesh) if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeGargoyleFlesh)
{ {
sfxPlay3DSound(pSprite, 1457, 0, 0); sfxPlay3DSound(actor, 1457, 0, 0);
aiNewState(actor, &gargoyleSBlast); aiNewState(actor, &gargoyleSBlast);
} }
break; break;
default: default:
sfxPlay3DSound(pSprite, 1457, 0, 0); sfxPlay3DSound(actor, 1457, 0, 0);
aiNewState(actor, &gargoyleSBlast); aiNewState(actor, &gargoyleSBlast);
break; break;
} }

View file

@ -74,7 +74,7 @@ void ghostSlashSeqCallback(int, DBloodActor* actor)
int dz = height-height2; int dz = height-height2;
int dx = CosScale16(pSprite->ang); int dx = CosScale16(pSprite->ang);
int dy = SinScale16(pSprite->ang); int dy = SinScale16(pSprite->ang);
sfxPlay3DSound(pSprite, 1406, 0, 0); sfxPlay3DSound(actor, 1406, 0, 0);
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGhost); actFireVector(actor, 0, 0, dx, dy, dz, kVectorGhost);
int r1 = Random(50); int r1 = Random(50);
int r2 = Random(50); int r2 = Random(50);
@ -172,12 +172,12 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
// allow fire missile in non-player targets if not a demo // allow fire missile in non-player targets if not a demo
if (IsPlayerSprite(pTarget) || gModernMap) { if (IsPlayerSprite(pTarget) || gModernMap) {
sfxPlay3DSound(pSprite, 489, 0, 0); sfxPlay3DSound(actor, 489, 0, 0);
actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull); actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
} }
#else #else
if (IsPlayerSprite(pTarget)) { if (IsPlayerSprite(pTarget)) {
sfxPlay3DSound(pSprite, 489, 0, 0); sfxPlay3DSound(actor, 489, 0, 0);
actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull); actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
} }
#endif #endif

View file

@ -230,7 +230,7 @@ static void gillThinkChase(DBloodActor* actor)
aiNewState(actor, &gillBeastSwimGoto); aiNewState(actor, &gillBeastSwimGoto);
else else
aiNewState(actor, &gillBeastGoto); aiNewState(actor, &gillBeastGoto);
sfxPlay3DSound(pSprite, 1701, -1, 0); sfxPlay3DSound(actor, 1701, -1, 0);
actor->SetTarget(nullptr); actor->SetTarget(nullptr);
} }

View file

@ -53,12 +53,12 @@ AISTATE tentacleChase = { kAiStateChase, 6, -1, 0, NULL, aiMoveTurn, aiPodChase,
void sub_6FF08(int, DBloodActor* actor) void sub_6FF08(int, DBloodActor* actor)
{ {
sfxPlay3DSound(&actor->s(), 2503, -1, 0); sfxPlay3DSound(actor, 2503, -1, 0);
} }
void sub_6FF54(int, DBloodActor* actor) void sub_6FF54(int, DBloodActor* actor)
{ {
sfxPlay3DSound(&actor->s(), 2500, -1, 0); sfxPlay3DSound(actor, 2500, -1, 0);
} }
void podAttack(int, DBloodActor* actor) void podAttack(int, DBloodActor* actor)
@ -85,9 +85,9 @@ void podAttack(int, DBloodActor* actor)
if (pDudeInfo->seeDist*0.1 < nDist) if (pDudeInfo->seeDist*0.1 < nDist)
{ {
if (Chance(0x8000)) if (Chance(0x8000))
sfxPlay3DSound(pSprite, 2474, -1, 0); sfxPlay3DSound(actor, 2474, -1, 0);
else else
sfxPlay3DSound(pSprite, 2475, -1, 0); sfxPlay3DSound(actor, 2475, -1, 0);
pMissile = actFireThing(actor, 0, -8000, dz/128-14500, kThingPodGreenBall, (nDist2<<23)/120); pMissile = actFireThing(actor, 0, -8000, dz/128-14500, kThingPodGreenBall, (nDist2<<23)/120);
} }
if (pMissile) if (pMissile)
@ -97,7 +97,7 @@ void podAttack(int, DBloodActor* actor)
dz += 8000; dz += 8000;
if (pDudeInfo->seeDist*0.1 < nDist) if (pDudeInfo->seeDist*0.1 < nDist)
{ {
sfxPlay3DSound(pSprite, 2454, -1, 0); sfxPlay3DSound(actor, 2454, -1, 0);
pMissile = actFireThing(actor, 0, -8000, dz/128-14500, kThingPodFireBall, (nDist2<<23)/120); pMissile = actFireThing(actor, 0, -8000, dz/128-14500, kThingPodFireBall, (nDist2<<23)/120);
} }
if (pMissile) if (pMissile)
@ -111,7 +111,7 @@ void podAttack(int, DBloodActor* actor)
void sub_70284(int, DBloodActor* actor) void sub_70284(int, DBloodActor* actor)
{ {
auto pSprite = &actor->s(); auto pSprite = &actor->s();
sfxPlay3DSound(pSprite, 2502, -1, 0); sfxPlay3DSound(actor, 2502, -1, 0);
int nDist, nBurn; int nDist, nBurn;
DAMAGE_TYPE dmgType; DAMAGE_TYPE dmgType;
switch (pSprite->type) { switch (pSprite->type) {

View file

@ -197,7 +197,7 @@ void punchCallback(int, DBloodActor* actor)
int dz = nZOffset1 - nZOffset2; int dz = nZOffset1 - nZOffset2;
if (!playGenDudeSound(pSprite, kGenDudeSndAttackMelee)) if (!playGenDudeSound(pSprite, kGenDudeSndAttackMelee))
sfxPlay3DSound(pSprite, 530, 1, 0); sfxPlay3DSound(actor, 530, 1, 0);
actFireVector(actor, 0, 0, dx, dy, dz,kVectorGenDudePunch); actFireVector(actor, 0, 0, dx, dy, dz,kVectorGenDudePunch);
} }
@ -295,7 +295,7 @@ static void ThrowThing(DBloodActor* actor, bool impact)
const THINGINFO* pThinkInfo = &thingInfo[curWeapon - kThingBase]; const THINGINFO* pThinkInfo = &thingInfo[curWeapon - kThingBase];
if (!gThingInfoExtra[curWeapon - kThingBase].allowThrow) return; if (!gThingInfoExtra[curWeapon - kThingBase].allowThrow) return;
else if (!playGenDudeSound(pSprite, kGenDudeSndAttackThrow)) else if (!playGenDudeSound(pSprite, kGenDudeSndAttackThrow))
sfxPlay3DSound(pSprite, 455, -1, 0); sfxPlay3DSound(actor, 455, -1, 0);
int zThrow = 14500; int zThrow = 14500;
int dx = pTarget->x - pSprite->x; int dx = pTarget->x - pSprite->x;
@ -357,7 +357,7 @@ static void ThrowThing(DBloodActor* actor, bool impact)
if (pLeech != NULL) pXThing->health = pXLeech->health; if (pLeech != NULL) pXThing->health = pXLeech->health;
else pXThing->health = ((pThinkInfo->startHealth << 4) * gGameOptions.nDifficulty) >> 1; else pXThing->health = ((pThinkInfo->startHealth << 4) * gGameOptions.nDifficulty) >> 1;
sfxPlay3DSound(pSprite, 490, -1, 0); sfxPlay3DSound(actor, 490, -1, 0);
pXThing->data3 = 512 / (gGameOptions.nDifficulty + 1); pXThing->data3 = 512 / (gGameOptions.nDifficulty + 1);
pThing->cstat &= ~CSTAT_SPRITE_BLOCK; pThing->cstat &= ~CSTAT_SPRITE_BLOCK;

View file

@ -81,7 +81,7 @@ void HackSeqCallback(int, DBloodActor* actor)
void StandSeqCallback(int, DBloodActor* actor) void StandSeqCallback(int, DBloodActor* actor)
{ {
sfxPlay3DSound(&actor->s(), 1102, -1, 0); sfxPlay3DSound(actor, 1102, -1, 0);
} }
static void zombaThinkSearch(DBloodActor* actor) static void zombaThinkSearch(DBloodActor* actor)