mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- Change spritetypebase::angle
to a DRotator named Angles
.
* Major pre-requisite for the next steps I'm undertaking, let's get it into the branch now.
This commit is contained in:
parent
347d725ba0
commit
2e0b9490e1
126 changed files with 1459 additions and 1459 deletions
|
@ -379,7 +379,7 @@ void DCoreActor::initFromSprite(spritetype* mspr)
|
|||
#define setter(flag, var) if (!(actorinfo->DefaultFlags & flag)) spr.var = mspr->var;
|
||||
|
||||
setter(DEFF_PICNUM, picnum);
|
||||
setter(DEFF_ANG, angle);
|
||||
setter(DEFF_ANG, Angles.Yaw);
|
||||
setter(DEFF_INTANG, intangle);
|
||||
setter(DEFF_XVEL, xint);
|
||||
setter(DEFF_YVEL, yint);
|
||||
|
|
|
@ -628,7 +628,7 @@ void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const i
|
|||
void DrawAutomapAlignmentFacing(const spritetype& spr, const DVector2& bpos, const DVector2& cangvect, const double czoom, const DVector2& xydim, const PalEntry& col)
|
||||
{
|
||||
auto v1 = OutAutomapVector(bpos, cangvect, czoom, xydim);
|
||||
auto v2 = OutAutomapVector(spr.angle.ToVector() * 8., cangvect, czoom);
|
||||
auto v2 = OutAutomapVector(spr.Angles.Yaw.ToVector() * 8., cangvect, czoom);
|
||||
auto v3 = v2.Rotated90CW();
|
||||
auto v4 = v1 + v2;
|
||||
|
||||
|
@ -651,7 +651,7 @@ void DrawAutomapAlignmentWall(const spritetype& spr, const DVector2& bpos, const
|
|||
|
||||
if ((spr.cstat & CSTAT_SPRITE_XFLIP) > 0) xoff = -xoff;
|
||||
|
||||
auto sprvec = spr.angle.ToVector().Rotated90CW() * xrep;
|
||||
auto sprvec = spr.Angles.Yaw.ToVector().Rotated90CW() * xrep;
|
||||
|
||||
auto b1 = bpos - sprvec * ((xspan * 0.5) + xoff);
|
||||
auto b2 = b1 + sprvec * xspan;
|
||||
|
@ -687,7 +687,7 @@ void DrawAutomapAlignmentFloor(const spritetype& spr, const DVector2& bpos, cons
|
|||
if ((spr.cstat & CSTAT_SPRITE_XFLIP) > 0) xoff = -xoff;
|
||||
if ((spr.cstat & CSTAT_SPRITE_YFLIP) > 0) yoff = -yoff;
|
||||
|
||||
auto sprvec = spr.angle.ToVector();
|
||||
auto sprvec = spr.Angles.Yaw.ToVector();
|
||||
auto xscale = sprvec.Rotated90CW() * xspan * xrep;
|
||||
auto yscale = sprvec * yspan * yrep;
|
||||
auto xybase = DVector2(((xspan * 0.5) + xoff) * xrep, ((yspan * 0.5) + yoff) * yrep);
|
||||
|
|
|
@ -83,12 +83,12 @@ public:
|
|||
|
||||
constexpr int int_ang() const
|
||||
{
|
||||
return spr.angle.Buildang();
|
||||
return spr.Angles.Yaw.Buildang();
|
||||
}
|
||||
|
||||
void norm_ang()
|
||||
{
|
||||
spr.angle = spr.angle.Normalized360();
|
||||
spr.Angles.Yaw = spr.Angles.Yaw.Normalized360();
|
||||
}
|
||||
|
||||
DVector3 interpolatedpos(double const interpfrac)
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
|
||||
DAngle interpolatedangle(double const interpfrac)
|
||||
{
|
||||
return interpolatedvalue(oang, spr.angle, interpfrac);
|
||||
return interpolatedvalue(oang, spr.Angles.Yaw, interpfrac);
|
||||
}
|
||||
|
||||
void backupz()
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
void backupang()
|
||||
{
|
||||
oang = spr.angle;
|
||||
oang = spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
void backuploc()
|
||||
|
|
|
@ -86,7 +86,7 @@ bool calcChaseCamPos(DVector3& ppos, DCoreActor* act, sectortype** psect, DAngle
|
|||
else
|
||||
{
|
||||
// same as wall calculation.
|
||||
hpos.*c -= npos.*c * npos.XY().dot((act->spr.angle - DAngle90).ToVector().Rotated90CW()) * (1. / 1024.);
|
||||
hpos.*c -= npos.*c * npos.XY().dot((act->spr.Angles.Yaw - DAngle90).ToVector().Rotated90CW()) * (1. / 1024.);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ void GetWallSpritePosition(const spritetypebase* spr, const DVector2& pos, DVect
|
|||
xoffset = tex->GetDisplayLeftOffset() + spr->xoffset;
|
||||
}
|
||||
|
||||
auto p = spr->angle.ToVector().Rotated90CW() * spr->scale.X;
|
||||
auto p = spr->Angles.Yaw.ToVector().Rotated90CW() * spr->scale.X;
|
||||
|
||||
if (spr->cstat & CSTAT_SPRITE_XFLIP) xoffset = -xoffset;
|
||||
double origin = (width * 0.5) + xoffset;
|
||||
|
@ -264,8 +264,8 @@ void TGetFlatSpritePosition(const spritetypebase* spr, const DVector2& pos, DVec
|
|||
double sprcenterx = (width * 0.5) + leftofs;
|
||||
double sprcentery = (height * 0.5) + topofs;
|
||||
|
||||
double cosang = spr->angle.Cos();
|
||||
double sinang = spr->angle.Sin();
|
||||
double cosang = spr->Angles.Yaw.Cos();
|
||||
double sinang = spr->Angles.Yaw.Sin();
|
||||
double cosangslope = cosang / sloperatio;
|
||||
double sinangslope = sinang / sloperatio;
|
||||
|
||||
|
@ -953,7 +953,7 @@ bool checkRangeOfFloorSprite(DCoreActor* itActor, const DVector3& pos, double ma
|
|||
GetFlatSpritePosition(itActor, itActor->spr.pos.XY(), out);
|
||||
|
||||
// expand the area to cover 'maxdist' units more on each side. (i.e. move the edges out)
|
||||
auto expand = (itActor->spr.angle - DAngle45).ToVector() * (maxdist + 0.25); // that's surely not accurate but here we must match Build's original value.
|
||||
auto expand = (itActor->spr.Angles.Yaw - DAngle45).ToVector() * (maxdist + 0.25); // that's surely not accurate but here we must match Build's original value.
|
||||
out[0] += expand;
|
||||
out[1] += expand.Rotated90CCW();
|
||||
out[2] -= expand;
|
||||
|
@ -1353,7 +1353,7 @@ tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor)
|
|||
tspr->yoffset = actor->spr.yoffset;
|
||||
tspr->sectp = actor->spr.sectp;
|
||||
tspr->statnum = actor->spr.statnum;
|
||||
tspr->angle = actor->spr.angle;
|
||||
tspr->Angles.Yaw = actor->spr.Angles.Yaw;
|
||||
tspr->xint = actor->spr.xint;
|
||||
tspr->yint = actor->spr.yint;
|
||||
tspr->inittype = actor->spr.inittype; // not used by tsprites.
|
||||
|
|
|
@ -414,7 +414,7 @@ inline int tspriteGetSlope(const tspritetype* spr)
|
|||
inline double spriteGetZOfSlopef(const spritetypebase* tspr, const DVector2& pos, int heinum)
|
||||
{
|
||||
if (heinum == 0) return tspr->pos.Z;
|
||||
return tspr->pos.Z + heinum * -tspr->angle.ToVector().dot(pos - tspr->pos.XY()) * (1. / SLOPEVAL_FACTOR);
|
||||
return tspr->pos.Z + heinum * -tspr->Angles.Yaw.ToVector().dot(pos - tspr->pos.XY()) * (1. / SLOPEVAL_FACTOR);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -316,7 +316,7 @@ static void ReadSpriteV7(FileReader& fr, spritetype& spr, int& secno)
|
|||
secno = fr.ReadInt16();
|
||||
spr.statnum = fr.ReadInt16();
|
||||
spr.intangle = fr.ReadInt16();
|
||||
spr.angle = mapangle(spr.intangle);
|
||||
spr.Angles.Yaw = mapangle(spr.intangle);
|
||||
spr.intowner = fr.ReadInt16();
|
||||
spr.xint = fr.ReadInt16();
|
||||
spr.yint = fr.ReadInt16();
|
||||
|
@ -344,7 +344,7 @@ static void ReadSpriteV6(FileReader& fr, spritetype& spr, int& secno)
|
|||
spr.yoffset = fr.ReadInt8();
|
||||
spr.picnum = fr.ReadInt16();
|
||||
spr.intangle = fr.ReadInt16();
|
||||
spr.angle = mapangle(spr.intangle);
|
||||
spr.Angles.Yaw = mapangle(spr.intangle);
|
||||
spr.xint = fr.ReadInt16();
|
||||
spr.yint = fr.ReadInt16();
|
||||
spr.inittype = fr.ReadInt16();
|
||||
|
@ -373,7 +373,7 @@ static void ReadSpriteV5(FileReader& fr, spritetype& spr, int& secno)
|
|||
spr.scale = DVector2(x * REPEAT_SCALE, y * REPEAT_SCALE);
|
||||
spr.picnum = fr.ReadInt16();
|
||||
spr.intangle = fr.ReadInt16();
|
||||
spr.angle = mapangle(spr.intangle);
|
||||
spr.Angles.Yaw = mapangle(spr.intangle);
|
||||
spr.xint = fr.ReadInt16();
|
||||
spr.yint = fr.ReadInt16();
|
||||
spr.inittype = fr.ReadInt16();
|
||||
|
|
|
@ -448,7 +448,7 @@ struct spritetypebase
|
|||
DVector3 pos;
|
||||
|
||||
sectortype* sectp;
|
||||
DAngle angle;
|
||||
DRotator Angles;
|
||||
DVector2 scale;
|
||||
|
||||
ESpriteFlags cstat;
|
||||
|
|
|
@ -686,7 +686,7 @@ void BunchDrawer::ProcessSection(int sectionnum, bool portal)
|
|||
if ((actor->spr.cstat & (CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_MASK)) != (CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL) ||
|
||||
(r_voxels && tiletovox[actor->spr.picnum] >= 0 && voxmodels[tiletovox[actor->spr.picnum]]) ||
|
||||
(r_voxels && gi->Voxelize(actor->spr.picnum) > -1) ||
|
||||
(actor->spr.angle.Cos() * viewvec.X) + (actor->spr.angle.Sin() * viewvec.Y) < 0)
|
||||
(actor->spr.Angles.Yaw.Cos() * viewvec.X) + (actor->spr.Angles.Yaw.Sin() * viewvec.Y) < 0)
|
||||
if (!renderAddTsprite(di->tsprites, actor))
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -317,11 +317,11 @@ void HWDrawInfo::DispatchSprites()
|
|||
|
||||
if (actor->sprext.renderflags & SPREXT_AWAY1)
|
||||
{
|
||||
tspr->pos.XY() += tspr->angle.ToVector() * 0.125;
|
||||
tspr->pos.XY() += tspr->Angles.Yaw.ToVector() * 0.125;
|
||||
}
|
||||
else if (actor->sprext.renderflags & SPREXT_AWAY2)
|
||||
{
|
||||
tspr->pos.XY() -= tspr->angle.ToVector() * 0.125;
|
||||
tspr->pos.XY() -= tspr->Angles.Yaw.ToVector() * 0.125;
|
||||
}
|
||||
|
||||
switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
|
|
|
@ -462,7 +462,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s
|
|||
visibility = sectorVisibility(sector);
|
||||
voxel = vox;
|
||||
|
||||
auto ang = spr->angle + ownerActor->sprext.rot.Yaw;
|
||||
auto ang = spr->Angles.Yaw + ownerActor->sprext.rot.Yaw;
|
||||
if ((spr->clipdist & TSPR_MDLROTATE) || rotate)
|
||||
{
|
||||
int myclock = (PlayClock << 3) + MulScale(4 << 3, (int)di->Viewpoint.TicFrac, 16);
|
||||
|
|
|
@ -62,13 +62,13 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
|
|||
{
|
||||
// Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results.
|
||||
auto d = wal.delta();
|
||||
auto deltaang = absangle(d.Angle(), tspr->angle);
|
||||
auto deltaang = absangle(d.Angle(), tspr->Angles.Yaw);
|
||||
const DAngle maxangdelta = DAngle360 / 1024;
|
||||
|
||||
// angle of the sprite must either be the wall's normal or the negative wall's normal to be aligned.
|
||||
if (deltaang >= DAngle90 - maxangdelta && deltaang <= DAngle90 + maxangdelta)
|
||||
{
|
||||
if (!((tspr->angle.Buildang()) & 510))
|
||||
if (!((tspr->Angles.Yaw.Buildang()) & 510))
|
||||
{
|
||||
// orthogonal lines do not check the actual position so that certain off-sector sprites get handled properly.
|
||||
// In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector.
|
||||
|
@ -1101,7 +1101,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
|
|||
int HWWall::CheckWallSprite(tspritetype* spr, tspritetype* last)
|
||||
{
|
||||
// If the position changed we need to recalculate everything.
|
||||
if (spr->pos.XY() != last->pos.XY() || spr->sectp != last->sectp || spr->angle != last->angle) return 3;
|
||||
if (spr->pos.XY() != last->pos.XY() || spr->sectp != last->sectp || spr->Angles.Yaw != last->Angles.Yaw) return 3;
|
||||
|
||||
// if the horizontal orientation changes we need to recalculate the walls this attaches to, but not the positioning.
|
||||
if (spr->scale.X != last->scale.X || spr->xoffset != last->xoffset || spr->picnum != last->picnum || ((spr->cstat ^ last->cstat) & CSTAT_SPRITE_XFLIP)) return 2;
|
||||
|
|
|
@ -421,7 +421,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet
|
|||
("yoffset", c.yoffset, def->yoffset)
|
||||
("statnum", c.statnum)
|
||||
("sectnum", c.sectp)
|
||||
("angle", c.angle, def->angle)
|
||||
("angles", c.Angles, def->Angles)
|
||||
("ang", c.intangle, def->intangle)
|
||||
("owner", c.intowner, def->intowner)
|
||||
("xvel", c.xint, def->xint)
|
||||
|
@ -636,7 +636,7 @@ void DCoreActor::Serialize(FSerializer& arc)
|
|||
if (arc.isReading())
|
||||
{
|
||||
spsmooth = {};
|
||||
backuppos();
|
||||
backuploc();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -331,7 +331,7 @@ DEFINE_PROPERTY(statnum, I, CoreActor)
|
|||
DEFINE_PROPERTY(angle, F, CoreActor)
|
||||
{
|
||||
PROP_INT_PARM(i, 0);
|
||||
defaults->spr.angle = DAngle::fromDeg(i);
|
||||
defaults->spr.Angles.Yaw = DAngle::fromDeg(i);
|
||||
bag.Info->ActorInfo()->DefaultFlags |= DEFF_ANG;
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ DEFINE_FIELD_NAMED_X(walltype, walltype, yrepeat, yrepeat)
|
|||
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, sectp, sector)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, cstat)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, statnum)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, angle)
|
||||
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, Angles.Yaw, angle)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, xint)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, yint)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, inittype)
|
||||
|
@ -629,7 +629,7 @@ DEFINE_FIELD_NAMED(DCoreActor, sprext.renderflags, renderflags)
|
|||
DEFINE_FIELD_NAMED(DCoreActor, sprext.alpha, alpha)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, time, spawnindex)
|
||||
DEFINE_FIELD(DCoreActor, spritesetindex)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.angle, angle)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.Angles.Yaw, angle)
|
||||
DEFINE_FIELD(DCoreActor, vel)
|
||||
DEFINE_FIELD(DCoreActor, viewzoffset)
|
||||
|
||||
|
|
|
@ -2704,13 +2704,13 @@ static void actNapalmMove(DBloodActor* actor)
|
|||
int spawnparam[2];
|
||||
spawnparam[0] = actor->xspr.data4 >> 1;
|
||||
spawnparam[1] = actor->xspr.data4 - spawnparam[0];
|
||||
auto ang = actor->spr.angle;
|
||||
auto ang = actor->spr.Angles.Yaw;
|
||||
actor->vel.Zero();
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
double t1 = RandomD(3.2) + 3.2;
|
||||
auto rndang = Random2A(0x71);
|
||||
actor->spr.angle = (ang + rndang).Normalized360();
|
||||
actor->spr.Angles.Yaw = (ang + rndang).Normalized360();
|
||||
auto spawned = actFireThing(actor, 0., 0., -0.5774, kThingNapalmBall, t1);
|
||||
spawned->SetOwner(actor->GetOwner());
|
||||
seqSpawn(61, spawned, nNapalmClient);
|
||||
|
@ -2942,7 +2942,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
|
|||
else
|
||||
{
|
||||
seqKill(actor);
|
||||
DBloodActor* pEffect = gFX.fxSpawnActor((FX_ID)52, actor->sector(), actor->spr.pos, actor->spr.angle);
|
||||
DBloodActor* pEffect = gFX.fxSpawnActor((FX_ID)52, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw);
|
||||
if (pEffect != nullptr)
|
||||
{
|
||||
pEffect->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING;
|
||||
|
@ -3835,7 +3835,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
|||
if (missileActor->hasX())
|
||||
{
|
||||
actPostSprite(missileActor, kStatDecoration);
|
||||
if (missileActor->spr.angle == DAngle180) sfxPlay3DSound(missileActor, 307, -1, 0);
|
||||
if (missileActor->spr.Angles.Yaw == DAngle180) sfxPlay3DSound(missileActor, 307, -1, 0);
|
||||
missileActor->spr.type = kSpriteDecoration;
|
||||
seqSpawn(9, missileActor, -1);
|
||||
}
|
||||
|
@ -3854,7 +3854,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
|||
if (pWallHit)
|
||||
{
|
||||
auto pFX = gFX.fxSpawnActor(FX_52, missileActor->sector(), missileActor->spr.pos);
|
||||
if (pFX) pFX->spr.angle = (pWallHit->delta().Angle() + DAngle90).Normalized360();
|
||||
if (pFX) pFX->spr.Angles.Yaw = (pWallHit->delta().Angle() + DAngle90).Normalized360();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -3947,7 +3947,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
|||
missileActor->spr.picnum = 2123;
|
||||
missileActor->SetTarget(actorHit);
|
||||
missileActor->xspr.TargetPos.Z = (missileActor->spr.pos.Z - actorHit->spr.pos.Z);
|
||||
missileActor->xspr.goalAng = (missileActor->spr.pos.XY() - actorHit->spr.pos.XY()).Angle() - actorHit->spr.angle;
|
||||
missileActor->xspr.goalAng = (missileActor->spr.pos.XY() - actorHit->spr.pos.XY()).Angle() - actorHit->spr.Angles.Yaw;
|
||||
missileActor->xspr.state = 1;
|
||||
actPostSprite(missileActor, kStatFlare);
|
||||
missileActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -4074,8 +4074,8 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
|||
static void actKickObject(DBloodActor* kicker, DBloodActor* kicked)
|
||||
{
|
||||
double nSpeed = max(kicker->vel.XY().Length() * 2, FixedToFloat(0xaaaaa));
|
||||
kicked->vel.X = nSpeed * (kicker->spr.angle + Random2A(85)).Cos();
|
||||
kicked->vel.Y = nSpeed * (kicker->spr.angle + Random2A(85)).Sin();
|
||||
kicked->vel.X = nSpeed * (kicker->spr.Angles.Yaw + Random2A(85)).Cos();
|
||||
kicked->vel.Y = nSpeed * (kicker->spr.Angles.Yaw + Random2A(85)).Sin();
|
||||
kicked->vel.Z = nSpeed * -0.5;
|
||||
kicked->spr.flags = 7;
|
||||
}
|
||||
|
@ -4677,7 +4677,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
}
|
||||
}
|
||||
if (actor->vel.X != 0 || actor->vel.Y != 0)
|
||||
actor->spr.angle = actor->vel.Angle();
|
||||
actor->spr.Angles.Yaw = actor->vel.Angle();
|
||||
return lhit;
|
||||
}
|
||||
|
||||
|
@ -5891,7 +5891,7 @@ static void actCheckTraps()
|
|||
{
|
||||
auto pos = actor->spr.pos;
|
||||
double t = actor->xspr.data1 * (128. / 120.);
|
||||
auto vec = actor->spr.angle.ToVector() * t;
|
||||
auto vec = actor->spr.Angles.Yaw.ToVector() * t;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), pos);
|
||||
|
@ -5903,7 +5903,7 @@ static void actCheckTraps()
|
|||
}
|
||||
pos += vec / 2;
|
||||
}
|
||||
actFireVector(actor, 0., 0., DVector3(actor->spr.angle.ToVector(), Random2F(0x8888) * 4), kVectorTchernobogBurn, actor->xspr.data1 << 5);
|
||||
actFireVector(actor, 0., 0., DVector3(actor->spr.Angles.Yaw.ToVector(), Random2F(0x8888) * 4), kVectorTchernobogBurn, actor->xspr.data1 << 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -6081,7 +6081,7 @@ void actCheckFlares()
|
|||
if (target->hasX() && target->xspr.health > 0)
|
||||
{
|
||||
DVector3 pos = target->spr.pos;
|
||||
pos.XY() += (actor->xspr.goalAng + target->spr.angle).ToVector() * target->clipdist * 0.5;
|
||||
pos.XY() += (actor->xspr.goalAng + target->spr.Angles.Yaw).ToVector() * target->clipdist * 0.5;
|
||||
pos.Z += actor->xspr.TargetPos.Z;
|
||||
SetActor(actor, pos);
|
||||
actor->vel = target->vel;
|
||||
|
@ -6169,7 +6169,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist)
|
|||
{
|
||||
auto spawned = actSpawnSprite(source, kStatDude);
|
||||
if (!spawned) return nullptr;
|
||||
DAngle angle = source->spr.angle;
|
||||
DAngle angle = source->spr.Angles.Yaw;
|
||||
int nDude = nType - kDudeBase;
|
||||
|
||||
auto pos = source->spr.pos;
|
||||
|
@ -6181,7 +6181,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist)
|
|||
spawned->spr.type = nType;
|
||||
if (!VanillaMode())
|
||||
spawned->spr.inittype = nType;
|
||||
spawned->spr.angle = angle;
|
||||
spawned->spr.Angles.Yaw = angle;
|
||||
SetActor(spawned, pos);
|
||||
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1;
|
||||
|
@ -6329,16 +6329,16 @@ DBloodActor* actFireThing(DBloodActor* actor, double xyoff, double zoff, double
|
|||
{
|
||||
assert(thingType >= kThingBase && thingType < kThingMax);
|
||||
|
||||
DVector3 vect = actor->spr.pos.plusZ(zoff) + (actor->spr.angle + DAngle90).ToVector() * xyoff + actor->spr.angle.ToVector() * actor->clipdist;
|
||||
DVector3 vect = actor->spr.pos.plusZ(zoff) + (actor->spr.Angles.Yaw + DAngle90).ToVector() * xyoff + actor->spr.Angles.Yaw.ToVector() * actor->clipdist;
|
||||
|
||||
if (HitScan(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, actor->clipdist * 0.25) != -1)
|
||||
{
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * actor->clipdist * 2;
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.Angles.Yaw.ToVector() * actor->clipdist * 2;
|
||||
}
|
||||
auto fired = actSpawnThing(actor->sector(), vect, thingType);
|
||||
fired->SetOwner(actor);
|
||||
fired->spr.angle = actor->spr.angle;
|
||||
fired->vel = DVector3(fired->spr.angle.ToVector() * nSpeed, nSpeed * zvel * 4) + actor->vel * 0.5;
|
||||
fired->spr.Angles.Yaw = actor->spr.Angles.Yaw;
|
||||
fired->vel = DVector3(fired->spr.Angles.Yaw.ToVector() * nSpeed, nSpeed * zvel * 4) + actor->vel * 0.5;
|
||||
return fired;
|
||||
}
|
||||
|
||||
|
@ -6437,10 +6437,10 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect
|
|||
bool impact = false;
|
||||
const MissileType* pMissileInfo = &missileInfo[nType - kMissileBase];
|
||||
|
||||
auto vect = actor->spr.pos.plusZ(zoff) + (actor->spr.angle + DAngle90).ToVector() * xyoff;
|
||||
auto vect = actor->spr.pos.plusZ(zoff) + (actor->spr.Angles.Yaw + DAngle90).ToVector() * xyoff;
|
||||
|
||||
double clipdist = pMissileInfo->fClipDist() + actor->clipdist;
|
||||
vect += actor->spr.angle.ToVector() * clipdist;
|
||||
vect += actor->spr.Angles.Yaw.ToVector() * clipdist;
|
||||
|
||||
int hit = HitScan(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, clipdist * 4);
|
||||
if (hit != -1)
|
||||
|
@ -6448,11 +6448,11 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect
|
|||
if (hit == 3 || hit == 0)
|
||||
{
|
||||
impact = true;
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * 1;
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.Angles.Yaw.ToVector() * 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * pMissileInfo->fClipDist() * 2;
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.Angles.Yaw.ToVector() * pMissileInfo->fClipDist() * 2;
|
||||
}
|
||||
}
|
||||
auto spawned = actSpawnSprite(actor->sector(), vect, 5, 1);
|
||||
|
@ -6466,7 +6466,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect
|
|||
|
||||
spawned->spr.scale = DVector2(pMissileInfo->xrepeat * REPEAT_SCALE, pMissileInfo->yrepeat * REPEAT_SCALE);
|
||||
spawned->spr.picnum = pMissileInfo->picnum;
|
||||
spawned->spr.angle = actor->spr.angle += mapangle(pMissileInfo->angleOfs);
|
||||
spawned->spr.Angles.Yaw = actor->spr.Angles.Yaw += mapangle(pMissileInfo->angleOfs);
|
||||
spawned->vel = dv * pMissileInfo->fVelocity();
|
||||
spawned->SetOwner(actor);
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK;
|
||||
|
@ -6663,7 +6663,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
|||
auto pFX = gFX.fxSpawnActor(pVectorData->surfHit[nnSurf].fx1, pSector, ppos);
|
||||
if (pFX)
|
||||
{
|
||||
pFX->spr.angle = pWall->normalAngle();
|
||||
pFX->spr.Angles.Yaw = pWall->normalAngle();
|
||||
pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
pFX->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
|
||||
}
|
||||
|
@ -6760,7 +6760,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
|||
if (pFX)
|
||||
{
|
||||
pFX->vel.Z = FixedToFloat(0x2222);
|
||||
pFX->spr.angle = pWall->normalAngle();
|
||||
pFX->spr.Angles.Yaw = pWall->normalAngle();
|
||||
pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
pFX->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
|
||||
}
|
||||
|
|
|
@ -249,38 +249,38 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, double nRan
|
|||
void aiChooseDirection(DBloodActor* actor, DAngle direction)
|
||||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DAngle vc = deltaangle(actor->spr.angle, direction);
|
||||
DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction);
|
||||
auto almost60deg = DAngle::fromBuild(341); // 60° does not work correctly - this is a little bit less, actually.
|
||||
DAngle v8 = vc.Sgn() == -1 ? -almost60deg : almost60deg;
|
||||
|
||||
double range = actor->vel.XY().dot(actor->spr.angle.ToVector()) * 120;
|
||||
double range = actor->vel.XY().dot(actor->spr.Angles.Yaw.ToVector()) * 120;
|
||||
|
||||
if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + vc;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.angle - vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + v8, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + v8;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle, range))
|
||||
actor->xspr.goalAng = actor->spr.angle;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - v8, range))
|
||||
actor->xspr.goalAng = actor->spr.angle - v8;
|
||||
if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + vc;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw - vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + v8, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + v8;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - v8, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw - v8;
|
||||
//else if (actor->spr.flags&2)
|
||||
//actor->xspr.goalAng = actor->spr.angle+341;
|
||||
else // Weird..
|
||||
actor->xspr.goalAng = actor->spr.angle + almost60deg;
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + almost60deg;
|
||||
if (Chance(0x8000))
|
||||
actor->xspr.dodgeDir = 1;
|
||||
else
|
||||
actor->xspr.dodgeDir = -1;
|
||||
|
||||
actor->xspr.goalAng = actor->xspr.goalAng.Normalized360();
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
{
|
||||
actor->xspr.dodgeDir = -actor->xspr.dodgeDir;
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
actor->xspr.dodgeDir = 0;
|
||||
}
|
||||
}
|
||||
|
@ -295,12 +295,12 @@ void aiMoveForward(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed();
|
||||
actor->vel.XY() += actor->spr.Angles.Yaw.ToVector() * pDudeInfo->FrontSpeed();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -313,9 +313,9 @@ void aiMoveTurn(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -328,9 +328,9 @@ void aiMoveDodge(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (actor->xspr.dodgeDir)
|
||||
{
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
|
@ -1505,7 +1505,7 @@ void aiThinkTarget(DBloodActor* actor)
|
|||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
|
@ -1549,7 +1549,7 @@ void aiLookForTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
|
|
|
@ -72,7 +72,7 @@ void batBiteSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * pTarget->spr.scale.Y);
|
||||
actFireVector(actor, 0., 0., DVector3(actor->spr.angle.ToVector() * 64, height2 - height), kVectorBatBite);
|
||||
actFireVector(actor, 0., 0., DVector3(actor->spr.Angles.Yaw.ToVector() * 64, height2 - height), kVectorBatBite);
|
||||
}
|
||||
|
||||
static void batThinkTarget(DBloodActor* actor)
|
||||
|
@ -107,7 +107,7 @@ static void batThinkTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
|
@ -139,7 +139,7 @@ static void batThinkGoto(DBloodActor* actor)
|
|||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &batSearch);
|
||||
batThinkTarget(actor);
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ static void batThinkPonder(DBloodActor* actor)
|
|||
double nDist = dvec.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle());
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (getDudeInfo(pTarget->spr.type)->eyeHeight * pTarget->spr.scale.Y);
|
||||
double top, bottom;
|
||||
|
@ -200,9 +200,9 @@ static void batMoveDodgeUp(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
if (actor->xspr.dodgeDir > 0)
|
||||
t2 += pDudeInfo->sideSpeed;
|
||||
|
@ -217,9 +217,9 @@ static void batMoveDodgeDown(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (actor->xspr.dodgeDir == 0)
|
||||
return;
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
|
@ -259,7 +259,7 @@ static void batThinkChase(DBloodActor* actor)
|
|||
double nDist = dvec.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle());
|
||||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y;
|
||||
// Should be dudeInfo[pTarget->spr.type-kDudeBase]
|
||||
double height2 = pDudeInfo->eyeHeight * pTarget->spr.scale.Y;
|
||||
|
@ -298,14 +298,14 @@ static void batMoveForward(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X;
|
||||
double nDist = dvec.Length();
|
||||
if ((unsigned int)Random(64) < 32 && nDist <= 0x20)
|
||||
|
@ -323,9 +323,9 @@ static void batMoveSwoop(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -347,13 +347,13 @@ static void batMoveFly(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
actor->spr.angle += DAngle90;
|
||||
actor->spr.Angles.Yaw += DAngle90;
|
||||
return;
|
||||
}
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X;
|
||||
|
|
|
@ -67,7 +67,7 @@ void SlashSeqCallback(int, DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DVector3 dv;
|
||||
dv.XY() = actor->spr.angle.ToVector();
|
||||
dv.XY() = actor->spr.Angles.Yaw.ToVector();
|
||||
// Correct ?
|
||||
dv.Z = (actor->spr.pos.Z - target->spr.pos.Z) / 64;
|
||||
|
||||
|
@ -90,7 +90,7 @@ void StompSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode(); // use new sector checking logic
|
||||
auto sectorMap = GetClosestSpriteSectors(pSector, actor->spr.pos.XY(), nDist, nullptr, newSectCheckMethod);
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector() * 1024, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), CLIPMASK1, 0);
|
||||
DBloodActor* actorh = nullptr;
|
||||
actHitcodeToData(hit, &gHitInfo, &actorh);
|
||||
|
||||
|
@ -179,7 +179,7 @@ static void beastThinkGoto(DBloodActor* actor)
|
|||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
if (pXSector && pXSector->Underwater)
|
||||
aiNewState(actor, &beastSwimSearch);
|
||||
|
@ -232,7 +232,7 @@ static void beastThinkChase(DBloodActor* actor)
|
|||
double nDist = dv.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dv.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dv.Angle());
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
@ -328,7 +328,7 @@ static void beastThinkSwimGoto(DBloodActor* actor)
|
|||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &beastSwimSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -363,7 +363,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
@ -391,30 +391,30 @@ static void beastMoveForward(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if (nDist <= 0x40 && Random(64) < 32)
|
||||
return;
|
||||
actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed();
|
||||
actor->vel.XY() += actor->spr.Angles.Yaw.ToVector() * pDudeInfo->FrontSpeed();
|
||||
}
|
||||
|
||||
static void sub_628A0(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if (Random(64) < 32 && nDist <= 0x40)
|
||||
|
@ -434,9 +434,9 @@ static void sub_62AE0(DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
|
||||
if (abs(nAng) > DAngle60)
|
||||
|
@ -464,14 +464,14 @@ static void sub_62D7C(DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
actor->spr.angle += DAngle90;
|
||||
actor->spr.Angles.Yaw += DAngle90;
|
||||
return;
|
||||
}
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -82,7 +82,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
|
|||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y);
|
||||
DVector3 vect(actor->spr.angle.ToVector() * 1024, height2 - height);
|
||||
DVector3 vect(actor->spr.Angles.Yaw.ToVector() * 1024, height2 - height);
|
||||
|
||||
actFireVector(actor, 0., 0., vect, kVectorBoneelBite);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ static void eelThinkTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
|
@ -152,7 +152,7 @@ static void eelThinkGoto(DBloodActor* actor)
|
|||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &eelSearch);
|
||||
eelThinkTarget(actor);
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ static void eelThinkPonder(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (getDudeInfo(target->spr.type)->eyeHeight * target->spr.scale.Y);
|
||||
double top, bottom;
|
||||
|
@ -215,9 +215,9 @@ static void eelMoveDodgeUp(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
if (actor->xspr.dodgeDir > 0)
|
||||
t2 += FixedToFloat(pDudeInfo->sideSpeed);
|
||||
|
@ -232,9 +232,9 @@ static void eelMoveDodgeDown(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (actor->xspr.dodgeDir == 0)
|
||||
return;
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
|
@ -275,7 +275,7 @@ static void eelThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double top, bottom;
|
||||
double top2, bottom2;
|
||||
|
@ -308,14 +308,14 @@ static void eelMoveForward(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2);
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if (nDist <= 57.5625)
|
||||
|
@ -333,9 +333,9 @@ static void eelMoveSwoop(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2);
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
|
@ -354,9 +354,9 @@ static void eelMoveAscend(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2);
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
|
|
|
@ -88,7 +88,7 @@ static void burnThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
switch (actor->spr.type)
|
||||
{
|
||||
|
@ -194,7 +194,7 @@ static void burnThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ AISTATE tinycaleb139698 = { kAiStateOther, 8, -1, 120, NULL, aiMoveTurn, NULL, &
|
|||
|
||||
void SeqAttackCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
vect.X += Random2F(1500, 4);
|
||||
vect.Y += Random2F(1500, 4);
|
||||
vect.Z += Random2F(1500, 8);
|
||||
|
@ -97,7 +97,7 @@ static void calebThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
if (pXSector && pXSector->Underwater)
|
||||
aiNewState(actor, &tinycalebSwimSearch);
|
||||
|
@ -151,7 +151,7 @@ static void calebThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ static void calebThinkSwimGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &tinycalebSwimSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ static void calebThinkSwimChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
|
@ -276,14 +276,14 @@ static void sub_65D04(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if (Random(64) < 32 && nDist <= 0x40)
|
||||
|
@ -304,9 +304,9 @@ static void sub_65F44(DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
auto target = actor->GetTarget();
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -332,13 +332,13 @@ static void sub_661E0(DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
auto target = actor->GetTarget();
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
actor->spr.angle += DAngle90;
|
||||
actor->spr.Angles.Yaw += DAngle90;
|
||||
return;
|
||||
}
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -68,7 +68,7 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor)
|
|||
auto target = actor->GetTarget();
|
||||
|
||||
DVector3 vec;
|
||||
vec.XY() = actor->spr.angle.ToVector() * 64;
|
||||
vec.XY() = actor->spr.Angles.Yaw.ToVector() * 64;
|
||||
vec.Z = target->spr.pos.Z - actor->spr.pos.Z;
|
||||
actFireVector(actor, Cerberus_XYOff, -Cerberus_ZOff, vec, kVectorCerberusHack);
|
||||
actFireVector(actor, -Cerberus_XYOff, 0, vec, kVectorCerberusHack);
|
||||
|
@ -84,7 +84,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
//auto pos = actor->spr.pos.plusZ(height); // what it probably should be
|
||||
|
||||
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
double nClosest = 0x7fffffff;
|
||||
BloodStatIterator it(kStatDude);
|
||||
while (auto actor2 = it.Next())
|
||||
|
@ -99,7 +99,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
pos += actor2->vel * nDist * (65536. / 0x1aaaaa);
|
||||
|
||||
DVector3 tvec = pos;
|
||||
tvec.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
tvec.Z += actor->dudeSlope * nDist;
|
||||
double tsr = nDist * 9.23828125;
|
||||
double top, bottom;
|
||||
|
@ -110,7 +110,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
if (nDist2 < nClosest)
|
||||
{
|
||||
DAngle nAngle = (pos2.XY() - pos.XY()).Angle();
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle);
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw);
|
||||
if (nDeltaAngle <= DAngle45)
|
||||
{
|
||||
double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z;
|
||||
|
@ -145,7 +145,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
|||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
//auto pos = actor->spr.pos.plusZ(height); // what it probably should be
|
||||
|
||||
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
DVector3 Aim2(Aim.XY(), 0);
|
||||
|
||||
double nClosest = 0x7fffffff;
|
||||
|
@ -164,7 +164,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
|||
pos += actor2->vel * nDist * (65536. / 0x1aaaaa);
|
||||
|
||||
DVector3 tvec = pos;
|
||||
tvec.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
tvec.Z += actor->dudeSlope * nDist;
|
||||
|
||||
double tsr = nDist * 9.23828125;
|
||||
|
@ -177,7 +177,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
|||
if (nDist2 < nClosest)
|
||||
{
|
||||
DAngle nAngle = (pos2.XY() - pos.XY()).Angle();
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle);
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw);
|
||||
if (nDeltaAngle <= DAngle45)
|
||||
{
|
||||
DUDEINFO* pDudeInfo2 = getDudeInfo(actor2->spr.type);
|
||||
|
@ -249,7 +249,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
|
@ -280,7 +280,7 @@ static void cerberusThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
switch (actor->spr.type) {
|
||||
case kDudeCerberusTwoHead:
|
||||
|
@ -351,7 +351,7 @@ static void cerberusThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -75,7 +75,7 @@ AISTATE cultistSwimRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &culti
|
|||
|
||||
void TommySeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14);
|
||||
vect.Y += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14);
|
||||
vect.Z += Random3F((5 - gGameOptions.nDifficulty) * 500, 14);
|
||||
|
@ -87,7 +87,7 @@ void TeslaSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
if (Chance(gCultTeslaFireChance[gGameOptions.nDifficulty]))
|
||||
{
|
||||
DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14);
|
||||
vect.Y += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14);
|
||||
vect.Z += Random3F((5 - gGameOptions.nDifficulty) * 500, 14);
|
||||
|
@ -98,7 +98,7 @@ void TeslaSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
void ShotSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14);
|
||||
vect.Y += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14);
|
||||
vect.Z += Random3F((5 - gGameOptions.nDifficulty) * 500, 14);
|
||||
|
@ -188,7 +188,7 @@ static void cultThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 320 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 320 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
switch (actor->xspr.medium)
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
if (nDist > 0 && nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ void SlashFSeqCallback(int, DBloodActor* actor)
|
|||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y);
|
||||
DVector3 vec(actor->spr.angle.ToVector() * 64, height - height2);
|
||||
DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, height - height2);
|
||||
|
||||
actFireVector(actor, 0, 0, vec, kVectorGargSlash);
|
||||
double r1 = RandomF(50, 8);
|
||||
|
@ -107,7 +107,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
double height = (actor->spr.scale.Y * getDudeInfo(actor->spr.type)->eyeHeight);
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
||||
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
double nClosest = 0x7fffffff;
|
||||
|
||||
BloodStatIterator it(kStatDude);
|
||||
|
@ -124,7 +124,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
pos += actor2->vel * nDist * (65536. / 0x1aaaaa);
|
||||
|
||||
DVector3 tvec = pos;
|
||||
tvec.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
tvec.Z += actor->dudeSlope * nDist;
|
||||
|
||||
double tsr = nDist * 9.23828125;
|
||||
|
@ -137,7 +137,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
if (nDist2 < nClosest)
|
||||
{
|
||||
DAngle nAngle = (pos2.XY() - pos.XY()).Angle();
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle);
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw);
|
||||
if (nDeltaAngle <= DAngle45)
|
||||
{
|
||||
double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z;
|
||||
|
@ -205,7 +205,7 @@ static void gargThinkTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
|
@ -242,7 +242,7 @@ static void gargThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &gargoyleFSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -254,9 +254,9 @@ static void gargMoveDodgeUp(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
if (actor->xspr.dodgeDir > 0)
|
||||
t2 += FixedToFloat(pDudeInfo->sideSpeed);
|
||||
|
@ -274,9 +274,9 @@ static void gargMoveDodgeDown(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (actor->xspr.dodgeDir == 0)
|
||||
return;
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
|
@ -320,7 +320,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
double nDist = dxy.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dxyAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dxyAngle);
|
||||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y;
|
||||
// Should be dudeInfo[target->spr.type-kDudeBase]
|
||||
double height2 = pDudeInfo->eyeHeight * target->spr.scale.Y;
|
||||
|
@ -489,14 +489,14 @@ static void gargMoveForward(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if ((unsigned int)Random(64) < 32 && nDist <= 0x40)
|
||||
|
@ -517,9 +517,9 @@ static void gargMoveSlow(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -552,9 +552,9 @@ static void gargMoveSwoop(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -587,13 +587,13 @@ static void gargMoveFly(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
actor->spr.angle += DAngle90;
|
||||
actor->spr.Angles.Yaw += DAngle90;
|
||||
return;
|
||||
}
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -68,7 +68,7 @@ void ghostSlashSeqCallback(int, DBloodActor* actor)
|
|||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y);
|
||||
DVector3 dv(actor->spr.angle.ToVector() * 64, height - height2);
|
||||
DVector3 dv(actor->spr.Angles.Yaw.ToVector() * 64, height - height2);
|
||||
|
||||
sfxPlay3DSound(actor, 1406, 0, 0);
|
||||
actFireVector(actor, 0, 0, dv, kVectorGhost);
|
||||
|
@ -94,7 +94,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
double height = (actor->spr.scale.Y * getDudeInfo(actor->spr.type)->eyeHeight);
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
||||
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
double nClosest = 0x7fffffff;
|
||||
|
||||
BloodStatIterator it(kStatDude);
|
||||
|
@ -111,7 +111,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
pos += actor2->vel * nDist * (65536. / 0x1aaaaa);
|
||||
|
||||
DVector3 tvec = pos;
|
||||
tvec.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
tvec.Z += actor->dudeSlope * nDist;
|
||||
|
||||
double tsr = nDist * 9.23828125;
|
||||
|
@ -124,7 +124,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
if (nDist2 < nClosest)
|
||||
{
|
||||
DAngle nAngle = (pos2.XY() - pos.XY()).Angle();
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle);
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw);
|
||||
if (nDeltaAngle <= DAngle45)
|
||||
{
|
||||
double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z;
|
||||
|
@ -186,7 +186,7 @@ static void ghostThinkTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
|
@ -222,7 +222,7 @@ static void ghostThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &ghostSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -234,9 +234,9 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
if (actor->xspr.dodgeDir > 0)
|
||||
t2 += FixedToFloat(pDudeInfo->sideSpeed);
|
||||
|
@ -254,9 +254,9 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
if (actor->xspr.dodgeDir == 0)
|
||||
return;
|
||||
AdjustVelocity(actor, ADJUSTER{
|
||||
|
@ -299,7 +299,7 @@ static void ghostThinkChase(DBloodActor* actor)
|
|||
double nDist = dxy.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dxyAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dxyAngle);
|
||||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y;
|
||||
// Should be dudeInfo[target->spr.type-kDudeBase]
|
||||
double height2 = pDudeInfo->eyeHeight * target->spr.scale.Y;
|
||||
|
@ -385,14 +385,14 @@ static void ghostMoveForward(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if ((unsigned int)Random(64) < 32 && nDist <= 0x40)
|
||||
|
@ -412,9 +412,9 @@ static void ghostMoveSlow(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -443,9 +443,9 @@ static void ghostMoveSwoop(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -473,13 +473,13 @@ static void ghostMoveFly(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
actor->spr.angle += DAngle90;
|
||||
actor->spr.Angles.Yaw += DAngle90;
|
||||
return;
|
||||
}
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -61,7 +61,7 @@ void GillBiteSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DVector3 vec(actor->spr.angle.ToVector() * 64, actor->spr.pos.Z - target->spr.pos.Z);
|
||||
DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, actor->spr.pos.Z - target->spr.pos.Z);
|
||||
vec.X += Random3F(2000, 8);
|
||||
vec.Y += Random3F(2000, 8);
|
||||
actFireVector(actor, 0, 0, vec, kVectorGillBite);
|
||||
|
@ -87,7 +87,7 @@ static void gillThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
if (pXSector && pXSector->Underwater)
|
||||
aiNewState(actor, &gillBeastSwimSearch);
|
||||
|
@ -136,7 +136,7 @@ static void gillThinkChase(DBloodActor* actor)
|
|||
double nDist = dv.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
@ -200,7 +200,7 @@ static void gillThinkSwimGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &gillBeastSwimSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ static void gillThinkSwimChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
|
@ -264,14 +264,14 @@ static void sub_6CB00(DBloodActor* actor)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2);
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if (Random(64) < 32 && nDist <= 0x40)
|
||||
|
@ -292,9 +292,9 @@ static void sub_6CD74(DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2);
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
|
@ -319,13 +319,13 @@ static void sub_6D03C(DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2);
|
||||
if (abs(nAng) > DAngle60)
|
||||
{
|
||||
actor->spr.angle += DAngle90;
|
||||
actor->spr.Angles.Yaw += DAngle90;
|
||||
return;
|
||||
}
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -70,7 +70,7 @@ static void handThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &handSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ static void handThinkChase(DBloodActor* actor)
|
|||
}
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -51,14 +51,14 @@ void houndBiteSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DVector3 vec(actor->spr.angle.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z);
|
||||
DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z);
|
||||
if (target->IsPlayerActor() || gModernMap) // allow to hit non-player targets
|
||||
actFireVector(actor, 0, 0, vec, kVectorHoundBite);
|
||||
}
|
||||
|
||||
void houndBurnSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
actFireMissile(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), 0), kMissileFlameHound);
|
||||
actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileFlameHound);
|
||||
}
|
||||
|
||||
static void houndThinkSearch(DBloodActor* actor)
|
||||
|
@ -79,7 +79,7 @@ static void houndThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &houndSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ static void houndThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ static void innocThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &innocentSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ static void innocThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ static void aiPodMove(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
{
|
||||
switch (actor->spr.type) {
|
||||
case kDudePodGreen:
|
||||
|
@ -198,7 +198,7 @@ static void aiPodChase(DBloodActor* actor)
|
|||
}
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ void ratBiteSeqCallback(int, DBloodActor* actor)
|
|||
auto target = actor->GetTarget();
|
||||
if (target->IsPlayerActor())
|
||||
{
|
||||
DVector3 vec(actor->spr.angle.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z);
|
||||
DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z);
|
||||
actFireVector(actor, 0, 0, vec, kVectorRatBite);
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ static void ratThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &ratSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ static void ratThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ static void spidBlindEffect(DBloodActor* actor, int nBlind, int max)
|
|||
|
||||
void SpidBiteSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DVector3 vec(actor->spr.angle.ToVector(), 0);
|
||||
DVector3 vec(actor->spr.Angles.Yaw.ToVector(), 0);
|
||||
|
||||
vec.X += Random2F(2000, 14);
|
||||
vec.Y += Random2F(2000, 14);
|
||||
|
@ -107,7 +107,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
void SpidJumpSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DVector3 vec(actor->spr.angle.ToVector(), 0);
|
||||
DVector3 vec(actor->spr.Angles.Yaw.ToVector(), 0);
|
||||
|
||||
vec.X += Random2F(200, 14);
|
||||
vec.Y += Random2F(200, 14);
|
||||
|
@ -143,7 +143,7 @@ void SpidBirthSeqCallback(int, DBloodActor* actor)
|
|||
DBloodActor* spawned = nullptr;
|
||||
if (target->IsPlayerActor() && pDudeExtraE->birthCounter < 10)
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
if (nDist < 0x1a0 && nDist > 0x140 && nDeltaAngle < pDudeInfo->Periphery())
|
||||
spawned = actSpawnDude(actor, kDudeSpiderRed, actor->clipdist * 0.25);
|
||||
else if (nDist < 0x140 && nDist > 0xc0 && nDeltaAngle < pDudeInfo->Periphery())
|
||||
|
@ -175,7 +175,7 @@ static void spidThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &spidSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ static void spidThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -65,7 +65,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
||||
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
double nClosest = 0x7fffffff;
|
||||
|
||||
BloodStatIterator it(kStatDude);
|
||||
|
@ -82,7 +82,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor)
|
|||
pos += actor2->vel * nDist * (65536. / 0x1aaaaa);
|
||||
|
||||
DVector3 tvec = pos;
|
||||
tvec.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
tvec.Z += actor->dudeSlope * nDist;
|
||||
|
||||
double tsr = nDist * 9.23828125;
|
||||
|
@ -95,7 +95,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor)
|
|||
if (nDist2 < nClosest)
|
||||
{
|
||||
DAngle nAngle = (pos2.XY() - pos.XY()).Angle();
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle);
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw);
|
||||
if (nDeltaAngle <= DAngle45)
|
||||
{
|
||||
double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z;
|
||||
|
@ -123,7 +123,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor)
|
|||
double height = actor->spr.scale.Y * pDudeInfo->eyeHeight * 0.25;
|
||||
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
DVector3 Aim(actor->spr.angle.ToVector(), -actor->dudeSlope);
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), -actor->dudeSlope);
|
||||
DVector3 Aim2(Aim.XY(), 0);
|
||||
double nClosest = 0x7fffffff;
|
||||
|
||||
|
@ -138,7 +138,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor)
|
|||
pos += actor2->vel * nDist * (65536. / 0x1aaaaa);
|
||||
|
||||
DVector3 tvec = pos;
|
||||
tvec.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
tvec.Z += actor->dudeSlope * nDist;
|
||||
|
||||
double tsr = nDist * 9.23828125;
|
||||
|
@ -151,7 +151,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor)
|
|||
if (nDist2 < nClosest)
|
||||
{
|
||||
DAngle nAngle = (pos2.XY() - pos.XY()).Angle();
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle);
|
||||
DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw);
|
||||
if (nDeltaAngle <= DAngle45)
|
||||
{
|
||||
double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z;
|
||||
|
@ -212,7 +212,7 @@ static void sub_725A4(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
if (nDist < pDudeInfo->SeeDist() && abs(nDeltaAngle) <= pDudeInfo->Periphery())
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
|
@ -243,7 +243,7 @@ static void sub_72850(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &tchernobogSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ static void tchernobogThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ static bool genDudeAdjustSlope(DBloodActor* actor, double dist, int weaponType,
|
|||
for (int i = -8191; i < 8192; i += by)
|
||||
{
|
||||
double ii = i / 16384.;
|
||||
HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector(), ii), clipMask, dist * 16); // this originally passed a badly scaled 'dist'.
|
||||
HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector(), ii), clipMask, dist * 16); // this originally passed a badly scaled 'dist'.
|
||||
if (!fStart && actor->GetTarget() == gHitInfo.actor()) fStart = ii;
|
||||
else if (fStart && actor->GetTarget() != gHitInfo.actor())
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ void punchCallback(int, DBloodActor* actor)
|
|||
if (!playGenDudeSound(actor, kGenDudeSndAttackMelee))
|
||||
sfxPlay3DSound(actor, 530, 1, 0);
|
||||
|
||||
actFireVector(actor, 0, 0, DVector3(actor->spr.angle.ToVector() * 64, nZOffset1 - nZOffset2), kVectorGenDudePunch);
|
||||
actFireVector(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector() * 64, nZOffset1 - nZOffset2), kVectorGenDudePunch);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ void genDudeAttack1(int, DBloodActor* actor)
|
|||
|
||||
if (pExtra->weaponType == kGenDudeWeaponHitscan)
|
||||
{
|
||||
dv = DVector3(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
dv = DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
// dispersal modifiers here in case if non-melee enemy
|
||||
if (!dudeIsMelee(actor))
|
||||
{
|
||||
|
@ -265,7 +265,7 @@ void genDudeAttack1(int, DBloodActor* actor)
|
|||
}
|
||||
else if (pExtra->weaponType == kGenDudeWeaponMissile)
|
||||
{
|
||||
dv = DVector3(actor->spr.angle.ToVector(), actor->dudeSlope);
|
||||
dv = DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
|
||||
// dispersal modifiers here
|
||||
dv.X += Random3F(dispersion, 14);
|
||||
|
@ -427,7 +427,7 @@ static void unicultThinkGoto(DBloodActor* actor)
|
|||
aiChooseDirection(actor, nAngle);
|
||||
|
||||
// if reached target, change to search mode
|
||||
if (nDist < 320 && absangle(actor->spr.angle, nAngle) < getDudeInfo(actor->spr.type)->Periphery())
|
||||
if (nDist < 320 && absangle(actor->spr.Angles.Yaw, nAngle) < getDudeInfo(actor->spr.type)->Periphery())
|
||||
{
|
||||
if (spriteIsUnderwater(actor, false)) aiGenDudeNewState(actor, &genDudeSearchW);
|
||||
else aiGenDudeNewState(actor, &genDudeSearchL);
|
||||
|
@ -515,7 +515,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DAngle losAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle losAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
|
||||
if (dist > pDudeInfo->SeeDist() || !cansee(target->spr.pos, target->sector(),
|
||||
|
@ -750,9 +750,9 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
double targetDist = -1;
|
||||
int hit = -1;
|
||||
if (weaponType == kGenDudeWeaponHitscan)
|
||||
hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), CLIPMASK1, dist);
|
||||
hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), CLIPMASK1, dist);
|
||||
else if (weaponType == kGenDudeWeaponMissile)
|
||||
hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), CLIPMASK0, dist);
|
||||
hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), CLIPMASK0, dist);
|
||||
|
||||
if (hit >= 0)
|
||||
{
|
||||
|
@ -865,7 +865,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
else if (weaponType == kGenDudeWeaponHitscan && hscn)
|
||||
{
|
||||
if (genDudeAdjustSlope(actor, dist, weaponType)) break;
|
||||
VectorScan(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), dist, 1);
|
||||
VectorScan(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), dist, 1);
|
||||
if (actor == gHitInfo.actor()) break;
|
||||
|
||||
bool immune = nnExtIsImmune(hitactor, gVectorData[curWeapon].dmgType);
|
||||
|
@ -926,7 +926,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
if (hit == 4 && weaponType == kGenDudeWeaponHitscan && hscn)
|
||||
{
|
||||
bool masked = (pHWall->cstat & CSTAT_WALL_MASKED);
|
||||
if (masked) VectorScan(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), dist, 1);
|
||||
if (masked) VectorScan(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), dist, 1);
|
||||
|
||||
if ((actor != gHitInfo.actor()) && (pHWall->type != kWallGib || !masked || pXHWall == NULL || !pXHWall->triggerVector || pXHWall->locked))
|
||||
{
|
||||
|
@ -1120,14 +1120,14 @@ void aiGenDudeMoveForward(DBloodActor* actor)
|
|||
|
||||
if (pExtra->canFly)
|
||||
{
|
||||
auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
double nAccel = pDudeInfo->FrontSpeed() * 4;
|
||||
if (abs(nAng) > DAngle60)
|
||||
return;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
actor->spr.angle += DAngle45;
|
||||
actor->spr.Angles.Yaw += DAngle45;
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
double nDist = dvec.Length();
|
||||
if ((unsigned int)Random(64) < 32 && nDist <= 0x40)
|
||||
|
@ -1144,15 +1144,15 @@ void aiGenDudeMoveForward(DBloodActor* actor)
|
|||
{
|
||||
DAngle maxTurn = mapangle(pDudeInfo->angSpeed * 4 >> 4);
|
||||
|
||||
DAngle dang = actor->xspr.goalAng - actor->spr.angle;
|
||||
actor->spr.angle += clamp(dang, -maxTurn, maxTurn);
|
||||
DAngle dang = actor->xspr.goalAng - actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw += clamp(dang, -maxTurn, maxTurn);
|
||||
|
||||
// don't move forward if trying to turn around
|
||||
if (abs(dang) > DAngle180 / 3)
|
||||
return;
|
||||
|
||||
double frontSpeed = FixedToFloat(actor->genDudeExtra.moveSpeed);
|
||||
actor->vel += actor->spr.angle.ToVector() * frontSpeed;
|
||||
actor->vel += actor->spr.Angles.Yaw.ToVector() * frontSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1172,32 +1172,32 @@ void aiGenDudeChooseDirection(DBloodActor* actor, DAngle direction, const DVecto
|
|||
|
||||
// TO-DO: Take in account if sprite is flip-x, so enemy select correct angle
|
||||
|
||||
DAngle vc = deltaangle(actor->spr.angle, direction);
|
||||
double range = vel.dot(actor->spr.angle.ToVector()) * 120;
|
||||
DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction);
|
||||
double range = vel.dot(actor->spr.Angles.Yaw.ToVector()) * 120;
|
||||
DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3;
|
||||
|
||||
if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + vc;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.angle - vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + v8, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + v8;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle, range))
|
||||
actor->xspr.goalAng = actor->spr.angle;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - v8, range))
|
||||
actor->xspr.goalAng = actor->spr.angle - v8;
|
||||
if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + vc;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw - vc / 2;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + v8, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + v8;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw;
|
||||
else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - v8, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw - v8;
|
||||
else
|
||||
actor->xspr.goalAng = actor->spr.angle + DAngle180 / 3;
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + DAngle180 / 3;
|
||||
|
||||
actor->xspr.goalAng = actor->xspr.goalAng.Normalized360();
|
||||
actor->xspr.dodgeDir = (Chance(0x8000)) ? 1 : -1;
|
||||
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
{
|
||||
actor->xspr.dodgeDir = -actor->xspr.dodgeDir;
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
actor->xspr.dodgeDir = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1386,7 +1386,7 @@ void removeLeech(DBloodActor* actLeech, bool delSprite)
|
|||
{
|
||||
if (actLeech != nullptr)
|
||||
{
|
||||
auto effectactor = gFX.fxSpawnActor((FX_ID)52, actLeech->sector(), actLeech->spr.pos, actLeech->spr.angle);
|
||||
auto effectactor = gFX.fxSpawnActor((FX_ID)52, actLeech->sector(), actLeech->spr.pos, actLeech->spr.Angles.Yaw);
|
||||
if (effectactor != nullptr)
|
||||
{
|
||||
effectactor->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING;
|
||||
|
@ -1778,10 +1778,10 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
|
|||
{
|
||||
atpos.XY() += actTarget->vel.XY() * nDist * 0.0375;
|
||||
|
||||
auto angBak = actor->spr.angle;
|
||||
actor->spr.angle = (atpos - actor->spr.pos.XY()).Angle();
|
||||
auto angBak = actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw = (atpos - actor->spr.pos.XY()).Angle();
|
||||
DVector3 dv;
|
||||
dv.XY() = actor->spr.angle.ToVector() * 64;
|
||||
dv.XY() = actor->spr.Angles.Yaw.ToVector() * 64;
|
||||
double tz = actTarget->spr.pos.Z - (actTarget->spr.scale.Y * pDudeInfo->aimHeight);
|
||||
double dz = (tz - top - 1) / nDist * 4;
|
||||
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
|
||||
|
@ -1798,7 +1798,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
|
|||
evPostActor(actor, t2, kCallbackLeechStateTimer);
|
||||
actor->xspr.data3 = ClipLow(actor->xspr.data3 - 1, 0);
|
||||
}
|
||||
actor->spr.angle = angBak;
|
||||
actor->spr.Angles.Yaw = angBak;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1858,11 +1858,11 @@ DBloodActor* genDudeSpawn(DBloodActor* source, DBloodActor* actor, double nDist)
|
|||
auto pos = actor->spr.pos;
|
||||
if (nDist > 0)
|
||||
{
|
||||
pos.XY() += actor->spr.angle.ToVector() * nDist;
|
||||
pos.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
}
|
||||
|
||||
spawned->spr.type = nType;
|
||||
spawned->spr.angle = actor->spr.angle;
|
||||
spawned->spr.Angles.Yaw = actor->spr.Angles.Yaw;
|
||||
SetActor(spawned, pos);
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1;
|
||||
spawned->clipdist = dudeInfo[nType - kDudeBase].fClipdist();
|
||||
|
|
|
@ -94,7 +94,7 @@ static void zombaThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 51.3125 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 51.3125 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &zombieASearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ static void zombaThinkChase(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ static void zombaThinkPonder(DBloodActor* actor)
|
|||
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ static void myThinkTarget(DBloodActor* actor)
|
|||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
continue;
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle());
|
||||
if (nDist < pDudeInfo->SeeDist() && abs(nDeltaAngle) <= pDudeInfo->Periphery())
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
|
@ -265,7 +265,7 @@ static void entryAIdle(DBloodActor* actor)
|
|||
static void entryEStand(DBloodActor* actor)
|
||||
{
|
||||
sfxPlay3DSound(actor, 1100, -1, 0);
|
||||
actor->spr.angle = (actor->xspr.TargetPos - actor->spr.pos).Angle();
|
||||
actor->spr.Angles.Yaw = (actor->xspr.TargetPos - actor->spr.pos).Angle();
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -55,7 +55,7 @@ void zombfHackSeqCallback(int, DBloodActor* actor)
|
|||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y * 0.25;
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height2 = pDudeInfoT->eyeHeight * target->spr.scale.Y * 0.25;
|
||||
actFireVector(actor, 0, 0, DVector3(actor->spr.angle.ToVector() * 64, height - height2), kVectorCleaver);
|
||||
actFireVector(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector() * 64, height - height2), kVectorCleaver);
|
||||
}
|
||||
|
||||
void PukeSeqCallback(int, DBloodActor* actor)
|
||||
|
@ -77,7 +77,7 @@ void PukeSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
void ThrowSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
actFireMissile(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), 0), kMissileButcherKnife);
|
||||
actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileButcherKnife);
|
||||
}
|
||||
|
||||
static void zombfThinkSearch(DBloodActor* actor)
|
||||
|
@ -94,7 +94,7 @@ static void zombfThinkGoto(DBloodActor* actor)
|
|||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||
if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery())
|
||||
aiNewState(actor, &zombieFSearch);
|
||||
aiThinkTarget(actor);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ static void zombfThinkChase(DBloodActor* actor)
|
|||
double nDist = dv.Length();
|
||||
if (nDist <= pDudeInfo->SeeDist())
|
||||
{
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
|
||||
{
|
||||
|
|
|
@ -69,7 +69,7 @@ tspritetype* viewInsertTSprite(tspriteArray& tsprites, sectortype* pSector, int
|
|||
{
|
||||
pos = parentTSprite->pos;
|
||||
pTSprite->ownerActor = parentTSprite->ownerActor;
|
||||
pTSprite->angle = parentTSprite->angle;
|
||||
pTSprite->Angles.Yaw = parentTSprite->Angles.Yaw;
|
||||
}
|
||||
pos.XY() += gCameraAng.ToVector() * 2;
|
||||
pTSprite->pos = pos;
|
||||
|
@ -242,7 +242,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
|
|||
}
|
||||
case kViewEffectTrail:
|
||||
{
|
||||
auto nAng = pTSprite->angle;
|
||||
auto nAng = pTSprite->Angles.Yaw;
|
||||
if (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)
|
||||
{
|
||||
nAng += DAngle90;
|
||||
|
@ -422,7 +422,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
|
|||
pNSprite->pal = 2;
|
||||
pNSprite->scale = DVector2(1, 1);
|
||||
pNSprite->cstat |= CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_YFLIP | CSTAT_SPRITE_TRANSLUCENT;
|
||||
pNSprite->angle = pTSprite->angle;
|
||||
pNSprite->Angles.Yaw = pTSprite->Angles.Yaw;
|
||||
pNSprite->ownerActor = pTSprite->ownerActor;
|
||||
break;
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
|
|||
pNSprite->pal = 2;
|
||||
pNSprite->scale = DVector2(nShade * REPEAT_SCALE, nShade * REPEAT_SCALE);
|
||||
pNSprite->cstat |= CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_TRANSLUCENT;
|
||||
pNSprite->angle = pTSprite->angle;
|
||||
pNSprite->Angles.Yaw = pTSprite->Angles.Yaw;
|
||||
pNSprite->ownerActor = pTSprite->ownerActor;
|
||||
break;
|
||||
}
|
||||
|
@ -477,16 +477,16 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
|
|||
if (cl_showweapon == 2 && r_voxels && nVoxel != -1)
|
||||
{
|
||||
auto gView = &gPlayer[gViewIndex];
|
||||
pNSprite->angle = gView->actor->spr.angle += DAngle90; // always face viewer
|
||||
pNSprite->Angles.Yaw = gView->actor->spr.Angles.Yaw += DAngle90; // always face viewer
|
||||
pNSprite->cstat |= CSTAT_SPRITE_ALIGNMENT_SLAB;
|
||||
pNSprite->cstat &= ~CSTAT_SPRITE_YFLIP;
|
||||
pNSprite->picnum = nVoxel;
|
||||
if (pPlayer->curWeapon == kWeapLifeLeech) // position lifeleech behind player
|
||||
{
|
||||
pNSprite->pos.XY() += gView->actor->spr.angle.ToVector() * 8;
|
||||
pNSprite->pos.XY() += gView->actor->spr.Angles.Yaw.ToVector() * 8;
|
||||
}
|
||||
if ((pPlayer->curWeapon == kWeapLifeLeech) || (pPlayer->curWeapon == kWeapVoodooDoll)) // make lifeleech/voodoo doll always face viewer like sprite
|
||||
pNSprite->angle += DAngle90;
|
||||
pNSprite->Angles.Yaw += DAngle90;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
if (cl_interpolate && owneractor->interpolated && !(pTSprite->flags & 512))
|
||||
{
|
||||
pTSprite->pos = owneractor->interpolatedpos(interpfrac);
|
||||
pTSprite->angle = owneractor->interpolatedangle(interpfrac);
|
||||
pTSprite->Angles.Yaw = owneractor->interpolatedangle(interpfrac);
|
||||
}
|
||||
int nAnim = 0;
|
||||
switch (picanm[nTile].extra & 7) {
|
||||
|
@ -585,7 +585,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
break;
|
||||
}
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle));
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw));
|
||||
if (nAnim <= 4)
|
||||
{
|
||||
pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
|
@ -604,7 +604,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
break;
|
||||
}
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle));
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw));
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
|
@ -640,7 +640,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
pTSprite->picnum = voxelIndex[pTSprite->picnum];
|
||||
if ((picanm[nTile].extra & 7) == 7)
|
||||
{
|
||||
pTSprite->angle = myclock.Normalized360();
|
||||
pTSprite->Angles.Yaw = myclock.Normalized360();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -874,7 +874,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
auto pNTSprite = viewAddEffect(tsprites, nTSprite, kViewEffectShoot);
|
||||
if (pNTSprite) {
|
||||
POSTURE* pPosture = &thisPlayer->pPosture[thisPlayer->lifeMode][thisPlayer->posture];
|
||||
pNTSprite->pos.XY() += pTSprite->angle.ToVector() * pPosture->xOffset;
|
||||
pNTSprite->pos.XY() += pTSprite->Angles.Yaw.ToVector() * pPosture->xOffset;
|
||||
pNTSprite->pos.Z = thisPlayer->actor->spr.pos.Z - pPosture->zOffset;
|
||||
}
|
||||
}
|
||||
|
@ -948,7 +948,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle));
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw));
|
||||
if (nAnim <= 4)
|
||||
{
|
||||
pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
|
@ -962,7 +962,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
}
|
||||
case 2:
|
||||
{
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle));
|
||||
nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,8 +174,8 @@ inline bool IsTargetTeammate(DBloodActor* pSource, DBloodActor* pTarget)
|
|||
template<typename T>
|
||||
void AdjustVelocity(DBloodActor *actor, T adjuster)
|
||||
{
|
||||
double nCos = actor->spr.angle.Cos();
|
||||
double nSin = actor->spr.angle.Sin();
|
||||
double nCos = actor->spr.Angles.Yaw.Cos();
|
||||
double nSin = actor->spr.Angles.Yaw.Sin();
|
||||
double t1 = actor->vel.X * nCos + actor->vel.Y * nSin;
|
||||
double t2 = actor->vel.X * nSin - actor->vel.Y * nCos;
|
||||
adjuster(actor, t1, t2);
|
||||
|
|
|
@ -187,7 +187,7 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6
|
|||
auto pFX = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos);
|
||||
if (pFX)
|
||||
{
|
||||
pFX->spr.angle = nullAngle;
|
||||
pFX->spr.Angles.Yaw = nullAngle;
|
||||
pFX->vel = actor->vel * (1./256);
|
||||
}
|
||||
evPostActor(actor, 6, kCallbackFXBloodSpurt);
|
||||
|
@ -224,7 +224,7 @@ void fxDynPuff(DBloodActor* actor, sectortype*) // 8
|
|||
if (actor->vel.Z)
|
||||
{
|
||||
double nDist = (actor->spr.scale.X * tileWidth(actor->spr.picnum)) * (1. / 2);
|
||||
DVector3 pos = actor->spr.pos + (actor->spr.angle - DAngle90).ToVector() * nDist;
|
||||
DVector3 pos = actor->spr.pos + (actor->spr.Angles.Yaw - DAngle90).ToVector() * nDist;
|
||||
auto pFX = gFX.fxSpawnActor(FX_7, actor->sector(), pos);
|
||||
if (pFX)
|
||||
{
|
||||
|
@ -343,7 +343,7 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10
|
|||
for (int i = 0; i < (pPlayer->bubbleTime >> 6); i++)
|
||||
{
|
||||
double nDist = (actor->spr.scale.X * tileWidth(actor->spr.picnum)) * (1. / 2);
|
||||
DVector2 pos = actor->spr.pos.XY() + actor->spr.angle.ToVector() * nDist;
|
||||
DVector2 pos = actor->spr.pos.XY() + actor->spr.Angles.Yaw.ToVector() * nDist;
|
||||
double z = bottom - RandomD(bottom - top, 8);
|
||||
auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), DVector3(pos, z));
|
||||
if (pFX)
|
||||
|
@ -447,7 +447,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14
|
|||
int nDist = Random(16);
|
||||
auto pos = nAngle.ToVector() * nDist * 4;
|
||||
gFX.fxSpawnActor(FX_48, actor->sector(), DVector3(pos, actor->spr.pos.Z));
|
||||
if (actor->spr.angle == DAngle180)
|
||||
if (actor->spr.Angles.Yaw == DAngle180)
|
||||
{
|
||||
int nChannel = 28 + (actor->GetIndex() & 2); // this is a little stupid...
|
||||
sfxPlay3DSound(actor, 385, nChannel, 1);
|
||||
|
@ -456,7 +456,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14
|
|||
{
|
||||
auto pFX = gFX.fxSpawnActor(FX_36, actor->sector(), DVector3(pos, floorZ - 0.25));
|
||||
if (pFX)
|
||||
pFX->spr.angle = nAngle;
|
||||
pFX->spr.Angles.Yaw = nAngle;
|
||||
}
|
||||
gFX.remove(actor);
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18
|
|||
pFX = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos);
|
||||
if (pFX)
|
||||
{
|
||||
pFX->spr.angle = nullAngle;
|
||||
pFX->spr.Angles.Yaw = nullAngle;
|
||||
pFX->vel = actor->vel * (1./256);
|
||||
}
|
||||
evPostActor(actor, 6, kCallbackFXPodBloodSpray);
|
||||
|
@ -637,7 +637,7 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19
|
|||
int nDist = Random(16);
|
||||
auto pos = actor->spr.pos.XY() + nAngle.ToVector() * nDist * 4;
|
||||
|
||||
if (actor->spr.angle == DAngle180 && actor->spr.type == 53)
|
||||
if (actor->spr.Angles.Yaw == DAngle180 && actor->spr.type == 53)
|
||||
{
|
||||
int nChannel = 28 + (actor->GetIndex() & 2);
|
||||
assert(nChannel < 32);
|
||||
|
@ -649,13 +649,13 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19
|
|||
if (Chance(0x500) || actor->spr.type == kThingPodGreenBall)
|
||||
pFX = gFX.fxSpawnActor(FX_55, actor->sector(), DVector3(pos, floorZ - 0.25));
|
||||
if (pFX)
|
||||
pFX->spr.angle = nAngle;
|
||||
pFX->spr.Angles.Yaw = nAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
pFX = gFX.fxSpawnActor(FX_32, actor->sector(), DVector3(pos, floorZ - 0.25));
|
||||
if (pFX)
|
||||
pFX->spr.angle = nAngle;
|
||||
pFX->spr.Angles.Yaw = nAngle;
|
||||
}
|
||||
gFX.remove(actor);
|
||||
}
|
||||
|
@ -693,7 +693,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ???
|
|||
double top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
actor->spr.pos = actor2->spr.pos.plusZ(-(bottom - actor->spr.pos.Z));
|
||||
actor->spr.angle = actor2->spr.angle;
|
||||
actor->spr.Angles.Yaw = actor2->spr.Angles.Yaw;
|
||||
ChangeActorSect(actor, actor2->sector());
|
||||
sfxPlay3DSound(actor2, 201, -1, 0);
|
||||
actor->vel.Zero();
|
||||
|
@ -730,7 +730,7 @@ void DropVoodooCb(DBloodActor* actor, sectortype*) // unused
|
|||
evPostActor(actor, 0, kCallbackRemove);
|
||||
return;
|
||||
}
|
||||
actor->spr.angle = (Owner->spr.pos - actor->spr.pos).Angle();
|
||||
actor->spr.Angles.Yaw = (Owner->spr.pos - actor->spr.pos).Angle();
|
||||
if (actor->hasX())
|
||||
{
|
||||
if (actor->xspr.data1 == 0)
|
||||
|
|
|
@ -484,7 +484,7 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, sectortype** cur
|
|||
pSprite->picnum = LittleShort(load.picnum);
|
||||
int secno = LittleShort(load.sectnum);
|
||||
pSprite->statnum = LittleShort(load.statnum);
|
||||
pSprite->angle = mapangle(LittleShort(load.ang));
|
||||
pSprite->Angles.Yaw = mapangle(LittleShort(load.ang));
|
||||
pSprite->intowner = LittleShort(load.owner);
|
||||
pSprite->xint = LittleShort(load.index);
|
||||
pSprite->yint = LittleShort(load.yvel);
|
||||
|
|
|
@ -276,7 +276,7 @@ void fxSpawnBlood(DBloodActor* actor, int)
|
|||
auto bloodactor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos);
|
||||
if (bloodactor)
|
||||
{
|
||||
bloodactor->spr.angle = DAngle180;
|
||||
bloodactor->spr.Angles.Yaw = DAngle180;
|
||||
bloodactor->vel.X = Random2F(0x6aaaa);
|
||||
bloodactor->vel.Y = Random2F(0x6aaaa);
|
||||
bloodactor->vel.Z = -Random2F(0x10aaaa) - FixedToFloat(100);
|
||||
|
@ -306,7 +306,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
|
|||
spawnactor = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos);
|
||||
if (spawnactor)
|
||||
{
|
||||
spawnactor->spr.angle = DAngle180;
|
||||
spawnactor->spr.Angles.Yaw = DAngle180;
|
||||
spawnactor->vel.X = Random2F(0x6aaaa);
|
||||
spawnactor->vel.Y = Random2F(0x6aaaa);
|
||||
spawnactor->vel.Z = -Random2F(0x10aaaa) - FixedToFloat(100);
|
||||
|
@ -322,15 +322,15 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
|
|||
|
||||
void fxSpawnEjectingBrass(DBloodActor* actor, double z, double dist, int rdist)
|
||||
{
|
||||
DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.angle.ToVector() + (actor->spr.angle + DAngle90).ToVector() * dist, z);
|
||||
DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.Angles.Yaw.ToVector() + (actor->spr.Angles.Yaw + DAngle90).ToVector() * dist, z);
|
||||
|
||||
auto pBrass = gFX.fxSpawnActor((FX_ID)(FX_37 + Random(3)), actor->sector(), pos);
|
||||
if (pBrass)
|
||||
{
|
||||
if (!VanillaMode())
|
||||
pBrass->spr.angle = RandomAngle();
|
||||
pBrass->spr.Angles.Yaw = RandomAngle();
|
||||
double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4);
|
||||
DAngle nAngle = actor->spr.angle + Random2A(56) + DAngle90;
|
||||
DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90;
|
||||
pBrass->vel.XY() = nAngle.ToVector() * nDist;
|
||||
pBrass->vel.Z = actor->vel.Z - 2 - Random2(40) / 30.;
|
||||
}
|
||||
|
@ -344,15 +344,15 @@ void fxSpawnEjectingBrass(DBloodActor* actor, double z, double dist, int rdist)
|
|||
|
||||
void fxSpawnEjectingShell(DBloodActor* actor, double z, double dist, int rdist)
|
||||
{
|
||||
DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.angle.ToVector() + (actor->spr.angle + DAngle90).ToVector() * dist, z);
|
||||
DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.Angles.Yaw.ToVector() + (actor->spr.Angles.Yaw + DAngle90).ToVector() * dist, z);
|
||||
|
||||
auto pShell = gFX.fxSpawnActor((FX_ID)(FX_40 + Random(3)), actor->sector(), pos);
|
||||
if (pShell)
|
||||
{
|
||||
if (!VanillaMode())
|
||||
pShell->spr.angle = RandomAngle();
|
||||
pShell->spr.Angles.Yaw = RandomAngle();
|
||||
double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4);
|
||||
DAngle nAngle = actor->spr.angle + Random2A(56) + DAngle90;
|
||||
DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90;
|
||||
pShell->vel.XY() = nAngle.ToVector() * nDist;
|
||||
pShell->vel.Z = actor->vel.Z - 2 - Random2(28) / 30.;
|
||||
}
|
||||
|
|
|
@ -253,7 +253,7 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto
|
|||
|
||||
int nNum = 256;
|
||||
gHitInfo.clearObj();
|
||||
auto pos = actor->spr.pos.plusZ(nZOffset) + (actor->spr.angle + DAngle90).ToVector() * nOffset;
|
||||
auto pos = actor->spr.pos.plusZ(nZOffset) + (actor->spr.Angles.Yaw + DAngle90).ToVector() * nOffset;
|
||||
auto bakCstat = actor->spr.cstat;
|
||||
actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin
|
|||
if (nType < kDudeBase || nType >= kDudeMax || (pDudeActor = actSpawnSprite(origin, kStatDude)) == NULL)
|
||||
return NULL;
|
||||
|
||||
DAngle angle = origin->spr.angle;
|
||||
DAngle angle = origin->spr.Angles.Yaw;
|
||||
auto pos = origin->spr.pos.plusZ(zadd);
|
||||
|
||||
if (dist >= 0)
|
||||
|
@ -270,7 +270,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin
|
|||
SetActor(pDudeActor, pos);
|
||||
|
||||
pDudeActor->spr.type = nType;
|
||||
pDudeActor->spr.angle = angle;
|
||||
pDudeActor->spr.Angles.Yaw = angle;
|
||||
|
||||
pDudeActor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
||||
pDudeActor->clipdist = getDudeInfo(nType)->fClipdist();
|
||||
|
@ -1312,7 +1312,7 @@ void nnExtProcessSuperSprites()
|
|||
double nSpeed = pact->vel.XY().Length();
|
||||
nSpeed = max<double>(nSpeed - nSpeed * FixedToFloat<6>(mass), FixedToFloat(0x9000 - (mass << 3))); // very messy math (TM)...
|
||||
|
||||
debrisactor->vel += pPlayer->actor->spr.angle.ToVector() * nSpeed;
|
||||
debrisactor->vel += pPlayer->actor->spr.Angles.Yaw.ToVector() * nSpeed;
|
||||
debrisactor->hit.hit.setSprite(pPlayer->actor);
|
||||
}
|
||||
}
|
||||
|
@ -1326,7 +1326,7 @@ void nnExtProcessSuperSprites()
|
|||
debrisactor->xspr.goalAng = debrisactor->vel.Angle();
|
||||
|
||||
debrisactor->norm_ang();
|
||||
DAngle ang = debrisactor->spr.angle;
|
||||
DAngle ang = debrisactor->spr.Angles.Yaw;
|
||||
if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble);
|
||||
else if (Chance(0x1000 - mass))
|
||||
{
|
||||
|
@ -1342,8 +1342,8 @@ void nnExtProcessSuperSprites()
|
|||
int vdist = max((int)(abs(debrisactor->vel.X) + abs(debrisactor->vel.Y) * 2048.), (uwater) ? 1 : 0);
|
||||
auto angStep = DAngle::fromBuild(vdist);
|
||||
|
||||
if (ang < debrisactor->xspr.goalAng) debrisactor->spr.angle = min(ang + angStep, debrisactor->xspr.goalAng);
|
||||
else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.angle = max(ang - angStep, debrisactor->xspr.goalAng);
|
||||
if (ang < debrisactor->xspr.goalAng) debrisactor->spr.Angles.Yaw = min(ang + angStep, debrisactor->xspr.goalAng);
|
||||
else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.Angles.Yaw = max(ang - angStep, debrisactor->xspr.goalAng);
|
||||
|
||||
auto pSector = debrisactor->sector();
|
||||
double fz, cz;
|
||||
|
@ -2745,7 +2745,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
|||
|
||||
// set random goal ang for swimming so they start turning
|
||||
if ((flags & kPhysDebrisSwim) && targetactor->vel.isZero())
|
||||
targetactor->xspr.goalAng = (targetactor->spr.angle + DAngle::fromBuild(Random3(kAng45))).Normalized360();
|
||||
targetactor->xspr.goalAng = (targetactor->spr.Angles.Yaw + DAngle::fromBuild(Random3(kAng45))).Normalized360();
|
||||
|
||||
if (targetactor->xspr.physAttr & kPhysDebrisVector)
|
||||
targetactor->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||
|
@ -3022,9 +3022,9 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi
|
|||
}
|
||||
else
|
||||
{
|
||||
if (toEvnAng) nAng = initiator->spr.angle;
|
||||
else if (toSrcAng) nAng = actor->spr.angle;
|
||||
else nAng = pSprite->spr.angle;
|
||||
if (toEvnAng) nAng = initiator->spr.Angles.Yaw;
|
||||
else if (toSrcAng) nAng = actor->spr.Angles.Yaw;
|
||||
else nAng = pSprite->spr.Angles.Yaw;
|
||||
|
||||
if (!toAng180 && toRndAng)
|
||||
{
|
||||
|
@ -3248,7 +3248,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
if (sourceactor->xspr.data3 & kModernTypeFlag2)
|
||||
{
|
||||
auto velv = actor->vel.XY();
|
||||
auto pt = rotatepoint(actor->spr.pos.XY(), velv, sourceactor->spr.angle - velv.Angle());
|
||||
auto pt = rotatepoint(actor->spr.pos.XY(), velv, sourceactor->spr.Angles.Yaw - velv.Angle());
|
||||
actor->vel.XY() = pt;
|
||||
|
||||
}
|
||||
|
@ -3258,7 +3258,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
}
|
||||
|
||||
if (sourceactor->xspr.data2 == 1)
|
||||
changeSpriteAngle(actor, sourceactor->spr.angle);
|
||||
changeSpriteAngle(actor, sourceactor->spr.Angles.Yaw);
|
||||
|
||||
viewBackupSpriteLoc(actor);
|
||||
|
||||
|
@ -3351,7 +3351,7 @@ void useEffectGen(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
|
||||
if (sourceactor->spr.flags & kModernTypeFlag4)
|
||||
{
|
||||
pEffect->spr.angle = sourceactor->spr.angle;
|
||||
pEffect->spr.Angles.Yaw = sourceactor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
if (pEffect->spr.cstat & CSTAT_SPRITE_ONE_SIDE)
|
||||
|
@ -3402,31 +3402,31 @@ void useSectorWindGen(DBloodActor* sourceactor, sectortype* pSector)
|
|||
if ((sourceactor->spr.flags & kModernTypeFlag1))
|
||||
pXSector->panAlways = pXSector->windAlways = 1;
|
||||
|
||||
DAngle angle = sourceactor->spr.angle;
|
||||
DAngle angle = sourceactor->spr.Angles.Yaw;
|
||||
if (sourceactor->xspr.data4 <= 0)
|
||||
{
|
||||
if ((sourceactor->xspr.data1 & 0x0002))
|
||||
{
|
||||
while (sourceactor->spr.angle == angle)
|
||||
sourceactor->spr.angle = RandomAngle();
|
||||
while (sourceactor->spr.Angles.Yaw == angle)
|
||||
sourceactor->spr.Angles.Yaw = RandomAngle();
|
||||
}
|
||||
}
|
||||
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD) sourceactor->spr.angle += mapangle(sourceactor->xspr.data4);
|
||||
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.angle -= mapangle(sourceactor->xspr.data4);
|
||||
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD) sourceactor->spr.Angles.Yaw += mapangle(sourceactor->xspr.data4);
|
||||
else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.Angles.Yaw -= mapangle(sourceactor->xspr.data4);
|
||||
else if (sourceactor->xspr.sysData1 == 0)
|
||||
{
|
||||
angle += mapangle(sourceactor->xspr.data4);
|
||||
if (angle >= DAngle180) sourceactor->xspr.sysData1 = 1;
|
||||
sourceactor->spr.angle = min(angle, DAngle180);
|
||||
sourceactor->spr.Angles.Yaw = min(angle, DAngle180);
|
||||
}
|
||||
else
|
||||
{
|
||||
angle -= mapangle(sourceactor->xspr.data4);
|
||||
if (angle <= -DAngle180) sourceactor->xspr.sysData1 = 0;
|
||||
sourceactor->spr.angle = max(angle, -DAngle180);
|
||||
sourceactor->spr.Angles.Yaw = max(angle, -DAngle180);
|
||||
}
|
||||
|
||||
pXSector->windAng = sourceactor->spr.angle;
|
||||
pXSector->windAng = sourceactor->spr.Angles.Yaw;
|
||||
|
||||
if (sourceactor->xspr.data3 > 0 && sourceactor->xspr.data3 < 4)
|
||||
{
|
||||
|
@ -3784,7 +3784,7 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector
|
|||
|
||||
if (sourceactor->spr.flags & kModernTypeFlag4)
|
||||
{
|
||||
spawned->spr.angle = sourceactor->spr.angle;
|
||||
spawned->spr.Angles.Yaw = sourceactor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
// should be: the more is seqs, the shorter is timer
|
||||
|
@ -4433,7 +4433,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
var = cansee(objActor->spr.pos, objActor->sector(), targ->spr.pos.plusZ(-height), targ->sector());
|
||||
if (cond == 4 && var > 0)
|
||||
{
|
||||
DAngle absang = absangle(delta.Angle(), objActor->spr.angle);
|
||||
DAngle absang = absangle(delta.Angle(), objActor->spr.Angles.Yaw);
|
||||
var = absang < (arg1 <= 0 ? pInfo->Periphery() : min(mapangle(arg1), DAngle360));
|
||||
}
|
||||
break;
|
||||
|
@ -4556,7 +4556,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
switch (cond)
|
||||
{
|
||||
default: break;
|
||||
case 0: return condCmp((arg3 == 0) ? (objActor->spr.angle.Normalized360().Buildang()) : objActor->spr.angle.Buildang(), arg1, arg2, cmpOp);
|
||||
case 0: return condCmp((arg3 == 0) ? (objActor->spr.Angles.Yaw.Normalized360().Buildang()) : objActor->spr.Angles.Yaw.Buildang(), arg1, arg2, cmpOp);
|
||||
case 5: return condCmp(objActor->spr.statnum, arg1, arg2, cmpOp);
|
||||
case 6: return ((objActor->spr.flags & kHitagRespawn) || objActor->spr.statnum == kStatRespawn);
|
||||
case 7: return condCmp(spriteGetSlope(objActor), arg1, arg2, cmpOp);
|
||||
|
@ -4619,15 +4619,15 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
if ((pPlayer = getPlayerById(objActor->spr.type)) != NULL)
|
||||
var = HitScan(objActor, pPlayer->zWeapon, pPlayer->flt_aim(), arg1, range);
|
||||
else if (objActor->IsDudeActor())
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector(), (!objActor->hasX()) ? 0 : objActor->dudeSlope), arg1, range);
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.Angles.Yaw.ToVector(), (!objActor->hasX()) ? 0 : objActor->dudeSlope), arg1, range);
|
||||
else if ((objActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
{
|
||||
var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 8 : -8; // was 0x20000 - HitScan uses Q28.4 for dz!
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector(), var3), arg1, range);
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.Angles.Yaw.ToVector(), var3), arg1, range);
|
||||
}
|
||||
else
|
||||
{
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector(), 0), arg1, range);
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.Angles.Yaw.ToVector(), 0), arg1, range);
|
||||
}
|
||||
|
||||
if (var < 0)
|
||||
|
@ -6050,7 +6050,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
|
|||
if (actor->xspr.data4 != 0) break;
|
||||
else if (actor->spr.flags & kModernTypeFlag1)
|
||||
{
|
||||
pPlayer->angle.settarget(actor->spr.angle);
|
||||
pPlayer->angle.settarget(actor->spr.Angles.Yaw);
|
||||
pPlayer->angle.lockinput();
|
||||
}
|
||||
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))
|
||||
|
@ -6488,7 +6488,7 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
dv.XY() = actor->spr.angle.ToVector();
|
||||
dv.XY() = actor->spr.Angles.Yaw.ToVector();
|
||||
dv.Z = clamp(sourceactor->xspr.data3 / 256., -4., 4.); // add slope controlling
|
||||
}
|
||||
|
||||
|
@ -7688,31 +7688,31 @@ void nnExtAiSetDirection(DBloodActor* actor, DAngle direction)
|
|||
{
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
|
||||
DAngle vc = deltaangle(actor->spr.angle, direction);
|
||||
DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction);
|
||||
DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3;
|
||||
double range = actor->vel.XY().dot(actor->spr.angle.ToVector()) * 120;
|
||||
double range = actor->vel.XY().dot(actor->spr.Angles.Yaw.ToVector()) * 120;
|
||||
|
||||
if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + vc, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + vc;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + vc / 2;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle - vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.angle - vc / 2;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + v8, range))
|
||||
actor->xspr.goalAng = actor->spr.angle + v8;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle, range))
|
||||
actor->xspr.goalAng = actor->spr.angle;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle - v8, range))
|
||||
actor->xspr.goalAng = actor->spr.angle - v8;
|
||||
if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + vc;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + vc / 2;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - vc / 2, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw - vc / 2;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + v8, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + v8;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw;
|
||||
else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - v8, range))
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw - v8;
|
||||
else
|
||||
actor->xspr.goalAng = actor->spr.angle + DAngle180 / 3;
|
||||
actor->xspr.goalAng = actor->spr.Angles.Yaw + DAngle180 / 3;
|
||||
|
||||
if (actor->xspr.dodgeDir)
|
||||
{
|
||||
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
{
|
||||
actor->xspr.dodgeDir = -actor->xspr.dodgeDir;
|
||||
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512))
|
||||
actor->xspr.dodgeDir = 0;
|
||||
}
|
||||
}
|
||||
|
@ -8040,7 +8040,7 @@ void aiPatrolStop(DBloodActor* actor, DBloodActor* targetactor, bool alarm)
|
|||
|
||||
if (mytarget && mytarget->spr.type == kMarkerPath)
|
||||
{
|
||||
if (targetactor == nullptr) actor->spr.angle = mytarget->spr.angle;
|
||||
if (targetactor == nullptr) actor->spr.Angles.Yaw = mytarget->spr.Angles.Yaw;
|
||||
actor->SetTarget(nullptr);
|
||||
}
|
||||
|
||||
|
@ -8086,7 +8086,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
|
|||
if (Chance(0x8000))
|
||||
goal = -goal;
|
||||
|
||||
actor->xspr.goalAng = (actor->spr.angle + goal).Normalized360();
|
||||
actor->xspr.goalAng = (actor->spr.Angles.Yaw + goal).Normalized360();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -8098,8 +8098,8 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
|
|||
void aiPatrolTurn(DBloodActor* actor)
|
||||
{
|
||||
DAngle nTurnRange = mapangle((getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4);
|
||||
DAngle nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
DAngle nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
||||
}
|
||||
|
||||
|
@ -8148,8 +8148,8 @@ void aiPatrolMove(DBloodActor* actor)
|
|||
}
|
||||
|
||||
DAngle nTurnRange = pDudeInfo->TurnRange() / 64;
|
||||
DAngle nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
|
||||
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
DAngle nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
||||
|
||||
if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor)))
|
||||
|
@ -8185,7 +8185,7 @@ void aiPatrolMove(DBloodActor* actor)
|
|||
}
|
||||
|
||||
frontSpeed = aiPatrolGetVelocity(pDudeInfo->frontSpeed, targetactor->xspr.busyTime);
|
||||
actor->vel += actor->spr.angle.ToVector() * FixedToFloat(frontSpeed);
|
||||
actor->vel += actor->spr.Angles.Yaw.ToVector() * FixedToFloat(frontSpeed);
|
||||
}
|
||||
|
||||
double vel = (actor->xspr.unused1 & kDudeFlagCrouch) ? kMaxPatrolCrouchVelocity : kMaxPatrolVelocity;
|
||||
|
@ -8356,7 +8356,7 @@ bool readyForCrit(DBloodActor* hunter, DBloodActor* victim)
|
|||
if (dvect.Length() >= (437.5 / max(gGameOptions.nDifficulty >> 1, 1)))
|
||||
return false;
|
||||
|
||||
return absangle(victim->spr.angle, dvect.Angle()) <= DAngle45;
|
||||
return absangle(victim->spr.Angles.Yaw, dvect.Angle()) <= DAngle45;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -8552,7 +8552,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
if (seeDistf)
|
||||
{
|
||||
DAngle periphery = max(pDudeInfo->Periphery(), DAngle60);
|
||||
DAngle nDeltaAngle = absangle(actor->spr.angle, dv.Angle());
|
||||
DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dv.Angle());
|
||||
if ((itCanSee = (!blind && nDistf < seeDistf && nDeltaAngle < periphery)) == true)
|
||||
{
|
||||
int base = 100 + ((20 * gGameOptions.nDifficulty) - (nDeltaAngle.Buildang() / 5));
|
||||
|
@ -8834,7 +8834,7 @@ void aiPatrolThink(DBloodActor* actor)
|
|||
else if (aiPatrolTurning(actor->xspr.aiState))
|
||||
{
|
||||
//viewSetSystemMessage("TURN");
|
||||
if (absangle(actor->spr.angle, actor->xspr.goalAng) < minAngle)
|
||||
if (absangle(actor->spr.Angles.Yaw, actor->xspr.goalAng) < minAngle)
|
||||
{
|
||||
// save imer for waiting
|
||||
stateTimer = actor->xspr.stateTimer;
|
||||
|
@ -8865,8 +8865,8 @@ void aiPatrolThink(DBloodActor* actor)
|
|||
// take marker's angle
|
||||
if (!(markeractor->spr.flags & kModernTypeFlag4))
|
||||
{
|
||||
actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->spr.angle+ DAngle180 : markeractor->spr.angle).Normalized360();
|
||||
if (absangle(actor->spr.angle, actor->xspr.goalAng) > minAngle) // let the enemy play move animation while turning
|
||||
actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->spr.Angles.Yaw+ DAngle180 : markeractor->spr.Angles.Yaw).Normalized360();
|
||||
if (absangle(actor->spr.Angles.Yaw, actor->xspr.goalAng) > minAngle) // let the enemy play move animation while turning
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9184,7 +9184,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
|
|||
burstactor->spr.scale = actor->spr.scale;
|
||||
burstactor->spr.scale *= 0.5;
|
||||
|
||||
burstactor->spr.angle = actor->spr.angle + mapangle(missileInfo[actor->spr.type - kMissileBase].angleOfs);
|
||||
burstactor->spr.Angles.Yaw = actor->spr.Angles.Yaw + mapangle(missileInfo[actor->spr.type - kMissileBase].angleOfs);
|
||||
burstactor->SetOwner(actor);
|
||||
|
||||
actBuildMissile(burstactor, actor);
|
||||
|
@ -9273,7 +9273,7 @@ void triggerTouchWall(DBloodActor* actor, walltype* pHWall)
|
|||
void changeSpriteAngle(DBloodActor* pSpr, DAngle nAng)
|
||||
{
|
||||
if (!pSpr->IsDudeActor())
|
||||
pSpr->spr.angle = nAng;
|
||||
pSpr->spr.Angles.Yaw = nAng;
|
||||
else
|
||||
{
|
||||
PLAYER* pPlayer = getPlayerById(pSpr->spr.type);
|
||||
|
@ -9281,9 +9281,9 @@ void changeSpriteAngle(DBloodActor* pSpr, DAngle nAng)
|
|||
pPlayer->angle.ang = nAng;
|
||||
else
|
||||
{
|
||||
pSpr->spr.angle = nAng;
|
||||
pSpr->spr.Angles.Yaw = nAng;
|
||||
if (xsprIsFine(pSpr))
|
||||
pSpr->xspr.goalAng = pSpr->spr.angle;
|
||||
pSpr->xspr.goalAng = pSpr->spr.Angles.Yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -812,7 +812,7 @@ void playerStart(int nPlayer, int bNewLevel)
|
|||
GetActorExtents(actor, &top, &bottom);
|
||||
actor->spr.pos.Z -= bottom - actor->spr.pos.Z;
|
||||
actor->spr.pal = 11 + (pPlayer->teamId & 3);
|
||||
actor->spr.angle = pPlayer->angle.ang = pStartZone->angle;
|
||||
actor->spr.Angles.Yaw = pPlayer->angle.ang = pStartZone->angle;
|
||||
actor->spr.type = kDudePlayer1 + nPlayer;
|
||||
actor->clipdist = pDudeInfo->fClipdist();
|
||||
actor->spr.flags = 15;
|
||||
|
@ -1421,7 +1421,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
|
|||
{
|
||||
auto plActor = pPlayer->actor;
|
||||
*out = {};
|
||||
auto pos = DVector3(plActor->spr.angle.ToVector(), pPlayer->slope);
|
||||
auto pos = DVector3(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope);
|
||||
int hit = HitScan(pPlayer->actor, pPlayer->zView, pos, 0x10000040, 128);
|
||||
double hitDist = (plActor->spr.pos.XY() - gHitInfo.hitpos.XY()).Length();
|
||||
if (hitDist < 64)
|
||||
|
@ -1499,7 +1499,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
|
|||
|
||||
void UpdatePlayerSpriteAngle(PLAYER* pPlayer)
|
||||
{
|
||||
pPlayer->actor->spr.angle = pPlayer->angle.ang;
|
||||
pPlayer->actor->spr.Angles.Yaw = pPlayer->angle.ang;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -1513,7 +1513,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
|
|||
auto plActor = pPlayer->actor;
|
||||
int const florhit = pPlayer->actor->hit.florhit.type;
|
||||
bool const va = plActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0;
|
||||
pPlayer->horizon.calcviewpitch(plActor->spr.pos.XY(), plActor->spr.angle, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
|
||||
pPlayer->horizon.calcviewpitch(plActor->spr.pos.XY(), plActor->spr.Angles.Yaw, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -1592,7 +1592,7 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
const double speed = pPlayer->posture == 1? 1. : 1. - (actor->xspr.height < 256 ? actor->xspr.height * (1. / 256.) : 0);
|
||||
const double& fvAccel = pInput->fvel > 0 ? pPosture->frontAccel : pPosture->backAccel;
|
||||
const double& svAccel = pPosture->sideAccel;
|
||||
actor->vel.XY() += DVector2(pInput->fvel * fvAccel, pInput->svel * svAccel).Rotated(actor->spr.angle) * speed;
|
||||
actor->vel.XY() += DVector2(pInput->fvel * fvAccel, pInput->svel * svAccel).Rotated(actor->spr.Angles.Yaw) * speed;
|
||||
}
|
||||
|
||||
if (SyncInput())
|
||||
|
@ -1715,8 +1715,8 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
auto spawned = actSpawnDude(pactor, kDudeHand, pPlayer->actor->clipdist * 0.5);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spr.angle += DAngle180;
|
||||
spawned->vel.XY() = pPlayer->actor->vel.XY() + (64. / 3.) * pPlayer->actor->spr.angle.ToVector();
|
||||
spawned->spr.Angles.Yaw += DAngle180;
|
||||
spawned->vel.XY() = pPlayer->actor->vel.XY() + (64. / 3.) * pPlayer->actor->spr.Angles.Yaw.ToVector();
|
||||
spawned->vel.Z = pPlayer->actor->vel.Z;
|
||||
}
|
||||
pPlayer->hand = 0;
|
||||
|
|
|
@ -120,7 +120,7 @@ void GameInterface::UpdateSounds()
|
|||
|
||||
if (pPlayer->actor)
|
||||
{
|
||||
listener.angle = float(-pPlayer->actor->spr.angle.Radians());
|
||||
listener.angle = float(-pPlayer->actor->spr.Angles.Yaw.Radians());
|
||||
listener.velocity.Zero();
|
||||
listener.position = GetSoundPos(pPlayer->actor->spr.pos);
|
||||
listener.valid = true;
|
||||
|
|
|
@ -271,10 +271,10 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
|
|||
if (nDist != 0 && cansee(DVector3(actor->spr.pos.XY(), top), actor->sector(), pos, target->sector()))
|
||||
{
|
||||
pos.XY() += target->vel.XY() * nDist * (65536. / 0x1aaaaa);
|
||||
auto angBak = actor->spr.angle;
|
||||
actor->spr.angle = (pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
auto angBak = actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw = (pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
double tz = target->spr.pos.Z - (target->spr.scale.Y * pDudeInfo->aimHeight);
|
||||
auto dvec = DVector3(actor->spr.angle.ToVector(), ((tz - top - 1) / nDist) * (1. / 16.));
|
||||
auto dvec = DVector3(actor->spr.Angles.Yaw.ToVector(), ((tz - top - 1) / nDist) * (1. / 16.));
|
||||
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
|
||||
if (auto missile = actFireMissile(actor, 0, (top - actor->spr.pos.Z) - 1, dvec, nMissileType))
|
||||
{
|
||||
|
@ -285,7 +285,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
|
|||
if (!VanillaMode()) // disable collisions so lifeleech doesn't do that weird bobbing
|
||||
missile->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
}
|
||||
actor->spr.angle = angBak;
|
||||
actor->spr.Angles.Yaw = angBak;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -909,7 +909,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec
|
|||
auto spot = rotatepoint(pivot, actor->basePoint, ptang_w2);
|
||||
viewBackupSpriteLoc(actor);
|
||||
actor->spr.pos.XY() = spot + pt_w2 - pivot;
|
||||
actor->spr.angle += angleofs;
|
||||
actor->spr.Angles.Yaw += angleofs;
|
||||
if (!VanillaMode() && actor->IsPlayerActor()) gPlayer[actor->spr.type - kDudePlayer1].angle.addadjustment(angleofs);
|
||||
|
||||
}
|
||||
|
@ -921,7 +921,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec
|
|||
auto spot = rotatepoint(pivotDy, actor->basePoint, ptang_w2);
|
||||
viewBackupSpriteLoc(actor);
|
||||
actor->spr.pos.XY() = spot - pt_w2 + pivot;
|
||||
actor->spr.angle += angleofs;
|
||||
actor->spr.Angles.Yaw += angleofs;
|
||||
if (!VanillaMode() && actor->IsPlayerActor()) gPlayer[actor->spr.type - kDudePlayer1].angle.addadjustment(angleofs);
|
||||
}
|
||||
else if (pXSector->Drag)
|
||||
|
@ -936,7 +936,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec
|
|||
{
|
||||
actor->spr.pos.XY() = rotatepoint(pt_w1, actor->spr.pos.XY(), angleofs);
|
||||
}
|
||||
actor->spr.angle += angleofs;
|
||||
actor->spr.Angles.Yaw += angleofs;
|
||||
actor->spr.pos += position;
|
||||
if (!VanillaMode() && actor->IsPlayerActor()) gPlayer[actor->spr.type - kDudePlayer1].angle.addadjustment(angleofs);
|
||||
}
|
||||
|
@ -962,7 +962,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec
|
|||
auto spot = rotatepoint(pivot, ac->basePoint, ptang_w2);
|
||||
viewBackupSpriteLoc(ac);
|
||||
ac->spr.pos.XY() = spot + pt_w2 - pivot;
|
||||
ac->spr.angle += angleofs;
|
||||
ac->spr.Angles.Yaw += angleofs;
|
||||
if (!VanillaMode() && ac->IsPlayerActor()) gPlayer[ac->spr.type - kDudePlayer1].angle.addadjustment(angleofs);
|
||||
}
|
||||
else if (ac->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
|
||||
|
@ -970,7 +970,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec
|
|||
auto spot = rotatepoint(pivot, ac->basePoint, ptang_w2);
|
||||
viewBackupSpriteLoc(ac);
|
||||
ac->spr.pos.XY() = spot - pt_w2 + pivot;
|
||||
ac->spr.angle += angleofs;
|
||||
ac->spr.Angles.Yaw += angleofs;
|
||||
if (!VanillaMode() && ac->IsPlayerActor()) gPlayer[ac->spr.type - kDudePlayer1].angle.addadjustment(angleofs);
|
||||
}
|
||||
}
|
||||
|
@ -1367,7 +1367,7 @@ int HDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
|
|||
if (!pXSector->marker0 || !pXSector->marker1) return 0;
|
||||
auto marker0 = pXSector->marker0;
|
||||
auto marker1 = pXSector->marker1;
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, pSector->type == kSectorSlide);
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, pSector->type == kSectorSlide);
|
||||
ZTranslateSector(pSector, pXSector, a2, nWave);
|
||||
pXSector->busy = a2;
|
||||
if (pXSector->command == kCmdLink && pXSector->txID)
|
||||
|
@ -1398,7 +1398,7 @@ int RDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
|
|||
nWave = pXSector->busyWaveB;
|
||||
if (!pXSector->marker0) return 0;
|
||||
auto marker0 = pXSector->marker0;
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.angle, pSector->type == kSectorRotate);
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.Angles.Yaw, pSector->type == kSectorRotate);
|
||||
ZTranslateSector(pSector, pXSector, a2, nWave);
|
||||
pXSector->busy = a2;
|
||||
if (pXSector->command == kCmdLink && pXSector->txID)
|
||||
|
@ -1429,13 +1429,13 @@ int StepRotateBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
|
|||
DAngle ang2;
|
||||
if (pXSector->busy < a2)
|
||||
{
|
||||
ang2 = ang1 + marker0->spr.angle;
|
||||
ang2 = ang1 + marker0->spr.Angles.Yaw;
|
||||
int nWave = pXSector->busyWaveA;
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, ang1, marker0->spr.pos, ang2, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ang2 = ang1 - marker0->spr.angle;
|
||||
ang2 = ang1 - marker0->spr.Angles.Yaw;
|
||||
int nWave = pXSector->busyWaveB;
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, ang2, marker0->spr.pos, ang1, true);
|
||||
}
|
||||
|
@ -1491,7 +1491,7 @@ int PathBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
|
|||
if (!basepath || !marker0 || !marker1) return 0;
|
||||
|
||||
int nWave = marker0->xspr.wave;
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, true);
|
||||
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, true);
|
||||
ZTranslateSector(pSector, pXSector, a2, nWave);
|
||||
pXSector->busy = a2;
|
||||
if ((a2 & 0xffff) == 0)
|
||||
|
@ -1617,7 +1617,7 @@ void OperateTeleport(sectortype* pSector)
|
|||
}
|
||||
actor->spr.pos.XY() = destactor->spr.pos.XY();
|
||||
actor->spr.pos.Z += destactor->sector()->floorz - pSector->floorz;
|
||||
actor->spr.angle = destactor->spr.angle;
|
||||
actor->spr.Angles.Yaw = destactor->spr.Angles.Yaw;
|
||||
ChangeActorSect(actor, destactor->sector());
|
||||
sfxPlay3DSound(destactor, 201, -1, 0);
|
||||
actor->vel.Zero();
|
||||
|
@ -1627,7 +1627,7 @@ void OperateTeleport(sectortype* pSector)
|
|||
{
|
||||
playerResetInertia(pPlayer);
|
||||
pPlayer->zViewVel = pPlayer->zWeaponVel = 0;
|
||||
pPlayer->angle.settarget(actor->spr.angle, true);
|
||||
pPlayer->angle.settarget(actor->spr.Angles.Yaw, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2331,9 +2331,9 @@ void trInit(TArray<DBloodActor*>& actors)
|
|||
{
|
||||
auto marker0 = pXSector->marker0;
|
||||
auto marker1 = pXSector->marker1;
|
||||
TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, pSector->type == kSectorSlide);
|
||||
TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, pSector->type == kSectorSlide);
|
||||
UpdateBasePoints(pSector);
|
||||
TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, pSector->type == kSectorSlide);
|
||||
TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, pSector->type == kSectorSlide);
|
||||
ZTranslateSector(pSector, pXSector, pXSector->busy, 1);
|
||||
break;
|
||||
}
|
||||
|
@ -2341,9 +2341,9 @@ void trInit(TArray<DBloodActor*>& actors)
|
|||
case kSectorRotate:
|
||||
{
|
||||
auto marker0 = pXSector->marker0;
|
||||
TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.angle, pSector->type == kSectorRotate);
|
||||
TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.Angles.Yaw, pSector->type == kSectorRotate);
|
||||
UpdateBasePoints(pSector);
|
||||
TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.angle, pSector->type == kSectorRotate);
|
||||
TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.Angles.Yaw, pSector->type == kSectorRotate);
|
||||
ZTranslateSector(pSector, pXSector, pXSector->busy, 1);
|
||||
break;
|
||||
}
|
||||
|
@ -2522,7 +2522,7 @@ void FireballTrapSeqCallback(int, DBloodActor* actor)
|
|||
if (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
actFireMissile(actor, 0, 0, DVector3(0, 0, (actor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 1 : -1), kMissileFireball);
|
||||
else
|
||||
actFireMissile(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), 0), kMissileFireball);
|
||||
actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileFireball);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2543,7 +2543,7 @@ void MGunFireSeqCallback(int, DBloodActor* actor)
|
|||
evPostActor(actor, 1, kCmdOff, actor);
|
||||
}
|
||||
DVector3 dv;
|
||||
dv.XY() = actor->spr.angle.ToVector();
|
||||
dv.XY() = actor->spr.Angles.Yaw.ToVector();
|
||||
dv.X += Random2F(1000, 14);
|
||||
dv.Y += Random2F(1000, 14);
|
||||
dv.Z = Random2F(1000, 14);
|
||||
|
|
|
@ -817,7 +817,7 @@ std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
|||
{
|
||||
PLAYER* pPlayer = &gPlayer[myconnectindex];
|
||||
if (!pPlayer->actor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(pPlayer->actor->spr.pos, pPlayer->actor->spr.angle);
|
||||
return std::make_pair(pPlayer->actor->spr.pos, pPlayer->actor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ void warpInit(TArray<DBloodActor*>& actors)
|
|||
ZONE* pZone = &gStartZone[actor->xspr.data1];
|
||||
pZone->pos = actor->spr.pos;
|
||||
pZone->sector = actor->sector();
|
||||
pZone->angle = actor->spr.angle;
|
||||
pZone->angle = actor->spr.Angles.Yaw;
|
||||
}
|
||||
DeleteSprite(actor);
|
||||
break;
|
||||
|
@ -96,7 +96,7 @@ void warpInit(TArray<DBloodActor*>& actors)
|
|||
ZONE* pZone = &gStartZone[actor->xspr.data1];
|
||||
pZone->pos = actor->spr.pos;
|
||||
pZone->sector = actor->sector();
|
||||
pZone->angle = actor->spr.angle;
|
||||
pZone->angle = actor->spr.Angles.Yaw;
|
||||
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
// fill player spawn position according team of player in TEAMS mode.
|
||||
|
@ -105,7 +105,7 @@ void warpInit(TArray<DBloodActor*>& actors)
|
|||
pZone = &gStartZoneTeam1[team1];
|
||||
pZone->pos = actor->spr.pos;
|
||||
pZone->sector = actor->sector();
|
||||
pZone->angle = actor->spr.angle;
|
||||
pZone->angle = actor->spr.Angles.Yaw;
|
||||
team1++;
|
||||
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ void warpInit(TArray<DBloodActor*>& actors)
|
|||
pZone = &gStartZoneTeam2[team2];
|
||||
pZone->pos = actor->spr.pos;
|
||||
pZone->sector = actor->sector();
|
||||
pZone->angle = actor->spr.angle;
|
||||
pZone->angle = actor->spr.Angles.Yaw;
|
||||
team2++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -441,7 +441,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
assert(pPlayer != NULL);
|
||||
auto plActor = pPlayer->actor;
|
||||
DVector3 pos(plActor->spr.pos.XY(), pPlayer->zWeapon);
|
||||
DVector3 Aim(plActor->spr.angle.ToVector(), pPlayer->slope);
|
||||
DVector3 Aim(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope);
|
||||
|
||||
WEAPONTRACK* pWeaponTrack = &gWeaponTrack[pPlayer->curWeapon];
|
||||
DBloodActor* targetactor = nullptr;
|
||||
|
@ -472,7 +472,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
double t = nDist * 4096 / pWeaponTrack->seeker;
|
||||
pos2 += actor->vel * t;
|
||||
}
|
||||
DVector3 lpos = pos + DVector3(plActor->spr.angle.ToVector(), pPlayer->slope) * nDist;
|
||||
DVector3 lpos = pos + DVector3(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope) * nDist;
|
||||
|
||||
double zRange = nDist * (9460 / 16384.);
|
||||
double top, bottom;
|
||||
|
@ -481,7 +481,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
continue;
|
||||
|
||||
DAngle angle = (pos2 - pos).Angle();
|
||||
DAngle deltaangle = absangle(angle, plActor->spr.angle);
|
||||
DAngle deltaangle = absangle(angle, plActor->spr.Angles.Yaw);
|
||||
if (deltaangle > DAngle::fromBuild(pWeaponTrack->angleRange))
|
||||
continue;
|
||||
if (pPlayer->aimTargetsCount < 16 && cansee(pos, plActor->sector(), pos2, actor->sector()))
|
||||
|
@ -519,7 +519,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
if (nDist == 0 || nDist > 3200)
|
||||
continue;
|
||||
|
||||
DVector3 lpos = pos + DVector3(plActor->spr.angle.ToVector(), pPlayer->slope) * nDist;
|
||||
DVector3 lpos = pos + DVector3(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope) * nDist;
|
||||
double zRange = nDist * (9460 / 16384.);
|
||||
|
||||
double top, bottom;
|
||||
|
@ -528,7 +528,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
continue;
|
||||
|
||||
DAngle angle = dv.Angle();
|
||||
DAngle deltaangle = absangle(angle, plActor->spr.angle);
|
||||
DAngle deltaangle = absangle(angle, plActor->spr.Angles.Yaw);
|
||||
if (deltaangle > DAngle::fromBuild(pWeaponTrack->thingAngle))
|
||||
continue;
|
||||
|
||||
|
@ -549,14 +549,14 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
}
|
||||
}
|
||||
DVector3 Aim2(Aim);
|
||||
Aim2.XY() = Aim2.XY().Rotated(-plActor->spr.angle);
|
||||
Aim2.XY() = Aim2.XY().Rotated(-plActor->spr.Angles.Yaw);
|
||||
Aim2.Z -= pPlayer->slope;
|
||||
|
||||
pPlayer->relAim.X = interpolatedvalue(pPlayer->relAim.X, Aim2.X, FixedToFloat(pWeaponTrack->aimSpeedHorz));
|
||||
pPlayer->relAim.Y = interpolatedvalue(pPlayer->relAim.Y, Aim2.Y, FixedToFloat(pWeaponTrack->aimSpeedHorz));
|
||||
pPlayer->relAim.Z = interpolatedvalue(pPlayer->relAim.Z, Aim2.Z, FixedToFloat(pWeaponTrack->aimSpeedVert));
|
||||
pPlayer->aim = pPlayer->relAim;
|
||||
pPlayer->aim.XY() = pPlayer->aim.XY().Rotated(plActor->spr.angle);
|
||||
pPlayer->aim.XY() = pPlayer->aim.XY().Rotated(plActor->spr.Angles.Yaw);
|
||||
pPlayer->aim.Z += pPlayer->slope;
|
||||
pPlayer->aimTarget = targetactor;
|
||||
}
|
||||
|
@ -1975,7 +1975,7 @@ void FireLifeLeech(int nTrigger, PLAYER* pPlayer)
|
|||
if (missileActor)
|
||||
{
|
||||
missileActor->SetTarget(pPlayer->aimTarget);
|
||||
missileActor->spr.angle = ((nTrigger == 2) ? DAngle180 : nullAngle);
|
||||
missileActor->spr.Angles.Yaw = ((nTrigger == 2) ? DAngle180 : nullAngle);
|
||||
}
|
||||
if (checkAmmo2(pPlayer, 8, 1))
|
||||
UseAmmo(pPlayer, 8, 1);
|
||||
|
|
|
@ -225,7 +225,7 @@ int ssp(DDukeActor* const actor, unsigned int cliptype) //The set sprite functio
|
|||
{
|
||||
Collision c;
|
||||
|
||||
return movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), cliptype, c) == kHitNone;
|
||||
return movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), cliptype, c) == kHitNone;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -275,7 +275,7 @@ void lotsofstuff(DDukeActor* actor, int n, int spawntype)
|
|||
void movesector(DDukeActor* const actor, int msindex, DAngle rotation)
|
||||
{
|
||||
//T1,T2 and T3 are used for all the sector moving stuff!!!
|
||||
actor->spr.pos.XY() += actor->spr.angle.ToVector() * actor->vel.X;
|
||||
actor->spr.pos.XY() += actor->spr.Angles.Yaw.ToVector() * actor->vel.X;
|
||||
|
||||
for(auto& wal : actor->sector()->walls)
|
||||
{
|
||||
|
@ -362,7 +362,7 @@ void movedummyplayers(void)
|
|||
{
|
||||
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
act->spr.pos.Z = act->sector()->ceilingz + 27;
|
||||
act->spr.angle = ps[p].angle.ang;
|
||||
act->spr.Angles.Yaw = ps[p].angle.ang;
|
||||
if (act->temp_data[0] == 8)
|
||||
act->temp_data[0] = 0;
|
||||
else act->temp_data[0]++;
|
||||
|
@ -401,7 +401,7 @@ void moveplayers(void)
|
|||
{
|
||||
act->restorepos();
|
||||
act->backupz();
|
||||
act->spr.angle = p->angle.oang;
|
||||
act->spr.Angles.Yaw = p->angle.oang;
|
||||
SetActor(act, act->spr.pos);
|
||||
}
|
||||
else
|
||||
|
@ -465,7 +465,7 @@ void moveplayers(void)
|
|||
p->angle.addadjustment(deltaangle(p->angle.ang, (p->wackedbyactor->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle()) * 0.5);
|
||||
}
|
||||
}
|
||||
act->spr.angle = p->angle.ang;
|
||||
act->spr.Angles.Yaw = p->angle.ang;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -499,13 +499,13 @@ void moveplayers(void)
|
|||
if (act->spr.extra < 8)
|
||||
{
|
||||
act->vel.X = 8;
|
||||
act->spr.angle = p->angle.ang;
|
||||
act->spr.Angles.Yaw = p->angle.ang;
|
||||
act->spr.extra++;
|
||||
ssp(act, CLIPMASK0);
|
||||
}
|
||||
else
|
||||
{
|
||||
act->spr.angle = DAngle360 - minAngle - p->angle.ang;
|
||||
act->spr.Angles.Yaw = DAngle360 - minAngle - p->angle.ang;
|
||||
SetActor(act, act->spr.pos);
|
||||
}
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ void detonate(DDukeActor *actor, int explosion)
|
|||
|
||||
void bounce(DDukeActor* actor)
|
||||
{
|
||||
DVector3 vect(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z);
|
||||
DVector3 vect(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z);
|
||||
|
||||
auto sectp = actor->sector();
|
||||
|
||||
|
@ -635,7 +635,7 @@ void bounce(DDukeActor* actor)
|
|||
|
||||
actor->vel.Z = vect.Z;
|
||||
actor->vel.X = vect.XY().Length();
|
||||
actor->spr.angle = vect.Angle();
|
||||
actor->spr.Angles.Yaw = vect.Angle();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -713,7 +713,7 @@ bool rat(DDukeActor* actor, bool makesound)
|
|||
if (ssp(actor, CLIPMASK0))
|
||||
{
|
||||
if (makesound && (krand() & 255) == 0) S_PlayActorSound(RATTY, actor);
|
||||
actor->spr.angle += mapangle((krand() & 31) - 15 + int(BobVal(actor->temp_data[0] << 8) * 8));
|
||||
actor->spr.Angles.Yaw += mapangle((krand() & 31) - 15 + int(BobVal(actor->temp_data[0] << 8) * 8));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -723,11 +723,11 @@ bool rat(DDukeActor* actor, bool makesound)
|
|||
actor->Destroy();
|
||||
return false;
|
||||
}
|
||||
else actor->spr.angle = randomAngle();
|
||||
else actor->spr.Angles.Yaw = randomAngle();
|
||||
}
|
||||
if (actor->vel.X < 8)
|
||||
actor->vel.X += 1/8.;
|
||||
actor->spr.angle += mapangle((krand() & 3) - 6);
|
||||
actor->spr.Angles.Yaw += mapangle((krand() & 3) - 6);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -755,7 +755,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
|
|||
Collision coll;
|
||||
auto sect = actor->sector();
|
||||
auto pos = actor->spr.pos;
|
||||
auto move = actor->spr.angle.ToVector() * actor->vel.X * 0.5;
|
||||
auto move = actor->spr.Angles.Yaw.ToVector() * actor->vel.X * 0.5;
|
||||
int j = clipmove(pos, §, move, 1.5, 4., 4., CLIPMASK1, coll);
|
||||
actor->spr.pos = pos;;
|
||||
actor->setsector(sect);
|
||||
|
@ -763,7 +763,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
|
|||
if (j == kHitWall)
|
||||
{
|
||||
auto ang = coll.hitWall->delta().Angle();
|
||||
actor->spr.angle = ang * 2 - actor->spr.angle;
|
||||
actor->spr.Angles.Yaw = ang * 2 - actor->spr.Angles.Yaw;
|
||||
}
|
||||
else if (j == kHitSprite)
|
||||
{
|
||||
|
@ -811,7 +811,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
|
|||
if (actor->spr.pal == 12)
|
||||
actor->vel.X = 10.25;
|
||||
else actor->vel.X = 8.75;
|
||||
actor->spr.angle = ps[p].angle.ang;
|
||||
actor->spr.Angles.Yaw = ps[p].angle.ang;
|
||||
ps[p].toggle_key_flag = 2;
|
||||
}
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
|
|||
}
|
||||
if (x < 32 && actor->sector() == ps[p].cursector)
|
||||
{
|
||||
actor->spr.angle = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
actor->vel.X = 3;
|
||||
}
|
||||
}
|
||||
|
@ -847,7 +847,7 @@ void forcesphere(DDukeActor* actor, int forcesphere)
|
|||
{
|
||||
k->spr.cstat = CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_YCENTER;
|
||||
k->clipdist = 16;
|
||||
k->spr.angle = j;
|
||||
k->spr.Angles.Yaw = j;
|
||||
k->vel.Z = l.Sin() * 2;
|
||||
k->vel.X = l.Cos() * 2;
|
||||
k->SetOwner(actor);
|
||||
|
@ -927,7 +927,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
actor->temp_data[2]++;
|
||||
if ((actor->temp_data[2] & 3) == 0) spawn(actor, explosion);
|
||||
getglobalz(actor);
|
||||
actor->spr.angle += DAngle22_5 * 0.75;
|
||||
actor->spr.Angles.Yaw += DAngle22_5 * 0.75;
|
||||
actor->vel.X = 8;
|
||||
int j = ssp(actor, CLIPMASK0);
|
||||
if (j != 1 || actor->spr.pos.Z > actor->floorz)
|
||||
|
@ -959,11 +959,11 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
actor->temp_data[2]++;
|
||||
if ((actor->temp_data[2] & 15) == 0)
|
||||
{
|
||||
a = actor->spr.angle;
|
||||
actor->spr.angle = actor->temp_angle;
|
||||
a = actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw = actor->temp_angle;
|
||||
if (attacksnd >= 0) S_PlayActorSound(attacksnd, actor);
|
||||
fi.shoot(actor, firelaser);
|
||||
actor->spr.angle = a;
|
||||
actor->spr.Angles.Yaw = a;
|
||||
}
|
||||
if (actor->temp_data[2] > (26 * 3) || !cansee(actor->spr.pos.plusZ(-16), actor->sector(), ps[p].GetActor()->getPosWithOffsetZ(), ps[p].cursector))
|
||||
{
|
||||
|
@ -998,7 +998,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
fi.shoot(actor, firelaser);
|
||||
}
|
||||
}
|
||||
actor->spr.angle += deltaangle(actor->spr.angle, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.25;
|
||||
actor->spr.Angles.Yaw += deltaangle(actor->spr.Angles.Yaw, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.25;
|
||||
}
|
||||
|
||||
if (actor->temp_data[0] != 2 && actor->temp_data[0] != 3 && Owner)
|
||||
|
@ -1006,7 +1006,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
double dist = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Length();
|
||||
if (dist <= 96)
|
||||
{
|
||||
a = actor->spr.angle;
|
||||
a = actor->spr.Angles.Yaw;
|
||||
actor->vel.X *= 0.5;
|
||||
}
|
||||
else a = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
|
@ -1033,7 +1033,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
{
|
||||
actor->temp_data[0] = 2 + (krand() & 2);
|
||||
actor->temp_data[2] = 0;
|
||||
actor->temp_angle = actor->spr.angle;
|
||||
actor->temp_angle = actor->spr.Angles.Yaw;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1057,8 +1057,8 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
actor->SetOwner(NewOwner);
|
||||
}
|
||||
|
||||
auto ang = deltaangle(actor->spr.angle, a);
|
||||
actor->spr.angle += ang * 0.125;
|
||||
auto ang = deltaangle(actor->spr.Angles.Yaw, a);
|
||||
actor->spr.Angles.Yaw += ang * 0.125;
|
||||
|
||||
if (actor->spr.pos.Z < Owner->spr.pos.Z - 2)
|
||||
actor->spr.pos.Z += 2;
|
||||
|
@ -1279,7 +1279,7 @@ void forcesphereexplode(DDukeActor *actor)
|
|||
}
|
||||
|
||||
actor->spr.pos = Owner->spr.pos;;
|
||||
actor->spr.angle += mapangle(Owner->temp_data[0]);
|
||||
actor->spr.Angles.Yaw += mapangle(Owner->temp_data[0]);
|
||||
|
||||
size = clamp(size, REPEAT_SCALE, 1.);
|
||||
|
||||
|
@ -1481,7 +1481,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
|
|||
else actor->vel.Z += ( gs.gravity - 50/256.);
|
||||
}
|
||||
|
||||
actor->spr.pos += actor->spr.angle.ToVector() * actor->vel.X;
|
||||
actor->spr.pos += actor->spr.Angles.Yaw.ToVector() * actor->vel.X;
|
||||
actor->spr.pos.Z += actor->vel.Z;
|
||||
|
||||
if (floorcheck && actor->spr.pos.Z >= actor->sector()->floorz)
|
||||
|
@ -1837,7 +1837,7 @@ void handle_se00(DDukeActor* actor)
|
|||
}
|
||||
}
|
||||
|
||||
actor->spr.angle += ang_amount * direction;
|
||||
actor->spr.Angles.Yaw += ang_amount * direction;
|
||||
actor->temp_angle += ang_amount * direction;
|
||||
}
|
||||
else
|
||||
|
@ -1849,14 +1849,14 @@ void handle_se00(DDukeActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Owner->spr.angle.Normalized360() > DAngle180)
|
||||
if (Owner->spr.Angles.Yaw.Normalized360() > DAngle180)
|
||||
direction = -1;
|
||||
else direction = 1;
|
||||
if (actor->temp_pos.Y == 0)
|
||||
actor->temp_pos.Y = (actor->spr.pos.XY() - Owner->spr.pos.XY()).Length();
|
||||
actor->vel.X = actor->temp_pos.Y;
|
||||
actor->spr.pos.XY() = Owner->spr.pos.XY();
|
||||
actor->spr.angle += ang_amount * direction;
|
||||
actor->spr.Angles.Yaw += ang_amount * direction;
|
||||
actor->temp_angle += ang_amount * direction;
|
||||
}
|
||||
|
||||
|
@ -1888,7 +1888,7 @@ void handle_se00(DDukeActor* actor)
|
|||
continue;
|
||||
}
|
||||
|
||||
act2->spr.angle += ang_amount * direction;
|
||||
act2->spr.Angles.Yaw += ang_amount * direction;
|
||||
act2->norm_ang();
|
||||
|
||||
act2->spr.pos.Z += zchange;
|
||||
|
@ -1975,10 +1975,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
|||
if(actor->vel.X != 0)
|
||||
{
|
||||
auto curangle = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
auto diffangle = deltaangle(actor->spr.angle, curangle) * 0.125;
|
||||
auto diffangle = deltaangle(actor->spr.Angles.Yaw, curangle) * 0.125;
|
||||
|
||||
actor->temp_angle += diffangle;
|
||||
actor->spr.angle += diffangle;
|
||||
actor->spr.Angles.Yaw += diffangle;
|
||||
|
||||
bool statstate = (!checkstat || ((sc->floorstat & CSTAT_SECTOR_SKY) == 0 && (sc->ceilingstat & CSTAT_SECTOR_SKY) == 0));
|
||||
if (actor->vel.X == sc->extra * maptoworld)
|
||||
|
@ -1994,10 +1994,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
|||
int p = findplayer(actor, &dist2);
|
||||
if (dist2 < 1280)//20480)
|
||||
{
|
||||
auto saved_angle = actor->spr.angle;
|
||||
actor->spr.angle = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
auto saved_angle = actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
fi.shoot(actor, RPG);
|
||||
actor->spr.angle = saved_angle;
|
||||
actor->spr.Angles.Yaw = saved_angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2027,7 +2027,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
|||
}
|
||||
}
|
||||
|
||||
auto vec = actor->spr.angle.ToVector() * actor->vel.X;
|
||||
auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X;
|
||||
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
{
|
||||
|
@ -2068,7 +2068,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
|||
!islocator(a2))
|
||||
{
|
||||
a2->spr.pos.XY() = rotatepoint(actor->spr.pos.XY(), a2->spr.pos.XY(), diffangle) + vec;
|
||||
a2->spr.angle += diffangle;
|
||||
a2->spr.Angles.Yaw += diffangle;
|
||||
|
||||
if (numplayers > 1)
|
||||
{
|
||||
|
@ -2173,7 +2173,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
|
|||
actor->vel.X = 0;
|
||||
operateactivators(actor->spr.hitag + (short)actor->temp_data[3], nullptr);
|
||||
actor->SetOwner(nullptr);
|
||||
actor->spr.angle += DAngle180;
|
||||
actor->spr.Angles.Yaw += DAngle180;
|
||||
actor->temp_data[4] = 0;
|
||||
fi.operateforcefields(actor, actor->spr.hitag);
|
||||
}
|
||||
|
@ -2182,7 +2182,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
|
|||
|
||||
if(actor->vel.X != 0)
|
||||
{
|
||||
auto vect = actor->spr.angle.ToVector() * actor->vel.X;
|
||||
auto vect = actor->spr.Angles.Yaw.ToVector() * actor->vel.X;
|
||||
|
||||
if ((sc->floorz - sc->ceilingz) < 108)
|
||||
if (ud.clipping == 0)
|
||||
|
@ -2330,7 +2330,7 @@ void handle_se02(DDukeActor* actor)
|
|||
else sc->setfloorslope(sc->getfloorslope() + (Sgn(actor->temp_data[5] - sc->getfloorslope()) << 4));
|
||||
}
|
||||
|
||||
auto vect = actor->spr.angle.ToVector() * actor->vel.X;
|
||||
auto vect = actor->spr.Angles.Yaw.ToVector() * actor->vel.X;
|
||||
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
if (ps[p].cursector == actor->sector() && ps[p].on_ground)
|
||||
|
@ -2480,10 +2480,10 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
|
|||
int p = findplayer(actor, &x);
|
||||
if (x < 512)
|
||||
{
|
||||
auto ang = actor->spr.angle;
|
||||
actor->spr.angle = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
auto ang = actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
fi.shoot(actor, FIRELASER);
|
||||
actor->spr.angle = ang;
|
||||
actor->spr.Angles.Yaw = ang;
|
||||
}
|
||||
|
||||
auto Owner = actor->GetOwner();
|
||||
|
@ -2525,8 +2525,8 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
|
|||
else actor->vel.X = 16;
|
||||
|
||||
auto ang = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
auto angdiff = deltaangle(actor->spr.angle, ang) / 8;
|
||||
actor->spr.angle += angdiff;
|
||||
auto angdiff = deltaangle(actor->spr.Angles.Yaw, ang) / 8;
|
||||
actor->spr.Angles.Yaw += angdiff;
|
||||
|
||||
if (rnd(32))
|
||||
{
|
||||
|
@ -2888,7 +2888,7 @@ void handle_se13(DDukeActor* actor)
|
|||
}
|
||||
|
||||
|
||||
if (actor->temp_data[2] == 4 && actor->spr.angle != DAngle90)
|
||||
if (actor->temp_data[2] == 4 && actor->spr.Angles.Yaw != DAngle90)
|
||||
for (int x = 0; x < 7; x++) RANDOMSCRAP(actor);
|
||||
}
|
||||
|
||||
|
@ -3312,7 +3312,7 @@ void handle_se20(DDukeActor* actor)
|
|||
|
||||
//if(actor->vel.X != 0) //Moving
|
||||
{
|
||||
auto vec = actor->spr.angle.ToVector() * (actor->temp_data[0] == 1 ? 0.5 : -0.5);
|
||||
auto vec = actor->spr.Angles.Yaw.ToVector() * (actor->temp_data[0] == 1 ? 0.5 : -0.5);
|
||||
|
||||
actor->temp_data[3] += actor->temp_data[0] == 1? 8 :- 8;
|
||||
|
||||
|
@ -3431,7 +3431,7 @@ void handle_se26(DDukeActor* actor)
|
|||
double zvel = actor->vel.Z;
|
||||
|
||||
actor->vel.X = 2;
|
||||
DVector2 vect = 2 * actor->spr.angle.ToVector(); // was: (32 * b sin) >> 14
|
||||
DVector2 vect = 2 * actor->spr.Angles.Yaw.ToVector(); // was: (32 * b sin) >> 14
|
||||
|
||||
actor->spr.shade++;
|
||||
if (actor->spr.shade > 7)
|
||||
|
@ -3479,7 +3479,7 @@ void handle_se27(DDukeActor* actor)
|
|||
|
||||
if (ud.recstat == 0) return;
|
||||
|
||||
actor->temp_angle = actor->spr.angle;
|
||||
actor->temp_angle = actor->spr.Angles.Yaw;
|
||||
|
||||
p = findplayer(actor, &xx);
|
||||
if (ps[p].GetActor()->spr.extra > 0 && myconnectindex == screenpeek)
|
||||
|
@ -3497,7 +3497,7 @@ void handle_se27(DDukeActor* actor)
|
|||
{
|
||||
ud.cameraactor = actor;
|
||||
actor->temp_data[0] = 999;
|
||||
actor->spr.angle += deltaangle(actor->spr.angle, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125;
|
||||
actor->spr.Angles.Yaw += deltaangle(actor->spr.Angles.Yaw, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125;
|
||||
actor->spr.yint = 100 + int((actor->spr.pos.Z - ps[p].GetActor()->getOffsetZ()) * (256. / 257.));
|
||||
|
||||
}
|
||||
|
@ -3512,7 +3512,7 @@ void handle_se27(DDukeActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
actor->spr.angle = (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
actor->spr.Angles.Yaw = (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
|
||||
if (actor->temp_data[0] == 999)
|
||||
{
|
||||
|
@ -3536,7 +3536,7 @@ void handle_se24(DDukeActor *actor, bool scroll, double mult)
|
|||
{
|
||||
if (actor->temp_data[4]) return;
|
||||
|
||||
auto vec = actor->spr.angle.ToVector() * actor->spr.yint / 256.;
|
||||
auto vec = actor->spr.Angles.Yaw.ToVector() * actor->spr.yint / 256.;
|
||||
|
||||
DukeSectIterator it(actor->sector());
|
||||
while (auto a2 = it.Next())
|
||||
|
@ -3706,7 +3706,7 @@ void handle_se35(DDukeActor *actor, int SMALLSMOKE, int EXPLOSION2)
|
|||
if (sc->ceilingz > actor->spr.pos.Z)
|
||||
for (int j = 0; j < 8; j++)
|
||||
{
|
||||
actor->spr.angle = randomAngle(90);
|
||||
actor->spr.Angles.Yaw = randomAngle(90);
|
||||
auto spawned = spawn(actor, SMALLSMOKE);
|
||||
if (spawned)
|
||||
{
|
||||
|
@ -3805,7 +3805,7 @@ void handle_se130(DDukeActor *actor, int countmax, int EXPLOSION2)
|
|||
double s = 0.03125 + (krand() & 7) * REPEAT_SCALE;
|
||||
k->spr.scale = DVector2(s, s);
|
||||
k->spr.pos.Z = sc->floorz + krandf(x);
|
||||
k->spr.angle += DAngle45 - randomAngle(90);
|
||||
k->spr.Angles.Yaw += DAngle45 - randomAngle(90);
|
||||
k->vel.X = krandf(8);
|
||||
ssp(k, CLIPMASK0);
|
||||
}
|
||||
|
@ -4090,16 +4090,16 @@ int dodge(DDukeActor* actor)
|
|||
continue;
|
||||
|
||||
auto delta = ac->spr.pos.XY() - oldpos;
|
||||
auto bvect = ac->spr.angle.ToVector() * 1024;
|
||||
auto bvect = ac->spr.Angles.Yaw.ToVector() * 1024;
|
||||
|
||||
if (actor->spr.angle.ToVector().dot(delta) >= 0)
|
||||
if (actor->spr.Angles.Yaw.ToVector().dot(delta) >= 0)
|
||||
{
|
||||
if (bvect.dot(delta) < 0)
|
||||
{
|
||||
double d = bvect.X * delta.Y - bvect.Y * delta.X;
|
||||
if (abs(d) < 256 * 64)
|
||||
{
|
||||
actor->spr.angle -= DAngle90 + randomAngle(180);
|
||||
actor->spr.Angles.Yaw -= DAngle90 + randomAngle(180);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -4124,9 +4124,9 @@ DAngle furthestangle(DDukeActor *actor, int angs)
|
|||
DAngle angincs = DAngle360 / angs;
|
||||
|
||||
if (!actor->isPlayer())
|
||||
if ((actor->temp_data[0] & 63) > 2) return(actor->spr.angle + DAngle180);
|
||||
if ((actor->temp_data[0] & 63) > 2) return(actor->spr.Angles.Yaw + DAngle180);
|
||||
|
||||
for (DAngle j = actor->spr.angle; j < DAngle360 + actor->spr.angle; j += angincs)
|
||||
for (DAngle j = actor->spr.Angles.Yaw; j < DAngle360 + actor->spr.Angles.Yaw; j += angincs)
|
||||
{
|
||||
hitscan(actor->spr.pos.plusZ(-8), actor->sector(), DVector3(j.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
|
||||
|
@ -4158,7 +4158,7 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, DVector2& pos)
|
|||
angincs = DAngle180;
|
||||
else angincs = DAngle360 / (1 + (krand() & 1));
|
||||
|
||||
for (auto j = tosee->spr.angle; j < tosee->spr.angle + DAngle360; j += (angincs - randomAngle(90)))
|
||||
for (auto j = tosee->spr.Angles.Yaw; j < tosee->spr.Angles.Yaw + DAngle360; j += (angincs - randomAngle(90)))
|
||||
{
|
||||
hitscan(tosee->spr.pos.plusZ(-16), tosee->sector(), DVector3(j.ToVector() * 1024, 64 - krandf(128)), hit, CLIPMASK1);
|
||||
|
||||
|
@ -4191,7 +4191,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
|
||||
ticselapsed = (actor->temp_data[0]) & 31;
|
||||
|
||||
aang = actor->spr.angle;
|
||||
aang = actor->spr.Angles.Yaw;
|
||||
|
||||
actor->vel.X += (moveptr[0] / 16 - actor->vel.X) / 5;
|
||||
if (actor->vel.Z < (648 / 256.))
|
||||
|
@ -4200,7 +4200,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
}
|
||||
|
||||
if (isRRRA() && (ang & windang))
|
||||
actor->spr.angle = WindDir;
|
||||
actor->spr.Angles.Yaw = WindDir;
|
||||
else if (ang & seekplayer)
|
||||
{
|
||||
DDukeActor* holoduke = !isRR()? ps[playernum].holoduke_on.Get() : nullptr;
|
||||
|
@ -4226,18 +4226,18 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
if (angdif < DAngle45)
|
||||
{
|
||||
DAngle add = DAngle22_5 * ((krand() & 256)? 1 : -1);
|
||||
actor->spr.angle += add;
|
||||
actor->spr.Angles.Yaw += add;
|
||||
if (hits(actor) < 51.25)
|
||||
actor->spr.angle -= add;
|
||||
actor->spr.Angles.Yaw -= add;
|
||||
}
|
||||
}
|
||||
else if (ticselapsed > 18 && ticselapsed < 26) // choose
|
||||
{
|
||||
if (angdif < DAngle90) actor->spr.angle = goalang;
|
||||
else actor->spr.angle += angdif * 0.25;
|
||||
if (angdif < DAngle90) actor->spr.Angles.Yaw = goalang;
|
||||
else actor->spr.Angles.Yaw += angdif * 0.25;
|
||||
}
|
||||
}
|
||||
else actor->spr.angle = goalang;
|
||||
else actor->spr.Angles.Yaw = goalang;
|
||||
}
|
||||
|
||||
if (ticselapsed < 1)
|
||||
|
@ -4246,14 +4246,14 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
if (ang & furthestdir)
|
||||
{
|
||||
goalang = furthestangle(actor, j);
|
||||
actor->spr.angle = goalang;
|
||||
actor->spr.Angles.Yaw = goalang;
|
||||
actor->SetOwner(ps[playernum].GetActor());
|
||||
}
|
||||
|
||||
if (ang & fleeenemy)
|
||||
{
|
||||
goalang = furthestangle(actor, j);
|
||||
actor->spr.angle = goalang;
|
||||
actor->spr.Angles.Yaw = goalang;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4414,7 +4414,7 @@ void movefta(void)
|
|||
// SFLAG_MOVEFTA_CHECKSEE is set for all actors in Duke.
|
||||
if (act->spr.pal == 33 || actorflag(act, SFLAG_MOVEFTA_CHECKSEE) ||
|
||||
(actorflag(act, SFLAG_MOVEFTA_CHECKSEEWITHPAL8) && act->spr.pal == 8) ||
|
||||
(act->spr.angle.Cos() * (px - sx) + act->spr.angle.Sin() * (py - sy) >= 0))
|
||||
(act->spr.Angles.Yaw.Cos() * (px - sx) + act->spr.Angles.Yaw.Sin() * (py - sy) >= 0))
|
||||
{
|
||||
double r1 = zrand(32);
|
||||
double r2 = zrand(52);
|
||||
|
|
|
@ -478,14 +478,14 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
)
|
||||
{
|
||||
if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER && actor->spr.picnum == LIZMAN)
|
||||
actor->spr.angle = randomAngle();
|
||||
actor->spr.Angles.Yaw = randomAngle();
|
||||
else if ((actor->temp_data[0]&3) == 1 && actor->spr.picnum != COMMANDER)
|
||||
actor->spr.angle = randomAngle();
|
||||
actor->spr.Angles.Yaw = randomAngle();
|
||||
SetActor(actor,actor->spr.pos);
|
||||
if (dasectp == nullptr) dasectp = §or[0];
|
||||
return result.setSector(dasectp);
|
||||
}
|
||||
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.angle += DAngle90 + DAngle45;
|
||||
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.Angles.Yaw += DAngle90 + DAngle45;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -706,7 +706,7 @@ void movefallers_d(void)
|
|||
if (act->temp_data[0] == 0)
|
||||
{
|
||||
act->spr.pos.Z -= 16;
|
||||
DAngle saved_angle = act->spr.angle;
|
||||
DAngle saved_angle = act->spr.Angles.Yaw;
|
||||
int x = act->spr.extra;
|
||||
j = fi.ifhitbyweapon(act);
|
||||
if (j >= 0)
|
||||
|
@ -735,7 +735,7 @@ void movefallers_d(void)
|
|||
act->spr.extra = x;
|
||||
}
|
||||
}
|
||||
act->spr.angle = saved_angle;
|
||||
act->spr.Angles.Yaw = saved_angle;
|
||||
act->spr.pos.Z += 16;
|
||||
}
|
||||
else if (act->temp_data[0] == 1)
|
||||
|
@ -963,7 +963,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo
|
|||
(wal->overpicnum == MIRROR || wal->picnum == MIRROR))
|
||||
{
|
||||
DAngle k = wal->delta().Angle();
|
||||
proj->spr.angle = k * 2 - proj->spr.angle;
|
||||
proj->spr.Angles.Yaw = k * 2 - proj->spr.Angles.Yaw;
|
||||
proj->SetOwner(proj);
|
||||
spawn(proj, TRANSPORTERSTAR);
|
||||
return true;
|
||||
|
@ -982,7 +982,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo
|
|||
}
|
||||
|
||||
DAngle k = wal->delta().Angle();
|
||||
proj->spr.angle = k * 2 - proj->spr.angle;
|
||||
proj->spr.Angles.Yaw = k * 2 - proj->spr.Angles.Yaw;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1080,7 +1080,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
movesprite_ex(proj, DVector3(proj->spr.angle.ToVector() * vel, velz), CLIPMASK1, coll);
|
||||
movesprite_ex(proj, DVector3(proj->spr.Angles.Yaw.ToVector() * vel, velz), CLIPMASK1, coll);
|
||||
|
||||
|
||||
if (proj->spr.picnum == RPG && proj->temp_actor != nullptr)
|
||||
|
@ -1115,7 +1115,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
for (int k = -3; k < 2; k++)
|
||||
{
|
||||
double zAdd = k * proj->vel.Z / 24;
|
||||
auto spawned = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2.,
|
||||
auto spawned = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.Angles.Yaw.ToVector() * k * 2.,
|
||||
FIRELASER, -40 + (k << 2),
|
||||
proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5);
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ void movetransports_d(void)
|
|||
ps[k].GetActor()->spr.extra = 0;
|
||||
}
|
||||
|
||||
ps[p].angle.ang = Owner->spr.angle;
|
||||
ps[p].angle.ang = Owner->spr.Angles.Yaw;
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
{
|
||||
|
@ -1515,7 +1515,7 @@ void movetransports_d(void)
|
|||
if (k && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
{
|
||||
k->vel.X = act2->vel.X * 0.5;
|
||||
k->spr.angle = act2->spr.angle;
|
||||
k->spr.Angles.Yaw = act2->spr.Angles.Yaw;
|
||||
ssp(k, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -1528,7 +1528,7 @@ void movetransports_d(void)
|
|||
if (act2->spr.statnum == STAT_PROJECTILE || (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1))
|
||||
{
|
||||
act2->spr.pos += (Owner->spr.pos - act->spr.pos.XY()).plusZ(-Owner->sector()->floorz);
|
||||
act2->spr.angle = Owner->spr.angle;
|
||||
act2->spr.Angles.Yaw = Owner->spr.Angles.Yaw;
|
||||
|
||||
act2->backupang();
|
||||
|
||||
|
@ -1685,7 +1685,7 @@ static void greenslime(DDukeActor *actor)
|
|||
|
||||
SetActor(actor, actor->spr.pos);
|
||||
|
||||
actor->spr.angle = ps[p].angle.ang;
|
||||
actor->spr.Angles.Yaw = ps[p].angle.ang;
|
||||
|
||||
if ((PlayerInput(p, SB_FIRE) || (ps[p].quick_kick > 0)) && ps[p].GetActor()->spr.extra > 0)
|
||||
if (ps[p].quick_kick > 0 || (ps[p].curr_weapon != HANDREMOTE_WEAPON && ps[p].curr_weapon != HANDBOMB_WEAPON && ps[p].curr_weapon != TRIPBOMB_WEAPON && ps[p].ammo_amount[ps[p].curr_weapon] >= 0))
|
||||
|
@ -1852,7 +1852,7 @@ static void greenslime(DDukeActor *actor)
|
|||
{
|
||||
s5->vel.X = 0;
|
||||
|
||||
actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5;
|
||||
actor->spr.pos = s5->spr.pos + s5->spr.Angles.Yaw.ToVector() * 0.5;
|
||||
actor->spr.picnum = GREENSLIME + 2 + (global_random & 1);
|
||||
|
||||
if (actor->spr.scale.Y < 1) actor->spr.scale.Y += (0.03125);
|
||||
|
@ -1930,7 +1930,7 @@ static void greenslime(DDukeActor *actor)
|
|||
{
|
||||
if (actor->vel.X < 2) actor->vel.X += 0.25;
|
||||
actor->vel.X = 4 - BobVal(512 + actor->temp_data[1]) * 2;
|
||||
actor->spr.angle += deltaangle(actor->spr.angle, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125;
|
||||
actor->spr.Angles.Yaw += deltaangle(actor->spr.Angles.Yaw, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125;
|
||||
// TJR
|
||||
}
|
||||
|
||||
|
@ -2029,7 +2029,7 @@ static void flamethrowerflame(DDukeActor *actor)
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK1, coll);
|
||||
movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK1, coll);
|
||||
|
||||
if (!actor->insector())
|
||||
{
|
||||
|
@ -2151,7 +2151,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
||||
movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
||||
|
||||
if (actor->sector()->lotag == 1 && actor->vel.Z == 0)
|
||||
{
|
||||
|
@ -2194,7 +2194,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
fi.checkhitwall(actor, wal, actor->spr.pos, actor->spr.picnum);
|
||||
|
||||
DAngle k = wal->delta().Angle();
|
||||
actor->spr.angle = k * 2 - actor->spr.angle;
|
||||
actor->spr.Angles.Yaw = k * 2 - actor->spr.Angles.Yaw;
|
||||
actor->vel.X *= 0.5;
|
||||
}
|
||||
|
||||
|
@ -3032,21 +3032,21 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
|||
if (ps[playernum].newOwner != nullptr)
|
||||
goalang = (ps[playernum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle();
|
||||
else goalang = (ps[playernum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
angdif = deltaangle(actor->spr.angle, goalang) * 0.25;
|
||||
angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25;
|
||||
if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle;
|
||||
actor->spr.angle += angdif;
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
if (a & spin)
|
||||
actor->spr.angle += DAngle45 * BobVal(actor->temp_data[0] << 3);
|
||||
actor->spr.Angles.Yaw += DAngle45 * BobVal(actor->temp_data[0] << 3);
|
||||
|
||||
if (a & face_player_slow)
|
||||
{
|
||||
if (ps[playernum].newOwner != nullptr)
|
||||
goalang = (ps[playernum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle();
|
||||
else goalang = (ps[playernum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong...
|
||||
actor->spr.angle += angdif;
|
||||
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.Angles.Yaw, goalang).Degrees()); // this looks very wrong...
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3060,9 +3060,9 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
|||
{
|
||||
DVector2 newpos = ps[playernum].GetActor()->spr.pos.XY() + (ps[playernum].vel.XY() * (4. / 3.));
|
||||
goalang = (newpos - actor->spr.pos.XY()).Angle();
|
||||
angdif = deltaangle(actor->spr.angle, goalang) * 0.25;
|
||||
angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25;
|
||||
if (angdif > -DAngle22_5/16 && angdif < nullAngle) angdif = nullAngle;
|
||||
actor->spr.angle += angdif;
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
if (actor->temp_data[1] == 0 || a == 0)
|
||||
|
@ -3158,7 +3158,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
|||
}
|
||||
|
||||
daxvel = actor->vel.X;
|
||||
angdif = actor->spr.angle;
|
||||
angdif = actor->spr.Angles.Yaw;
|
||||
|
||||
if (a && actor->spr.picnum != ROTATEGUN)
|
||||
{
|
||||
|
|
|
@ -392,14 +392,14 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
if (dasectp == nullptr || (dasectp != nullptr && actor->actorstayput != nullptr && actor->actorstayput != dasectp))
|
||||
{
|
||||
if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER)
|
||||
actor->spr.angle = randomAngle();
|
||||
actor->spr.Angles.Yaw = randomAngle();
|
||||
else if ((actor->temp_data[0] & 3) == 1)
|
||||
actor->spr.angle = randomAngle();
|
||||
actor->spr.Angles.Yaw = randomAngle();
|
||||
SetActor(actor, actor->spr.pos);
|
||||
if (dasectp == nullptr) dasectp = §or[0];
|
||||
return result.setSector(dasectp);
|
||||
}
|
||||
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.angle += DAngle45 + DAngle90;
|
||||
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.Angles.Yaw += DAngle45 + DAngle90;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -576,7 +576,7 @@ void movefallers_r(void)
|
|||
if (act->temp_data[0] == 0)
|
||||
{
|
||||
act->spr.pos.Z -= 16;
|
||||
DAngle saved_angle = act->spr.angle;
|
||||
DAngle saved_angle = act->spr.Angles.Yaw;
|
||||
int x = act->spr.extra;
|
||||
int j = fi.ifhitbyweapon(act);
|
||||
if (j >= 0)
|
||||
|
@ -605,7 +605,7 @@ void movefallers_r(void)
|
|||
act->spr.extra = x;
|
||||
}
|
||||
}
|
||||
act->spr.angle = saved_angle;
|
||||
act->spr.Angles.Yaw = saved_angle;
|
||||
act->spr.pos.Z += 16;
|
||||
}
|
||||
else if (act->temp_data[0] == 1)
|
||||
|
@ -726,18 +726,18 @@ static void chickenarrow(DDukeActor* actor)
|
|||
{
|
||||
DAngle ang, ang2;
|
||||
ang = (ts->spr.pos - actor->spr.pos).Angle();
|
||||
ang2 = deltaangle(ang, actor->spr.angle);
|
||||
ang2 = deltaangle(ang, actor->spr.Angles.Yaw);
|
||||
// this was quite broken in the original code. Fixed so that it seeks properly
|
||||
if (abs(ang2) < DAngle1 * 17.5)
|
||||
{
|
||||
actor->spr.angle = ang;
|
||||
actor->spr.Angles.Yaw = ang;
|
||||
}
|
||||
else if (ang2 > nullAngle)
|
||||
{
|
||||
actor->spr.angle -= DAngle1 * 9;
|
||||
actor->spr.Angles.Yaw -= DAngle1 * 9;
|
||||
}
|
||||
else
|
||||
actor->spr.angle += DAngle1 * 9;
|
||||
actor->spr.Angles.Yaw += DAngle1 * 9;
|
||||
|
||||
if (actor->spr.hitag > 180)
|
||||
if (actor->vel.Z <= 0)
|
||||
|
@ -836,7 +836,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
|
|||
if (proj->spr.picnum != RPG && (!isRRRA() || proj->spr.picnum != RPG2) && proj->spr.picnum != FREEZEBLAST && proj->spr.picnum != SPIT && proj->spr.picnum != SHRINKSPARK && (wal->overpicnum == MIRROR || wal->picnum == MIRROR))
|
||||
{
|
||||
DAngle walang = wal->delta().Angle();
|
||||
proj->spr.angle = walang * 2 - proj->spr.angle;
|
||||
proj->spr.Angles.Yaw = walang * 2 - proj->spr.Angles.Yaw;
|
||||
proj->SetOwner(proj);
|
||||
spawn(proj, TRANSPORTERSTAR);
|
||||
return true;
|
||||
|
@ -859,7 +859,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
|
|||
}
|
||||
|
||||
DAngle walang = wal->delta().Angle();
|
||||
proj->spr.angle = walang * 2 - proj->spr.angle;
|
||||
proj->spr.Angles.Yaw = walang * 2 - proj->spr.Angles.Yaw;
|
||||
return true;
|
||||
}
|
||||
if (proj->spr.picnum == SHRINKSPARK)
|
||||
|
@ -870,7 +870,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
|
|||
}
|
||||
if (proj->spr.extra <= 0)
|
||||
{
|
||||
proj->spr.pos += proj->spr.angle.ToVector() * 8;
|
||||
proj->spr.pos += proj->spr.Angles.Yaw.ToVector() * 8;
|
||||
auto Owner = proj->GetOwner();
|
||||
if (!isRRRA() || !Owner || (Owner->spr.picnum != CHEER && Owner->spr.picnum != CHEERSTAYPUT))
|
||||
{
|
||||
|
@ -879,7 +879,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
|
|||
{
|
||||
j->spr.scale = DVector2(0.125, 0.125);
|
||||
j->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
j->spr.angle += DAngle90;
|
||||
j->spr.Angles.Yaw += DAngle90;
|
||||
j->clipdist = proj->spr.scale.X * tileWidth(proj->spr.picnum) * 0.125;
|
||||
}
|
||||
}
|
||||
|
@ -893,7 +893,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
|
|||
}
|
||||
|
||||
DAngle k = wal->delta().Angle();
|
||||
proj->spr.angle = k * 2 - proj->spr.angle;
|
||||
proj->spr.Angles.Yaw = k * 2 - proj->spr.Angles.Yaw;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1006,7 +1006,7 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
movesprite_ex(proj, DVector3(proj->spr.angle.ToVector() * vel, velz), CLIPMASK1, coll);
|
||||
movesprite_ex(proj, DVector3(proj->spr.Angles.Yaw.ToVector() * vel, velz), CLIPMASK1, coll);
|
||||
|
||||
if ((proj->spr.picnum == RPG || (isRRRA() && isIn(proj->spr.picnum, RPG2, RRTILE1790))) && proj->temp_actor != nullptr)
|
||||
if ((proj->spr.pos.XY() - proj->temp_actor->spr.pos.XY()).Length() < 16)
|
||||
|
@ -1039,7 +1039,7 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
for (int k = -3; k < 2; k++)
|
||||
{
|
||||
double zAdd = k * proj->vel.Z / 24;
|
||||
auto x = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2.,
|
||||
auto x = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.Angles.Yaw.ToVector() * k * 2.,
|
||||
FIRELASER, -40 + (k << 2),
|
||||
proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5);
|
||||
|
||||
|
@ -1222,7 +1222,7 @@ void movetransports_r(void)
|
|||
ps[k].GetActor()->spr.extra = 0;
|
||||
}
|
||||
|
||||
ps[p].angle.ang = Owner->spr.angle;
|
||||
ps[p].angle.ang = Owner->spr.Angles.Yaw;
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
{
|
||||
|
@ -1430,7 +1430,7 @@ void movetransports_r(void)
|
|||
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
{
|
||||
spawned->vel.X = act2->vel.X * 0.5;
|
||||
spawned->spr.angle = act2->spr.angle;
|
||||
spawned->spr.Angles.Yaw = act2->spr.Angles.Yaw;
|
||||
ssp(spawned, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -1443,7 +1443,7 @@ void movetransports_r(void)
|
|||
if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)
|
||||
{
|
||||
act2->spr.pos += (Owner->spr.pos - act->spr.pos.XY()).plusZ(-Owner->sector()->floorz);
|
||||
act2->spr.angle = Owner->spr.angle;
|
||||
act2->spr.Angles.Yaw = Owner->spr.Angles.Yaw;
|
||||
|
||||
act2->backupang();
|
||||
|
||||
|
@ -1496,7 +1496,7 @@ void movetransports_r(void)
|
|||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
movesprite_ex(act2, DVector3(act2->spr.angle.ToVector() * act2->vel.X, 0), CLIPMASK1, coll);
|
||||
movesprite_ex(act2, DVector3(act2->spr.Angles.Yaw.ToVector() * act2->vel.X, 0), CLIPMASK1, coll);
|
||||
|
||||
break;
|
||||
case 161:
|
||||
|
@ -1507,7 +1507,7 @@ void movetransports_r(void)
|
|||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
movesprite_ex(act2, DVector3(act2->spr.angle.ToVector() * act2->vel.X, 0), CLIPMASK1, coll);
|
||||
movesprite_ex(act2, DVector3(act2->spr.Angles.Yaw.ToVector() * act2->vel.X, 0), CLIPMASK1, coll);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1700,7 +1700,7 @@ static void rrra_specialstats()
|
|||
if (act->spr.extra == act->spr.lotag)
|
||||
S_PlaySound(183);
|
||||
act->spr.extra--;
|
||||
int j = movesprite_ex(act, DVector3(act->spr.angle.ToVector() * act->spr.hitag / 16., act->spr.hitag / 128.), CLIPMASK0, coll);
|
||||
int j = movesprite_ex(act, DVector3(act->spr.Angles.Yaw.ToVector() * act->spr.hitag / 16., act->spr.hitag / 128.), CLIPMASK0, coll);
|
||||
if (j > 0)
|
||||
{
|
||||
S_PlayActorSound(PIPEBOMB_EXPLODE, act);
|
||||
|
@ -1945,7 +1945,7 @@ void rr_specialstats()
|
|||
{
|
||||
if (act2->spr.picnum == RRTELEPORTDEST)
|
||||
{
|
||||
ps[p].angle.ang = act2->spr.angle;
|
||||
ps[p].angle.ang = act2->spr.Angles.Yaw;
|
||||
ps[p].GetActor()->spr.pos = act2->spr.pos.plusZ(-36 + gs.playerheight);
|
||||
ps[p].GetActor()->backuppos();
|
||||
ps[p].setbobpos();
|
||||
|
@ -2032,7 +2032,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
||||
movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
||||
|
||||
if (actor->sector()->lotag == 1 && actor->vel.Z == 0)
|
||||
{
|
||||
|
@ -2094,7 +2094,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
goto DETONATEB;
|
||||
}
|
||||
DAngle k = wal->delta().Angle();
|
||||
actor->spr.angle = k * 2 - actor->spr.angle;
|
||||
actor->spr.Angles.Yaw = k * 2 - actor->spr.Angles.Yaw;
|
||||
actor->vel.X *= 0.5;
|
||||
}
|
||||
|
||||
|
@ -2217,13 +2217,13 @@ static int henstand(DDukeActor *actor)
|
|||
{
|
||||
makeitfall(actor);
|
||||
Collision coll;
|
||||
movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
||||
movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
||||
if (coll.type)
|
||||
{
|
||||
if (coll.type == kHitWall)
|
||||
{
|
||||
DAngle k = coll.hitWall->delta().Angle();
|
||||
actor->spr.angle = k * 2 - actor->spr.angle;
|
||||
actor->spr.Angles.Yaw = k * 2 - actor->spr.Angles.Yaw;
|
||||
}
|
||||
else if (coll.type == kHitSprite)
|
||||
{
|
||||
|
@ -2238,7 +2238,7 @@ static int henstand(DDukeActor *actor)
|
|||
{
|
||||
ns->vel.X = 2;
|
||||
ns->spr.lotag = 40;
|
||||
ns->spr.angle = actor->spr.angle;
|
||||
ns->spr.Angles.Yaw = actor->spr.Angles.Yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2409,7 +2409,7 @@ void moveactors_r(void)
|
|||
if (!isRRRA() || (sectp->lotag != 1 && sectp->lotag != 160))
|
||||
if (act->vel.X != 0)
|
||||
{
|
||||
movesprite_ex(act, DVector3(act->spr.angle.ToVector()* act->vel.X, act->vel.Z), CLIPMASK0, coll);
|
||||
movesprite_ex(act, DVector3(act->spr.Angles.Yaw.ToVector()* act->vel.X, act->vel.Z), CLIPMASK0, coll);
|
||||
act->vel.X -= 1. / 16.;
|
||||
}
|
||||
break;
|
||||
|
@ -3020,21 +3020,21 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
|||
if (ps[pnum].newOwner != nullptr)
|
||||
goalang = (ps[pnum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle();
|
||||
else goalang = (ps[pnum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
angdif = deltaangle(actor->spr.angle, goalang) * 0.25;
|
||||
angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25;
|
||||
if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle;
|
||||
actor->spr.angle += angdif;
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
if (a & spin)
|
||||
actor->spr.angle += DAngle45 * BobVal(actor->temp_data[0] << 3);
|
||||
actor->spr.Angles.Yaw += DAngle45 * BobVal(actor->temp_data[0] << 3);
|
||||
|
||||
if (a & face_player_slow)
|
||||
{
|
||||
if (ps[pnum].newOwner != nullptr)
|
||||
goalang = (ps[pnum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle();
|
||||
else goalang = (ps[pnum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle();
|
||||
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong...
|
||||
actor->spr.angle += angdif;
|
||||
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.Angles.Yaw, goalang).Degrees()); // this looks very wrong...
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
if (isRRRA())
|
||||
|
@ -3044,8 +3044,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
|||
if (ps[pnum].newOwner != nullptr)
|
||||
goalang = ((ps[pnum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle() + DAngle180);
|
||||
else goalang = ((ps[pnum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle() + DAngle180);
|
||||
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong...
|
||||
actor->spr.angle += angdif;
|
||||
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.Angles.Yaw, goalang).Degrees()); // this looks very wrong...
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
if ((a & jumptoplayer) == jumptoplayer)
|
||||
|
@ -3104,9 +3104,9 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
|||
{
|
||||
DVector2 newpos = ps[pnum].GetActor()->spr.pos.XY() + (ps[pnum].vel.XY() * (4. / 3.));
|
||||
goalang = (newpos - actor->spr.pos.XY()).Angle();
|
||||
angdif = deltaangle(actor->spr.angle, goalang) * 0.25;
|
||||
angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25;
|
||||
if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle;
|
||||
actor->spr.angle += angdif;
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
}
|
||||
|
||||
if (actor->temp_data[1] == 0 || a == 0)
|
||||
|
@ -3191,7 +3191,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
|||
}
|
||||
|
||||
daxvel = actor->vel.X;
|
||||
angdif = actor->spr.angle;
|
||||
angdif = actor->spr.Angles.Yaw;
|
||||
|
||||
if (a)
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
}
|
||||
|
||||
k = angletorotation1(t->angle, viewang);
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -174,7 +174,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
if (actorflag(h, SFLAG2_INTERPOLATEANGLE))
|
||||
{
|
||||
t->angle = h->interpolatedangle(interpfrac);
|
||||
t->Angles.Yaw = h->interpolatedangle(interpfrac);
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,8 +237,8 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->scale = DVector2(0, 0);
|
||||
else
|
||||
{
|
||||
t->angle = (viewVec - t->pos.XY()).Angle();
|
||||
t->pos.XY() = OwnerAc->spr.pos.XY() + t->angle.ToVector();
|
||||
t->Angles.Yaw = (viewVec - t->pos.XY()).Angle();
|
||||
t->pos.XY() = OwnerAc->spr.pos.XY() + t->Angles.Yaw.ToVector();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -263,7 +263,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
}
|
||||
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -281,7 +281,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
}
|
||||
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
|
||||
if (k > 6)
|
||||
{
|
||||
|
@ -367,7 +367,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
}
|
||||
else
|
||||
{
|
||||
k = angletorotation1(h->spr.angle, viewang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -467,12 +467,12 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
else switch (l)
|
||||
{
|
||||
case 2:
|
||||
k = angletorotation1(h->spr.angle, viewang, 8, 1);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang, 8, 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
k = angletorotation1(h->spr.angle, viewang, 7);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang, 7);
|
||||
if (k > 3)
|
||||
{
|
||||
t->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
|
@ -483,7 +483,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
case 5:
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation1(h->spr.angle, kang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, kang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -493,7 +493,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
case 7:
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -502,7 +502,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
break;
|
||||
case 8:
|
||||
k = angletorotation1(h->spr.angle, viewang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang);
|
||||
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
break;
|
||||
default:
|
||||
|
@ -624,7 +624,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
}
|
||||
else
|
||||
{
|
||||
k = angletorotation1(t->angle, viewang);
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -667,7 +667,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->picnum = OwnerAc->dispicnum;
|
||||
t->pal = OwnerAc->spr.pal;
|
||||
t->shade = OwnerAc->spr.shade;
|
||||
t->angle = OwnerAc->spr.angle;
|
||||
t->Angles.Yaw = OwnerAc->spr.Angles.Yaw;
|
||||
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
|
||||
}
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
}
|
||||
|
||||
k = angletorotation1(t->angle, viewang);
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
|
|
@ -64,7 +64,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
case CHAIR3:
|
||||
|
||||
k = angletorotation1(t->angle, viewang);
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -154,7 +154,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
if (actorflag(h, SFLAG2_INTERPOLATEANGLE))
|
||||
{
|
||||
t->angle = h->interpolatedangle(interpfrac);
|
||||
t->Angles.Yaw = h->interpolatedangle(interpfrac);
|
||||
}
|
||||
|
||||
|
||||
|
@ -228,8 +228,8 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->scale = DVector2(0, 0);
|
||||
else
|
||||
{
|
||||
t->angle = (viewVec - t->pos.XY()).Angle();
|
||||
t->pos.XY() = OwnerAc->spr.pos.XY() + t->angle.ToVector();
|
||||
t->Angles.Yaw = (viewVec - t->pos.XY()).Angle();
|
||||
t->pos.XY() = OwnerAc->spr.pos.XY() + t->Angles.Yaw.ToVector();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -269,7 +269,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
else if (OwnerAc->spr.picnum == MAMA)
|
||||
{
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation1(h->spr.angle, kang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, kang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -287,7 +287,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case EMPTYBIKE:
|
||||
if (!isRRRA()) goto default_case;
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -299,7 +299,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case EMPTYBOAT:
|
||||
if (!isRRRA()) goto default_case;
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -310,7 +310,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
case RPG:
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -322,7 +322,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case RPG2:
|
||||
if (!isRRRA()) goto default_case;
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -335,7 +335,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case RECON:
|
||||
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
|
||||
if (k > 6)
|
||||
{
|
||||
|
@ -422,7 +422,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
} else
|
||||
{
|
||||
k = angletorotation1(h->spr.angle, viewang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -484,7 +484,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
}
|
||||
else if (ps[p].OnMotorcycle)
|
||||
{
|
||||
k = angletorotation2(h->spr.angle, viewang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, viewang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -508,7 +508,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
}
|
||||
else if (ps[p].OnBoat)
|
||||
{
|
||||
k = angletorotation2(h->spr.angle, viewang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, viewang);
|
||||
|
||||
if (k > 6)
|
||||
{
|
||||
|
@ -606,12 +606,12 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
else switch (l)
|
||||
{
|
||||
case 2:
|
||||
k = angletorotation1(h->spr.angle, viewang, 8, 1);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang, 8, 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
k = angletorotation1(h->spr.angle, viewang, 7);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang, 7);
|
||||
if (k > 3)
|
||||
{
|
||||
t->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
|
@ -622,7 +622,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
case 5:
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation1(h->spr.angle, kang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, kang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -632,7 +632,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
case 7:
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation2(h->spr.angle, kang);
|
||||
k = angletorotation2(h->spr.Angles.Yaw, kang);
|
||||
if (k > 6)
|
||||
{
|
||||
k = 12 - k;
|
||||
|
@ -641,7 +641,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
break;
|
||||
case 8:
|
||||
k = angletorotation1(h->spr.angle, viewang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, viewang);
|
||||
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
break;
|
||||
default:
|
||||
|
@ -649,7 +649,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
if (bg && h->spr.statnum == 2 && h->spr.extra > 0)
|
||||
{
|
||||
kang = (h->spr.pos - viewVec).Angle();
|
||||
k = angletorotation1(h->spr.angle, kang);
|
||||
k = angletorotation1(h->spr.Angles.Yaw, kang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -869,7 +869,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
case PLAYERONWATER:
|
||||
|
||||
k = angletorotation1(t->angle, viewang);
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
@ -915,14 +915,14 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->picnum = OwnerAc->dispicnum;
|
||||
t->pal = OwnerAc->spr.pal;
|
||||
t->shade = OwnerAc->spr.shade;
|
||||
t->angle = OwnerAc->spr.angle;
|
||||
t->Angles.Yaw = OwnerAc->spr.Angles.Yaw;
|
||||
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RAT:
|
||||
k = angletorotation1(t->angle, viewang);
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
|
|
@ -182,7 +182,7 @@ void resetpins(sectortype* sect)
|
|||
{
|
||||
spawned->spr.lotag = a2->spr.lotag;
|
||||
spawned->clipdist = 12; // random formula here was bogus and always produced 48.
|
||||
spawned->spr.angle -= DAngle22_5 * 0.125 * (((krand() & 32) - (krand() & 64)) >> 5); // weird formula to preserve number of krand calls.
|
||||
spawned->spr.Angles.Yaw -= DAngle22_5 * 0.125 * (((krand() & 32) - (krand() & 64)) >> 5); // weird formula to preserve number of krand calls.
|
||||
}
|
||||
}
|
||||
if (a2->spr.picnum == 280)
|
||||
|
|
|
@ -98,7 +98,7 @@ static int ccmd_spawn(CCmdFuncPtr parm)
|
|||
{
|
||||
if (set & 1) spawned->spr.pal = (uint8_t)pal;
|
||||
if (set & 2) spawned->spr.cstat = ESpriteFlags::FromInt(cstat);
|
||||
if (set & 4) spawned->spr.angle = ang;
|
||||
if (set & 4) spawned->spr.Angles.Yaw = ang;
|
||||
if (set & 8) SetActor(spawned, DVector3( x, y, z ));
|
||||
|
||||
if (spawned->sector() == nullptr)
|
||||
|
|
|
@ -59,7 +59,7 @@ std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
|||
{
|
||||
auto pActor = ps[screenpeek].GetActor();
|
||||
if (!pActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(pActor->spr.pos, pActor->spr.angle);
|
||||
return std::make_pair(pActor->spr.pos, pActor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
GameStats GameInterface::getStats()
|
||||
|
@ -436,7 +436,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
|
|||
double j = clamp(czoom * act->spr.scale.Y + abs(pp.truefz - pp.GetActor()->getOffsetZ()) * REPEAT_SCALE, 0.333, 2.);
|
||||
|
||||
auto const vec = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim);
|
||||
auto const daang = -((!SyncInput() ? act->spr.angle : act->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees();
|
||||
auto const daang = -((!SyncInput() ? act->spr.Angles.Yaw : act->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees();
|
||||
|
||||
DrawTexture(twod, tileGetTexture(i), vec.X, vec.Y, DTA_TranslationIndex, TRANSLATION(Translation_Remap + setpal(&pp), act->spr.pal), DTA_CenterOffset, true,
|
||||
DTA_Rotate, daang, DTA_Color, shadeToLight(act->spr.shade), DTA_ScaleX, j, DTA_ScaleY, j, TAG_DONE);
|
||||
|
|
|
@ -1225,8 +1225,8 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
else*/ SetGameVarID(lVar2, act->spr.statnum, sActor, sPlayer);
|
||||
break;
|
||||
case ACTOR_ANG:
|
||||
if (bSet) act->spr.angle = DAngle::fromBuild(lValue);
|
||||
else SetGameVarID(lVar2, act->spr.angle.Buildang(), sActor, sPlayer);
|
||||
if (bSet) act->spr.Angles.Yaw = DAngle::fromBuild(lValue);
|
||||
else SetGameVarID(lVar2, act->spr.Angles.Yaw.Buildang(), sActor, sPlayer);
|
||||
break;
|
||||
case ACTOR_OWNER:
|
||||
// there is no way to handle this well because we do not know whether this is an actor or not. Pity.
|
||||
|
@ -1409,18 +1409,18 @@ static int ifcanshoottarget(DDukeActor *actor, int g_p, int g_x)
|
|||
return 0;
|
||||
else
|
||||
{
|
||||
actor->spr.angle += angdif;
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
hs = hitasprite(actor, &hit);
|
||||
actor->spr.angle -= angdif;
|
||||
actor->spr.Angles.Yaw -= angdif;
|
||||
if (hs > sclip)
|
||||
{
|
||||
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
actor->spr.angle += angdif;
|
||||
actor->spr.Angles.Yaw += angdif;
|
||||
hs = hitasprite(actor, &hit);
|
||||
actor->spr.angle -= angdif;
|
||||
actor->spr.Angles.Yaw -= angdif;
|
||||
if (hs > 48)
|
||||
{
|
||||
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
|
||||
|
@ -1556,7 +1556,7 @@ int ParseState::parse(void)
|
|||
g_ac->spr.hitag = ScriptCode[g_t[5] + 2]; // Ai
|
||||
g_t[0] = g_t[2] = g_t[3] = 0;
|
||||
if (g_ac->spr.hitag & random_angle)
|
||||
g_ac->spr.angle = randomAngle();
|
||||
g_ac->spr.Angles.Yaw = randomAngle();
|
||||
insptr++;
|
||||
break;
|
||||
case concmd_action:
|
||||
|
@ -1596,10 +1596,10 @@ int ParseState::parse(void)
|
|||
switch (krand() & 1)
|
||||
{
|
||||
case 0:
|
||||
g_ac->spr.angle += DAngle90 + randomAngle(90);
|
||||
g_ac->spr.Angles.Yaw += DAngle90 + randomAngle(90);
|
||||
break;
|
||||
case 1:
|
||||
g_ac->spr.angle -= DAngle90 + randomAngle(90);
|
||||
g_ac->spr.Angles.Yaw -= DAngle90 + randomAngle(90);
|
||||
break;
|
||||
}
|
||||
insptr++;
|
||||
|
@ -1610,7 +1610,7 @@ int ParseState::parse(void)
|
|||
break;
|
||||
|
||||
case concmd_rndmove:
|
||||
g_ac->spr.angle = randomAngle();
|
||||
g_ac->spr.Angles.Yaw = randomAngle();
|
||||
g_ac->vel.X = 25/16.;
|
||||
insptr++;
|
||||
break;
|
||||
|
@ -1972,11 +1972,11 @@ int ParseState::parse(void)
|
|||
break;
|
||||
case concmd_strafeleft:
|
||||
insptr++;
|
||||
movesprite_ex(g_ac, DVector3(-g_ac->spr.angle.Sin(), g_ac->spr.angle.Cos(), g_ac->vel.Z), CLIPMASK0, coll);
|
||||
movesprite_ex(g_ac, DVector3(-g_ac->spr.Angles.Yaw.Sin(), g_ac->spr.Angles.Yaw.Cos(), g_ac->vel.Z), CLIPMASK0, coll);
|
||||
break;
|
||||
case concmd_straferight:
|
||||
insptr++;
|
||||
movesprite_ex(g_ac, DVector3(g_ac->spr.angle.Sin(), -g_ac->spr.angle.Cos(), g_ac->vel.Z), CLIPMASK0, coll);
|
||||
movesprite_ex(g_ac, DVector3(g_ac->spr.Angles.Yaw.Sin(), -g_ac->spr.Angles.Yaw.Cos(), g_ac->vel.Z), CLIPMASK0, coll);
|
||||
break;
|
||||
case concmd_larrybird:
|
||||
insptr++;
|
||||
|
@ -2121,7 +2121,7 @@ int ParseState::parse(void)
|
|||
g_ac->spr.hitag = *insptr;
|
||||
insptr++;
|
||||
if(g_ac->spr.hitag&random_angle)
|
||||
g_ac->spr.angle = randomAngle();
|
||||
g_ac->spr.Angles.Yaw = randomAngle();
|
||||
break;
|
||||
case concmd_spawn:
|
||||
insptr++;
|
||||
|
@ -2486,7 +2486,7 @@ int ParseState::parse(void)
|
|||
if( g_ac->sector()->lotag == 0 )
|
||||
{
|
||||
HitInfo hit{};
|
||||
neartag(g_ac->spr.pos.plusZ(-32), g_ac->sector(), g_ac->spr.angle, hit, 48, NT_Lotag | NT_NoSpriteCheck);
|
||||
neartag(g_ac->spr.pos.plusZ(-32), g_ac->sector(), g_ac->spr.Angles.Yaw, hit, 48, NT_Lotag | NT_NoSpriteCheck);
|
||||
auto sectp = hit.hitSector;
|
||||
if (sectp)
|
||||
{
|
||||
|
@ -2833,7 +2833,7 @@ int ParseState::parse(void)
|
|||
case concmd_ifangdiffl:
|
||||
{
|
||||
insptr++;
|
||||
auto ang = absangle(ps[g_p].angle.ang, g_ac->spr.angle);
|
||||
auto ang = absangle(ps[g_p].angle.ang, g_ac->spr.Angles.Yaw);
|
||||
parseifelse( ang <= mapangle(*insptr));
|
||||
break;
|
||||
}
|
||||
|
@ -3147,7 +3147,7 @@ int ParseState::parse(void)
|
|||
int i;
|
||||
insptr++;
|
||||
i = *(insptr++); // ID of def
|
||||
SetGameVarID(i, g_ac->spr.angle.Buildang(), g_ac, g_p);
|
||||
SetGameVarID(i, g_ac->spr.Angles.Yaw.Buildang(), g_ac, g_p);
|
||||
break;
|
||||
}
|
||||
case concmd_setactorangle:
|
||||
|
@ -3155,7 +3155,7 @@ int ParseState::parse(void)
|
|||
int i;
|
||||
insptr++;
|
||||
i = *(insptr++); // ID of def
|
||||
g_ac->spr.angle = DAngle::fromBuild(GetGameVarID(i, g_ac, g_p).safeValue() & 2047);
|
||||
g_ac->spr.Angles.Yaw = DAngle::fromBuild(GetGameVarID(i, g_ac, g_p).safeValue() & 2047);
|
||||
break;
|
||||
}
|
||||
case concmd_randvar:
|
||||
|
|
|
@ -278,7 +278,7 @@ inline void applyRotation1(DDukeActor* h, tspritetype* t, DAngle viewang)
|
|||
return;
|
||||
}
|
||||
|
||||
int k = angletorotation1(t->angle, viewang);
|
||||
int k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
|
|
|
@ -843,7 +843,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
|
||||
p->angle.processhelpers(scaleAdjust);
|
||||
p->horizon.processhelpers(scaleAdjust);
|
||||
p->GetActor()->spr.angle = p->angle.ang;
|
||||
p->GetActor()->spr.Angles.Yaw = p->angle.ang;
|
||||
}
|
||||
|
||||
if (packet)
|
||||
|
|
|
@ -171,7 +171,7 @@ double hits(DDukeActor* actor)
|
|||
else zoff = 0;
|
||||
|
||||
auto pos = actor->spr.pos;
|
||||
hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
return (hit.hitpos.XY() - actor->spr.pos.XY()).Length();
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ double hitasprite(DDukeActor* actor, DDukeActor** hitsp)
|
|||
else zoff = 0;
|
||||
|
||||
auto pos = actor->spr.pos;
|
||||
hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
if (hitsp) *hitsp = hit.actor();
|
||||
|
||||
if (hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) && badguy(actor))
|
||||
|
@ -231,7 +231,7 @@ DDukeActor* aim(DDukeActor* actor, int abase)
|
|||
bool gotshrinker, gotfreezer;
|
||||
static const int aimstats[] = { STAT_PLAYER, STAT_DUMMYPLAYER, STAT_ACTOR, STAT_ZOMBIEACTOR };
|
||||
|
||||
DAngle a = actor->spr.angle;
|
||||
DAngle a = actor->spr.Angles.Yaw;
|
||||
|
||||
// Autoaim from DukeGDX.
|
||||
if (actor->isPlayer())
|
||||
|
@ -248,7 +248,7 @@ DDukeActor* aim(DDukeActor* actor, int abase)
|
|||
setFreeAimVelocity(vel, zvel, plr->horizon.sum(), 16.);
|
||||
|
||||
HitInfo hit{};
|
||||
hitscan(plr->GetActor()->getPosWithOffsetZ().plusZ(4), actor->sector(), DVector3(actor->spr.angle.ToVector() * vel, zvel), hit, CLIPMASK1);
|
||||
hitscan(plr->GetActor()->getPosWithOffsetZ().plusZ(4), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * vel, zvel), hit, CLIPMASK1);
|
||||
|
||||
if (hit.actor() != nullptr)
|
||||
{
|
||||
|
@ -1051,7 +1051,7 @@ void shootbloodsplat(DDukeActor* actor, int p, const DVector3& pos, DAngle ang,
|
|||
if (spawned)
|
||||
{
|
||||
spawned->vel.X = -0.75;
|
||||
spawned->spr.angle = hit.hitWall->delta().Angle() - DAngle90;
|
||||
spawned->spr.Angles.Yaw = hit.hitWall->delta().Angle() - DAngle90;
|
||||
spawned->spr.pos = hit.hitpos;
|
||||
spawned->spr.cstat |= randomXFlip();
|
||||
ssp(spawned, CLIPMASK0);
|
||||
|
|
|
@ -168,7 +168,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
|
|||
zvel = (((ps[j].GetActor()->getPrevOffsetZ() - spos.Z) * vel) / dist);
|
||||
|
||||
if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0)
|
||||
sang = actor->spr.angle + mapangle((krand() & 31) - 16);
|
||||
sang = actor->spr.Angles.Yaw + mapangle((krand() & 31) - 16);
|
||||
|
||||
if (actor->sector()->lotag == 2 && (krand() % 5) == 0)
|
||||
spawned = spawn(actor, WATERBUBBLE);
|
||||
|
@ -203,7 +203,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
|
|||
spawned->spr.pos.Z--;
|
||||
spawned->setsector(actor->sector());
|
||||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.angle = sang;
|
||||
spawned->spr.Angles.Yaw = sang;
|
||||
spawned->spr.scale = DVector2(0.03125, 0.03125);
|
||||
spawned->clipdist = 10;
|
||||
spawned->spr.yint = p;
|
||||
|
@ -294,7 +294,7 @@ static void shootknee(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
|
|||
if (splash)
|
||||
{
|
||||
splash->spr.pos.XY() = hit.hitpos.XY();
|
||||
splash->spr.angle = ps[p].angle.ang; // Total tweek
|
||||
splash->spr.Angles.Yaw = ps[p].angle.ang; // Total tweek
|
||||
splash->vel.X = 2;
|
||||
ssp(actor, CLIPMASK0);
|
||||
splash->vel.X = 0;
|
||||
|
@ -442,7 +442,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int
|
|||
jib->spr.pos.Z += 4;
|
||||
jib->vel.X = 1;
|
||||
jib->spr.scale = DVector2(0.375, 0.375);
|
||||
jib->spr.angle += DAngle22_5 / 2 - randomAngle(22.5);
|
||||
jib->spr.Angles.Yaw += DAngle22_5 / 2 - randomAngle(22.5);
|
||||
}
|
||||
}
|
||||
else spawn(spark, SMALLSMOKE);
|
||||
|
@ -511,7 +511,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int
|
|||
if (hole)
|
||||
{
|
||||
hole->vel.X = -1 / 16.;
|
||||
hole->spr.angle = hit.hitWall->delta().Angle() - DAngle90;
|
||||
hole->spr.Angles.Yaw = hit.hitWall->delta().Angle() - DAngle90;
|
||||
ssp(hole, CLIPMASK0);
|
||||
hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
|
||||
}
|
||||
|
@ -638,14 +638,14 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
|
|||
spawned->vel.X = 64;
|
||||
ssp(spawned, CLIPMASK0);
|
||||
spawned->vel.X = ovel;
|
||||
spawned->spr.angle += DAngle22_5 - randomAngle(45);
|
||||
spawned->spr.Angles.Yaw += DAngle22_5 - randomAngle(45);
|
||||
}
|
||||
}
|
||||
|
||||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->clipdist = 1;
|
||||
|
||||
ang = actor->spr.angle + DAngle22_5 / 4 - randomAngle(22.5 / 2);
|
||||
ang = actor->spr.Angles.Yaw + DAngle22_5 / 4 - randomAngle(22.5 / 2);
|
||||
zvel = oldzvel + 2 - krandf(4);
|
||||
|
||||
scount--;
|
||||
|
@ -715,7 +715,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
zvel = ((ps[j].GetActor()->getPrevOffsetZ() - pos.Z) * vel) / dist;
|
||||
|
||||
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
|
||||
ang = actor->spr.angle + randomAngle(DAngle22_5 / 4) - DAngle22_5 / 8;
|
||||
ang = actor->spr.Angles.Yaw + randomAngle(DAngle22_5 / 4) - DAngle22_5 / 8;
|
||||
}
|
||||
if (p < 0) aimed = nullptr;
|
||||
|
||||
|
@ -755,7 +755,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
}
|
||||
|
||||
spawned->spr.pos += spawnofs;
|
||||
spawned->spr.angle += aoffs;
|
||||
spawned->spr.Angles.Yaw += aoffs;
|
||||
|
||||
spawned->spr.scale = DVector2(0.65625, 0.65625);
|
||||
}
|
||||
|
@ -771,7 +771,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
}
|
||||
|
||||
spawned->spr.pos += spawnofs;
|
||||
spawned->spr.angle += aoffs;
|
||||
spawned->spr.Angles.Yaw += aoffs;
|
||||
|
||||
spawned->spr.scale = DVector2(0.375, 0.375);
|
||||
}
|
||||
|
@ -784,7 +784,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
else if ((isWW2GI() && aplWeaponWorksLike(ps[p].curr_weapon, p) == DEVISTATOR_WEAPON) || (!isWW2GI() && ps[p].curr_weapon == DEVISTATOR_WEAPON))
|
||||
{
|
||||
spawned->spr.extra >>= 2;
|
||||
spawned->spr.angle += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
spawned->spr.Angles.Yaw += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
spawned->vel.Z += 1 - krandf(2);
|
||||
|
||||
if (ps[p].hbomb_hold_delay)
|
||||
|
@ -872,8 +872,8 @@ static void shootlaser(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
|
|||
ssp(bomb, CLIPMASK0);
|
||||
bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
auto delta = -hit.hitWall->delta();
|
||||
bomb->spr.angle = delta.Angle() - DAngle90;
|
||||
bomb->temp_angle = bomb->spr.angle;
|
||||
bomb->spr.Angles.Yaw = delta.Angle() - DAngle90;
|
||||
bomb->temp_angle = bomb->spr.Angles.Yaw;
|
||||
|
||||
if (p >= 0)
|
||||
ps[p].ammo_amount[TRIPBOMB_WEAPON]--;
|
||||
|
@ -1078,7 +1078,7 @@ void shoot_d(DDukeActor* actor, int atwith)
|
|||
}
|
||||
else
|
||||
{
|
||||
sang = actor->spr.angle;
|
||||
sang = actor->spr.Angles.Yaw;
|
||||
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tileHeight(actor->spr.picnum) * 0.5) + 4);
|
||||
|
||||
if (actor->spr.picnum != ROTATEGUN)
|
||||
|
@ -1111,7 +1111,7 @@ void shoot_d(DDukeActor* actor, int atwith)
|
|||
{
|
||||
k->setsector(sect);
|
||||
k->spr.pos = spos;
|
||||
k->spr.angle = sang;
|
||||
k->spr.Angles.Yaw = sang;
|
||||
k->vel.X = 500 / 16.;
|
||||
k->vel.Z = 0;
|
||||
}
|
||||
|
@ -2226,7 +2226,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
double hd = hits(pact);
|
||||
if (hd < 32)
|
||||
{
|
||||
spawned->spr.angle += DAngle180;
|
||||
spawned->spr.Angles.Yaw += DAngle180;
|
||||
spawned->vel *= 1./3.;
|
||||
}
|
||||
|
||||
|
@ -2353,9 +2353,9 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
auto j = spawn(pact, SHOTGUNSHELL);
|
||||
if (j)
|
||||
{
|
||||
j->spr.angle += DAngle180;
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
ssp(j, CLIPMASK0);
|
||||
j->spr.angle -= DAngle180;
|
||||
j->spr.Angles.Yaw -= DAngle180;
|
||||
}
|
||||
p->kickback_pic++;
|
||||
break;
|
||||
|
@ -2387,7 +2387,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
auto j = spawn(pact, SHELL);
|
||||
if (j)
|
||||
{
|
||||
j->spr.angle += DAngle180;
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
j->vel.X += 2.;
|
||||
j->spr.pos.Z += 3;
|
||||
ssp(j, CLIPMASK0);
|
||||
|
|
|
@ -185,7 +185,7 @@ static void shootmelee(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int a
|
|||
if (splash)
|
||||
{
|
||||
splash->spr.pos.XY() = hit.hitpos.XY();
|
||||
splash->spr.angle = ps[p].angle.ang; // Total tweek
|
||||
splash->spr.Angles.Yaw = ps[p].angle.ang; // Total tweek
|
||||
splash->vel.X = 2;
|
||||
ssp(actor, 0);
|
||||
splash->vel.X = 0;
|
||||
|
@ -336,7 +336,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
|
|||
jib->spr.pos.Z += 4;
|
||||
jib->vel.X = 1;
|
||||
jib->spr.scale = DVector2(0.375, 0.375);
|
||||
jib->spr.angle += DAngle22_5 / 2 - randomAngle(22.5);
|
||||
jib->spr.Angles.Yaw += DAngle22_5 / 2 - randomAngle(22.5);
|
||||
}
|
||||
}
|
||||
else spawn(spark, SMALLSMOKE);
|
||||
|
@ -409,7 +409,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
|
|||
if (hole)
|
||||
{
|
||||
hole->vel.X = -1 / 16;
|
||||
hole->spr.angle = hit.hitWall->delta().Angle() - DAngle90;
|
||||
hole->spr.Angles.Yaw = hit.hitWall->delta().Angle() - DAngle90;
|
||||
ssp(hole, CLIPMASK0);
|
||||
hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL;
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
|
|||
pos.Z -= 4;
|
||||
if (actor->spr.picnum == 4649)
|
||||
{
|
||||
pos += (actor->spr.angle + DAngle45).ToVector() * 16;
|
||||
pos += (actor->spr.Angles.Yaw + DAngle45).ToVector() * 16;
|
||||
pos.Z += 12;
|
||||
}
|
||||
if (actor->spr.picnum == VIXEN)
|
||||
|
@ -499,7 +499,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
|
|||
{
|
||||
auto aimed = aim(actor, AUTO_AIM_ANGLE);
|
||||
|
||||
pos += (actor->spr.angle + DAngle22_5 * 1.25).ToVector() * 16;
|
||||
pos += (actor->spr.Angles.Yaw + DAngle22_5 * 1.25).ToVector() * 16;
|
||||
|
||||
if (aimed)
|
||||
{
|
||||
|
@ -545,7 +545,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
|
|||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->clipdist = 1;
|
||||
|
||||
ang = actor->spr.angle + DAngle22_5 / 4 + randomAngle(22.5 / 2);
|
||||
ang = actor->spr.Angles.Yaw + DAngle22_5 / 4 + randomAngle(22.5 / 2);
|
||||
zvel = oldzvel + 2 - krandf(4);
|
||||
|
||||
if (atwith == FIRELASER)
|
||||
|
@ -626,7 +626,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
zvel = ((ps[j].GetActor()->getPrevOffsetZ() - pos.Z) * vel) / dist;
|
||||
|
||||
if (badguy(actor) && (actor->spr.hitag & face_player_smart))
|
||||
ang = actor->spr.angle + randomAngle(22.5 / 4) - DAngle22_5 / 8;
|
||||
ang = actor->spr.Angles.Yaw + randomAngle(22.5 / 4) - DAngle22_5 / 8;
|
||||
}
|
||||
|
||||
if (p < 0) aimed = nullptr;
|
||||
|
@ -681,7 +681,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
else if (ps[p].curr_weapon == TIT_WEAPON)
|
||||
{
|
||||
spawned->spr.extra >>= 2;
|
||||
spawned->spr.angle += DAngle22_5 / 8 - randomAngle(DAngle22_5 / 4);
|
||||
spawned->spr.Angles.Yaw += DAngle22_5 / 8 - randomAngle(DAngle22_5 / 4);
|
||||
spawned->vel.Z += 1 - krandf(2);
|
||||
|
||||
if (ps[p].hbomb_hold_delay)
|
||||
|
@ -772,7 +772,7 @@ static void shootwhip(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int at
|
|||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->clipdist = 1;
|
||||
|
||||
ang = actor->spr.angle + DAngle22_5/4 - randomAngle(DAngle22_5/2);
|
||||
ang = actor->spr.Angles.Yaw + DAngle22_5/4 - randomAngle(DAngle22_5/2);
|
||||
zvel = oldzvel + 2 - krandf(4);
|
||||
|
||||
scount--;
|
||||
|
@ -829,7 +829,7 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
else
|
||||
{
|
||||
p = -1;
|
||||
sang = actor->spr.angle;
|
||||
sang = actor->spr.Angles.Yaw;
|
||||
spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tileHeight(actor->spr.picnum) * 0.5) - 3);
|
||||
|
||||
if (badguy(actor))
|
||||
|
@ -876,7 +876,7 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
if (j)
|
||||
{
|
||||
j->vel.X = 2;
|
||||
j->spr.angle = actor->spr.angle;
|
||||
j->spr.Angles.Yaw = actor->spr.Angles.Yaw;
|
||||
j->spr.pos.Z -= 5;
|
||||
}
|
||||
break;
|
||||
|
@ -887,7 +887,7 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
if (j)
|
||||
{
|
||||
j->vel.X = 250 / 16.;
|
||||
j->spr.angle = actor->spr.angle;
|
||||
j->spr.Angles.Yaw = actor->spr.Angles.Yaw;
|
||||
j->spr.pos.Z -= 15;
|
||||
}
|
||||
break;
|
||||
|
@ -1467,7 +1467,7 @@ void checkweapons_r(player_struct* p)
|
|||
auto j = spawn(p->GetActor(), 7220);
|
||||
if (j)
|
||||
{
|
||||
j->spr.angle = p->angle.ang;
|
||||
j->spr.Angles.Yaw = p->angle.ang;
|
||||
j->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON];
|
||||
}
|
||||
p->OnMotorcycle = 0;
|
||||
|
@ -1486,7 +1486,7 @@ void checkweapons_r(player_struct* p)
|
|||
auto j = spawn(p->GetActor(), 7233);
|
||||
if (j)
|
||||
{
|
||||
j->spr.angle = p->angle.ang;
|
||||
j->spr.Angles.Yaw = p->angle.ang;
|
||||
j->saved_ammo = p->ammo_amount[BOAT_WEAPON];
|
||||
}
|
||||
p->OnBoat = 0;
|
||||
|
@ -2697,7 +2697,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
double hd = hits(p->GetActor());
|
||||
if (hd < 32)
|
||||
{
|
||||
spawned->spr.angle += DAngle180;
|
||||
spawned->spr.Angles.Yaw += DAngle180;
|
||||
spawned->vel *= 1./3.;
|
||||
}
|
||||
|
||||
|
@ -2909,7 +2909,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
if (j)
|
||||
{
|
||||
|
||||
j->spr.angle += DAngle180;
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
j->vel.X += 2.;
|
||||
j->spr.pos.Z += 3;
|
||||
ssp(j, CLIPMASK0);
|
||||
|
@ -3949,7 +3949,7 @@ void OnMotorcycle(player_struct *p, DDukeActor* motosprite)
|
|||
if (motosprite)
|
||||
{
|
||||
p->GetActor()->spr.pos.XY() = motosprite->spr.pos.XY();
|
||||
p->angle.ang = motosprite->spr.angle;
|
||||
p->angle.ang = motosprite->spr.Angles.Yaw;
|
||||
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo;
|
||||
motosprite->Destroy();
|
||||
}
|
||||
|
@ -4004,7 +4004,7 @@ void OffMotorcycle(player_struct *p)
|
|||
auto spawned = spawn(p->GetActor(), EMPTYBIKE);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spr.angle = p->angle.ang;
|
||||
spawned->spr.Angles.Yaw = p->angle.ang;
|
||||
spawned->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON];
|
||||
}
|
||||
}
|
||||
|
@ -4023,7 +4023,7 @@ void OnBoat(player_struct *p, DDukeActor* boat)
|
|||
if (boat)
|
||||
{
|
||||
p->GetActor()->spr.pos.XY() = boat->spr.pos.XY();
|
||||
p->angle.ang = boat->spr.angle;
|
||||
p->angle.ang = boat->spr.Angles.Yaw;
|
||||
p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo;
|
||||
boat->Destroy();
|
||||
}
|
||||
|
@ -4065,7 +4065,7 @@ void OffBoat(player_struct *p)
|
|||
auto spawned = spawn(p->GetActor(), EMPTYBOAT);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spr.angle = p->angle.ang;
|
||||
spawned->spr.Angles.Yaw = p->angle.ang;
|
||||
spawned->saved_ammo = p->ammo_amount[BOAT_WEAPON];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,15 +117,15 @@ void DoSpawn(player_struct *p, int snum)
|
|||
if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE2 ) )
|
||||
{
|
||||
// like shotgun shells
|
||||
j->spr.angle += DAngle180;
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
ssp(j,CLIPMASK0);
|
||||
j->spr.angle += DAngle180;
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
// p->kickback_pic++;
|
||||
}
|
||||
else if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE3 ) )
|
||||
{
|
||||
// like chaingun shells
|
||||
j->spr.angle += DAngle90;
|
||||
j->spr.Angles.Yaw += DAngle90;
|
||||
j->vel.X += 2.;
|
||||
j->spr.pos.Z += 3;
|
||||
ssp(j,CLIPMASK0);
|
||||
|
@ -365,7 +365,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
|
|||
double hd = hits(p->GetActor());
|
||||
if (hd < 32)
|
||||
{
|
||||
spawned->spr.angle += DAngle180;
|
||||
spawned->spr.Angles.Yaw += DAngle180;
|
||||
spawned->vel *= 1./3.;
|
||||
}
|
||||
|
||||
|
|
|
@ -584,7 +584,7 @@ void resetpspritevars(int g, const DVector3& startpos)
|
|||
I_Error("Too many player sprites (max 16.)");
|
||||
|
||||
po[numplayersprites].opos = act->spr.pos;
|
||||
po[numplayersprites].oa = act->spr.angle;
|
||||
po[numplayersprites].oa = act->spr.Angles.Yaw;
|
||||
po[numplayersprites].os = act->sector();
|
||||
|
||||
numplayersprites++;
|
||||
|
@ -626,7 +626,7 @@ void resetpspritevars(int g, const DVector3& startpos)
|
|||
act->SetOwner(act);
|
||||
|
||||
ps[j].setbobpos();
|
||||
ps[j].angle.oang = ps[j].angle.ang = act->spr.angle;
|
||||
ps[j].angle.oang = ps[j].angle.ang = act->spr.Angles.Yaw;
|
||||
|
||||
updatesector(act->spr.pos, &ps[j].cursector);
|
||||
|
||||
|
|
|
@ -915,7 +915,7 @@ static void handle_st25(sectortype* sptr, DDukeActor* actor)
|
|||
if (act3->spr.lotag == 15)
|
||||
{
|
||||
act3->sector()->lotag ^= 0x8000; // Toggle the open or close
|
||||
act3->spr.angle += DAngle180;
|
||||
act3->spr.Angles.Yaw += DAngle180;
|
||||
if (act3->temp_data[4]) callsound(act3->sector(), act3);
|
||||
callsound(act3->sector(), act3);
|
||||
if (act3->sector()->lotag & 0x8000) act3->temp_data[4] = 1;
|
||||
|
|
|
@ -651,7 +651,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
|
|||
if (spawned)
|
||||
{
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.angle = wal->delta().Angle() + DAngle90;
|
||||
spawned->spr.Angles.Yaw = wal->delta().Angle() + DAngle90;
|
||||
|
||||
S_PlayActorSound(SOMETHINGHITFORCE, spawned);
|
||||
}
|
||||
|
@ -997,7 +997,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
spawned->spr.pos.Z += 4;
|
||||
spawned->vel.X = 1;
|
||||
spawned->spr.scale = DVector2(0.375, 0.375);
|
||||
spawned->spr.angle = DAngle22_5 / 4 - randomAngle(22.5 / 2);
|
||||
spawned->spr.Angles.Yaw = DAngle22_5 / 4 - randomAngle(22.5 / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (targ->spr.picnum != TANK && !bossguy(targ) && targ->spr.picnum != RECON && targ->spr.picnum != ROTATEGUN)
|
||||
{
|
||||
if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
|
||||
targ->spr.angle = proj->spr.angle + DAngle180;
|
||||
targ->spr.Angles.Yaw = proj->spr.Angles.Yaw + DAngle180;
|
||||
|
||||
targ->vel.X = -proj->spr.extra * 0.25;
|
||||
auto sp = targ->sector();
|
||||
|
@ -1051,7 +1051,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
targ->attackertype = hitpic;
|
||||
targ->hitextra += proj->spr.extra;
|
||||
targ->hitang = proj->spr.angle;
|
||||
targ->hitang = proj->spr.Angles.Yaw;
|
||||
targ->SetHitOwner(Owner);
|
||||
}
|
||||
|
||||
|
@ -1120,8 +1120,8 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL)
|
||||
{
|
||||
proj->vel.X = targ->vel.X * 0.75;
|
||||
proj->spr.angle -= targ->spr.angle.Normalized180() * 2 + DAngle180;
|
||||
targ->spr.angle = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90;
|
||||
proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw.Normalized180() * 2 + DAngle180;
|
||||
targ->spr.Angles.Yaw = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90;
|
||||
if (S_CheckSoundPlaying(POOLBALLHIT) < 2)
|
||||
S_PlayActorSound(POOLBALLHIT, targ);
|
||||
}
|
||||
|
@ -1130,7 +1130,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (krand() & 3)
|
||||
{
|
||||
targ->vel.X = 10.25;
|
||||
targ->spr.angle = proj->spr.angle;
|
||||
targ->spr.Angles.Yaw = proj->spr.Angles.Yaw;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1222,7 +1222,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
lotsofglass(targ, nullptr, 40);
|
||||
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
lotsofglass(targ, nullptr, 8);
|
||||
targ->Destroy();
|
||||
break;
|
||||
|
@ -1235,7 +1235,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
for (j = 0; j < 48; j++)
|
||||
{
|
||||
fi.shoot(targ, BLOODSPLAT1);
|
||||
targ->spr.angle += DAngle1 * 58.5; // Was 333, which really makes no sense.
|
||||
targ->spr.Angles.Yaw += DAngle1 * 58.5; // Was 333, which really makes no sense.
|
||||
}
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
S_PlayActorSound(SQUISHED, targ);
|
||||
|
@ -1348,21 +1348,21 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
{
|
||||
targ->spr.extra -= proj->spr.extra;
|
||||
if (targ->spr.extra > 0) break;
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT1);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT2);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT3);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT4);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT1);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT2);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT3);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
fi.shoot(targ, BLOODSPLAT4);
|
||||
fi.guts(targ, JIBS1, 1, myconnectindex);
|
||||
fi.guts(targ, JIBS2, 2, myconnectindex);
|
||||
|
|
|
@ -892,7 +892,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
|
|||
{
|
||||
for (int j = n - 1; j >= 0; j--)
|
||||
{
|
||||
DAngle a = actor->spr.angle - DAngle45 + DAngle180 + randomAngle(90);
|
||||
DAngle a = actor->spr.Angles.Yaw - DAngle45 + DAngle180 + randomAngle(90);
|
||||
auto vel = krandf(4) + 2;
|
||||
auto zvel = 4 - krandf(4);
|
||||
|
||||
|
@ -917,7 +917,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
|
|||
double z = sect->floorz - krandf(abs(sect->ceilingz - sect->floorz));
|
||||
if (abs(z) > 32)
|
||||
z = actor->spr.pos.Z - 32 + krandf(64);
|
||||
DAngle a = actor->spr.angle - DAngle180;
|
||||
DAngle a = actor->spr.Angles.Yaw - DAngle180;
|
||||
auto vel = krandf(4) + 2;
|
||||
auto zvel = -krandf(4);
|
||||
|
||||
|
@ -1477,7 +1477,7 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj)
|
|||
spawned->spr.pos.Z += 4;
|
||||
spawned->vel.X = 1;
|
||||
spawned->spr.scale = DVector2(0.375, 0.375);
|
||||
spawned->spr.angle = DAngle22_5 / 4 - randomAngle(22.5 / 2);
|
||||
spawned->spr.Angles.Yaw = DAngle22_5 / 4 - randomAngle(22.5 / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1507,7 +1507,7 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj)
|
|||
targ->attackertype = proj->spr.picnum;
|
||||
targ->hitextra += proj->spr.extra;
|
||||
if (targ->spr.picnum != COW)
|
||||
targ->hitang = proj->spr.angle;
|
||||
targ->hitang = proj->spr.Angles.Yaw;
|
||||
targ->SetHitOwner(proj->GetOwner());
|
||||
}
|
||||
|
||||
|
@ -2029,7 +2029,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
break;
|
||||
case BOWLINGBALL:
|
||||
proj->vel.X = targ->vel.X * 0.75;
|
||||
if (krand() & 16) proj->spr.angle -= DAngle22_5 / 8;
|
||||
if (krand() & 16) proj->spr.Angles.Yaw -= DAngle22_5 / 8;
|
||||
S_PlayActorSound(355, targ);
|
||||
break;
|
||||
|
||||
|
@ -2042,23 +2042,23 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL)
|
||||
{
|
||||
proj->vel.X = targ->vel.X * 0.75;
|
||||
proj->spr.angle -= targ->spr.angle.Normalized180() * 2 + DAngle180;
|
||||
targ->spr.angle = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90;
|
||||
proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw.Normalized180() * 2 + DAngle180;
|
||||
targ->spr.Angles.Yaw = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90;
|
||||
if (S_CheckSoundPlaying(POOLBALLHIT) < 2)
|
||||
S_PlayActorSound(POOLBALLHIT, targ);
|
||||
}
|
||||
else if (proj->spr.picnum == BOWLINGPIN || proj->spr.picnum == BOWLINGPIN + 1)
|
||||
{
|
||||
proj->vel.X *= 0.75;
|
||||
proj->spr.angle -= targ->spr.angle * 2 + randomAngle(11.25);
|
||||
targ->spr.angle += randomAngle(22.5 / 8);
|
||||
proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw * 2 + randomAngle(11.25);
|
||||
targ->spr.Angles.Yaw += randomAngle(22.5 / 8);
|
||||
S_PlayActorSound(355, targ);
|
||||
}
|
||||
else if (proj->spr.picnum == HENSTAND || proj->spr.picnum == HENSTAND + 1)
|
||||
{
|
||||
proj->vel.X *= 0.75;
|
||||
proj->spr.angle -= targ->spr.angle * 2 + randomAngle(22.5 / 8);
|
||||
targ->spr.angle += randomAngle(22.5 / 8);
|
||||
proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw * 2 + randomAngle(22.5 / 8);
|
||||
targ->spr.Angles.Yaw += randomAngle(22.5 / 8);
|
||||
S_PlayActorSound(355, targ);
|
||||
}
|
||||
else
|
||||
|
@ -2066,7 +2066,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
if (krand() & 3)
|
||||
{
|
||||
targ->vel.X = 10.25;
|
||||
targ->spr.angle = proj->spr.angle;
|
||||
targ->spr.Angles.Yaw = proj->spr.Angles.Yaw;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -2139,7 +2139,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
lotsofglass(targ, nullptr, 40);
|
||||
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
targ->spr.angle = randomAngle();
|
||||
targ->spr.Angles.Yaw = randomAngle();
|
||||
lotsofglass(targ, nullptr, 8);
|
||||
targ->Destroy();
|
||||
break;
|
||||
|
|
|
@ -360,7 +360,7 @@ void S_GetCamera(DVector3* c, DAngle* ca, sectortype** cs)
|
|||
{
|
||||
if (c) *c = ud.cameraactor->spr.pos;
|
||||
if (cs) *cs = ud.cameraactor->sector();
|
||||
if (ca) *ca = ud.cameraactor->spr.angle;
|
||||
if (ca) *ca = ud.cameraactor->spr.Angles.Yaw;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, PClassActor*
|
|||
act->spr.shade = s_shd;
|
||||
if (!scale.isZero()) act->spr.scale = DVector2(scale.X, scale.Y);
|
||||
|
||||
act->spr.angle = s_ang;
|
||||
act->spr.Angles.Yaw = s_ang;
|
||||
act->vel.X = s_vel;
|
||||
act->vel.Z = s_zvel;
|
||||
act->backuploc();
|
||||
|
@ -313,7 +313,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act)
|
|||
act->timetosleep = 0;
|
||||
|
||||
if (actj)
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam)
|
|||
|
||||
act->spr.shade = -127;
|
||||
act->spr.cstat = CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
|
||||
act->vel.X = 8;
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
|
@ -400,7 +400,7 @@ void initfootprint(DDukeActor* actj, DDukeActor* act)
|
|||
|
||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
|
||||
if ((ps[actj->PlayerIndex()].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
act->spr.pos.Z = sect->floorz;
|
||||
|
@ -435,7 +435,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
|
|||
}
|
||||
else
|
||||
{
|
||||
ang = act->spr.angle;
|
||||
ang = act->spr.Angles.Yaw;
|
||||
act->spr.pos.Z = actj->spr.pos.Z - gs.playerheight + 3;
|
||||
}
|
||||
|
||||
|
@ -446,12 +446,12 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
|
|||
if (isNamWW2GI())
|
||||
{
|
||||
// to the right, with feeling
|
||||
act->spr.angle = ang + DAngle90;
|
||||
act->spr.Angles.Yaw = ang + DAngle90;
|
||||
act->vel.X = 1.875;
|
||||
}
|
||||
else
|
||||
{
|
||||
act->spr.angle = ang - DAngle90;
|
||||
act->spr.Angles.Yaw = ang - DAngle90;
|
||||
act->vel.X = 1.25;
|
||||
}
|
||||
|
||||
|
@ -850,7 +850,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
|
|||
act2->spr.lotag == SE_1_PIVOT &&
|
||||
act2->spr.hitag == actor->spr.hitag)
|
||||
{
|
||||
if (actor->spr.angle == DAngle90)
|
||||
if (actor->spr.Angles.Yaw == DAngle90)
|
||||
{
|
||||
actor->spr.pos.XY() = act2->spr.pos.XY();
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n)
|
|||
{
|
||||
for (j = n - 1; j >= 0; j--)
|
||||
{
|
||||
auto a = actor->spr.angle - DAngle45 + DAngle180 + randomAngle(90);
|
||||
auto a = actor->spr.Angles.Yaw - DAngle45 + DAngle180 + randomAngle(90);
|
||||
auto vel = krandf(4) + 2;
|
||||
auto zvel = 4 - krandf(4);
|
||||
|
||||
|
@ -1027,7 +1027,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n)
|
|||
double z = sect->floorz - krandf(abs(sect->ceilingz - sect->floorz));
|
||||
if (fabs(z) > 32)
|
||||
z = actor->spr.pos.Z - 32 + krandf(64);
|
||||
DAngle angl = actor->spr.angle - DAngle180;
|
||||
DAngle angl = actor->spr.Angles.Yaw - DAngle180;
|
||||
auto vel = krandf(4) + 2;
|
||||
auto zvel = 4 - krandf(4);
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
|
|||
if (abs(z) > 32)
|
||||
z = actor->spr.pos.Z - 32 + krandf(64);
|
||||
|
||||
DAngle a = actor->spr.angle - DAngle180;
|
||||
DAngle a = actor->spr.Angles.Yaw - DAngle180;
|
||||
auto vel = krandf(4) + 2;
|
||||
auto zvel = - krandf(8);
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
break;
|
||||
case TONGUE:
|
||||
if (actj)
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.pos.Z -= gs.playerheight;
|
||||
act->vel.Z = 1 - krandf(2);
|
||||
act->vel.X = 4 - krandf(8);
|
||||
|
@ -510,7 +510,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
act->temp_data[0] = krand() & 2047;
|
||||
act->spr.cstat = randomFlip();
|
||||
act->spr.scale = DVector2(0.125, 0.125);
|
||||
act->spr.angle = randomAngle();
|
||||
act->spr.Angles.Yaw = randomAngle();
|
||||
}
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
@ -535,7 +535,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
|
||||
if (actj)
|
||||
{
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.shade = -64;
|
||||
act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip();
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
if (act->spr.picnum == WATERBUBBLE)
|
||||
{
|
||||
if (actj)
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.scale = DVector2(0.0625, 0.0625);
|
||||
}
|
||||
else act->spr.scale = DVector2(0.5, 0.5);
|
||||
|
@ -739,7 +739,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
|
||||
if (act->spr.picnum == RAT)
|
||||
{
|
||||
act->spr.angle = randomAngle();
|
||||
act->spr.Angles.Yaw = randomAngle();
|
||||
act->spr.scale = DVector2(0.75, 0.75);
|
||||
act->spr.cstat = 0;
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case STEAM:
|
||||
if (actj)
|
||||
{
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
|
||||
act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE);
|
||||
act->vel.X = -0.5;
|
||||
|
|
|
@ -251,7 +251,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
break;
|
||||
case TONGUE:
|
||||
if (actj)
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.pos.Z -= gs.playerheight;
|
||||
act->vel.Z = 1 - krandf(2);
|
||||
act->vel.X = 4 - krandf(8);
|
||||
|
@ -484,7 +484,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
act->temp_data[0] = krand() & 2047;
|
||||
act->spr.cstat = randomFlip();
|
||||
act->spr.scale = DVector2(0.125, 0.125);
|
||||
act->spr.angle = randomAngle();
|
||||
act->spr.Angles.Yaw = randomAngle();
|
||||
}
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
@ -499,7 +499,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case SMALLSMOKE:
|
||||
if (actj)
|
||||
{
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.shade = -64;
|
||||
act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip();
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
if (act->spr.picnum == WATERBUBBLE)
|
||||
{
|
||||
if (actj)
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
double s = REPEAT_SCALE + (krand() & 7) * REPEAT_SCALE;
|
||||
act->spr.scale = DVector2(s, s);
|
||||
}
|
||||
|
@ -847,7 +847,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
|
||||
if (act->spr.picnum == RAT)
|
||||
{
|
||||
act->spr.angle = randomAngle();
|
||||
act->spr.Angles.Yaw = randomAngle();
|
||||
act->spr.scale = DVector2(0.75, 0.75);
|
||||
act->spr.cstat = 0;
|
||||
}
|
||||
|
@ -1103,7 +1103,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case STEAM:
|
||||
if (actj)
|
||||
{
|
||||
act->spr.angle = actj->spr.angle;
|
||||
act->spr.Angles.Yaw = actj->spr.Angles.Yaw;
|
||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
|
||||
act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE);
|
||||
act->vel.X = -0.5;
|
||||
|
|
|
@ -94,7 +94,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector
|
|||
pActor->clipdist = 2.5;
|
||||
pActor->spr.scale = DVector2(nScale, nScale);
|
||||
pActor->spr.picnum = 1;
|
||||
pActor->spr.angle = nullAngle;
|
||||
pActor->spr.Angles.Yaw = nullAngle;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->vel.X = 0;
|
||||
|
|
|
@ -61,7 +61,7 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, DA
|
|||
ChangeActorStat(ap, 101);
|
||||
|
||||
ap->spr.pos.Z = ap->sector()->floorz;
|
||||
nAngle = ap->spr.angle;
|
||||
nAngle = ap->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
ap->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -71,7 +71,7 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, DA
|
|||
ap->spr.picnum = 1;
|
||||
ap->spr.pal = ap->sector()->ceilingpal;
|
||||
ap->clipdist = 15;
|
||||
ap->spr.angle = nAngle;
|
||||
ap->spr.Angles.Yaw = nAngle;
|
||||
ap->spr.scale = DVector2(0.625, 0.625);
|
||||
ap->vel.X = 0;
|
||||
ap->vel.Y = 0;
|
||||
|
@ -179,7 +179,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
PlotCourseToSprite(ap, pTarget);
|
||||
|
||||
ap->vel.XY() = ap->spr.angle.ToVector() * 256;
|
||||
ap->vel.XY() = ap->spr.Angles.Yaw.ToVector() * 256;
|
||||
}
|
||||
|
||||
switch (move.type)
|
||||
|
@ -188,7 +188,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (move.actor() == pTarget)
|
||||
{
|
||||
auto nAngDiff = absangle(ap->spr.angle, (pTarget->spr.pos - ap->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(ap->spr.Angles.Yaw, (pTarget->spr.pos - ap->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
ap->nAction = 2;
|
||||
|
@ -201,7 +201,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
}
|
||||
case kHitWall:
|
||||
{
|
||||
ap->spr.angle += DAngle45;
|
||||
ap->spr.Angles.Yaw += DAngle45;
|
||||
ap->VelFromAngle(-2);
|
||||
break;
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
ap->vel.X = 0;
|
||||
ap->vel.Y = 0;
|
||||
ap->spr.angle = (pTarget->spr.pos - ap->spr.pos).Angle();
|
||||
ap->spr.Angles.Yaw = (pTarget->spr.pos - ap->spr.pos).Angle();
|
||||
|
||||
ap->nAction = 3;
|
||||
ap->nFrame = 0;
|
||||
|
@ -265,7 +265,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
ap->nAction = 1;
|
||||
|
||||
ap->vel.XY() = ap->spr.angle.ToVector() * 256;
|
||||
ap->vel.XY() = ap->spr.Angles.Yaw.ToVector() * 256;
|
||||
ap->nFrame = 0;
|
||||
}
|
||||
else
|
||||
|
@ -273,7 +273,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
// loc_25718:
|
||||
if (nFlag & 0x80)
|
||||
{
|
||||
BuildBullet(ap, 8, INT_MAX, ap->spr.angle, pTarget, 1);
|
||||
BuildBullet(ap, 8, INT_MAX, ap->spr.Angles.Yaw, pTarget, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ DExhumedActor* BuildBubble(const DVector3& pos, sectortype* pSector)
|
|||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.picnum = 1;
|
||||
pActor->spr.angle = inita;
|
||||
pActor->spr.Angles.Yaw = inita;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = -1200 / 256.;
|
||||
|
|
|
@ -247,7 +247,7 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo
|
|||
|
||||
if (nStat == kStatAnubisDrum)
|
||||
{
|
||||
auto nAngle = (pActor->spr.angle + DAngle22_5) - RandomAngle9();
|
||||
auto nAngle = (pActor->spr.Angles.Yaw + DAngle22_5) - RandomAngle9();
|
||||
|
||||
pHitActor->vel.XY() = nAngle.ToVector() * 2048;
|
||||
pHitActor->vel.Z = -(RandomSize(3) + 1);
|
||||
|
@ -434,7 +434,7 @@ MOVEEND:
|
|||
|
||||
HitInfo hit{};
|
||||
double dz = -pBullet->nPitch *2;
|
||||
hitscan(apos, pActor->sector(), DVector3(pActor->spr.angle.ToVector() * 1024, dz), hit, CLIPMASK1);
|
||||
hitscan(apos, pActor->sector(), DVector3(pActor->spr.Angles.Yaw.ToVector() * 1024, dz), hit, CLIPMASK1);
|
||||
pos = hit.hitpos;
|
||||
hitactor = hit.actor();
|
||||
pHitSect = hit.hitSector;
|
||||
|
@ -498,8 +498,8 @@ HITSPRITE:
|
|||
{
|
||||
if (pHitWall != nullptr)
|
||||
{
|
||||
pos.X -= pActor->spr.angle.Cos() * 0.5;
|
||||
pos.Y -= pActor->spr.angle.Sin() * 0.5;
|
||||
pos.X -= pActor->spr.Angles.Yaw.Cos() * 0.5;
|
||||
pos.Y -= pActor->spr.Angles.Yaw.Sin() * 0.5;
|
||||
|
||||
if (nType != 3 || RandomSize(2) == 0)
|
||||
{
|
||||
|
@ -573,7 +573,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA
|
|||
sBullet.nDoubleDamage = nDoubleDamage;
|
||||
|
||||
sBullet.pActor = insertActor(pActor->sector(), 200);
|
||||
sBullet.pActor->spr.angle = nAngle;
|
||||
sBullet.pActor->spr.Angles.Yaw = nAngle;
|
||||
|
||||
double nHeight = GetActorHeight(pTarget);
|
||||
|
||||
|
@ -639,7 +639,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA
|
|||
pBulletActor->spr.scale = DVector2(nRepeat * REPEAT_SCALE, nRepeat * REPEAT_SCALE);
|
||||
pBulletActor->spr.xoffset = 0;
|
||||
pBulletActor->spr.yoffset = 0;
|
||||
pBulletActor->spr.angle = nAngle;
|
||||
pBulletActor->spr.Angles.Yaw = nAngle;
|
||||
pBulletActor->vel.X = 0;
|
||||
pBulletActor->vel.Y = 0;
|
||||
pBulletActor->vel.Z = 0;
|
||||
|
@ -748,7 +748,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA
|
|||
xy -= pBulletActor->spr.pos.XY();
|
||||
|
||||
nAngle = xy.Angle();
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -672,7 +672,7 @@ std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
|||
{
|
||||
auto pPlayerActor = PlayerList[nLocalPlayer].pActor;
|
||||
if (!pPlayerActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(pPlayerActor->spr.pos, pPlayerActor->spr.angle);
|
||||
return std::make_pair(pPlayerActor->spr.pos, pPlayerActor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
void Serialize(FSerializer& arc) override;
|
||||
void VelFromAngle(int shift = 0)
|
||||
{
|
||||
vel.XY() = spr.angle.ToVector() * (1 << (10 + shift));
|
||||
vel.XY() = spr.Angles.Yaw.ToVector() * (1 << (10 + shift));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
}
|
||||
else
|
||||
{
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
ChangeActorStat(pActor, 103);
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->spr.lotag = runlist_HeadRun() + 1;
|
||||
pActor->spr.hitag = 0;
|
||||
pActor->spr.extra = -1;
|
||||
|
@ -210,7 +210,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
|
||||
void IdleFish(DExhumedActor* pActor, int edx)
|
||||
{
|
||||
pActor->spr.angle += DAngle180 + DAngle45 - RandomAngle9();
|
||||
pActor->spr.Angles.Yaw += DAngle180 + DAngle45 - RandomAngle9();
|
||||
pActor->norm_ang();
|
||||
|
||||
pActor->VelFromAngle(-8);
|
||||
|
@ -426,7 +426,7 @@ void AIFish::Tick(RunListEvent* ev)
|
|||
|
||||
if (z <= nHeight)
|
||||
{
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * (32 - 8);
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (32 - 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -506,7 +506,7 @@ void AIFish::Tick(RunListEvent* ev)
|
|||
if (pHitAct->spr.statnum == 100)
|
||||
{
|
||||
pActor->pTarget = coll.actor();
|
||||
pActor->spr.angle = (pHitAct->spr.pos - pActor->spr.pos).Angle();
|
||||
pActor->spr.Angles.Yaw = (pHitAct->spr.pos - pActor->spr.pos).Angle();
|
||||
|
||||
if (nAction != 3)
|
||||
{
|
||||
|
|
|
@ -71,18 +71,18 @@ void ThrowGrenade(int nPlayer, double dz, double push1)
|
|||
DExhumedActor* pActor = PlayerList[nPlayer].pPlayerGrenade;
|
||||
auto pPlayerActor = PlayerList[nPlayer].pActor;
|
||||
|
||||
DAngle nAngle = pPlayerActor->spr.angle;
|
||||
DAngle nAngle = pPlayerActor->spr.Angles.Yaw;
|
||||
|
||||
ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect);
|
||||
|
||||
pActor->spr.pos = pPlayerActor->spr.pos;
|
||||
|
||||
if (nAngle < nullAngle) {
|
||||
nAngle = pPlayerActor->spr.angle;
|
||||
nAngle = pPlayerActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
|
||||
if (push1 <= 23.4375)
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ void BuildGrenade(int nPlayer)
|
|||
pActor->clipdist = 7.5;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = pPlayerActor->spr.angle;
|
||||
pActor->spr.Angles.Yaw = pPlayerActor->spr.Angles.Yaw;
|
||||
pActor->spr.intowner = nPlayer;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
|
@ -200,7 +200,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
|
|||
if (pActor->nTurn < 0)
|
||||
{
|
||||
auto pPlayerActor = PlayerList[nPlayer].pActor;
|
||||
auto nAngle = pPlayerActor->spr.angle;
|
||||
auto nAngle = pPlayerActor->spr.Angles.Yaw;
|
||||
|
||||
DVector2 vect = nAngle.ToVector() * 32;
|
||||
pActor->spr.pos = pPlayerActor->spr.pos + vect;
|
||||
|
@ -363,7 +363,7 @@ void AIGrenade::Tick(RunListEvent* ev)
|
|||
}
|
||||
else if (nMov.type == kHitSprite)
|
||||
{
|
||||
BounceGrenade(pActor, nMov.actor()->spr.angle);
|
||||
BounceGrenade(pActor, nMov.actor()->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
pActor->nHealth = 0;
|
||||
|
|
|
@ -306,7 +306,7 @@ Collision CheckCloseRange(int nPlayer, DVector3& pos, sectortype* *ppSector)
|
|||
auto pActor = PlayerList[nPlayer].pActor;
|
||||
|
||||
HitInfo hit{};
|
||||
hitscan(pos, *ppSector, DVector3(pActor->spr.angle.ToVector() * 1024, 0 ), hit, CLIPMASK1);
|
||||
hitscan(pos, *ppSector, DVector3(pActor->spr.Angles.Yaw.ToVector() * 1024, 0 ), hit, CLIPMASK1);
|
||||
|
||||
const double ecx = 56.84; // bsin(150, -3)
|
||||
double sqrtNum = (hit.hitpos.XY() - pos.XY()).LengthSquared();
|
||||
|
@ -702,7 +702,7 @@ loc_flag:
|
|||
}
|
||||
|
||||
int nAmmoType = WeaponInfo[nWeapon].nAmmoType;
|
||||
DAngle nAngle = pPlayerActor->spr.angle;
|
||||
DAngle nAngle = pPlayerActor->spr.Angles.Yaw;
|
||||
auto thePos = pPlayerActor->spr.pos;
|
||||
|
||||
double nHeight = GetActorHeight(pPlayerActor) * -0.5;
|
||||
|
@ -844,7 +844,7 @@ loc_flag:
|
|||
// only autoaim if target is in front of the player.
|
||||
assert(t->sector());
|
||||
DAngle angletotarget = (t->spr.pos - pPlayerActor->spr.pos).Angle();
|
||||
DAngle anglediff = absangle(pPlayerActor->spr.angle, angletotarget);
|
||||
DAngle anglediff = absangle(pPlayerActor->spr.Angles.Yaw, angletotarget);
|
||||
if (anglediff < DAngle90)
|
||||
{
|
||||
target = t;
|
||||
|
@ -866,7 +866,7 @@ loc_flag:
|
|||
BuildSnake(nPlayer, nHeight);
|
||||
nQuake[nPlayer] = 2.;
|
||||
|
||||
PlayerList[nPlayer].nThrust -= pPlayerActor->spr.angle.ToVector() * 2;
|
||||
PlayerList[nPlayer].nThrust -= pPlayerActor->spr.Angles.Yaw.ToVector() * 2;
|
||||
break;
|
||||
}
|
||||
case kWeaponRing:
|
||||
|
|
|
@ -650,7 +650,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag)
|
|||
}
|
||||
case 88:
|
||||
{
|
||||
AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.angle);
|
||||
AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.Angles.Yaw);
|
||||
|
||||
DeleteActor(pActor);
|
||||
return;
|
||||
|
@ -665,7 +665,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag)
|
|||
}
|
||||
case 78:
|
||||
{
|
||||
AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.angle);
|
||||
AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.Angles.Yaw);
|
||||
|
||||
auto pSector = pActor->sector();
|
||||
pSector->Flag |= 0x8000;
|
||||
|
|
|
@ -106,7 +106,7 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
else
|
||||
{
|
||||
pSector = pActor->sector();
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
pActor->spr.pos.Z = pSector->floorz;
|
||||
|
||||
ChangeActorStat(pActor, 118);
|
||||
|
@ -123,7 +123,7 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->spr.hitag = 0;
|
||||
pActor->spr.lotag = runlist_HeadRun() + 1;
|
||||
|
||||
|
@ -284,7 +284,7 @@ void AILavaDude::Tick(RunListEvent* ev)
|
|||
ChangeActorSect(pActor, pSector);
|
||||
pActor->spr.pos = pos;
|
||||
|
||||
pActor->spr.angle += DAngle180 + mapangle(RandomWord() & 0x3FF);
|
||||
pActor->spr.Angles.Yaw += DAngle180 + mapangle(RandomWord() & 0x3FF);
|
||||
pActor->VelFromAngle();
|
||||
break;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ void AILavaDude::Tick(RunListEvent* ev)
|
|||
|
||||
if (coll.type == kHitWall)
|
||||
{
|
||||
pActor->spr.angle += DAngle180 + mapangle(RandomWord() & 0x3FF);
|
||||
pActor->spr.Angles.Yaw += DAngle180 + mapangle(RandomWord() & 0x3FF);
|
||||
pActor->VelFromAngle();
|
||||
break;
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ void AILavaDude::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (coll.actor() == pTarget)
|
||||
{
|
||||
auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
pActor->nAction = 2;
|
||||
|
@ -342,7 +342,7 @@ void AILavaDude::Tick(RunListEvent* ev)
|
|||
{
|
||||
if ((nFlag & 0x80) && pTarget)
|
||||
{
|
||||
BuildBullet(pActor, 10, INT_MAX, pActor->spr.angle, pTarget, 1);
|
||||
BuildBullet(pActor, 10, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
|
||||
}
|
||||
else if (var_1C)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
{
|
||||
ChangeActorStat(pActor, 104);
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -63,7 +63,7 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
|
@ -167,7 +167,7 @@ void AILion::Damage(RunListEvent* ev)
|
|||
PlotCourseToSprite(pActor, pTarget);
|
||||
pActor->nAction = 5;
|
||||
pActor->nCount = RandomSize(3);
|
||||
pActor->spr.angle += mapangle((- (RandomSize(1) << 8)) + (RandomSize(1) << 8)); // NOTE: no angle mask in original code
|
||||
pActor->spr.Angles.Yaw += mapangle((- (RandomSize(1) << 8)) + (RandomSize(1) << 8)); // NOTE: no angle mask in original code
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -249,7 +249,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (RandomBit())
|
||||
{
|
||||
pActor->spr.angle = RandomAngle();
|
||||
pActor->spr.Angles.Yaw = RandomAngle();
|
||||
pActor->VelFromAngle(-1);
|
||||
}
|
||||
else
|
||||
|
@ -273,18 +273,18 @@ void AILion::Tick(RunListEvent* ev)
|
|||
|
||||
if (pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)
|
||||
{
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * 2048;
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 2048;
|
||||
}
|
||||
else
|
||||
{
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * 512;
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512;
|
||||
}
|
||||
}
|
||||
|
||||
if (nMov.type == kHitWall)
|
||||
{
|
||||
// loc_378FA:
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-1);
|
||||
break;
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
}
|
||||
else
|
||||
{
|
||||
auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
pActor->nAction = 3;
|
||||
|
@ -314,7 +314,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
else
|
||||
{
|
||||
// loc_378FA:
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-1);
|
||||
break;
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
|
||||
double nCheckDist = 0x7FFFFFFF;
|
||||
|
||||
DAngle nAngle = pActor->spr.angle;
|
||||
DAngle nAngle = pActor->spr.Angles.Yaw;
|
||||
DAngle nScanAngle = (nAngle - DAngle90).Normalized360();
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
|
@ -396,10 +396,10 @@ void AILion::Tick(RunListEvent* ev)
|
|||
nScanAngle += DAngle45;
|
||||
}
|
||||
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
|
||||
pActor->nAction = 6;
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * (1024 - 128);
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (1024 - 128);
|
||||
D3PlayFX(StaticSound[kSound24], pActor);
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
if (nMov.type == kHitWall)
|
||||
{
|
||||
pActor->nAction = 7;
|
||||
pActor->spr.angle = (GetWallNormal(nMov.hitWall) + DAngle180).Normalized360();
|
||||
pActor->spr.Angles.Yaw = (GetWallNormal(nMov.hitWall) + DAngle180).Normalized360();
|
||||
pActor->nCount = RandomSize(4);
|
||||
return;
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (nMov.actor() == pTarget)
|
||||
{
|
||||
auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
pActor->nAction = 3;
|
||||
|
@ -436,7 +436,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
else
|
||||
{
|
||||
// loc_378FA:
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-1);
|
||||
break;
|
||||
}
|
||||
|
@ -458,13 +458,13 @@ void AILion::Tick(RunListEvent* ev)
|
|||
}
|
||||
else
|
||||
{
|
||||
pActor->spr.angle += RandomAngle9() + DAngle45 + DAngle90;
|
||||
pActor->spr.Angles.Yaw += RandomAngle9() + DAngle45 + DAngle90;
|
||||
}
|
||||
|
||||
pActor->vel.Z = -1000 / 256.;
|
||||
|
||||
pActor->nAction = 6;
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * (1024 - 128);
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (1024 - 128);
|
||||
D3PlayFX(StaticSound[kSound24], pActor);
|
||||
}
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ Collision MoveCreatureWithCaution(DExhumedActor* pActor)
|
|||
|
||||
ChangeActorSect(pActor, pSectorPre);
|
||||
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-2);
|
||||
Collision c;
|
||||
c.setNone();
|
||||
|
@ -604,7 +604,7 @@ double PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
|
|||
return -1;
|
||||
|
||||
auto vect = pActor2->spr.pos.XY() - pActor1->spr.pos.XY();
|
||||
pActor1->spr.angle = vect.Angle();
|
||||
pActor1->spr.Angles.Yaw = vect.Angle();
|
||||
return vect.Length();
|
||||
|
||||
}
|
||||
|
@ -944,7 +944,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
|
|||
*/
|
||||
auto pActor = PlayerList[nLocalPlayer].pActor;
|
||||
initpos = pActor->spr.pos;
|
||||
inita = pActor->spr.angle;
|
||||
inita = pActor->spr.Angles.Yaw;
|
||||
initsectp = pActor->sector();
|
||||
}
|
||||
|
||||
|
@ -995,7 +995,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol
|
|||
if (pActor2 == nullptr)
|
||||
{
|
||||
pActor->pitch = nullAngle;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1005,7 +1005,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol
|
|||
double nSqrt = vect.Length();
|
||||
DAngle nPitch = VecToAngle(nSqrt, (pActor2->spr.pos.Z - nHeight - pActor->spr.pos.Z) / 16.);
|
||||
|
||||
DAngle nAngDelta = deltaangle(pActor->spr.angle, nMyAngle);
|
||||
DAngle nAngDelta = deltaangle(pActor->spr.Angles.Yaw, nMyAngle);
|
||||
|
||||
if (abs(nAngDelta) >= DAngle22_5 / 2)
|
||||
{
|
||||
|
@ -1019,12 +1019,12 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol
|
|||
}
|
||||
|
||||
nAngDelta = clamp(nAngDelta, -push1, push1);
|
||||
nAngle = (nAngDelta + pActor->spr.angle).Normalized360();
|
||||
nAngle = (nAngDelta + pActor->spr.Angles.Yaw).Normalized360();
|
||||
auto nPitchDelta = clamp(deltaangle(pActor->pitch, nPitch), -DAngle22_5 / 5, DAngle22_5 / 5);
|
||||
pActor->pitch = (pActor->pitch + nPitchDelta).Normalized180();
|
||||
}
|
||||
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
|
||||
auto cospitch = pActor->pitch.Cos();
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ DVector3 WheresMyMouth(int nPlayer, sectortype **sectnum)
|
|||
*sectnum = pActor->sector();
|
||||
auto pos = pActor->spr.pos.plusZ(-height);
|
||||
|
||||
auto vect = pActor->spr.angle.ToVector() * 8;
|
||||
auto vect = pActor->spr.Angles.Yaw.ToVector() * 8;
|
||||
|
||||
Collision scratch;
|
||||
clipmove(pos, sectnum, vect, 320, 5., 5., CLIPMASK1, scratch);
|
||||
|
@ -1282,7 +1282,7 @@ void AICreatureChunk::Tick(RunListEvent* ev)
|
|||
}
|
||||
else if (nVal.type == kHitSprite)
|
||||
{
|
||||
nAngle = nVal.actor()->spr.angle;
|
||||
nAngle = nVal.actor()->spr.Angles.Yaw;
|
||||
}
|
||||
else if (nVal.type == kHitWall)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
}
|
||||
else
|
||||
{
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
ChangeActorStat(pActor, 102);
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->spr.picnum = 1;
|
||||
pActor->spr.hitag = 0;
|
||||
pActor->spr.lotag = runlist_HeadRun() + 1;
|
||||
|
@ -274,7 +274,7 @@ void AIMummy::Tick(RunListEvent* ev)
|
|||
{
|
||||
case kHitWall:
|
||||
{
|
||||
pActor->spr.angle += DAngle180 + mapangle(RandomWord() & 0x3FF);
|
||||
pActor->spr.Angles.Yaw += DAngle180 + mapangle(RandomWord() & 0x3FF);
|
||||
pActor->VelFromAngle(-2);
|
||||
return;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ void AIMummy::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (nMov.actor() == pTarget)
|
||||
{
|
||||
auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
pActor->nAction = 2;
|
||||
|
@ -337,7 +337,7 @@ void AIMummy::Tick(RunListEvent* ev)
|
|||
SetQuake(pActor, 100);
|
||||
|
||||
// low 16 bits of returned var contains the sprite index, the high 16 the bullet number
|
||||
auto pBullet = BuildBullet(pActor, 9, -60, pActor->spr.angle, pTarget, 1);
|
||||
auto pBullet = BuildBullet(pActor, 9, -60, pActor->spr.Angles.Yaw, pTarget, 1);
|
||||
CheckMummyRevive(pActor);
|
||||
|
||||
if (pBullet)
|
||||
|
|
|
@ -1338,12 +1338,12 @@ void AITrap::Tick(RunListEvent* ev)
|
|||
return;
|
||||
}
|
||||
|
||||
auto pBullet = BuildBullet(pActor, nType, 0, pActor->spr.angle, nullptr, 1);
|
||||
auto pBullet = BuildBullet(pActor, nType, 0, pActor->spr.Angles.Yaw, nullptr, 1);
|
||||
if (pBullet)
|
||||
{
|
||||
if (nType == 15)
|
||||
{
|
||||
pBullet->spr.angle -= DAngle90;
|
||||
pBullet->spr.Angles.Yaw -= DAngle90;
|
||||
D3PlayFX(StaticSound[kSound32], pBullet);
|
||||
}
|
||||
else
|
||||
|
@ -1419,7 +1419,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal)
|
|||
}
|
||||
else
|
||||
{
|
||||
auto nAngle = pActor->spr.angle + DAngle22_5 - RandomAngle9();
|
||||
auto nAngle = pActor->spr.Angles.Yaw + DAngle22_5 - RandomAngle9();
|
||||
|
||||
if (nVal)
|
||||
{
|
||||
|
@ -1554,7 +1554,7 @@ void DoFinale()
|
|||
{
|
||||
if (!(dword_96788 & 2))
|
||||
{
|
||||
pFinaleSpr->spr.angle = RandomAngle();
|
||||
pFinaleSpr->spr.Angles.Yaw = RandomAngle();
|
||||
BuildSpark(pFinaleSpr, 1);
|
||||
}
|
||||
|
||||
|
@ -1739,7 +1739,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
|
|||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
pActor->spr.angle = RandomAngle();
|
||||
pActor->spr.Angles.Yaw = RandomAngle();
|
||||
BuildSpark(pActor, 1); // shoot out blue orbs
|
||||
}
|
||||
|
||||
|
@ -1811,7 +1811,7 @@ void AIEnergyBlock::Damage(RunListEvent* ev)
|
|||
|
||||
auto pActor2 = insertActor(lasthitsect, 0);
|
||||
|
||||
pActor2->spr.angle = mapangle(ev->nParam);
|
||||
pActor2->spr.Angles.Yaw = mapangle(ev->nParam);
|
||||
pActor2->spr.pos = lasthit;
|
||||
|
||||
BuildSpark(pActor2, 0); // shoot out blue orb when damaged
|
||||
|
|
|
@ -293,8 +293,8 @@ void RestartPlayer(int nPlayer)
|
|||
|
||||
pActor->spr.pos = nNStartSprite->spr.pos;
|
||||
ChangeActorSect(pActor, nNStartSprite->sector());
|
||||
plr->angle.ang = nNStartSprite->spr.angle;
|
||||
pActor->spr.angle = plr->angle.ang;
|
||||
plr->angle.ang = nNStartSprite->spr.Angles.Yaw;
|
||||
pActor->spr.Angles.Yaw = plr->angle.ang;
|
||||
|
||||
floorsprt = insertActor(pActor->sector(), 0);
|
||||
|
||||
|
@ -308,7 +308,7 @@ void RestartPlayer(int nPlayer)
|
|||
pActor->spr.pos.XY() = plr->sPlayerSave.pos.XY();
|
||||
pActor->spr.pos.Z = plr->sPlayerSave.pSector->floorz;
|
||||
plr->angle.ang = plr->sPlayerSave.nAngle;
|
||||
pActor->spr.angle = plr->angle.ang;
|
||||
pActor->spr.Angles.Yaw = plr->angle.ang;
|
||||
|
||||
floorsprt = nullptr;
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ void RestartPlayer(int nPlayer)
|
|||
pDActor->spr.xoffset = 0;
|
||||
pDActor->spr.yoffset = 0;
|
||||
pDActor->spr.shade = pActor->spr.shade;
|
||||
pDActor->spr.angle = pActor->spr.angle;
|
||||
pDActor->spr.Angles.Yaw = pActor->spr.Angles.Yaw;
|
||||
pDActor->spr.cstat = pActor->spr.cstat;
|
||||
|
||||
pDActor->spr.lotag = runlist_HeadRun() + 1;
|
||||
|
@ -665,7 +665,7 @@ static void pickupMessage(int no)
|
|||
void UpdatePlayerSpriteAngle(Player* pPlayer)
|
||||
{
|
||||
inita = pPlayer->angle.ang;
|
||||
if (pPlayer->pActor) pPlayer->pActor->spr.angle = inita;
|
||||
if (pPlayer->pActor) pPlayer->pActor->spr.Angles.Yaw = inita;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -847,7 +847,7 @@ bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectort
|
|||
{
|
||||
if ((sect->hitag == 45) && bTouchFloor)
|
||||
{
|
||||
auto nDiff = absangle(nNormal, pPlayerActor->spr.angle + DAngle180);
|
||||
auto nDiff = absangle(nNormal, pPlayerActor->spr.Angles.Yaw + DAngle180);
|
||||
|
||||
if (nDiff <= DAngle45)
|
||||
{
|
||||
|
@ -1073,7 +1073,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
{
|
||||
auto ang = GetAngleToSprite(pPlayerActor, pSpiritSprite);
|
||||
PlayerList[nPlayer].angle.settarget(ang, true);
|
||||
pPlayerActor->spr.angle = ang;
|
||||
pPlayerActor->spr.Angles.Yaw = ang;
|
||||
|
||||
PlayerList[nPlayer].horizon.settarget(nullAngle, true);
|
||||
|
||||
|
@ -1360,7 +1360,7 @@ sectdone:
|
|||
HitInfo near;
|
||||
|
||||
// neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value.
|
||||
neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.angle, near, 128., NT_Hitag | NT_NoSpriteCheck);
|
||||
neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.Angles.Yaw, near, 128., NT_Hitag | NT_NoSpriteCheck);
|
||||
|
||||
DExhumedActor* pActorB;
|
||||
feebtag(pPlayerActor->spr.pos, pPlayerActor->sector(), &pActorB, var_30, 48);
|
||||
|
@ -2258,7 +2258,7 @@ sectdone:
|
|||
ChangeActorStat(pActorB, 899);
|
||||
}
|
||||
|
||||
SetSavePoint(nPlayer, pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.angle);
|
||||
SetSavePoint(nPlayer, pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.Angles.Yaw);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2602,7 +2602,7 @@ sectdone:
|
|||
{
|
||||
initpos = pPlayerActor->spr.pos;
|
||||
initsectp = pPlayerActor->sector();
|
||||
inita = pPlayerActor->spr.angle;
|
||||
inita = pPlayerActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
if (!PlayerList[nPlayer].nHealth)
|
||||
|
@ -2647,7 +2647,7 @@ sectdone:
|
|||
|
||||
if (pPlayerActor->sector()->pAbove != nullptr)
|
||||
{
|
||||
pDopple->spr.angle = pPlayerActor->spr.angle;
|
||||
pDopple->spr.Angles.Yaw = pPlayerActor->spr.Angles.Yaw;
|
||||
ChangeActorSect(pDopple, pPlayerActor->sector()->pAbove);
|
||||
pDopple->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
}
|
||||
|
@ -2814,7 +2814,7 @@ DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater)
|
|||
DEFINE_ACTION_FUNCTION(_ExhumedPlayer, GetAngle)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(Player);
|
||||
ACTION_RETURN_INT(self->pActor->spr.angle.Buildang());
|
||||
ACTION_RETURN_INT(self->pActor->spr.Angles.Yaw.Buildang());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ void DestroyAllEggs()
|
|||
|
||||
void SetHeadVel(DExhumedActor* pActor)
|
||||
{
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * 1024 * (1 << nVelShift);
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 1024 * (1 << nVelShift);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -324,7 +324,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr
|
|||
if (pActor2 == nullptr)
|
||||
{
|
||||
pActor->pitch = nullAngle;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr
|
|||
|
||||
DAngle nMyAngle = vect.Angle();
|
||||
DAngle nPitch = VecToAngle(nSqrt * 16, edx);
|
||||
DAngle nAngDelta = deltaangle(pActor->spr.angle, nMyAngle);
|
||||
DAngle nAngDelta = deltaangle(pActor->spr.Angles.Yaw, nMyAngle);
|
||||
|
||||
if (abs(nAngDelta) >= DAngle22_5)
|
||||
{
|
||||
|
@ -353,13 +353,13 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr
|
|||
nAngDelta = val2;
|
||||
}
|
||||
|
||||
nAngle = (nAngDelta + pActor->spr.angle).Normalized360();
|
||||
nAngle = (nAngDelta + pActor->spr.Angles.Yaw).Normalized360();
|
||||
|
||||
auto nPitchDelta = clamp(deltaangle(pActor->pitch, nPitch), -DAngle22_5 / 5, DAngle22_5 / 5);
|
||||
pActor->pitch = (pActor->pitch + nPitchDelta).Normalized180();
|
||||
}
|
||||
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
|
||||
auto cospitch = pActor->pitch.Cos();
|
||||
|
||||
|
@ -472,13 +472,13 @@ void BuildQueenEgg(int nQueen, int nVal)
|
|||
pActor2->spr.yoffset = 0;
|
||||
pActor2->spr.shade = -12;
|
||||
pActor2->spr.picnum = 1;
|
||||
pActor2->spr.angle = pActor->spr.angle + RandomAngle9() - DAngle45;
|
||||
pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw + RandomAngle9() - DAngle45;
|
||||
pActor2->backuppos();
|
||||
|
||||
if (!nVal)
|
||||
{
|
||||
pActor2->spr.scale = DVector2(0.46875, 0.46875);
|
||||
pActor2->vel.XY() = pActor2->spr.angle.ToVector() * 1024;
|
||||
pActor2->vel.XY() = pActor2->spr.Angles.Yaw.ToVector() * 1024;
|
||||
pActor2->vel.Z = -6000 / 256.;
|
||||
pActor2->spr.cstat = 0;
|
||||
}
|
||||
|
@ -604,12 +604,12 @@ void AIQueenEgg::Tick(RunListEvent* ev)
|
|||
nAngle = GetWallNormal(nMov.hitWall);
|
||||
break;
|
||||
case kHitSprite:
|
||||
nAngle = nMov.actor()->spr.angle;
|
||||
nAngle = nMov.actor()->spr.Angles.Yaw;
|
||||
break;
|
||||
}
|
||||
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * 512;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -639,7 +639,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
|
|||
}
|
||||
[[fallthrough]];
|
||||
case kHitWall:
|
||||
pActor->spr.angle = DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->spr.Angles.Yaw = DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->VelFromAngle(-3);
|
||||
pActor->vel.Z = (-RandomSize(5)) / 256.;
|
||||
break;
|
||||
|
@ -664,7 +664,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
|
|||
pEgg->nCounter--;
|
||||
if (pEgg->nCounter <= 0)
|
||||
{
|
||||
auto pWaspSprite = BuildWasp(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.angle, true);
|
||||
auto pWaspSprite = BuildWasp(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.Angles.Yaw, true);
|
||||
pActor->spr.pos.Z = pWaspSprite->spr.pos.Z;
|
||||
|
||||
DestroyEgg(nEgg);
|
||||
|
@ -753,7 +753,7 @@ void BuildQueenHead(int nQueen)
|
|||
pActor2->spr.pal = 0;
|
||||
pActor2->spr.xoffset = 0;
|
||||
pActor2->spr.yoffset = 0;
|
||||
pActor2->spr.angle = pActor->spr.angle;
|
||||
pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw;
|
||||
|
||||
nVelShift = 2;
|
||||
SetHeadVel(pActor2);
|
||||
|
@ -851,11 +851,11 @@ void AIQueenHead::Tick(RunListEvent* ev)
|
|||
auto nMov = MoveCreature(pActor);
|
||||
|
||||
// original BUG - this line doesn't exist in original code?
|
||||
DAngle nNewAng = pActor->spr.angle;
|
||||
DAngle nNewAng = pActor->spr.Angles.Yaw;
|
||||
|
||||
if (nMov.exbits == 0)
|
||||
{
|
||||
if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.angle;
|
||||
if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.Angles.Yaw;
|
||||
else if (nMov.type == kHitWall) nNewAng = GetWallNormal(nMov.hitWall);
|
||||
}
|
||||
else if (nMov.exbits == kHitAux2)
|
||||
|
@ -870,7 +870,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
|
|||
}
|
||||
|
||||
// original BUG - var_18 isn't being set if the check above == 0x20000 ?
|
||||
pActor->spr.angle = nNewAng;
|
||||
pActor->spr.Angles.Yaw = nNewAng;
|
||||
nVelShift++;
|
||||
|
||||
if (nVelShift < 5)
|
||||
|
@ -945,7 +945,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
|
|||
runlist_DamageEnemy(pTarget, pActor, 10);
|
||||
D3PlayFX(StaticSound[kSoundQTail] | 0x2000, pActor);
|
||||
|
||||
pActor->spr.angle += DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->spr.Angles.Yaw += DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->norm_ang();
|
||||
|
||||
pActor->vel.Z = ((-20) - RandomSize(6)) / 256.;
|
||||
|
@ -960,7 +960,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
|
|||
MoveQP[nQHead] = pActor->spr.pos;
|
||||
assert(pActor->sector());
|
||||
MoveQS[nQHead] = pActor->sector();
|
||||
MoveQA[nQHead] = pActor->spr.angle;
|
||||
MoveQA[nQHead] = pActor->spr.Angles.Yaw;
|
||||
|
||||
nHd = nQHead;
|
||||
|
||||
|
@ -983,7 +983,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
|
|||
}
|
||||
|
||||
pTActor->spr.pos = MoveQP[nHd];
|
||||
pTActor->spr.angle = MoveQA[nHd];
|
||||
pTActor->spr.Angles.Yaw = MoveQA[nHd];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
{
|
||||
ChangeActorStat(pActor, 121);
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -1182,7 +1182,7 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.picnum = 1;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
|
@ -1363,7 +1363,7 @@ void AIQueen::Tick(RunListEvent* ev)
|
|||
}
|
||||
[[fallthrough]];
|
||||
case 0x8000:
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->norm_ang();
|
||||
|
||||
SetQueenSpeed(pActor, si);
|
||||
|
@ -1406,7 +1406,7 @@ void AIQueen::Tick(RunListEvent* ev)
|
|||
|
||||
if (!si)
|
||||
{
|
||||
BuildBullet(pActor, 12, INT_MAX, pActor->spr.angle, pTarget, 1);
|
||||
BuildBullet(pActor, 12, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -101,7 +101,7 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
|
|||
{
|
||||
ChangeActorStat(pActor, 108);
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -111,7 +111,7 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
|
|||
pActor->spr.picnum = 1;
|
||||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->clipdist = 7.5;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->spr.scale = DVector2(0.78125, 0.78125);
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
|
@ -369,7 +369,7 @@ void AIRat::Tick(RunListEvent* ev)
|
|||
return;
|
||||
}
|
||||
|
||||
pActor->spr.angle = RandomAngle();
|
||||
pActor->spr.Angles.Yaw = RandomAngle();
|
||||
SetRatVel(pActor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
|
|||
}
|
||||
else
|
||||
{
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
ChangeActorStat(pActor, 119);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
|
|||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
|
@ -232,9 +232,9 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (pTarget == nullptr)
|
||||
{
|
||||
auto nAngle = pActor->spr.angle;
|
||||
auto nAngle = pActor->spr.Angles.Yaw;
|
||||
pActor->pTarget = FindPlayer(pActor, 60);
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -282,7 +282,7 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
{
|
||||
if ((PlotCourseToSprite(pActor, pTarget) >= 60*16) || pActor->nCount > 0)
|
||||
{
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * 256;
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 256;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -312,7 +312,7 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
}
|
||||
case kHitWall:
|
||||
{
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-2);
|
||||
pActor->nAction = 1;
|
||||
pActor->nFrame = 0;
|
||||
|
@ -342,7 +342,7 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
SetQuake(pActor, 25);
|
||||
pActor->nCount = 60;
|
||||
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-2);
|
||||
pActor->nAction = 1;
|
||||
pActor->nFrame = 0;
|
||||
|
@ -360,7 +360,7 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
{
|
||||
runlist_DamageEnemy(nMov.actor(), pActor, 15);
|
||||
|
||||
auto vel = pActor->spr.angle.ToVector() * 1024 * 15;
|
||||
auto vel = pActor->spr.Angles.Yaw.ToVector() * 1024 * 15;
|
||||
|
||||
if (pHitActor->spr.statnum == 100)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp
|
|||
{
|
||||
ChangeActorStat(pActor, 105);
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
angle = pActor->spr.angle;
|
||||
angle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -61,7 +61,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp
|
|||
pActor->spr.picnum = 1;
|
||||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->clipdist = 15;
|
||||
pActor->spr.angle = angle;
|
||||
pActor->spr.Angles.Yaw = angle;
|
||||
pActor->spr.scale = DVector2(0.625, 0.625);
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
|
@ -101,7 +101,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp
|
|||
|
||||
void GoRoach(DExhumedActor* pActor)
|
||||
{
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * (512 - 128);
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (512 - 128);
|
||||
}
|
||||
|
||||
void AIRoach::Draw(RunListEvent* ev)
|
||||
|
@ -300,19 +300,19 @@ void AIRoach::Tick(RunListEvent* ev)
|
|||
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle();
|
||||
pActor->spr.Angles.Yaw = (pTarget->spr.pos - pActor->spr.pos).Angle();
|
||||
|
||||
pActor->nFrame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
GoRoach(pActor);
|
||||
}
|
||||
}
|
||||
else if (nMov.type == kHitWall)
|
||||
{
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
GoRoach(pActor);
|
||||
}
|
||||
else
|
||||
|
@ -329,7 +329,7 @@ void AIRoach::Tick(RunListEvent* ev)
|
|||
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle();
|
||||
pActor->spr.Angles.Yaw = (pTarget->spr.pos - pActor->spr.pos).Angle();
|
||||
|
||||
pActor->nFrame = 0;
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ void AIRoach::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (nFlag & 0x80)
|
||||
{
|
||||
BuildBullet(pActor, 13, INT_MAX, pActor->spr.angle, pTarget, 1);
|
||||
BuildBullet(pActor, 13, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
{
|
||||
ChangeActorStat(pActor, 122);
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -66,7 +66,7 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
|
|||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
|
@ -273,7 +273,7 @@ void AIScorp::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (pTarget == nMov.actor())
|
||||
{
|
||||
auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
pActor->nAction = 2;
|
||||
|
@ -341,7 +341,7 @@ void AIScorp::Tick(RunListEvent* ev)
|
|||
return;
|
||||
}
|
||||
|
||||
auto nBulletSprite = BuildBullet(pActor, 16, INT_MAX, pActor->spr.angle, pTarget, 1);
|
||||
auto nBulletSprite = BuildBullet(pActor, 16, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
|
||||
if (nBulletSprite)
|
||||
{
|
||||
PlotCourseToSprite(nBulletSprite, pTarget);
|
||||
|
@ -391,14 +391,14 @@ void AIScorp::Tick(RunListEvent* ev)
|
|||
return;
|
||||
}
|
||||
|
||||
auto pSpiderActor = BuildSpider(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.angle);
|
||||
auto pSpiderActor = BuildSpider(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.Angles.Yaw);
|
||||
if (pSpiderActor)
|
||||
{
|
||||
pSpiderActor->spr.angle = RandomAngle();
|
||||
pSpiderActor->spr.Angles.Yaw = RandomAngle();
|
||||
|
||||
int nVel = RandomSize(5) + 1;
|
||||
|
||||
pSpiderActor->vel.XY() = pSpiderActor->spr.angle.ToVector() * 4 * nVel;
|
||||
pSpiderActor->vel.XY() = pSpiderActor->spr.Angles.Yaw.ToVector() * 4 * nVel;
|
||||
pSpiderActor->vel.Z = -(RandomSize(5) + 3);
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
|
|||
if (mode == 0)
|
||||
{
|
||||
PlotCourseToSprite(pActor, pTarget);
|
||||
pActor->spr.angle += mapangle(RandomSize(7) - 63);
|
||||
pActor->spr.Angles.Yaw += mapangle(RandomSize(7) - 63);
|
||||
pActor->norm_ang();
|
||||
|
||||
pActor->VelFromAngle();
|
||||
|
@ -459,7 +459,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
|
|||
{
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle();
|
||||
pActor->spr.Angles.Yaw = (pTarget->spr.pos - pActor->spr.pos).Angle();
|
||||
|
||||
pActor->nIndex = RandomSize(2) + RandomSize(3);
|
||||
|
||||
|
|
|
@ -534,7 +534,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal)
|
|||
tspritetype* pTSprite = mytspriteArray->get(nSprite);
|
||||
DAngle nAngle = (nCamerapos.XY() - pTSprite->pos.XY()).Angle();
|
||||
|
||||
int nSeqOffset = (((pTSprite->angle + DAngle90 + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8;
|
||||
int nSeqOffset = (((pTSprite->Angles.Yaw + DAngle90 + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8;
|
||||
|
||||
int16_t nFrame = SeqBase[nSeqOffset + nSeq] + nVal;
|
||||
|
||||
|
@ -596,7 +596,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
|
|||
else
|
||||
{
|
||||
DAngle nAngle = (nCamerapos.XY() - pTSprite->pos.XY()).Angle();
|
||||
val = (((pTSprite->angle + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8;
|
||||
val = (((pTSprite->Angles.Yaw + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8;
|
||||
}
|
||||
|
||||
int eax = SeqBase[edx] + nFrame;
|
||||
|
@ -644,7 +644,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
|
|||
tsp->shade = shade;
|
||||
tsp->pal = pTSprite->pal;
|
||||
tsp->scale = pTSprite->scale;
|
||||
tsp->angle = pTSprite->angle;
|
||||
tsp->Angles.Yaw = pTSprite->Angles.Yaw;
|
||||
tsp->ownerActor = pTSprite->ownerActor;
|
||||
tsp->sectp = pTSprite->sectp;
|
||||
tsp->cstat = pTSprite->cstat |= CSTAT_SPRITE_YCENTER;
|
||||
|
|
|
@ -56,7 +56,7 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
|
|||
{
|
||||
ChangeActorStat(pActor, 120);
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -69,7 +69,7 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
|
|||
pActor->spr.pal = pActor->sector()->ceilingpal;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->spr.picnum = 1;
|
||||
pActor->spr.hitag = 0;
|
||||
pActor->spr.lotag = runlist_HeadRun() + 1;
|
||||
|
@ -114,7 +114,7 @@ void BuildSoul(DExhumedActor* pSet)
|
|||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.picnum = seq_GetSeqPicnum(kSeqSet, 75, 0);
|
||||
pActor->spr.angle = RandomAngle();
|
||||
pActor->spr.Angles.Yaw = RandomAngle();
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = -1 - RandomSize(10) / 256.;
|
||||
|
@ -155,7 +155,7 @@ void AISoul::Tick(RunListEvent* ev)
|
|||
|
||||
double nVel = mapangle(pActor->spr.extra).Cos();
|
||||
|
||||
auto vect = pActor->spr.angle.ToVector() * nVel * 8;
|
||||
auto vect = pActor->spr.Angles.Yaw.ToVector() * nVel * 8;
|
||||
auto coll = movesprite(pActor,vect, pActor->vel.Z, 0, CLIPMASK0);
|
||||
if (coll.exbits & 0x10000)
|
||||
{
|
||||
|
@ -427,7 +427,7 @@ void AISet::Tick(RunListEvent* ev)
|
|||
}
|
||||
|
||||
// loc_338E2
|
||||
pActor->vel.XY() = pActor->spr.angle.ToVector() * 512;
|
||||
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512;
|
||||
|
||||
if (pActor->nIndex2)
|
||||
{
|
||||
|
@ -455,7 +455,7 @@ void AISet::Tick(RunListEvent* ev)
|
|||
}
|
||||
}
|
||||
|
||||
pActor->spr.angle += DAngle45;
|
||||
pActor->spr.Angles.Yaw += DAngle45;
|
||||
pActor->VelFromAngle(-1);
|
||||
break;
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ void AISet::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (pTarget == nMov.actor())
|
||||
{
|
||||
auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
pActor->nAction = 4;
|
||||
|
@ -528,7 +528,7 @@ void AISet::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (nFlag & 0x80)
|
||||
{
|
||||
auto pBullet = BuildBullet(pActor, 11, INT_MAX, pActor->spr.angle, pTarget, 1);
|
||||
auto pBullet = BuildBullet(pActor, 11, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
|
||||
if (pBullet)
|
||||
SetBulletEnemy(pBullet->nPhase, pTarget);
|
||||
|
||||
|
|
|
@ -170,13 +170,13 @@ void BuildSnake(int nPlayer, double zVal)
|
|||
auto pos = pPlayerActor->spr.pos.plusZ(zVal - 10);
|
||||
|
||||
HitInfo hit{};
|
||||
hitscan(pos, pPlayerActor->sector(), DVector3(pPlayerActor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
hitscan(pos, pPlayerActor->sector(), DVector3(pPlayerActor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK1);
|
||||
|
||||
double nSize = (hit.hitpos.XY() - pos.XY()).Length();
|
||||
|
||||
if (nSize < 64)
|
||||
{
|
||||
hit.hitpos -= pPlayerActor->spr.angle.ToVector() * 0.5;
|
||||
hit.hitpos -= pPlayerActor->spr.Angles.Yaw.ToVector() * 0.5;
|
||||
auto pActor = insertActor(hit.hitSector, 202);
|
||||
pActor->spr.pos = hit.hitpos;
|
||||
|
||||
|
@ -231,7 +231,7 @@ void BuildSnake(int nPlayer, double zVal)
|
|||
pActor->spr.pal = 0;
|
||||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.angle = pPlayerActor->spr.angle;
|
||||
pActor->spr.Angles.Yaw = pPlayerActor->spr.Angles.Yaw;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
|
@ -284,7 +284,7 @@ DExhumedActor* FindSnakeEnemy(int nSnake)
|
|||
DExhumedActor* pActor = SnakeList[nSnake].pSprites[0]; // CHECKME
|
||||
if (!pActor) return nullptr;
|
||||
|
||||
DAngle nAngle = pActor->spr.angle;
|
||||
DAngle nAngle = pActor->spr.Angles.Yaw;
|
||||
auto pSector =pActor->sector();
|
||||
|
||||
DAngle maxangle = DAngle360;
|
||||
|
@ -350,7 +350,7 @@ void AISnake::Tick(RunListEvent* ev)
|
|||
if (pEnemySprite == nullptr)
|
||||
{
|
||||
SEARCH_ENEMY:
|
||||
auto vec = pActor->spr.angle.ToVector() * 37.5;
|
||||
auto vec = pActor->spr.Angles.Yaw.ToVector() * 37.5;
|
||||
nMov = movesprite(pActor, vec, BobVal(SnakeList[nSnake].nAngle) * 2, 0, CLIPMASK1);
|
||||
|
||||
FindSnakeEnemy(nSnake);
|
||||
|
@ -384,7 +384,7 @@ void AISnake::Tick(RunListEvent* ev)
|
|||
}
|
||||
else
|
||||
{
|
||||
DAngle nAngle = pActor->spr.angle;
|
||||
DAngle nAngle = pActor->spr.Angles.Yaw;
|
||||
double cosang = -nAngle.Cos() * 4;
|
||||
double sinang = -nAngle.Sin() * 4;
|
||||
|
||||
|
@ -400,7 +400,7 @@ void AISnake::Tick(RunListEvent* ev)
|
|||
DExhumedActor* pActor2 = SnakeList[nSnake].pSprites[i];
|
||||
if (!pActor2) continue;
|
||||
|
||||
pActor2->spr.angle = nAngle;
|
||||
pActor2->spr.Angles.Yaw = nAngle;
|
||||
pActor2->spr.pos = pActor->spr.pos;
|
||||
|
||||
ChangeActorSect(pActor2, pSector);
|
||||
|
|
|
@ -506,7 +506,7 @@ void GameInterface::UpdateSounds()
|
|||
{
|
||||
Snake *pSnake = &SnakeList[nSnakeCam];
|
||||
pos = pSnake->pSprites[0]->spr.pos;
|
||||
ang = pSnake->pSprites[0]->spr.angle;
|
||||
ang = pSnake->pSprites[0]->spr.Angles.Yaw;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype*
|
|||
ChangeActorStat(spp, 99);
|
||||
|
||||
spp->spr.pos.Z = spp->sector()->floorz;
|
||||
nAngle = spp->spr.angle;
|
||||
nAngle = spp->spr.Angles.Yaw;
|
||||
}
|
||||
|
||||
spp->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
@ -67,7 +67,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype*
|
|||
spp->spr.pal = spp->sector()->ceilingpal;
|
||||
spp->spr.xoffset = 0;
|
||||
spp->spr.yoffset = 0;
|
||||
spp->spr.angle = nAngle;
|
||||
spp->spr.Angles.Yaw = nAngle;
|
||||
spp->spr.picnum = 1;
|
||||
spp->spr.hitag = 0;
|
||||
spp->spr.lotag = runlist_HeadRun() + 1;
|
||||
|
@ -308,7 +308,7 @@ void AISpider::Tick(RunListEvent* ev)
|
|||
{
|
||||
case kHitWall:
|
||||
{
|
||||
spp->spr.angle += DAngle45;
|
||||
spp->spr.Angles.Yaw += DAngle45;
|
||||
spp->VelFromAngle();
|
||||
return;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ void AISpider::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (nMov.actor() == pTarget)
|
||||
{
|
||||
auto nAngDiff = absangle(spp->spr.angle, (pTarget->spr.pos - spp->spr.pos).Angle());
|
||||
auto nAngDiff = absangle(spp->spr.Angles.Yaw, (pTarget->spr.pos - spp->spr.pos).Angle());
|
||||
if (nAngDiff < DAngle22_5 / 2)
|
||||
{
|
||||
spp->nAction = 2;
|
||||
|
|
|
@ -70,7 +70,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double
|
|||
{
|
||||
// interpolate sprite position
|
||||
pTSprite->pos = pTSprite->ownerActor->interpolatedpos(interpfrac);
|
||||
pTSprite->angle = pTSprite->ownerActor->interpolatedangle(interpfrac);
|
||||
pTSprite->Angles.Yaw = pTSprite->ownerActor->interpolatedangle(interpfrac);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double
|
|||
|
||||
auto pSector =pPlayerActor->sector();
|
||||
|
||||
DAngle nAngle = -pPlayerActor->spr.angle;
|
||||
DAngle nAngle = -pPlayerActor->spr.Angles.Yaw;
|
||||
|
||||
for (int nTSprite = int(tsprites.Size()-1); nTSprite >= 0; nTSprite--)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ void DrawView(double interpfrac, bool sceneonly)
|
|||
|
||||
nCamerapos = pActor->spr.pos;
|
||||
pSector = pActor->sector();
|
||||
nCameraang = pActor->spr.angle;
|
||||
nCameraang = pActor->spr.Angles.Yaw;
|
||||
rotscrnang = nullAngle;
|
||||
|
||||
SetGreenPal();
|
||||
|
@ -343,7 +343,7 @@ void DrawView(double interpfrac, bool sceneonly)
|
|||
|
||||
pPlayerActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
|
||||
auto ang2 = nCameraang - pPlayerActor->spr.angle;
|
||||
auto ang2 = nCameraang - pPlayerActor->spr.Angles.Yaw;
|
||||
if (ang2.Degrees() < 0)
|
||||
ang2 = -ang2;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype*
|
|||
}
|
||||
else
|
||||
{
|
||||
nAngle = pActor->spr.angle;
|
||||
nAngle = pActor->spr.Angles.Yaw;
|
||||
ChangeActorStat(pActor, 107);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype*
|
|||
pActor->spr.xoffset = 0;
|
||||
pActor->spr.yoffset = 0;
|
||||
pActor->spr.picnum = 1;
|
||||
pActor->spr.angle = nAngle;
|
||||
pActor->spr.Angles.Yaw = nAngle;
|
||||
pActor->vel.X = 0;
|
||||
pActor->vel.Y = 0;
|
||||
pActor->vel.Z = 0;
|
||||
|
@ -172,7 +172,7 @@ void AIWasp::Damage(RunListEvent* ev)
|
|||
}
|
||||
|
||||
pActor->nAction = 1;
|
||||
pActor->spr.angle += DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->spr.Angles.Yaw += DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->norm_ang();
|
||||
|
||||
pActor->nVel = 3000;
|
||||
|
@ -186,7 +186,7 @@ void AIWasp::Damage(RunListEvent* ev)
|
|||
pActor->nFrame = 0;
|
||||
|
||||
pActor->spr.cstat = 0;
|
||||
pActor->spr.angle += DAngle180;
|
||||
pActor->spr.Angles.Yaw += DAngle180;
|
||||
|
||||
pActor->VelFromAngle();
|
||||
|
||||
|
@ -327,7 +327,7 @@ void AIWasp::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (bVal)
|
||||
{
|
||||
pActor->spr.angle += DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->spr.Angles.Yaw += DAngle45 + DAngle90 + RandomAngle9();
|
||||
pActor->vel.Z = ((-20) - RandomSize(6)) / 256.;
|
||||
|
||||
pActor->nAction = 1;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue