mirror of
https://github.com/DrBeef/Raze.git
synced 2025-04-04 07:00:54 +00:00
- 11x replacing the same pattern.
This commit is contained in:
parent
e3cc9879eb
commit
5d78c81acb
10 changed files with 34 additions and 33 deletions
|
@ -86,10 +86,10 @@ static void gillThinkGoto(DBloodActor* actor)
|
|||
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
|
||||
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
if (pXSector && pXSector->Underwater)
|
||||
aiNewState(actor, &gillBeastSwimSearch);
|
||||
|
@ -199,10 +199,10 @@ static void gillThinkSwimGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &gillBeastSwimSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -67,10 +67,10 @@ static void handThinkGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &handSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -82,10 +82,10 @@ static void houndThinkGoto(DBloodActor* actor)
|
|||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &houndSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -51,10 +51,10 @@ static void innocThinkGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &innocentSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -140,10 +140,11 @@ static void aiPodMove(DBloodActor* actor)
|
|||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery) {
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
switch (actor->spr.type) {
|
||||
case kDudePodGreen:
|
||||
case kDudePodFire:
|
||||
|
|
|
@ -63,10 +63,10 @@ static void ratThinkGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &ratSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -171,10 +171,10 @@ static void spidThinkGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &spidSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -262,10 +262,10 @@ static void sub_72850(DBloodActor* actor)
|
|||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &tchernobogSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -92,10 +92,10 @@ static void zombaThinkGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 51.3125 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 51.3125 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &zombieASearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
|
@ -91,10 +91,10 @@ static void zombfThinkGoto(DBloodActor* actor)
|
|||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &zombieFSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue