From fbae41ee0aa46c1d5e3e06b7bfbc32b18b2c0a4e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Sep 2021 21:05:40 +0200 Subject: [PATCH] - renamed the sprite variant of aiDamageSprite. --- source/games/blood/src/actor.cpp | 10 +++++----- source/games/blood/src/actor.h | 2 +- source/games/blood/src/aibeast.cpp | 4 ++-- source/games/blood/src/nnexts.cpp | 6 +++--- source/games/blood/src/player.cpp | 8 ++++---- source/games/blood/src/triggers.cpp | 12 ++++++------ source/games/blood/src/weapon.cpp | 22 +++++++++++----------- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 64d5b5458..6383daa29 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -3966,7 +3966,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) { int nOwner = pMissile->owner; int nDamage = (15 + Random(7)) << 4; - actDamageSprite(nOwner, pSpriteHit, kDamageBullet, nDamage); + actDamageSprite_(nOwner, pSpriteHit, kDamageBullet, nDamage); } actPostSprite(missileActor, kStatFree); break; @@ -4276,7 +4276,7 @@ static void checkCeilHit(DBloodActor* actor) int dmg = abs((mass1 - mass2) * (pSprite2->clipdist - pSprite->clipdist)); if (actor2->IsDudeActor()) { - if (dmg > 0) actDamageSprite(pSprite2->index, pSprite, (Chance(0x2000)) ? kDamageFall : (Chance(0x4000)) ? kDamageExplode : kDamageBullet, dmg); + if (dmg > 0) actDamageSprite_(pSprite2->index, pSprite, (Chance(0x2000)) ? kDamageFall : (Chance(0x4000)) ? kDamageExplode : kDamageBullet, dmg); if (Chance(0x0200)) actKickObject(actor2, actor); } } @@ -4475,7 +4475,7 @@ static void checkFloorHit(DBloodActor* actor) } actKickObject(actor, actor2); sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum); - actDamageSprite(-1, pSprite2, kDamageFall, 80); + actDamageSprite_(-1, pSprite2, kDamageFall, 80); break; case kTrapSawCircular: if (!pXSprite2->state) actDamageSprite(actor, actor, kDamageBullet, 1); @@ -4874,7 +4874,7 @@ void MoveDude(DBloodActor* actor) { nSector = pSprite->sectnum; if (pSprite->statnum == kStatDude || pSprite->statnum == kStatThing) - actDamageSprite(pSprite->index, pSprite, kDamageFall, 1000 << 4); + actDamageSprite_(pSprite->index, pSprite, kDamageFall, 1000 << 4); } if (sector[nSector].type >= kSectorPath && sector[nSector].type <= kSectorRotate) @@ -7404,7 +7404,7 @@ void SerializeActor(FSerializer& arc) } // dumping ground for temporary wrappers. -int actDamageSprite(int nSource, spritetype* pSprite, DAMAGE_TYPE damageType, int damage) +int actDamageSprite_(int nSource, spritetype* pSprite, DAMAGE_TYPE damageType, int damage) { return actDamageSprite(nSource == -1 ? nullptr : &bloodActors[nSource], &bloodActors[pSprite->index], damageType, damage); } diff --git a/source/games/blood/src/actor.h b/source/games/blood/src/actor.h index 45ee2d9d9..06e1afaba 100644 --- a/source/games/blood/src/actor.h +++ b/source/games/blood/src/actor.h @@ -223,7 +223,7 @@ void actRadiusDamage(DBloodActor* source, int x, int y, int z, int nSector, int DBloodActor *actDropObject(DBloodActor *pSprite, int nType); bool actHealDude(DBloodActor* pXDude, int a2, int a3); void actKillDude(DBloodActor* a1, DBloodActor* pSprite, DAMAGE_TYPE a3, int a4); -int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE a3, int a4); +int actDamageSprite_(int nSource, spritetype *pSprite, DAMAGE_TYPE a3, int a4); int actDamageSprite(DBloodActor* pSource, DBloodActor* pTarget, DAMAGE_TYPE damageType, int damage); void actHitcodeToData(int a1, HITINFO *pHitInfo, DBloodActor **actor, walltype **a7 = nullptr); void actAirDrag(DBloodActor *pSprite, int a2); diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 217f5aaaf..8679198ea 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -139,7 +139,7 @@ void StompSeqCallback(int, DBloodActor* actor1) nDamage = v1c + ((vc-nDist2)*v10)/vc; if (IsPlayerSprite(pSprite2)) gPlayer[pSprite2->type-kDudePlayer1].quakeEffect += nDamage*4; - actDamageSprite(nSprite, pSprite2, kDamageFall, nDamage<<4); + actDamageSprite_(nSprite, pSprite2, kDamageFall, nDamage<<4); } } } @@ -169,7 +169,7 @@ void StompSeqCallback(int, DBloodActor* actor1) nDamage = v1c + ((vc-nDist2)*v10)/vc; if (IsPlayerSprite(pSprite2)) gPlayer[pSprite2->type-kDudePlayer1].quakeEffect += nDamage*4; - actDamageSprite(nSprite, pSprite2, kDamageFall, nDamage<<4); + actDamageSprite_(nSprite, pSprite2, kDamageFall, nDamage<<4); } } } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 34327d409..0cf6cba3d 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1500,7 +1500,7 @@ void debrisConcuss(int nOwner, int listIndex, int x, int y, int z, int dmg) { pSprite->statnum = kStatThing; // temporary change statnum property } - actDamageSprite(nOwner, pSprite, kDamageExplode, dmg); + actDamageSprite_(nOwner, pSprite, kDamageExplode, dmg); if (thing) pSprite->statnum = kStatDecoration; // return statnum property back @@ -3019,13 +3019,13 @@ void damageSprites(XSPRITE* pXSource, spritetype* pSprite) { playerDamageArmor(pPlayer, (DAMAGE_TYPE)dmgType, dmg); for (int i = 0; i < 3; armor[i] = pPlayer->armor[i], pPlayer->armor[i] = 0, i++); - actDamageSprite(pSource->index, pSprite, (DAMAGE_TYPE)dmgType, dmg); + actDamageSprite_(pSource->index, pSprite, (DAMAGE_TYPE)dmgType, dmg); for (int i = 0; i < 3; pPlayer->armor[i] = armor[i], i++); } else { - actDamageSprite(pSource->index, pSprite, (DAMAGE_TYPE)dmgType, dmg); + actDamageSprite_(pSource->index, pSprite, (DAMAGE_TYPE)dmgType, dmg); } diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index f7d754b97..3469c7d6d 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -268,7 +268,7 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp) } if (ceilIsTooLow(pPlayer->pSprite)) - actDamageSprite(pPlayer->pSprite->index, pPlayer->pSprite, kDamageExplode, 65535); + actDamageSprite_(pPlayer->pSprite->index, pPlayer->pSprite, kDamageExplode, 65535); } break; #endif @@ -316,7 +316,7 @@ void powerupDeactivate(PLAYER *pPlayer, int nPowerUp) if (gModernMap) { playerSizeReset(pPlayer); if (ceilIsTooLow(pPlayer->pSprite)) - actDamageSprite(pPlayer->pSprite->index, pPlayer->pSprite, kDamageExplode, 65535); + actDamageSprite_(pPlayer->pSprite->index, pPlayer->pSprite, kDamageExplode, 65535); } break; case kItemShroomGrow: @@ -1669,13 +1669,13 @@ void playerProcess(PLAYER *pPlayer) { short nSector = pSprite->sectnum; if (pushmove_old(&pSprite->x, &pSprite->y, &pSprite->z, &nSector, dw, dzt, dzb, CLIPMASK0) == -1) - actDamageSprite(nSprite, pSprite, kDamageFall, 500<<4); + actDamageSprite_(nSprite, pSprite, kDamageFall, 500<<4); if (pSprite->sectnum != nSector) { if (nSector == -1) { nSector = pSprite->sectnum; - actDamageSprite(nSprite, pSprite, kDamageFall, 500<<4); + actDamageSprite_(nSprite, pSprite, kDamageFall, 500<<4); } assert(nSector >= 0 && nSector < kMaxSectors); ChangeSpriteSect(nSprite, nSector); diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 408af2ab9..8686ed681 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1168,7 +1168,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) nDamage = 500; else nDamage = pXSector->data; - actDamageSprite(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); + actDamageSprite_(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); } a2 = ClipRange(a2-(vbp/2)*4, 0, 65536); } @@ -1179,7 +1179,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) nDamage = 500; else nDamage = pXSector->data; - actDamageSprite(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); + actDamageSprite_(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); a2 = ClipRange(a2-(vbp/2)*4, 0, 65536); } } @@ -1202,7 +1202,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) nDamage = 500; else nDamage = pXSector->data; - actDamageSprite(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); + actDamageSprite_(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); } a2 = ClipRange(a2+(vbp/2)*4, 0, 65536); } @@ -1213,7 +1213,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) nDamage = 500; else nDamage = pXSector->data; - actDamageSprite(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); + actDamageSprite_(nSprite, &sprite[nSprite], kDamageFall, nDamage<<4); a2 = ClipRange(a2+(vbp/2)*4, 0, 65536); } } @@ -1426,9 +1426,9 @@ void TeleFrag(int nKiller, int nSector) { spritetype *pSprite = &sprite[nSprite]; if (pSprite->statnum == kStatDude) - actDamageSprite(nKiller, pSprite, kDamageExplode, 4000); + actDamageSprite_(nKiller, pSprite, kDamageExplode, 4000); else if (pSprite->statnum == kStatThing) - actDamageSprite(nKiller, pSprite, kDamageExplode, 4000); + actDamageSprite_(nKiller, pSprite, kDamageExplode, 4000); } } diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 3a2252bbf..44b10c222 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -1434,7 +1434,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) spritetype *pSprite = pPlayer->pSprite; if (nTrigger == 4) { - actDamageSprite(nSprite, pSprite, kDamageBullet, 1<<4); + actDamageSprite_(nSprite, pSprite, kDamageBullet, 1<<4); return; } assert(pPlayer->voodooTarget >= 0); @@ -1447,7 +1447,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) { sfxPlay3DSound(pSprite, 460, 2, 0); fxSpawnBlood(pTarget, 17<<4); - int nDamage = actDamageSprite(nSprite, pTarget, kDamageSpirit, 17<<4); + int nDamage = actDamageSprite_(nSprite, pTarget, kDamageSpirit, 17<<4); UseAmmo(pPlayer, 9, nDamage/4); break; } @@ -1455,7 +1455,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) { sfxPlay3DSound(pSprite, 460, 2, 0); fxSpawnBlood(pTarget, 17<<4); - int nDamage = actDamageSprite(nSprite, pTarget, kDamageSpirit, 9<<4); + int nDamage = actDamageSprite_(nSprite, pTarget, kDamageSpirit, 9<<4); if (IsPlayerSprite(pTarget)) WeaponLower(&gPlayer[pTarget->type-kDudePlayer1]); UseAmmo(pPlayer, 9, nDamage/4); @@ -1465,7 +1465,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) { sfxPlay3DSound(pSprite, 463, 2, 0); fxSpawnBlood(pTarget, 17<<4); - int nDamage = actDamageSprite(nSprite, pTarget, kDamageSpirit, 49<<4); + int nDamage = actDamageSprite_(nSprite, pTarget, kDamageSpirit, 49<<4); UseAmmo(pPlayer, 9, nDamage/4); break; } @@ -1473,7 +1473,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) { sfxPlay3DSound(pSprite, 460, 2, 0); fxSpawnBlood(pTarget, 17<<4); - int nDamage = actDamageSprite(nSprite, pTarget, kDamageSpirit, 11<<4); + int nDamage = actDamageSprite_(nSprite, pTarget, kDamageSpirit, 11<<4); if (IsPlayerSprite(pTarget)) { PLAYER *pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1]; @@ -1508,7 +1508,7 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer) int v8 = pPlayer->ammoCount[9] << 1; int nDamage = (v8 + Random(vc)) << 4; nDamage = (nDamage * ((51200 - nDist) + 1)) / 51200; - nDamage = actDamageSprite(pPlayer->nSprite, pTarget, kDamageSpirit, nDamage); + nDamage = actDamageSprite_(pPlayer->nSprite, pTarget, kDamageSpirit, nDamage); if (IsPlayerSprite(pTarget)) { @@ -1546,7 +1546,7 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer) int v8 = pPlayer->ammoCount[9] << 1; int nDamage = (v8 + Random2(vc)) << 4; nDamage = (nDamage * ((51200 - nDist) + 1)) / 51200; - nDamage = actDamageSprite(pPlayer->nSprite, pTarget, kDamageSpirit, nDamage); + nDamage = actDamageSprite_(pPlayer->nSprite, pTarget, kDamageSpirit, nDamage); UseAmmo(pPlayer, 9, nDamage); if (IsPlayerSprite(pTarget)) { @@ -1699,7 +1699,7 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer) if (checkAmmo2(pPlayer, 8, 1)) UseAmmo(pPlayer, 8, 1); else - actDamageSprite(pPlayer->nSprite, pPlayer->pSprite, kDamageSpirit, 16); + actDamageSprite_(pPlayer->nSprite, pPlayer->pSprite, kDamageSpirit, 16); pPlayer->visibility = ClipHigh(pPlayer->visibility+5, 50); } @@ -1722,7 +1722,7 @@ void AltFireLifeLeech(int , PLAYER *pPlayer) int nAmmo = pPlayer->ammoCount[8]; if (nAmmo < 25 && pPlayer->pXSprite->health > unsigned((25-nAmmo)<<4)) { - actDamageSprite(pPlayer->nSprite, pPlayer->pSprite, kDamageSpirit, ((25-nAmmo)<<4)); + actDamageSprite_(pPlayer->nSprite, pPlayer->pSprite, kDamageSpirit, ((25-nAmmo)<<4)); nAmmo = 25; } pXSprite->data3 = nAmmo; @@ -2668,7 +2668,7 @@ void teslaHit(spritetype *pMissile, int a2) int nDamage = ClipLow((nDist-(ksqrt(dx*dx+dy*dy)>>4)+20)>>1, 10); if (nSprite == nOwner) nDamage /= 2; - actDamageSprite(nOwner, pSprite, kDamageTesla, nDamage<<4); + actDamageSprite_(nOwner, pSprite, kDamageTesla, nDamage<<4); } } } @@ -2686,7 +2686,7 @@ void teslaHit(spritetype *pMissile, int a2) int dx = pMissile->x-pSprite->x; int dy = pMissile->y-pSprite->y; int nDamage = ClipLow(nDist-(ksqrt(dx*dx+dy*dy)>>4)+20, 20); - actDamageSprite(nOwner, pSprite, kDamageTesla, nDamage<<4); + actDamageSprite_(nOwner, pSprite, kDamageTesla, nDamage<<4); } } }