- renamed evPost to evPostActor and evKill to evKillActor for clarity.

This commit is contained in:
Christoph Oelckers 2021-08-27 09:44:47 +02:00
parent 0ab33b7ffe
commit 71b144023d
13 changed files with 115 additions and 115 deletions

View file

@ -2878,7 +2878,7 @@ static DBloodActor* actDropFlag(DBloodActor* actor, int nType)
auto act2 = actDropItem(actor, nType);
if (act2 && gGameOptions.nGameType == 3)
{
evPost(act2, 1800, kCallbackReturnFlag);
evPostActor(act2, 1800, kCallbackReturnFlag);
}
return act2;
}
@ -3291,7 +3291,7 @@ static void zombieAxeNormalDeath(DBloodActor* actor, int nSeq)
else if (nSeq == 1 && Chance(0x4000))
{
seqSpawn(dudeInfo[nType].seqStartID + 7, actor, nDudeToGibClient1);
evPost(actor, 0, kCallbackFXZombieSpurt);
evPostActor(actor, 0, kCallbackFXZombieSpurt);
sfxPlay3DSound(actor, 362, -1, 0);
actor->x().data1 = 35;
actor->x().data2 = 5;
@ -4002,7 +4002,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
{
if (pThingInfo && pSpriteHit->type == kThingTNTBarrel && actorHit->x().burnTime == 0)
evPost(actorHit, 0, kCallbackFXFlameLick);
evPostActor(actorHit, 0, kCallbackFXFlameLick);
int nDamage = (50 + Random(50)) << 4;
actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage);
@ -4022,7 +4022,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if ((pThingInfo && pThingInfo->dmgControl[kDamageBurn] != 0) || (pDudeInfo && pDudeInfo->damageVal[kDamageBurn] != 0))
{
if (pThingInfo && pSpriteHit->type == kThingTNTBarrel && actorHit->x().burnTime == 0)
evPost(actorHit, 0, kCallbackFXFlameLick);
evPostActor(actorHit, 0, kCallbackFXFlameLick);
actBurnSprite(missileOwner, actorHit, 480);
actRadiusDamage(missileOwner, pMissile->x, pMissile->y, pMissile->z, pMissile->sectnum, 16, 20, 10, kDamageBullet, 6, 480);
@ -4061,7 +4061,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if (hitCode == 3 && actorHit && actorHit->hasX())
{
if ((pSpriteHit->statnum == kStatThing || pSpriteHit->statnum == kStatDude) && pXSpriteHit->burnTime == 0)
evPost(actorHit, 0, kCallbackFXFlameLick);
evPostActor(actorHit, 0, kCallbackFXFlameLick);
actBurnSprite(missileOwner, actorHit, (4 + gGameOptions.nDifficulty) << 2);
actDamageSprite(missileOwner, actorHit, kDamageBurn, 8);
@ -4073,7 +4073,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if (hitCode == 3 && actorHit && actorHit->hasX())
{
if ((pSpriteHit->statnum == kStatThing || pSpriteHit->statnum == kStatDude) && pXSpriteHit->burnTime == 0)
evPost(actorHit, 0, kCallbackFXFlameLick);
evPostActor(actorHit, 0, kCallbackFXFlameLick);
actBurnSprite(missileOwner, actorHit, (4 + gGameOptions.nDifficulty) << 2);
actDamageSprite(missileOwner, actorHit, kDamageBurn, 8);
@ -4088,7 +4088,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
if (hitCode == 3 && actorHit && actorHit->hasX())
{
if ((pSpriteHit->statnum == kStatThing || pSpriteHit->statnum == kStatDude) && pXSpriteHit->burnTime == 0)
evPost(actorHit, 0, kCallbackFXFlameLick);
evPostActor(actorHit, 0, kCallbackFXFlameLick);
actBurnSprite(missileOwner, actorHit, 32);
actDamageSprite(missileOwner, actorHit, kDamageSpirit, 12);
@ -4135,7 +4135,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
sfxKill3DSound(pMissile, -1, -1);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 518, pMissile->sectnum);
GibSprite(pMissile, (hitCode == 2) ? GIBTYPE_23 : GIBTYPE_22, NULL, NULL);
evKill(missileActor);
evKillActor(missileActor);
seqKill(missileActor);
actPostSprite(missileActor, kStatFree);
if (hitCode == 3 && actorHit)
@ -5117,7 +5117,7 @@ void MoveDude(DBloodActor* actor)
pPlayer->posture = 1;
pXSprite->burnTime = 0;
pPlayer->bubbleTime = abs(actor->zvel()) >> 12;
evPost(actor, 0, kCallbackPlayerBubble);
evPostActor(actor, 0, kCallbackPlayerBubble);
sfxPlay3DSound(actor, 720, -1, 0);
}
else
@ -5127,7 +5127,7 @@ void MoveDude(DBloodActor* actor)
case kDudeCultistTommy:
case kDudeCultistShotgun:
pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble);
evPostActor(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &cultistSwimGoto);
break;
@ -5141,26 +5141,26 @@ void MoveDude(DBloodActor* actor)
if (fixRandomCultist) // fix burning cultists randomly switching types underwater
pSprite->type = pSprite->inittype; // restore back to spawned cultist type
pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble);
evPostActor(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &cultistSwimGoto);
break;
}
case kDudeZombieAxeNormal:
pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble);
evPostActor(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &zombieAGoto);
break;
case kDudeZombieButcher:
pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble);
evPostActor(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &zombieFGoto);
break;
case kDudeGillBeast:
pXSprite->burnTime = 0;
evPost(actor, 0, kCallbackEnemeyBubble);
evPostActor(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(actor, 720, -1, 0);
aiNewState(actor, &gillBeastSwimGoto);
@ -5183,7 +5183,7 @@ void MoveDude(DBloodActor* actor)
if (pSprite->type == kDudeModernCustom) {
evPost(actor, 0, kCallbackEnemeyBubble);
evPostActor(actor, 0, kCallbackEnemeyBubble);
if (!canSwim(actor)) actKillDude(actor, actor, kDamageFall, 1000 << 4);
break;
}
@ -5500,7 +5500,7 @@ void actExplodeSprite(DBloodActor* actor)
if (pSprite->statnum == kStatExplosion) return;
sfxKill3DSound(pSprite, -1, -1);
evKill(actor);
evKillActor(actor);
int nType = kExplosionStandard;
@ -5874,12 +5874,12 @@ static void actCheckThings()
if (hit.type == kHitSector)
{
actRadiusDamage(actor->GetOwner(), pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 200, 1, 20, kDamageExplode, 6, 0);
evPost(actor, 0, kCallbackFXPodBloodSplat);
evPostActor(actor, 0, kCallbackFXPodBloodSplat);
}
else if (hit.type == kHitSprite)
{
actDamageSprite(actor->GetOwner(), hit.actor, kDamageFall, 12);
evPost(actor, 0, kCallbackFXPodBloodSplat);
evPostActor(actor, 0, kCallbackFXPodBloodSplat);
}
break;
@ -5991,7 +5991,7 @@ static void actCheckExplosion()
{
assert(dudeactor->hasX());
XSPRITE* pXDude = &dudeactor->x();
if (!pXDude->burnTime) evPost(dudeactor, 0, kCallbackFXFlameLick);
if (!pXDude->burnTime) evPostActor(dudeactor, 0, kCallbackFXFlameLick);
actBurnSprite(Owner, dudeactor, pExplodeInfo->burnTime << 2);
}
}
@ -6017,7 +6017,7 @@ static void actCheckExplosion()
if (pExplodeInfo->burnTime)
{
if (pThing->type == kThingTNTBarrel && !pXThing->burnTime)
evPost(thingactor, 0, kCallbackFXFlameLick);
evPostActor(thingactor, 0, kCallbackFXFlameLick);
actBurnSprite(Owner, thingactor, pExplodeInfo->burnTime << 2);
}
}
@ -6598,17 +6598,17 @@ DBloodActor* actSpawnThing(int nSector, int x, int y, int z, int nThingType)
break;
case kThingArmedTNTStick:
evPost(actor, 0, kCallbackFXDynPuff);
evPostActor(actor, 0, kCallbackFXDynPuff);
sfxPlay3DSound(actor, 450, 0, 0);
break;
case kThingArmedTNTBundle:
sfxPlay3DSound(actor, 450, 0, 0);
evPost(actor, 0, kCallbackFXDynPuff);
evPostActor(actor, 0, kCallbackFXDynPuff);
break;
case kThingArmedSpray:
evPost(actor, 0, kCallbackFXDynPuff);
evPostActor(actor, 0, kCallbackFXDynPuff);
break;
}
return actor;
@ -6659,10 +6659,10 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
switch (pMissile->type)
{
case kMissileLifeLeechRegular:
evPost(spawned, 0, kCallbackFXFlameLick);
evPostActor(spawned, 0, kCallbackFXFlameLick);
break;
case kMissileTeslaAlt:
evPost(spawned, 0, kCallbackFXTeslaAlt);
evPostActor(spawned, 0, kCallbackFXTeslaAlt);
break;
case kMissilePukeGreen:
seqSpawn(29, spawned, -1);
@ -6709,16 +6709,16 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
spawned->zvel() += actor->zvel() / 2 + Random2(0x11111);
break;
case kMissileFlareAlt:
evPost(spawned, 30, kCallbackFXFlareBurst);
evPost(spawned, 0, kCallbackFXFlareSpark);
evPostActor(spawned, 30, kCallbackFXFlareBurst);
evPostActor(spawned, 0, kCallbackFXFlareSpark);
sfxPlay3DSound(pMissile, 422, 0, 0);
break;
case kMissileFlareRegular:
evPost(spawned, 0, kCallbackFXFlareSpark);
evPostActor(spawned, 0, kCallbackFXFlareSpark);
sfxPlay3DSound(pMissile, 422, 0, 0);
break;
case kMissileLifeLeechAltSmall:
evPost(spawned, 0, kCallbackFXArcSpark);
evPostActor(spawned, 0, kCallbackFXArcSpark);
break;
case kMissileArcGargoyle:
sfxPlay3DSound(pMissile, 252, 0, 0);
@ -6779,7 +6779,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5,
pMissile->owner = pSprite->index;
pMissile->cstat |= 1;
spawned->SetTarget(nullptr);
evPost(spawned, 600, kCallbackRemove);
evPostActor(spawned, 600, kCallbackRemove);
actBuildMissile(spawned, actor);
@ -6883,7 +6883,7 @@ bool actCheckRespawn(DBloodActor* actor)
pSprite->y = actor->basePoint().y;
pSprite->z = actor->basePoint().z;
}
evPost(actor, nRespawnTime, kCallbackRespawn);
evPostActor(actor, nRespawnTime, kCallbackRespawn);
}
return 1;
}
@ -7036,7 +7036,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
}
if (pVectorData->burnTime)
{
if (!actor->x().burnTime) evPost(actor, 0, kCallbackFXFlameLick);
if (!actor->x().burnTime) evPostActor(actor, 0, kCallbackFXFlameLick);
actBurnSprite(shooter->GetOwner(), actor, pVectorData->burnTime);
}
}
@ -7066,7 +7066,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
}
if (pVectorData->burnTime)
{
if (!actor->x().burnTime) evPost(actor, 0, kCallbackFXFlameLick);
if (!actor->x().burnTime) evPostActor(actor, 0, kCallbackFXFlameLick);
actBurnSprite(shooter->GetOwner(), actor, pVectorData->burnTime);
}
if (Chance(pVectorData->fxChance))
@ -7124,7 +7124,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
actor->zvel() += MulScale(a6, impulse, 16);
if (pVectorData->burnTime != 0) {
if (!pXSprite->burnTime) evPost(actor, 0, kCallbackFXFlameLick);
if (!pXSprite->burnTime) evPostActor(actor, 0, kCallbackFXFlameLick);
actBurnSprite(shooter->GetOwner(), actor, pVectorData->burnTime);
}
@ -7321,7 +7321,7 @@ void actPostProcess(void)
{
if (p.sprite->s().statnum != kStatFree)
{
evKill(p.sprite);
evKillActor(p.sprite);
if (p.sprite->hasX()) seqKill(p.sprite);
DeleteSprite(p.sprite->s().index);
}

View file

@ -1087,7 +1087,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
aiGenDudeNewState(actor, &genDudeBurnGoto);
actHealDude(actor, dudeInfo[55].startHealth, dudeInfo[55].startHealth);
actor->dudeExtra.time = PlayClock + 360;
evKill(actor, kCallbackFXFlameLick);
evKillActor(actor, kCallbackFXFlameLick);
}
}
@ -1161,7 +1161,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
aiPlay3DSound(actor, 1031 + Random(2), AI_SFX_PRIORITY_2, -1);
actor->dudeExtra.time = PlayClock + 360;
actHealDude(actor, dudeInfo[40].startHealth, dudeInfo[40].startHealth);
evKill(actor, kCallbackFXFlameLick);
evKillActor(actor, kCallbackFXFlameLick);
}
break;
case kDudeInnocent:
@ -1172,7 +1172,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
actor->dudeExtra.time = PlayClock + 360;
actHealDude(actor, dudeInfo[39].startHealth, dudeInfo[39].startHealth);
evKill(actor, kCallbackFXFlameLick);
evKillActor(actor, kCallbackFXFlameLick);
}
break;
case kDudeBurningCultist:
@ -1208,7 +1208,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
pSprite->type = kDudeBurningZombieButcher;
aiNewState(actor, &zombieFBurnGoto);
actHealDude(actor, dudeInfo[42].startHealth, dudeInfo[42].startHealth);
evKill(actor, kCallbackFXFlameLick);
evKillActor(actor, kCallbackFXFlameLick);
}
break;
case kDudeTinyCaleb:
@ -1227,7 +1227,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
actor->dudeExtra.time = PlayClock + 360;
actHealDude(actor, dudeInfo[39].startHealth, dudeInfo[39].startHealth);
evKill(actor, kCallbackFXFlameLick);
evKillActor(actor, kCallbackFXFlameLick);
}
break;
case kDudeCultistBeast:
@ -1248,7 +1248,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
pSprite->type = kDudeBurningZombieAxe;
aiNewState(actor, &zombieABurnGoto);
actHealDude(actor, dudeInfo[41].startHealth, dudeInfo[41].startHealth);
evKill(actor, kCallbackFXFlameLick);
evKillActor(actor, kCallbackFXFlameLick);
}
break;
}

View file

@ -150,7 +150,7 @@ void cultThrowSeqCallback(int, DBloodActor* actor)
if (v4)
pMissile->x().Impact = 1;
else
evPost(pMissile, 120 * (1 + Random(2)), kCmdOn);
evPostActor(pMissile, 120 * (1 + Random(2)), kCmdOn);
}
void sub_68170(int, DBloodActor* actor)
@ -162,7 +162,7 @@ void sub_68170(int, DBloodActor* actor)
nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(actor, 455, -1, 0);
auto pMissile = actFireThing(actor, 0, 0, actor->dudeSlope - 9460, nMissile, 0x133333);
evPost(pMissile, 120 * (2 + Random(2)), kCmdOn);
evPostActor(pMissile, 120 * (2 + Random(2)), kCmdOn);
}
void sub_68230(int, DBloodActor* actor)

View file

@ -56,7 +56,7 @@ void sub_71A90(int, DBloodActor* actor)
int nTarget = pTarget->index;
int nOwner = pSprite->owner;
if (pXTarget->burnTime == 0)
evPost(actor->GetTarget(), 0, kCallbackFXFlameLick);
evPostActor(actor->GetTarget(), 0, kCallbackFXFlameLick);
actBurnSprite(nOwner, pXTarget, 40);
if (Chance(0x6000))
aiNewState(actor, &tcherno13A9D4);

View file

@ -405,14 +405,14 @@ static void ThrowThing(DBloodActor* actor, bool impact)
pXSpawned->stateTimer = 1;
actor->genDudeExtra().pLifeLeech = spawned;
evPost(spawned, 80, kCallbackLeechStateTimer);
evPostActor(spawned, 80, kCallbackLeechStateTimer);
return;
}
if (impact == true && dist <= 7680) pXSpawned->Impact = true;
else {
pXSpawned->Impact = false;
evPost(spawned, 120 * Random(2) + 120, kCmdOn);
evPostActor(spawned, 120 * Random(2) + 120, kCmdOn);
}
}
@ -1889,7 +1889,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
{
missile->SetOwner(actor);
pXSprite->stateTimer = 1;
evPost(actor, t2, kCallbackLeechStateTimer);
evPostActor(actor, t2, kCallbackLeechStateTimer);
pXSprite->data3 = ClipLow(pXSprite->data3 - 1, 0);
}
pSprite->ang = angBak;

View file

@ -55,14 +55,14 @@ void fxFlameLick(DBloodActor* actor, int) // 0
}
}
if (pXSprite->burnTime > 0)
evPost(actor, 5, kCallbackFXFlameLick);
evPostActor(actor, 5, kCallbackFXFlameLick);
}
void Remove(DBloodActor* actor, int) // 1
{
if (!actor) return;
spritetype *pSprite = &actor->s();
evKill(actor, kCallbackFXFlareSpark);
evKillActor(actor, kCallbackFXFlareSpark);
if (pSprite->extra > 0)
seqKill(3, pSprite->extra);
sfxKill3DSound(pSprite, 0, -1);
@ -98,9 +98,9 @@ void FlareBurst(DBloodActor* actor, int) // 2
spawnedactor->xvel() += dx;
spawnedactor->yvel() += dy;
spawnedactor->zvel() += dz;
evPost(spawnedactor, 960, kCallbackRemove);
evPostActor(spawnedactor, 960, kCallbackRemove);
}
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
}
void fxFlareSpark(DBloodActor* actor, int) // 3
@ -114,7 +114,7 @@ void fxFlareSpark(DBloodActor* actor, int) // 3
pFX->yvel() = actor->yvel() + Random2(0x1aaaa);
pFX->zvel() = actor->zvel() - Random(0x1aaaa);
}
evPost(actor, 4, kCallbackFXFlareSpark);
evPostActor(actor, 4, kCallbackFXFlareSpark);
}
void fxFlareSparkLite(DBloodActor* actor, int) // 4
@ -128,7 +128,7 @@ void fxFlareSparkLite(DBloodActor* actor, int) // 4
pFX->yvel() = actor->yvel() + Random2(0x1aaaa);
pFX->zvel() = actor->zvel() - Random(0x1aaaa);
}
evPost(actor, 12, kCallbackFXFlareSparkLite);
evPostActor(actor, 12, kCallbackFXFlareSparkLite);
}
void fxZombieBloodSpurt(DBloodActor* actor, int) // 5
@ -149,12 +149,12 @@ void fxZombieBloodSpurt(DBloodActor* actor, int) // 5
}
if (pXSprite->data1 > 0)
{
evPost(actor, 4, kCallbackFXZombieSpurt);
evPostActor(actor, 4, kCallbackFXZombieSpurt);
pXSprite->data1 -= 4;
}
else if (pXSprite->data2 > 0)
{
evPost(actor, 60, kCallbackFXZombieSpurt);
evPostActor(actor, 60, kCallbackFXZombieSpurt);
pXSprite->data1 = 40;
pXSprite->data2--;
}
@ -172,7 +172,7 @@ void fxBloodSpurt(DBloodActor* actor, int) // 6
pFX->yvel() = actor->yvel()>>8;
pFX->zvel() = actor->zvel()>>8;
}
evPost(actor, 6, kCallbackFXBloodSpurt);
evPostActor(actor, 6, kCallbackFXBloodSpurt);
}
@ -187,7 +187,7 @@ void fxArcSpark(DBloodActor* actor, int) // 7
pFX->yvel() = actor->yvel() + Random2(0x10000);
pFX->zvel() = actor->zvel() - Random(0x1aaaa);
}
evPost(actor, 3, kCallbackFXArcSpark);
evPostActor(actor, 3, kCallbackFXArcSpark);
}
@ -209,7 +209,7 @@ void fxDynPuff(DBloodActor* actor, int) // 8
pFX->zvel() = actor->zvel();
}
}
evPost(actor, 12, kCallbackFXDynPuff);
evPostActor(actor, 12, kCallbackFXDynPuff);
}
void Respawn(DBloodActor* actor, int) // 9
@ -231,13 +231,13 @@ void Respawn(DBloodActor* actor, int) // 9
case 1: {
int nTime = MulScale(actGetRespawnTime(actor), 0x4000, 16);
pXSprite->respawnPending = 2;
evPost(actor, nTime, kCallbackRespawn);
evPostActor(actor, nTime, kCallbackRespawn);
break;
}
case 2: {
int nTime = MulScale(actGetRespawnTime(actor), 0x2000, 16);
pXSprite->respawnPending = 3;
evPost(actor, nTime, kCallbackRespawn);
evPostActor(actor, nTime, kCallbackRespawn);
break;
}
case 3: {
@ -324,7 +324,7 @@ void PlayerBubble(DBloodActor* actor, int) // 10
pFX->zvel() = actor->zvel() + Random2(0x1aaaa);
}
}
evPost(actor, 4, kCallbackPlayerBubble);
evPostActor(actor, 4, kCallbackPlayerBubble);
}
}
@ -349,7 +349,7 @@ void EnemyBubble(DBloodActor* actor, int) // 11
pFX->zvel() = actor->zvel() + Random2(0x1aaaa);
}
}
evPost(actor, 4, kCallbackEnemeyBubble);
evPostActor(actor, 4, kCallbackEnemeyBubble);
}
void CounterCheck(DBloodActor*, int nSector) // 12
@ -431,7 +431,7 @@ void fxTeslaAlt(DBloodActor* actor, int) // 15
pFX->yvel() = actor->yvel() + Random2(0x1aaaa);
pFX->zvel() = actor->zvel() - Random(0x1aaaa);
}
evPost(actor, 3, kCallbackFXTeslaAlt);
evPostActor(actor, 3, kCallbackFXTeslaAlt);
}
@ -520,7 +520,7 @@ void returnFlagToBase(DBloodActor* actor, int) // 17
break;
}
}
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
}
void fxPodBloodSpray(DBloodActor* actor, int) // 18
@ -539,7 +539,7 @@ void fxPodBloodSpray(DBloodActor* actor, int) // 18
pFX->yvel() = actor->yvel() >> 8;
pFX->zvel() = actor->zvel() >> 8;
}
evPost(actor, 6, kCallbackFXPodBloodSpray);
evPostActor(actor, 6, kCallbackFXPodBloodSpray);
}
void fxPodBloodSplat(DBloodActor* actor, int) // 19
@ -623,7 +623,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
int nOwner = pSprite->owner;
if (nOwner < 0 || nOwner >= kMaxSprites)
{
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
return;
}
spritetype *pOwner = &sprite[nOwner];
@ -634,7 +634,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
pPlayer = NULL;
if (!pPlayer)
{
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
return;
}
pSprite->ang = getangle(pOwner->x-pSprite->x, pOwner->y-pSprite->y);
@ -644,7 +644,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
XSPRITE *pXSprite = &actor->x();
if (pXSprite->data1 == 0)
{
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
return;
}
int nSprite2;
@ -681,7 +681,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
int nDmg = actDamageSprite(actor, actor2, kDamageSpirit, pXSprite->data1<<4);
pXSprite->data1 = ClipLow(pXSprite->data1-nDmg, 0);
sub_76A08(actor2, pSprite, pPlayer2);
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
return;
}
}
@ -722,7 +722,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
if (vd && (Chance(vd) || nNextSprite < 0))
{
sub_76A08(actor2, pSprite, NULL);
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
return;
}
}
@ -730,7 +730,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
}
}
pXSprite->data1 = ClipLow(pXSprite->data1-1, 0);
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
}
}
@ -741,12 +741,12 @@ void callbackCondition(DBloodActor* actor, int)
TRCONDITION* pCond = &gCondition[pXSprite->sysData1];
for (unsigned i = 0; i < pCond->length; i++) {
EVENT evn; evn.index = pCond->obj[i].index; evn.type = pCond->obj[i].type;
EVENT evn; evn.index_ = pCond->obj[i].index; evn.type = pCond->obj[i].type;
evn.cmd = pCond->obj[i].cmd; evn.funcID = kCallbackCondition;
useCondition(&sprite[pXSprite->reference], pXSprite, evn);
}
evPost(actor, pXSprite->busyTime, kCallbackCondition);
evPostActor(actor, pXSprite->busyTime, kCallbackCondition);
return;
}

View file

@ -368,7 +368,7 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
EVENT event;
event.actor = nType == SS_SPRITE? &bloodActors[nIndex] : nullptr;
event.index = nIndex;
event.index_ = nIndex;
event.type = nType;
event.cmd = command;
@ -482,7 +482,7 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
#endif
for (int i = bucketHead[rxId]; i < bucketHead[rxId + 1]; i++)
{
if (event.type != rxBucket[i].type || (event.type != OBJ_SPRITE && event.index != rxBucket[i].rxindex) || (event.type == OBJ_SPRITE && event.actor != rxBucket[i].GetActor()))
if (event.type != rxBucket[i].type || (event.type != OBJ_SPRITE && event.index_ != rxBucket[i].rxindex) || (event.type == OBJ_SPRITE && event.actor != rxBucket[i].GetActor()))
{
switch (rxBucket[i].type)
{
@ -531,12 +531,12 @@ void evPost_(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback)
}
void evPost(DBloodActor* actor, unsigned int nDelta, COMMAND_ID command)
void evPostActor(DBloodActor* actor, unsigned int nDelta, COMMAND_ID command)
{
evPost_(actor->s().index, OBJ_SPRITE, nDelta, command);
}
void evPost(DBloodActor* actor, unsigned int nDelta, CALLBACK_ID callback)
void evPostActor(DBloodActor* actor, unsigned int nDelta, CALLBACK_ID callback)
{
evPost_(actor->s().index, OBJ_SPRITE, nDelta, callback);
}
@ -561,7 +561,7 @@ void evKill_(int index, int type)
{
for (auto ev = queue.begin(); ev != queue.end();)
{
if (ev->index == index && ev->type == type) ev = queue.erase(ev);
if (ev->index_ == index && ev->type == type) ev = queue.erase(ev);
else ev++;
}
}
@ -570,17 +570,17 @@ void evKill_(int index, int type, CALLBACK_ID cb)
{
for (auto ev = queue.begin(); ev != queue.end();)
{
if (ev->index == index && ev->type == type && ev->funcID == cb) ev = queue.erase(ev);
if (ev->index_ == index && ev->type == type && ev->funcID == cb) ev = queue.erase(ev);
else ev++;
}
}
void evKill(DBloodActor* actor)
void evKillActor(DBloodActor* actor)
{
evKill_(actor->s().index, 3);
}
void evKill(DBloodActor* actor, CALLBACK_ID cb)
void evKillActor(DBloodActor* actor, CALLBACK_ID cb)
{
evKill_(actor->s().index, 3, cb);
}
@ -602,21 +602,21 @@ void evProcess(unsigned int time)
{
assert(event.funcID < kCallbackMax);
assert(gCallback[event.funcID] != nullptr);
if (event.type == OBJ_SPRITE) gCallback[event.funcID](&bloodActors[event.index], 0);
else gCallback[event.funcID](nullptr, event.index);
if (event.type == OBJ_SPRITE) gCallback[event.funcID](&bloodActors[event.index_], 0);
else gCallback[event.funcID](nullptr, event.index_);
}
else
{
switch (event.type)
{
case SS_SECTOR:
trMessageSector(event.index, event);
trMessageSector(event.index_, event);
break;
case SS_WALL:
trMessageWall(event.index, event);
trMessageWall(event.index_, event);
break;
case SS_SPRITE:
trMessageSprite(event.index, event);
trMessageSprite(event.index_, event);
break;
}
}
@ -633,7 +633,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, EVENT& w, EVENT* d
{
if (arc.BeginObject(keyname))
{
arc("index", w.index)
arc("index", w.index_)
("type", w.type)
("command", w.cmd)
("func", w.funcID)

View file

@ -150,7 +150,7 @@ inline bool channelRangeIsFine(int channel) {
struct EVENT
{
DBloodActor* actor;
int16_t index;
int16_t index_;
int8_t type;
int8_t cmd;
int16_t funcID;
@ -166,8 +166,8 @@ void evInit(void);
void evSend(int nIndex, int nType, int rxId, COMMAND_ID command);
//void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command);
//void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback);
void evPost(DBloodActor*, unsigned int nDelta, COMMAND_ID command);
void evPost(DBloodActor*, unsigned int nDelta, CALLBACK_ID callback);
void evPostActor(DBloodActor*, unsigned int nDelta, COMMAND_ID command);
void evPostActor(DBloodActor*, unsigned int nDelta, CALLBACK_ID callback);
void evPostSector(int index, unsigned int nDelta, COMMAND_ID command);
void evPostSector(int index, unsigned int nDelta, CALLBACK_ID callback);
@ -175,7 +175,7 @@ void evPostSector(int index, unsigned int nDelta, CALLBACK_ID callback);
void evProcess(unsigned int nTime);
void evKill_(int a1, int a2);
void evKill_(int a1, int a2, CALLBACK_ID a3);
void evKill(DBloodActor*);
void evKill(DBloodActor*, CALLBACK_ID a3);
void evKillActor(DBloodActor*);
void evKillActor(DBloodActor*, CALLBACK_ID a3);
END_BLD_NS

View file

@ -110,7 +110,7 @@ FXDATA gFXData[] = {
void CFX::destroy(DBloodActor* actor)
{
if (!actor) return;
evKill(actor);
evKillActor(actor);
if (actor->hasX()) seqKill(actor);
DeleteSprite(actor);
}
@ -185,7 +185,7 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, int nSector, int x, int y, int z, unsi
if (a6 == 0)
a6 = pFX->ate;
if (a6)
evPost(actor, a6+Random2(a6>>1), kCallbackRemove);
evPostActor(actor, a6+Random2(a6>>1), kCallbackRemove);
return actor;
}
@ -272,7 +272,7 @@ void fxSpawnBlood(DBloodActor *actor, int )
bloodactor->xvel() = Random2(0x6aaaa);
bloodactor->yvel() = Random2(0x6aaaa);
bloodactor->zvel() = -(int)Random(0x10aaaa)-100;
evPost(bloodactor, 8, kCallbackFXBloodSpurt);
evPostActor(bloodactor, 8, kCallbackFXBloodSpurt);
}
}
@ -297,7 +297,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int )
spawnactor->xvel() = Random2(0x6aaaa);
spawnactor->yvel() = Random2(0x6aaaa);
spawnactor->zvel() = -(int)Random(0x10aaaa)-100;
evPost(spawnactor, 8, kCallbackFXPodBloodSpray);
evPostActor(spawnactor, 8, kCallbackFXPodBloodSpray);
}
}

View file

@ -310,7 +310,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
case kCheatMcGee:
{
if (!gMe->pXSprite->burnTime)
evPost(gMe->actor(), 0, kCallbackFXFlameLick);
evPostActor(gMe->actor(), 0, kCallbackFXFlameLick);
actBurnSprite(gMe->pSprite->index, gMe->pXSprite, 2400);
return GStrings("TXTB_FIRED");
}
@ -323,7 +323,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
actHealDude(gMe->actor(), 200, 200);
gMe->armor[1] = VanillaMode() ? 200 : 3200;
if (!gMe->pXSprite->burnTime)
evPost(gMe->actor(), 0, kCallbackFXFlameLick);
evPostActor(gMe->actor(), 0, kCallbackFXFlameLick);
actBurnSprite(gMe->pSprite->index, gMe->pXSprite, 2400);
return GStrings("TXTB_RETARD");
}

View file

@ -1054,7 +1054,7 @@ void nnExtProcessSuperSprites() {
if (pXCond->data1 >= kCondGameBase && pXCond->data1 < kCondGameMax) {
EVENT evn;
evn.index = pXCond->reference; evn.cmd = (int8_t)pXCond->command;
evn.index_ = pXCond->reference; evn.cmd = (int8_t)pXCond->command;
evn.type = OBJ_SPRITE; evn.funcID = kCallbackMax;
useCondition(&sprite[pXCond->reference], pXCond, evn);
@ -1064,7 +1064,7 @@ void nnExtProcessSuperSprites() {
for (unsigned k = 0; k < pCond->length; k++) {
EVENT evn;
evn.index = pCond->obj[k].index; evn.cmd = pCond->obj[k].cmd;
evn.index_ = pCond->obj[k].index; evn.cmd = pCond->obj[k].cmd;
evn.type = pCond->obj[k].type; evn.funcID = kCallbackMax;
useCondition(&sprite[pXCond->reference], pXCond, evn);
@ -3082,14 +3082,14 @@ void damageSprites(XSPRITE* pXSource, spritetype* pSprite)
case kDmgBurn:
if (pXSprite->burnTime > 0) break;
actBurnSprite(pSource->index, pXSprite, ClipLow(dmg >> 1, 128));
evKill(actor, kCallbackFXFlameLick);
evPost(actor, 0, kCallbackFXFlameLick); // show flames
evKillActor(actor, kCallbackFXFlameLick);
evPostActor(actor, 0, kCallbackFXFlameLick); // show flames
break;
case kDmgElectric:
forceRecoil = true; // show tesla recoil animation
break;
case kDmgBullet:
evKill(actor, kCallbackFXBloodSpurt);
evKillActor(actor, kCallbackFXBloodSpurt);
for (int i = 1; i < 6; i++) {
if (Chance(0x16000 >> i))
@ -4194,7 +4194,7 @@ void modernTypeSendCommand(int nSprite, int destChannel, COMMAND_ID command) {
void modernTypeTrigger(int destObjType, int destObjIndex, EVENT event) {
if (event.type != OBJ_SPRITE) return;
spritetype* pSource = &sprite[event.index];
spritetype* pSource = &sprite[event.index_];
if (!xspriRangeIsFine(pSource->extra)) return;
XSPRITE* pXSource = &xsprite[pSource->extra];
@ -4811,10 +4811,10 @@ bool modernTypeOperateSprite(int nSprite, spritetype* pSprite, XSPRITE* pXSprite
viewSetSystemMessage("Only sprites could use command #%d", event.cmd);
return true;
} else if (xspriRangeIsFine(sprite[event.index].extra)) {
} else if (xspriRangeIsFine(sprite[event.index_].extra)) {
// copy dude flags from the source to destination sprite
aiPatrolFlagsMgr(&sprite[event.index], &xsprite[sprite[event.index].extra], pSprite, pXSprite, true, false);
aiPatrolFlagsMgr(&sprite[event.index_], &xsprite[sprite[event.index_].extra], pSprite, pXSprite, true, false);
}
@ -4841,8 +4841,8 @@ bool modernTypeOperateSprite(int nSprite, spritetype* pSprite, XSPRITE* pXSprite
}
break;
case kCmdDudeFlagsSet:
if (!xspriRangeIsFine(sprite[event.index].extra)) break;
else aiPatrolFlagsMgr(&sprite[event.index], &xsprite[sprite[event.index].extra], pSprite, pXSprite, false, true); // initialize patrol dude with possible new flags
if (!xspriRangeIsFine(sprite[event.index_].extra)) break;
else aiPatrolFlagsMgr(&sprite[event.index_], &xsprite[sprite[event.index_].extra], pSprite, pXSprite, false, true); // initialize patrol dude with possible new flags
break;
default:
if (!pXSprite->state) evPost_(nSprite, OBJ_SPRITE, 0, kCmdOn);
@ -5379,7 +5379,7 @@ void useSequentialTx(XSPRITE* pXSource, COMMAND_ID cmd, bool setState) {
int useCondition(spritetype* pSource, XSPRITE* pXSource, EVENT event) {
int objType = event.type; int objIndex = event.index;
int objType = event.type; int objIndex = event.index_;
bool srcIsCondition = false;
if (objType == OBJ_SPRITE && objIndex != pSource->index)
srcIsCondition = (sprite[objIndex].type == kModernCondition || sprite[objIndex].type == kModernConditionFalse);
@ -7897,7 +7897,7 @@ void callbackUniMissileBurst(DBloodActor* actor, int) // 22
zvel[pBurst->index] += dz;
evPost_(pBurst->index, 3, 960, kCallbackRemove);
}
evPost(actor, 0, kCallbackRemove);
evPostActor(actor, 0, kCallbackRemove);
}

View file

@ -2074,7 +2074,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
DBloodActor* pItem = nullptr;
if (pPlayer->pXSprite->dropMsg && (pItem = actDropItem(pActor, pPlayer->pXSprite->dropMsg)) != NULL)
evPost(pItem, 500, kCallbackRemove);
evPostActor(pItem, 500, kCallbackRemove);
if (pPlayer->pXSprite->key) {
@ -2085,7 +2085,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
}
if (i == 0 && (pItem = actDropKey(pActor, (pPlayer->pXSprite->key + kItemKeyBase) - 1)) != NULL)
evPost(pItem, 500, kCallbackRemove);
evPostActor(pItem, 500, kCallbackRemove);
}

View file

@ -171,7 +171,7 @@ void ReverseBusy(int a1, BUSYID a2)
unsigned int GetSourceBusy(EVENT a1)
{
int nIndex = a1.index;
int nIndex = a1.index_;
switch (a1.type)
{
case 6:
@ -209,7 +209,7 @@ void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event)
PLAYER *pPlayer = &gPlayer[nPlayer];
if (pPlayer->pXSprite->health > 0)
{
evKill(actor);
evKillActor(actor);
pPlayer->ammoCount[8] = ClipHigh(pPlayer->ammoCount[8]+pXSprite->data3, gAmmoInfo[8].max);
pPlayer->hasWeapon[9] = 1;
if (pPlayer->curWeapon != kWeapLifeLeech)
@ -1698,7 +1698,7 @@ void LinkSprite(int nSprite, XSPRITE *pXSprite, EVENT event) {
{
if (event.type == 3)
{
int nSprite2 = event.index;
int nSprite2 = event.index_;
int nXSprite2 = sprite[nSprite2].extra;
assert(nXSprite2 > 0 && nXSprite2 < kMaxXSprites);
pXSprite->data1 = xsprite[nXSprite2].data1;