mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- rename USER::goalAng
This commit is contained in:
parent
057d2a565a
commit
9df7c55040
26 changed files with 113 additions and 113 deletions
|
@ -3965,7 +3965,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
||||||
missileActor->spr.picnum = 2123;
|
missileActor->spr.picnum = 2123;
|
||||||
missileActor->SetTarget(actorHit);
|
missileActor->SetTarget(actorHit);
|
||||||
missileActor->xspr.TargetPos.Z = (missileActor->spr.pos.Z - actorHit->spr.pos.Z);
|
missileActor->xspr.TargetPos.Z = (missileActor->spr.pos.Z - actorHit->spr.pos.Z);
|
||||||
missileActor->xspr.goalAng = getangle(missileActor->spr.pos.XY() - actorHit->spr.pos.XY()) - actorHit->int_ang();
|
missileActor->xspr._goalAng = getangle(missileActor->spr.pos.XY() - actorHit->spr.pos.XY()) - actorHit->int_ang();
|
||||||
missileActor->xspr.state = 1;
|
missileActor->xspr.state = 1;
|
||||||
actPostSprite(missileActor, kStatFlare);
|
actPostSprite(missileActor, kStatFlare);
|
||||||
missileActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
missileActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||||
|
@ -6139,8 +6139,8 @@ void actCheckFlares()
|
||||||
if (target->hasX() && target->xspr.health > 0)
|
if (target->hasX() && target->xspr.health > 0)
|
||||||
{
|
{
|
||||||
DVector3 pos = target->spr.pos;
|
DVector3 pos = target->spr.pos;
|
||||||
pos.X += mulscale30r(Cos(actor->xspr.goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld;
|
pos.X += mulscale30r(Cos(actor->xspr._goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld;
|
||||||
pos.Y += mulscale30r(Sin(actor->xspr.goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld;
|
pos.Y += mulscale30r(Sin(actor->xspr._goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld;
|
||||||
pos.Z += actor->xspr.TargetPos.Z;
|
pos.Z += actor->xspr.TargetPos.Z;
|
||||||
SetActor(actor, pos);
|
SetActor(actor, pos);
|
||||||
actor->vel = target->vel;
|
actor->vel = target->vel;
|
||||||
|
|
|
@ -261,21 +261,21 @@ void aiChooseDirection(DBloodActor* actor, int a3)
|
||||||
if (vc < 0)
|
if (vc < 0)
|
||||||
v8 = -341;
|
v8 = -341;
|
||||||
if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi))
|
if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + vc;
|
actor->xspr._goalAng = actor->int_ang() + vc;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + vc / 2;
|
actor->xspr._goalAng = actor->int_ang() + vc / 2;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() - vc / 2;
|
actor->xspr._goalAng = actor->int_ang() - vc / 2;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + v8;
|
actor->xspr._goalAng = actor->int_ang() + v8;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang(), vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang(), vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang();
|
actor->xspr._goalAng = actor->int_ang();
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() - v8;
|
actor->xspr._goalAng = actor->int_ang() - v8;
|
||||||
//else if (actor->spr.flags&2)
|
//else if (actor->spr.flags&2)
|
||||||
//actor->xspr.goalAng = actor->spr.angle+341;
|
//actor->xspr.goalAng = actor->spr.angle+341;
|
||||||
else // Weird..
|
else // Weird..
|
||||||
actor->xspr.goalAng = actor->int_ang() + 341;
|
actor->xspr._goalAng = actor->int_ang() + 341;
|
||||||
if (Chance(0x8000))
|
if (Chance(0x8000))
|
||||||
actor->xspr.dodgeDir = 1;
|
actor->xspr.dodgeDir = 1;
|
||||||
else
|
else
|
||||||
|
@ -298,7 +298,7 @@ void aiMoveForward(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
|
@ -317,7 +317,7 @@ void aiMoveTurn(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ void aiMoveDodge(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (actor->xspr.dodgeDir)
|
if (actor->xspr.dodgeDir)
|
||||||
|
|
|
@ -85,7 +85,7 @@ static void batThinkTarget(DBloodActor* actor)
|
||||||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||||
{
|
{
|
||||||
pDudeExtraE->thinkTime = 0;
|
pDudeExtraE->thinkTime = 0;
|
||||||
actor->xspr.goalAng += 256;
|
actor->xspr._goalAng += 256;
|
||||||
aiSetTarget(actor, actor->basePoint);
|
aiSetTarget(actor, actor->basePoint);
|
||||||
aiNewState(actor, &batTurn);
|
aiNewState(actor, &batTurn);
|
||||||
return;
|
return;
|
||||||
|
@ -127,7 +127,7 @@ static void batThinkTarget(DBloodActor* actor)
|
||||||
|
|
||||||
static void batThinkSearch(DBloodActor* actor)
|
static void batThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
batThinkTarget(actor);
|
batThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ static void batMoveDodgeUp(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
AdjustVelocity(actor, ADJUSTER{
|
AdjustVelocity(actor, ADJUSTER{
|
||||||
|
@ -217,7 +217,7 @@ static void batMoveDodgeDown(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (actor->xspr.dodgeDir == 0)
|
if (actor->xspr.dodgeDir == 0)
|
||||||
|
@ -295,7 +295,7 @@ static void batMoveForward(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
@ -320,13 +320,13 @@ static void batMoveSwoop(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X;
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X;
|
||||||
|
@ -344,7 +344,7 @@ static void batMoveFly(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
|
|
@ -163,7 +163,7 @@ static void MorphToBeast(DBloodActor* actor)
|
||||||
|
|
||||||
static void beastThinkSearch(DBloodActor* actor)
|
static void beastThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ static void beastMoveForward(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
|
@ -410,7 +410,7 @@ static void sub_628A0(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
@ -438,13 +438,13 @@ static void sub_62AE0(DBloodActor* actor)
|
||||||
auto target = actor->GetTarget();
|
auto target = actor->GetTarget();
|
||||||
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
||||||
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -467,7 +467,7 @@ static void sub_62D7C(DBloodActor* actor)
|
||||||
auto target = actor->GetTarget();
|
auto target = actor->GetTarget();
|
||||||
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
||||||
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
|
|
@ -97,7 +97,7 @@ static void eelThinkTarget(DBloodActor* actor)
|
||||||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||||
{
|
{
|
||||||
pDudeExtraE->thinkTime = 0;
|
pDudeExtraE->thinkTime = 0;
|
||||||
actor->xspr.goalAng += 256;
|
actor->xspr._goalAng += 256;
|
||||||
aiSetTarget(actor, actor->basePoint);
|
aiSetTarget(actor, actor->basePoint);
|
||||||
aiNewState(actor, &eelTurn);
|
aiNewState(actor, &eelTurn);
|
||||||
return;
|
return;
|
||||||
|
@ -140,7 +140,7 @@ static void eelThinkTarget(DBloodActor* actor)
|
||||||
|
|
||||||
static void eelThinkSearch(DBloodActor* actor)
|
static void eelThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
eelThinkTarget(actor);
|
eelThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ static void eelMoveDodgeUp(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
AdjustVelocity(actor, ADJUSTER{
|
AdjustVelocity(actor, ADJUSTER{
|
||||||
|
@ -232,7 +232,7 @@ static void eelMoveDodgeDown(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (actor->xspr.dodgeDir == 0)
|
if (actor->xspr.dodgeDir == 0)
|
||||||
|
@ -307,7 +307,7 @@ static void eelMoveForward(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
|
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
|
||||||
|
@ -332,7 +332,7 @@ static void eelMoveSwoop(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
|
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
|
||||||
|
@ -353,7 +353,7 @@ static void eelMoveAscend(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
|
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2;
|
||||||
|
|
|
@ -76,7 +76,7 @@ void BurnSeqCallback(int, DBloodActor*)
|
||||||
|
|
||||||
static void burnThinkSearch(DBloodActor* actor)
|
static void burnThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ void SeqAttackCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void calebThinkSearch(DBloodActor* actor)
|
static void calebThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ static void sub_65D04(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
@ -308,13 +308,13 @@ static void sub_65F44(DBloodActor* actor)
|
||||||
auto target = actor->GetTarget();
|
auto target = actor->GetTarget();
|
||||||
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
||||||
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -338,7 +338,7 @@ static void sub_661E0(DBloodActor* actor)
|
||||||
auto target = actor->GetTarget();
|
auto target = actor->GetTarget();
|
||||||
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
||||||
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
|
|
@ -227,7 +227,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void cerberusThinkSearch(DBloodActor* actor)
|
static void cerberusThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
|
||||||
pDudeExtraE->thinkTime++;
|
pDudeExtraE->thinkTime++;
|
||||||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng += 256;
|
actor->xspr._goalAng += 256;
|
||||||
aiSetTarget(actor, actor->basePoint);
|
aiSetTarget(actor, actor->basePoint);
|
||||||
if (actor->spr.type == kDudeCerberusTwoHead)
|
if (actor->spr.type == kDudeCerberusTwoHead)
|
||||||
aiNewState(actor, &cerberus139890);
|
aiNewState(actor, &cerberus139890);
|
||||||
|
|
|
@ -186,7 +186,7 @@ static bool TargetNearExplosion(sectortype* sector)
|
||||||
|
|
||||||
static void cultThinkSearch(DBloodActor* actor)
|
static void cultThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiLookForTarget(actor);
|
aiLookForTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ static void gargThinkTarget(DBloodActor* actor)
|
||||||
pDudeExtraE->thinkTime++;
|
pDudeExtraE->thinkTime++;
|
||||||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng += 256;
|
actor->xspr._goalAng += 256;
|
||||||
aiSetTarget(actor, actor->basePoint);
|
aiSetTarget(actor, actor->basePoint);
|
||||||
aiNewState(actor, &gargoyleTurn);
|
aiNewState(actor, &gargoyleTurn);
|
||||||
return;
|
return;
|
||||||
|
@ -249,7 +249,7 @@ static void gargThinkTarget(DBloodActor* actor)
|
||||||
|
|
||||||
static void gargThinkSearch(DBloodActor* actor)
|
static void gargThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiLookForTarget(actor);
|
aiLookForTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ static void gargMoveDodgeUp(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
AdjustVelocity(actor, ADJUSTER{
|
AdjustVelocity(actor, ADJUSTER{
|
||||||
|
@ -296,7 +296,7 @@ static void gargMoveDodgeDown(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (actor->xspr.dodgeDir == 0)
|
if (actor->xspr.dodgeDir == 0)
|
||||||
|
@ -508,7 +508,7 @@ static void gargMoveForward(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
@ -536,13 +536,13 @@ static void gargMoveSlow(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -571,13 +571,13 @@ static void gargMoveSwoop(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -606,7 +606,7 @@ static void gargMoveFly(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void ghostThinkTarget(DBloodActor* actor)
|
||||||
pDudeExtraE->thinkTime++;
|
pDudeExtraE->thinkTime++;
|
||||||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng += 256;
|
actor->xspr._goalAng += 256;
|
||||||
aiSetTarget(actor, actor->basePoint);
|
aiSetTarget(actor, actor->basePoint);
|
||||||
aiNewState(actor, &ghostTurn);
|
aiNewState(actor, &ghostTurn);
|
||||||
return;
|
return;
|
||||||
|
@ -228,7 +228,7 @@ static void ghostThinkTarget(DBloodActor* actor)
|
||||||
|
|
||||||
static void ghostThinkSearch(DBloodActor* actor)
|
static void ghostThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
AdjustVelocity(actor, ADJUSTER{
|
AdjustVelocity(actor, ADJUSTER{
|
||||||
|
@ -275,7 +275,7 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
if (actor->xspr.dodgeDir == 0)
|
if (actor->xspr.dodgeDir == 0)
|
||||||
|
@ -403,7 +403,7 @@ static void ghostMoveForward(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
@ -430,13 +430,13 @@ static void ghostMoveSlow(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -461,13 +461,13 @@ static void ghostMoveSwoop(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -491,7 +491,7 @@ static void ghostMoveFly(DBloodActor* actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
|
|
@ -73,7 +73,7 @@ void GillBiteSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void gillThinkSearch(DBloodActor* actor)
|
static void gillThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ static void sub_6CB00(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
|
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
|
||||||
|
@ -294,13 +294,13 @@ static void sub_6CD74(DBloodActor* actor)
|
||||||
auto target = actor->GetTarget();
|
auto target = actor->GetTarget();
|
||||||
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
||||||
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
|
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
|
||||||
if (abs(nAng) > DAngle60)
|
if (abs(nAng) > DAngle60)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = (actor->int_ang() + 512) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + 512) & 2047;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
|
@ -323,7 +323,7 @@ static void sub_6D03C(DBloodActor* actor)
|
||||||
auto target = actor->GetTarget();
|
auto target = actor->GetTarget();
|
||||||
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight;
|
||||||
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight;
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
|
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
|
||||||
|
|
|
@ -58,7 +58,7 @@ void HandJumpSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void handThinkSearch(DBloodActor* actor)
|
static void handThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ void houndBurnSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void houndThinkSearch(DBloodActor* actor)
|
static void houndThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ AISTATE innocentGoto = { kAiStateMove, 6, -1, 600, NULL, aiMoveForward, innocThi
|
||||||
|
|
||||||
static void innocThinkSearch(DBloodActor* actor)
|
static void innocThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ void sub_70284(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void aiPodSearch(DBloodActor* actor)
|
static void aiPodSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ void ratBiteSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void ratThinkSearch(DBloodActor* actor)
|
static void ratThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ void SpidBirthSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void spidThinkSearch(DBloodActor* actor)
|
static void spidThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ void sub_720AC(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void sub_72580(DBloodActor* actor)
|
static void sub_72580(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ static void sub_725A4(DBloodActor* actor)
|
||||||
pDudeExtraE->thinkTime++;
|
pDudeExtraE->thinkTime++;
|
||||||
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active)
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng += 256;
|
actor->xspr._goalAng += 256;
|
||||||
aiSetTarget(actor, actor->basePoint);
|
aiSetTarget(actor, actor->basePoint);
|
||||||
aiNewState(actor, &tcherno13AA28);
|
aiNewState(actor, &tcherno13AA28);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -401,7 +401,7 @@ static void unicultThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
// TO DO: if can't see the target, but in fireDist range - stop moving and look around
|
// TO DO: if can't see the target, but in fireDist range - stop moving and look around
|
||||||
|
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiLookForTarget(actor);
|
aiLookForTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -899,7 +899,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
if (spriteIsUnderwater(actor)) aiGenDudeNewState(actor, &genDudeChaseW);
|
if (spriteIsUnderwater(actor)) aiGenDudeNewState(actor, &genDudeChaseW);
|
||||||
else aiGenDudeNewState(actor, &genDudeChaseL);
|
else aiGenDudeNewState(actor, &genDudeChaseL);
|
||||||
actor->xspr.goalAng = Random(kAng360);
|
actor->xspr._goalAng = Random(kAng360);
|
||||||
//viewSetSystemMessage("WALL OR SPRITE TOUCH");
|
//viewSetSystemMessage("WALL OR SPRITE TOUCH");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ void aiGenDudeMoveForward(DBloodActor* actor)
|
||||||
|
|
||||||
if (pExtra->canFly)
|
if (pExtra->canFly)
|
||||||
{
|
{
|
||||||
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng));
|
auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng));
|
||||||
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3);
|
||||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||||
int nAccel = pDudeInfo->frontSpeed << 2;
|
int nAccel = pDudeInfo->frontSpeed << 2;
|
||||||
|
@ -1136,7 +1136,7 @@ void aiGenDudeMoveForward(DBloodActor* actor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int dang = ((kAng180 + actor->xspr.goalAng - actor->int_ang()) & 2047) - kAng180;
|
int dang = ((kAng180 + actor->xspr._goalAng - actor->int_ang()) & 2047) - kAng180;
|
||||||
actor->set_int_ang(((actor->int_ang() + ClipRange(dang, -maxTurn, maxTurn)) & 2047));
|
actor->set_int_ang(((actor->int_ang() + ClipRange(dang, -maxTurn, maxTurn)) & 2047));
|
||||||
|
|
||||||
// don't move forward if trying to turn around
|
// don't move forward if trying to turn around
|
||||||
|
@ -1173,19 +1173,19 @@ void aiGenDudeChooseDirection(DBloodActor* actor, int a3, int xvel, int yvel)
|
||||||
int vsi = ((t1 * 15) >> 12) / 2; int v8 = (vc >= 0) ? 341 : -341;
|
int vsi = ((t1 * 15) >> 12) / 2; int v8 = (vc >= 0) ? 341 : -341;
|
||||||
|
|
||||||
if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi))
|
if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + vc;
|
actor->xspr._goalAng = actor->int_ang() + vc;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + vc / 2;
|
actor->xspr._goalAng = actor->int_ang() + vc / 2;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() - vc / 2;
|
actor->xspr._goalAng = actor->int_ang() - vc / 2;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + v8;
|
actor->xspr._goalAng = actor->int_ang() + v8;
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang(), vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang(), vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang();
|
actor->xspr._goalAng = actor->int_ang();
|
||||||
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi))
|
else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() - v8;
|
actor->xspr._goalAng = actor->int_ang() - v8;
|
||||||
else
|
else
|
||||||
actor->xspr.goalAng = actor->int_ang() + 341;
|
actor->xspr._goalAng = actor->int_ang() + 341;
|
||||||
|
|
||||||
actor->xspr.dodgeDir = (Chance(0x8000)) ? 1 : -1;
|
actor->xspr.dodgeDir = (Chance(0x8000)) ? 1 : -1;
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ void StandSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void zombaThinkSearch(DBloodActor* actor)
|
static void zombaThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiLookForTarget(actor);
|
aiLookForTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ static void myThinkTarget(DBloodActor* actor)
|
||||||
|
|
||||||
static void myThinkSearch(DBloodActor* actor)
|
static void myThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
myThinkTarget(actor);
|
myThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ void ThrowSeqCallback(int, DBloodActor* actor)
|
||||||
|
|
||||||
static void zombfThinkSearch(DBloodActor* actor)
|
static void zombfThinkSearch(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
aiChooseDirection(actor, actor->xspr.goalAng);
|
aiChooseDirection(actor, actor->xspr._goalAng);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -549,7 +549,7 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, int* cursectnum,
|
||||||
pXSprite->data1 = bitReader.readSigned(16);
|
pXSprite->data1 = bitReader.readSigned(16);
|
||||||
pXSprite->data2 = bitReader.readSigned(16);
|
pXSprite->data2 = bitReader.readSigned(16);
|
||||||
pXSprite->data3 = bitReader.readSigned(16);
|
pXSprite->data3 = bitReader.readSigned(16);
|
||||||
pXSprite->goalAng = bitReader.readUnsigned(11);
|
pXSprite->_goalAng = bitReader.readUnsigned(11);
|
||||||
pXSprite->dodgeDir = bitReader.readSigned(2);
|
pXSprite->dodgeDir = bitReader.readSigned(2);
|
||||||
pXSprite->locked = bitReader.readUnsigned(1);
|
pXSprite->locked = bitReader.readUnsigned(1);
|
||||||
pXSprite->medium = bitReader.readUnsigned(2);
|
pXSprite->medium = bitReader.readUnsigned(2);
|
||||||
|
|
|
@ -634,7 +634,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRIT
|
||||||
("burnsource", w.burnSource, def->burnSource)
|
("burnsource", w.burnSource, def->burnSource)
|
||||||
("busytime", w.busyTime, def->busyTime)
|
("busytime", w.busyTime, def->busyTime)
|
||||||
("waittime", w.waitTime, def->waitTime)
|
("waittime", w.waitTime, def->waitTime)
|
||||||
("goalang", w.goalAng, def->goalAng)
|
("goalang", w._goalAng, def->_goalAng)
|
||||||
("burntime", w.burnTime, def->burnTime)
|
("burntime", w.burnTime, def->burnTime)
|
||||||
("height", w.height, def->height)
|
("height", w.height, def->height)
|
||||||
("statetimer", w.stateTimer, def->stateTimer)
|
("statetimer", w.stateTimer, def->stateTimer)
|
||||||
|
|
|
@ -104,6 +104,7 @@ struct XSPRITE {
|
||||||
const vec3_t int_TargetPos() const { return { int(TargetPos.X * worldtoint), int(TargetPos.Y * worldtoint), int(TargetPos.Z * worldtoint)}; }
|
const vec3_t int_TargetPos() const { return { int(TargetPos.X * worldtoint), int(TargetPos.Y * worldtoint), int(TargetPos.Z * worldtoint)}; }
|
||||||
|
|
||||||
DVector3 TargetPos;
|
DVector3 TargetPos;
|
||||||
|
uint16_t _goalAng; // Dude goal ang
|
||||||
|
|
||||||
int32_t sysData1; // used to keep here various system data, so user can't change it in map editor
|
int32_t sysData1; // used to keep here various system data, so user can't change it in map editor
|
||||||
int32_t sysData2; //
|
int32_t sysData2; //
|
||||||
|
@ -121,7 +122,6 @@ struct XSPRITE {
|
||||||
uint16_t busyTime; // busyTime
|
uint16_t busyTime; // busyTime
|
||||||
uint16_t waitTime; // waitTime
|
uint16_t waitTime; // waitTime
|
||||||
uint16_t data4; // Data 4
|
uint16_t data4; // Data 4
|
||||||
uint16_t goalAng; // Dude goal ang
|
|
||||||
uint16_t burnTime;
|
uint16_t burnTime;
|
||||||
uint16_t height;
|
uint16_t height;
|
||||||
uint16_t stateTimer; // ai timer
|
uint16_t stateTimer; // ai timer
|
||||||
|
|
|
@ -1347,23 +1347,23 @@ void nnExtProcessSuperSprites()
|
||||||
debrisMove(i);
|
debrisMove(i);
|
||||||
|
|
||||||
if (debrisactor->vel.X != 0 || debrisactor->int_vel().Y)
|
if (debrisactor->vel.X != 0 || debrisactor->int_vel().Y)
|
||||||
debrisactor->xspr.goalAng = getangle(debrisactor->vel) & 2047;
|
debrisactor->xspr._goalAng = getangle(debrisactor->vel) & 2047;
|
||||||
|
|
||||||
int ang = debrisactor->int_ang() & 2047;
|
int ang = debrisactor->int_ang() & 2047;
|
||||||
if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble);
|
if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble);
|
||||||
else if (Chance(0x1000 - mass))
|
else if (Chance(0x1000 - mass))
|
||||||
{
|
{
|
||||||
if (debrisactor->vel.Z > 0x100) debrisBubble(debrisactor);
|
if (debrisactor->vel.Z > 0x100) debrisBubble(debrisactor);
|
||||||
if (ang == debrisactor->xspr.goalAng)
|
if (ang == debrisactor->xspr._goalAng)
|
||||||
{
|
{
|
||||||
debrisactor->xspr.goalAng = (debrisactor->int_ang() + Random3(kAng60)) & 2047;
|
debrisactor->xspr._goalAng = (debrisactor->int_ang() + Random3(kAng60)) & 2047;
|
||||||
debrisBubble(debrisactor);
|
debrisBubble(debrisactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int angStep = ClipLow(mulscale8(1, ((abs(debrisactor->int_vel().X) + abs(debrisactor->int_vel().Y)) >> 5)), (uwater) ? 1 : 0);
|
int angStep = ClipLow(mulscale8(1, ((abs(debrisactor->int_vel().X) + abs(debrisactor->int_vel().Y)) >> 5)), (uwater) ? 1 : 0);
|
||||||
if (ang < debrisactor->xspr.goalAng) debrisactor->set_int_ang(ClipHigh(ang + angStep, debrisactor->xspr.goalAng));
|
if (ang < debrisactor->xspr._goalAng) debrisactor->set_int_ang(ClipHigh(ang + angStep, debrisactor->xspr._goalAng));
|
||||||
else if (ang > debrisactor->xspr.goalAng) debrisactor->set_int_ang(ClipLow(ang - angStep, debrisactor->xspr.goalAng));
|
else if (ang > debrisactor->xspr._goalAng) debrisactor->set_int_ang(ClipLow(ang - angStep, debrisactor->xspr._goalAng));
|
||||||
|
|
||||||
auto pSector = debrisactor->sector();
|
auto pSector = debrisactor->sector();
|
||||||
int cz = getceilzofslopeptr(pSector, debrisactor->int_pos().X, debrisactor->int_pos().Y);
|
int cz = getceilzofslopeptr(pSector, debrisactor->int_pos().X, debrisactor->int_pos().Y);
|
||||||
|
@ -2784,7 +2784,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
||||||
|
|
||||||
// set random goal ang for swimming so they start turning
|
// set random goal ang for swimming so they start turning
|
||||||
if ((flags & kPhysDebrisSwim) && targetactor->int_vel().X ==0 && targetactor->vel.Y == 0 && targetactor->vel.Z == 0)
|
if ((flags & kPhysDebrisSwim) && targetactor->int_vel().X ==0 && targetactor->vel.Y == 0 && targetactor->vel.Z == 0)
|
||||||
targetactor->xspr.goalAng = (targetactor->int_ang() + Random3(kAng45)) & 2047;
|
targetactor->xspr._goalAng = (targetactor->int_ang() + Random3(kAng45)) & 2047;
|
||||||
|
|
||||||
if (targetactor->xspr.physAttr & kPhysDebrisVector)
|
if (targetactor->xspr.physAttr & kPhysDebrisVector)
|
||||||
targetactor->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
|
targetactor->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||||
|
@ -7738,19 +7738,19 @@ void nnExtAiSetDirection(DBloodActor* actor, int a3)
|
||||||
v8 = -341;
|
v8 = -341;
|
||||||
|
|
||||||
if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi))
|
if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + vc;
|
actor->xspr._goalAng = actor->int_ang() + vc;
|
||||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi))
|
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + vc / 2;
|
actor->xspr._goalAng = actor->int_ang() + vc / 2;
|
||||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi))
|
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() - vc / 2;
|
actor->xspr._goalAng = actor->int_ang() - vc / 2;
|
||||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi))
|
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() + v8;
|
actor->xspr._goalAng = actor->int_ang() + v8;
|
||||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang(), vsi))
|
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang(), vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang();
|
actor->xspr._goalAng = actor->int_ang();
|
||||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi))
|
else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi))
|
||||||
actor->xspr.goalAng = actor->int_ang() - v8;
|
actor->xspr._goalAng = actor->int_ang() - v8;
|
||||||
else
|
else
|
||||||
actor->xspr.goalAng = actor->int_ang() + 341;
|
actor->xspr._goalAng = actor->int_ang() + 341;
|
||||||
|
|
||||||
if (actor->xspr.dodgeDir)
|
if (actor->xspr.dodgeDir)
|
||||||
{
|
{
|
||||||
|
@ -8132,7 +8132,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
|
||||||
if (Chance(0x8000))
|
if (Chance(0x8000))
|
||||||
goal = -goal;
|
goal = -goal;
|
||||||
|
|
||||||
actor->xspr.goalAng = (actor->int_ang() + goal) & 2047;
|
actor->xspr._goalAng = (actor->int_ang() + goal) & 2047;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -8144,7 +8144,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
|
||||||
void aiPatrolTurn(DBloodActor* actor)
|
void aiPatrolTurn(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
int nTurnRange = (getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4;
|
int nTurnRange = (getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4;
|
||||||
int nAng = getincangle(actor->int_ang(), actor->xspr.goalAng);
|
int nAng = getincangle(actor->int_ang(), actor->xspr._goalAng);
|
||||||
actor->set_int_ang((actor->int_ang() + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047);
|
actor->set_int_ang((actor->int_ang() + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8192,7 +8192,7 @@ void aiPatrolMove(DBloodActor* actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
|
int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4;
|
||||||
int nAng = getincangle(actor->int_ang(), actor->xspr.goalAng);
|
int nAng = getincangle(actor->int_ang(), actor->xspr._goalAng);
|
||||||
actor->set_int_ang((actor->int_ang() + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047);
|
actor->set_int_ang((actor->int_ang() + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047);
|
||||||
|
|
||||||
if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor)))
|
if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor)))
|
||||||
|
@ -8873,7 +8873,7 @@ void aiPatrolThink(DBloodActor* actor)
|
||||||
else if (aiPatrolTurning(actor->xspr.aiState))
|
else if (aiPatrolTurning(actor->xspr.aiState))
|
||||||
{
|
{
|
||||||
//viewSetSystemMessage("TURN");
|
//viewSetSystemMessage("TURN");
|
||||||
if ((int)actor->int_ang() == (int)actor->xspr.goalAng)
|
if ((int)actor->int_ang() == (int)actor->xspr._goalAng)
|
||||||
{
|
{
|
||||||
// save imer for waiting
|
// save imer for waiting
|
||||||
stateTimer = actor->xspr.stateTimer;
|
stateTimer = actor->xspr.stateTimer;
|
||||||
|
@ -8904,8 +8904,8 @@ void aiPatrolThink(DBloodActor* actor)
|
||||||
// take marker's angle
|
// take marker's angle
|
||||||
if (!(markeractor->spr.flags & kModernTypeFlag4))
|
if (!(markeractor->spr.flags & kModernTypeFlag4))
|
||||||
{
|
{
|
||||||
actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->int_ang() + kAng180 : markeractor->int_ang()) & 2047;
|
actor->xspr._goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->int_ang() + kAng180 : markeractor->int_ang()) & 2047;
|
||||||
if ((int)actor->int_ang() != (int)actor->xspr.goalAng) // let the enemy play move animation while turning
|
if ((int)actor->int_ang() != (int)actor->xspr._goalAng) // let the enemy play move animation while turning
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9331,7 +9331,7 @@ void changeSpriteAngle(DBloodActor* pSpr, int nAng)
|
||||||
{
|
{
|
||||||
pSpr->set_int_ang(nAng);
|
pSpr->set_int_ang(nAng);
|
||||||
if (pSpr->hasX())
|
if (pSpr->hasX())
|
||||||
pSpr->xspr.goalAng = pSpr->int_ang();
|
pSpr->xspr._goalAng = pSpr->int_ang();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue