- added format conversion helpers to DUDEINFO.

This commit is contained in:
Christoph Oelckers 2022-09-16 23:04:46 +02:00
parent b2d1988e50
commit d7a93e140c
4 changed files with 20 additions and 4 deletions

View file

@ -139,7 +139,7 @@ static void batThinkGoto(DBloodActor* actor)
auto nAngle = VecToAngle(dvec);
int nDist = approxDist(dvec);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery))
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
aiNewState(actor, &batSearch);
batThinkTarget(actor);
}

View file

@ -178,7 +178,7 @@ static void beastThinkGoto(DBloodActor* actor)
auto nAngle = VecToAngle(dvec);
int nDist = approxDist(dvec);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery))
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
{
if (pXSector && pXSector->Underwater)
aiNewState(actor, &beastSwimSearch);
@ -328,7 +328,7 @@ static void beastThinkSwimGoto(DBloodActor* actor)
auto nAngle = VecToAngle(dvec);
int nDist = approxDist(dvec);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery))
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
aiNewState(actor, &beastSwimSearch);
aiThinkTarget(actor);
}

View file

@ -152,7 +152,7 @@ static void eelThinkGoto(DBloodActor* actor)
auto nAngle = VecToAngle(dvec);
int nDist = approxDist(dvec);
aiChooseDirection(actor, nAngle);
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery))
if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
aiNewState(actor, &eelSearch);
eelThinkTarget(actor);
}

View file

@ -52,6 +52,22 @@ struct DUDEINFO {
int damageVal[7]; // real damage? Hmm?
int at8c; // unused ?
int at90; // unused ?
// converters to floating point format
inline double Heardist() const
{
return hearDist * maptoworld;
}
inline double SeeDist() const
{
return seeDist * maptoworld;
}
inline DAngle Periphery() const
{
return mapangle(periphery);
}
};
extern DUDEINFO dudeInfo[kDudeMax - kDudeBase];