mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- replaced mapangle(85) with DAngle15.
This commit is contained in:
parent
2c46d66c1e
commit
0672a1a958
5 changed files with 12 additions and 11 deletions
|
@ -1717,6 +1717,7 @@ constexpr DAngle minAngle = DAngle::fromDeg(1. / 65536.);
|
|||
constexpr FAngle nullFAngle = FAngle::fromDeg(0.);
|
||||
|
||||
constexpr DAngle DAngle1 = DAngle::fromDeg(1);
|
||||
constexpr DAngle DAngle15 = DAngle::fromDeg(15);
|
||||
constexpr DAngle DAngle22_5 = DAngle::fromDeg(22.5);
|
||||
constexpr DAngle DAngle45 = DAngle::fromDeg(45);
|
||||
constexpr DAngle DAngle60 = DAngle::fromDeg(60);
|
||||
|
|
|
@ -173,17 +173,17 @@ static void batThinkPonder(DBloodActor* actor)
|
|||
if (cansee(pTarget->spr.pos, pTarget->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
aiSetTarget(actor, actor->GetTarget());
|
||||
if (height2 - height < 48 && nDist < 0x180 && nDist > 0xc0 && nDeltaAngle < mapangle(85))
|
||||
if (height2 - height < 48 && nDist < 0x180 && nDist > 0xc0 && nDeltaAngle < DAngle15)
|
||||
aiNewState(actor, &batDodgeUp);
|
||||
else if (height2 - height > 0x50 && nDist < 0x180 && nDist > 0xc0 && nDeltaAngle < mapangle(85))
|
||||
else if (height2 - height > 0x50 && nDist < 0x180 && nDist > 0xc0 && nDeltaAngle < DAngle15)
|
||||
aiNewState(actor, &batDodgeDown);
|
||||
else if (height2 - height < 0x20 && nDist < 0x20 && nDeltaAngle < mapangle(85))
|
||||
else if (height2 - height < 0x20 && nDist < 0x20 && nDeltaAngle < DAngle15)
|
||||
aiNewState(actor, &batDodgeUp);
|
||||
else if (height2 - height > 0x60 && nDist < 0x140 && nDist > 0x80 && nDeltaAngle < mapangle(85))
|
||||
else if (height2 - height > 0x60 && nDist < 0x140 && nDist > 0x80 && nDeltaAngle < DAngle15)
|
||||
aiNewState(actor, &batDodgeDown);
|
||||
else if (height2 - height < 0x20 && nDist < 0x140 && nDist > 0x80 && nDeltaAngle < mapangle(85))
|
||||
else if (height2 - height < 0x20 && nDist < 0x140 && nDist > 0x80 && nDeltaAngle < DAngle15)
|
||||
aiNewState(actor, &batDodgeUp);
|
||||
else if (height2 - height < 0x20 && nDeltaAngle < mapangle(85) && nDist > 0x140)
|
||||
else if (height2 - height < 0x20 && nDeltaAngle < DAngle15 && nDist > 0x140)
|
||||
aiNewState(actor, &batDodgeUp);
|
||||
else if (height2 - height > 0x40)
|
||||
aiNewState(actor, &batDodgeDown);
|
||||
|
@ -273,7 +273,7 @@ static void batThinkChase(DBloodActor* actor)
|
|||
double floorZ = getflorzofslopeptr(actor->sector(), actor->spr.pos);
|
||||
double floorDelta = floorZ - bottom;
|
||||
double heightDelta = height2 - height;
|
||||
bool angWithinRange = nDeltaAngle < mapangle(85);
|
||||
bool angWithinRange = nDeltaAngle < DAngle15;
|
||||
if (heightDelta < 32 && nDist < 0x20 && angWithinRange)
|
||||
aiNewState(actor, &batBite);
|
||||
else if ((heightDelta > 80 || floorDelta > 80) && nDist < 0x140 && nDist > 0x80 && angWithinRange)
|
||||
|
|
|
@ -239,7 +239,7 @@ static void beastThinkChase(DBloodActor* actor)
|
|||
{
|
||||
aiSetTarget(actor, actor->GetTarget());
|
||||
actor->dudeSlope = nDist == 0 ? 0 : int(target->spr.pos.Z - actor->spr.pos.Z / nDist) * 16384;
|
||||
if (nDist < 0x140 && nDist > 0xa0 && nDeltaAngle < mapangle(85) && (target->spr.flags & 2)
|
||||
if (nDist < 0x140 && nDist > 0xa0 && nDeltaAngle < DAngle15 && (target->spr.flags & 2)
|
||||
&& target->IsPlayerActor() && Chance(0x8000))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
|
||||
|
@ -371,7 +371,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
|
|||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
aiSetTarget(actor, actor->GetTarget());
|
||||
if (nDist < 64 && nDeltaAngle < mapangle(85))
|
||||
if (nDist < 64 && nDeltaAngle < DAngle15)
|
||||
aiNewState(actor, &beastSwimSlash);
|
||||
else
|
||||
{
|
||||
|
|
|
@ -356,7 +356,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
double floorZ = getflorzofslopeptr(actor->sector(), actor->spr.pos);
|
||||
double floorDelta = floorZ - bottom;
|
||||
double heightDelta = height2 - height;
|
||||
bool angWithinRange = nDeltaAngle < mapangle(85);
|
||||
bool angWithinRange = nDeltaAngle < DAngle15;
|
||||
switch (actor->spr.type)
|
||||
{
|
||||
case kDudeGargoyleFlesh:
|
||||
|
|
|
@ -334,7 +334,7 @@ static void ghostThinkChase(DBloodActor* actor)
|
|||
double floorZ = getflorzofslopeptr(actor->sector(), actor->spr.pos);
|
||||
double floorDelta = floorZ - bottom;
|
||||
double heightDelta = height2 - height;
|
||||
bool angWithinRange = nDeltaAngle < mapangle(85);
|
||||
bool angWithinRange = nDeltaAngle < DAngle15;
|
||||
switch (actor->spr.type) {
|
||||
case kDudePhantasm:
|
||||
if (nDist < 0x200 && nDist > 0x100 && angWithinRange) {
|
||||
|
|
Loading…
Reference in a new issue