- handle a few more operators

This commit is contained in:
Christoph Oelckers 2022-09-01 00:40:58 +02:00
parent 588af5aa71
commit 231107921e
11 changed files with 23 additions and 24 deletions

View file

@ -1569,7 +1569,7 @@ void forcesphere(DDukeActor* actor, int forcesphere)
{
if (actor->int_zvel() < 6144)
actor->add_int_zvel( 192);
actor->spr.pos.Z += actor->spr.zvel * inttoworld;
actor->spr.pos.Z += actor->int_zvel() * inttoworld;
if (actor->spr.pos.Z > sectp->floorz)
actor->spr.pos.Z = sectp->floorz;
actor->temp_data[3]--;
@ -2494,7 +2494,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
}
}
if (actor->int_zvel() < 4096) actor->add_int_zvel( gs.gravity - 50);
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->int_ang()), 14), MulScale(actor->spr.xvel, bsin(actor->int_ang()), 14), actor->spr.zvel });
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->int_ang()), 14), MulScale(actor->spr.xvel, bsin(actor->int_ang()), 14), actor->int_zvel()});
}
else
{
@ -4348,7 +4348,7 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift)
DukeSectIterator it(actor->sector());
while (auto a2 = it.Next())
{
if (a2->spr.zvel >= 0)
if (a2->int_zvel() >= 0)
{
switch (a2->spr.statnum)
{

View file

@ -1332,7 +1332,7 @@ static bool movefireball(DDukeActor* actor)
ball->spr.extra = 0;
ball->temp_pos = ball->spr.pos;
ball->fproj.vel = { ball->spr.xvel, ball->spr.yvel, ball->spr.zvel };
ball->fproj.vel = { ball->spr.xvel, ball->spr.yvel, ball->int_zvel()};
ChangeActorStat(ball, STAT_PROJECTILE);
}

View file

@ -955,7 +955,7 @@ static void chickenarrow(DDukeActor* actor)
actor->set_int_ang(ang);
if (actor->spr.hitag > 180)
if (actor->spr.zvel <= 0)
if (actor->int_zvel() <= 0)
actor->add_int_zvel( 200);
}
}
@ -1582,7 +1582,7 @@ void movetransports_r(void)
ll = abs(act2->int_zvel()) * zinttoworld;
if (isRRRA())
{
if (act2->spr.zvel >= 0)
if (act2->int_zvel() >= 0)
warpdir = 2;
else
warpdir = 1;

View file

@ -572,7 +572,7 @@ void Gravity(DExhumedActor* pActor)
{
if (pActor->spr.statnum != 100)
{
if (pActor->spr.zvel <= 1024)
if (pActor->int_zvel() <= 1024)
{
if (pActor->int_zvel() < 2048) {
pActor->add_int_zvel( 512);

View file

@ -1441,7 +1441,7 @@ void AISpark::Tick(RunListEvent* ev)
return;
}
if (pActor->spr.zvel <= 0) {
if (pActor->int_zvel() <= 0) {
return;
}
}

View file

@ -829,12 +829,12 @@ void AIPlayer::Tick(RunListEvent* ev)
UpdatePlayerSpriteAngle(pPlayer);
}
// pPlayerActor->spr.zvel is modified within Gravity()
// player.zvel is modified within Gravity()
int zVel = pPlayerActor->int_zvel();
Gravity(pPlayerActor);
if (pPlayerActor->spr.zvel >= 6500 && zVel < 6500)
if (pPlayerActor->int_zvel() >= 6500 && zVel < 6500)
{
D3PlayFX(StaticSound[kSound17], pPlayerActor);
}
@ -848,7 +848,7 @@ void AIPlayer::Tick(RunListEvent* ev)
int x = (sPlayerInput[nPlayer].xVel * 4) >> 2;
int y = (sPlayerInput[nPlayer].yVel * 4) >> 2;
int z = (pPlayerActor->spr.zvel * 4) >> 2;
int z = (pPlayerActor->int_zvel() * 4) >> 2;
if (pPlayerActor->int_zvel() > 8192)
pPlayerActor->set_int_zvel(8192);

View file

@ -619,7 +619,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
if (nMov.exbits & kHitAux2)
{
pActor->set_int_zvel(-(pActor->spr.zvel - 256));
pActor->set_int_zvel(-(pActor->int_vel() - 256));
if (pActor->int_zvel() < -512)
{
pActor->set_int_zvel(0);

View file

@ -253,7 +253,7 @@ int SetupSkull(DSWActor* actor)
int DoSkullMove(DSWActor* actor)
{
auto vect = MOVExy(actor->spr.xvel, actor->spr.angle);
double daz = actor->spr.zvel * zinttoworld;
double daz = actor->int_zvel() * zinttoworld;
actor->user.coll = move_missile(actor, DVector3(vect, daz), 16, 16, CLIPMASK_MISSILE, ACTORMOVETICS);

View file

@ -44,7 +44,7 @@ inline void UpdateChangeXY(DSWActor* actor)
inline void UpdateChange(DSWActor* actor, double zfactor = 1.0)
{
UpdateChangeXY(actor);
actor->user.set_int_change_z(int(actor->spr.zvel * zfactor));
actor->user.set_int_change_z(int(actor->int_zvel() * zfactor));
}

View file

@ -3491,7 +3491,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
}
if (actor->int_zvel())
vec.Z = actor->spr.zvel * locktics * zinttoworld;
vec.Z = actor->int_zvel() * locktics * zinttoworld;
}
actor->user.coll = move_sprite(actor, vec, actor->user.ceiling_dist, actor->user.floor_dist, 0, locktics);

View file

@ -4422,7 +4422,7 @@ bool WeaponMoveHit(DSWActor* actor)
// on walls, so look with hitscan
HitInfo hit{};
hitscan(actor->int_pos(), actor->sector(), { bcos(actor->int_ang()), bsin(actor->int_ang()), actor->spr.zvel }, hit, CLIPMASK_MISSILE);
hitscan(actor->int_pos(), actor->sector(), { bcos(actor->int_ang()), bsin(actor->int_ang()), actor->int_zvel()}, hit, CLIPMASK_MISSILE);
if (!hit.hitSector)
{
@ -7921,7 +7921,7 @@ int DoPlasma(DSWActor* actor)
DoBlurExtend(actor, 0, 4);
auto vec = MOVExy(actor->spr.xvel, actor->spr.angle);
double daz = actor->spr.zvel * zinttoworld;
double daz = actor->int_zvel() * zinttoworld;
actor->user.coll = move_missile(actor, DVector3(vec, daz), 16, 16, CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -8850,7 +8850,7 @@ int DoBoltThinMan(DSWActor* actor)
DoBlurExtend(actor, 0, 4);
auto vec = MOVExy(actor->spr.xvel, actor->spr.angle);
double daz = actor->spr.zvel * zinttoworld;
double daz = actor->int_zvel() * zinttoworld;
actor->user.coll = move_missile(actor, DVector3(vec, daz), CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -9422,7 +9422,7 @@ int DoBoltSeeker(DSWActor* actor)
DoBlurExtend(actor, 0, 4);
auto vec = MOVExy(actor->spr.xvel, actor->spr.angle);
double daz = actor->spr.zvel * zinttoworld;
double daz = actor->int_zvel() * zinttoworld;
actor->user.coll = move_missile(actor, DVector3(vec, daz), CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -9461,7 +9461,7 @@ int DoElectro(DSWActor* actor)
MissileSeek(actor, 30, 512/*, 3, 52, 2*/);
auto vec = MOVExy(actor->spr.xvel, actor->spr.angle);
double daz = actor->spr.zvel * zinttoworld;
double daz = actor->int_zvel() * zinttoworld;
actor->user.coll = move_missile(actor, DVector3(vec, daz), CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -10887,7 +10887,7 @@ bool MissileSetPos(DSWActor* actor, ANIMATOR* DoWeapon, int dist)
// make missile move in smaller increments
actor->spr.xvel = short((dist * 6) / MISSILEMOVETICS);
actor->set_int_zvel(short((actor->spr.zvel*6) / MISSILEMOVETICS));
actor->set_int_zvel(short((actor->int_zvel() * 6) / MISSILEMOVETICS));
// some Weapon Animators use this
UpdateChange(actor);
@ -11103,7 +11103,7 @@ int DoSerpRing(DSWActor* actor)
return 0;
}
double zz = actor->int_pos().Z + actor->spr.zvel * zinttoworld;
double zz = actor->int_pos().Z + actor->int_zvel() * zinttoworld;
if (zz > own->spr.pos.Z - actor->user.pos.Z)
zz = own->spr.pos.Z - actor->user.pos.Z;
@ -12381,8 +12381,7 @@ int InitStar(PLAYER* pp)
actorNew->spr.yrepeat = actorNew->spr.xrepeat = STAR_REPEAT;
actorNew->spr.shade = -25;
actorNew->spr.clipdist = 32 >> 2;
// actorNew->spr.zvel was overflowing with this calculation - had to move to a local
// long var
// zvel was overflowing with this calculation - had to move to a local long var
zvel = -MulScale(pp->horizon.horiz.asq16(), HORIZ_MULT+STAR_HORIZ_ADJ, 16);
actorNew->user.ceiling_dist = (1);