mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- added format conversion helpers to DUDEINFO.
This commit is contained in:
parent
b2d1988e50
commit
d7a93e140c
4 changed files with 20 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue