- use a wrapper function to check for the radial damage event.

This commit is contained in:
Christoph Oelckers 2021-10-28 18:08:03 +02:00
parent 7a65cc46d0
commit 791240786d
5 changed files with 7 additions and 5 deletions

View file

@ -399,6 +399,8 @@ struct RunListEvent
int nRadialDamage; // Radial damage needs a bit more info.
int nDamageRadius;
DExhumedActor* pRadialActor;
bool isRadialEvent() const { return nMessage == EMessageType::RadialDamage; }
};
struct ExhumedAI

View file

@ -440,7 +440,7 @@ void AIAnubis::Damage(RunListEvent* ev)
if (nAction < 11)
{
DropMagic(ap);
ap->nAction = (ev->nMessage == EMessageType::RadialDamage) + 11;
ap->nAction = int(ev->isRadialEvent()) + 11;
ap->nFrame = 0;
}
}

View file

@ -287,7 +287,7 @@ void AIFish::Damage(RunListEvent* ev)
pSprite->cstat &= 0xFEFE;
if (ev->nMessage == EMessageType::Damage)
if (!ev->isRadialEvent())
{
for (int i = 0; i < 3; i++)
{

View file

@ -140,7 +140,7 @@ void AILion::Damage(RunListEvent* ev)
{
DropMagic(pActor);
if (ev->nMessage == EMessageType::RadialDamage)
if (ev->isRadialEvent())
{
pActor->nAction = 11;
}

View file

@ -650,7 +650,7 @@ void AIPlayer::Damage(RunListEvent* ev)
return;
}
DExhumedActor* pActor2 = (ev->nMessage != EMessageType::RadialDamage) ? ev->pOtherActor : ev->pRadialActor->pTarget;
DExhumedActor* pActor2 = (!ev->isRadialEvent()) ? ev->pOtherActor : ev->pRadialActor->pTarget;
// ok continue case 0x80000 as normal, loc_1C57C
if (!PlayerList[nPlayer].nHealth) {
@ -726,7 +726,7 @@ void AIPlayer::Damage(RunListEvent* ev)
PlayerList[nPlayer].nPlayerScore--;
}
if (ev->nMessage == EMessageType::RadialDamage)
if (ev->isRadialEvent())
{
for (int i = 122; i <= 131; i++)
{