diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 043415f0e..4956a4362 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,11 @@ June 30, 2009 +- Enough with this "momentum" garbage. What Doom calls "momentum" is really + velocity, and now it's known as such. The actor variables momx/momy/momz + are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z + are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will + continue to work as aliases from DECORATE. The ACS functions, however, + require you to use the new name, since they never saw an official release + yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. diff --git a/src/actor.h b/src/actor.h index 065d5c69a..23638417d 100644 --- a/src/actor.h +++ b/src/actor.h @@ -256,7 +256,7 @@ enum MF4_LOOKALLAROUND = 0x00010000, // Monster has eyes in the back of its head MF4_STANDSTILL = 0x00020000, // Monster should not chase targets unless attacked? MF4_SPECTRAL = 0x00040000, - MF4_SCROLLMOVE = 0x00080000, // momentum has been applied by a scroller + MF4_SCROLLMOVE = 0x00080000, // velocity has been applied by a scroller MF4_NOSPLASHALERT = 0x00100000, // Splashes don't alert this monster MF4_SYNCHRONIZED = 0x00200000, // For actors spawned at load-time only: Do not randomize tics MF4_NOTARGETSWITCH = 0x00400000, // monster never switches target until current one is dead @@ -684,7 +684,7 @@ public: FTextureID ceilingpic; // contacted sec ceilingpic fixed_t radius, height; // for movement checking fixed_t projectilepassheight; // height for clipping projectile movement against this actor - fixed_t momx, momy, momz; // momentums + fixed_t velx, vely, velz; // velocity SDWORD tics; // state tic counter FState *state; SDWORD Damage; // For missiles and monster railgun diff --git a/src/b_func.cpp b/src/b_func.cpp index 359d48832..5da2e8e2c 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -42,7 +42,7 @@ bool FCajunMaster::Reachable (AActor *looker, AActor *rtarget) fixed_t estimated_dist = P_AproxDistance (looker->x - rtarget->x, looker->y - rtarget->y); bool reachable = true; - FPathTraverse it(looker->x+looker->momx, looker->y+looker->momy, rtarget->x, rtarget->y, PT_ADDLINES|PT_ADDTHINGS); + FPathTraverse it(looker->x+looker->velx, looker->y+looker->vely, rtarget->x, rtarget->y, PT_ADDLINES|PT_ADDTHINGS); intercept_t *in; while ((in = it.Next())) { @@ -56,8 +56,8 @@ bool FCajunMaster::Reachable (AActor *looker, AActor *rtarget) frac = in->frac - FixedDiv (4*FRACUNIT, MAX_TRAVERSE_DIST); dist = FixedMul (frac, MAX_TRAVERSE_DIST); - hitx = it.Trace().x + FixedMul (looker->momx, frac); - hity = it.Trace().y + FixedMul (looker->momy, frac); + hitx = it.Trace().x + FixedMul (looker->velx, frac); + hity = it.Trace().y + FixedMul (looker->vely, frac); if (in->isaline) { @@ -171,8 +171,8 @@ void FCajunMaster::Dofire (AActor *actor, ticcmd_t *cmd) no_fire = true; //actor->player->angle = R_PointToAngle2(actor->x, actor->y, actor->player->enemy->x, actor->player->enemy->y); //Distance to enemy. - dist = P_AproxDistance ((actor->x + actor->momx) - (enemy->x + enemy->momx), - (actor->y + actor->momy) - (enemy->y + enemy->momy)); + dist = P_AproxDistance ((actor->x + actor->velx) - (enemy->x + enemy->velx), + (actor->y + actor->vely) - (enemy->y + enemy->vely)); //FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go. if (actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE) @@ -225,7 +225,7 @@ void FCajunMaster::Dofire (AActor *actor, ticcmd_t *cmd) shootmissile: dist = P_AproxDistance (actor->x - enemy->x, actor->y - enemy->y); m = dist / GetDefaultByType (actor->player->ReadyWeapon->ProjectileType)->Speed; - SetBodyAt (enemy->x + enemy->momx*m*2, enemy->y + enemy->momy*m*2, enemy->z, 1); + SetBodyAt (enemy->x + enemy->velx*m*2, enemy->y + enemy->vely*m*2, enemy->z, 1); actor->player->angle = R_PointToAngle2 (actor->x, actor->y, body1->x, body1->y); if (Check_LOS (actor, enemy, SHOOTFOV)) no_fire = false; @@ -485,16 +485,16 @@ fixed_t FCajunMaster::FakeFire (AActor *source, AActor *dest, ticcmd_t *cmd) velocity[1] = FIXED2FLOAT(dest->y - source->y); velocity[2] = FIXED2FLOAT(dest->z - source->z); velocity.MakeUnit(); - th->momx = FLOAT2FIXED(velocity[0] * speed); - th->momy = FLOAT2FIXED(velocity[1] * speed); - th->momz = FLOAT2FIXED(velocity[2] * speed); + th->velx = FLOAT2FIXED(velocity[0] * speed); + th->vely = FLOAT2FIXED(velocity[1] * speed); + th->velz = FLOAT2FIXED(velocity[2] * speed); fixed_t dist = 0; while (dist < SAFE_SELF_MISDIST) { dist += th->Speed; - th->SetOrigin (th->x + th->momx, th->y + th->momy, th->z + th->momz); + th->SetOrigin (th->x + th->velx, th->y + th->vely, th->z + th->velz); if (!CleanAhead (th, th->x, th->y, cmd)) break; } @@ -509,8 +509,8 @@ angle_t FCajunMaster::FireRox (AActor *bot, AActor *enemy, ticcmd_t *cmd) AActor *actor; int m; - SetBodyAt (bot->x + FixedMul(bot->momx, 5*FRACUNIT), - bot->y + FixedMul(bot->momy, 5*FRACUNIT), + SetBodyAt (bot->x + FixedMul(bot->velx, 5*FRACUNIT), + bot->y + FixedMul(bot->vely, 5*FRACUNIT), bot->z + (bot->height / 2), 2); actor = bglobal.body2; @@ -521,8 +521,8 @@ angle_t FCajunMaster::FireRox (AActor *bot, AActor *enemy, ticcmd_t *cmd) //Predict. m = (((dist+1)/FRACUNIT) / GetDefaultByName("Rocket")->Speed); - SetBodyAt (enemy->x + FixedMul (enemy->momx, (m+2*FRACUNIT)), - enemy->y + FixedMul(enemy->momy, (m+2*FRACUNIT)), ONFLOORZ, 1); + SetBodyAt (enemy->x + FixedMul(enemy->velx, (m+2*FRACUNIT)), + enemy->y + FixedMul(enemy->vely, (m+2*FRACUNIT)), ONFLOORZ, 1); dist = P_AproxDistance(actor->x-bglobal.body1->x, actor->y-bglobal.body1->y); //try the predicted location if (P_CheckSight (actor, bglobal.body1, 1)) //See the predicted location, so give a test missile diff --git a/src/b_think.cpp b/src/b_think.cpp index 08d514521..742c33a8a 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -88,7 +88,7 @@ void FCajunMaster::ThinkForMove (AActor *actor, ticcmd_t *cmd) dist = b->dest ? P_AproxDistance(actor->x-b->dest->x, actor->y-b->dest->y) : 0; if (b->missile && - ((!b->missile->momx || !b->missile->momy) || !Check_LOS(actor, b->missile, SHOOTFOV*3/2))) + ((!b->missile->velx || !b->missile->vely) || !Check_LOS(actor, b->missile, SHOOTFOV*3/2))) { b->sleft = !b->sleft; b->missile = NULL; //Probably ended its travel. diff --git a/src/d_player.h b/src/d_player.h index 8cd668658..bc99d22e3 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -164,7 +164,7 @@ typedef enum { CF_NOCLIP = 1 << 0, // No clipping, walk through barriers. CF_GODMODE = 1 << 1, // No damage, no health loss. - CF_NOMOMENTUM = 1 << 2, // Not really a cheat, just a debug aid. + CF_NOVELOCITY = 1 << 2, // Not really a cheat, just a debug aid. CF_NOTARGET = 1 << 3, // [RH] Monsters don't target CF_FLY = 1 << 4, // [RH] Flying player CF_CHASECAM = 1 << 5, // [RH] Put camera behind player @@ -251,13 +251,13 @@ public: fixed_t viewz; // focal origin above r.z fixed_t viewheight; // base height above floor for viewz fixed_t deltaviewheight; // squat speed. - fixed_t bob; // bounded/scaled total momentum + fixed_t bob; // bounded/scaled total velocity // killough 10/98: used for realistic bobbing (i.e. not simply overall speed) - // mo->momx and mo->momy represent true momenta experienced by player. + // mo->velx and mo->vely represent true velocity experienced by player. // This only represents the thrust that the player applies himself. // This avoids anomolies with such things as Boom ice and conveyors. - fixed_t momx, momy; // killough 10/98 + fixed_t velx, vely; // killough 10/98 bool centering; BYTE turnticks; diff --git a/src/d_protocol.h b/src/d_protocol.h index 4fe6bec00..547e20d2a 100644 --- a/src/d_protocol.h +++ b/src/d_protocol.h @@ -191,7 +191,7 @@ enum ECheatCommand CHT_PUZZLE, CHT_MDK, // Kill actor player is aiming at CHT_ANUBIS, - CHT_NOMOMENTUM, + CHT_NOVELOCITY, CHT_DONNYTRUMP, CHT_LEGO, CHT_RESSURECT, // [GRB] diff --git a/src/doomdef.h b/src/doomdef.h index bd5978ade..03921f09b 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -338,7 +338,7 @@ enum // linedefs. More friction can create mud, sludge, // magnetized floors, etc. Less friction can create ice. -#define MORE_FRICTION_MOMENTUM 15000 // mud factor based on momentum +#define MORE_FRICTION_VELOCITY 15000 // mud factor based on velocity #define ORIG_FRICTION 0xE800 // original value #define ORIG_FRICTION_FACTOR 2048 // original value #define FRICTION_LOW 0xf900 diff --git a/src/g_doom/a_archvile.cpp b/src/g_doom/a_archvile.cpp index 4286995d7..c9526ba85 100644 --- a/src/g_doom/a_archvile.cpp +++ b/src/g_doom/a_archvile.cpp @@ -117,7 +117,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VileAttack) S_Sound (self, CHAN_WEAPON, "vile/stop", 1, ATTN_NORM); P_TraceBleed (20, target); P_DamageMobj (target, self, self, 20, NAME_None); - target->momz = 1000 * FRACUNIT / target->Mass; + target->velz = 1000 * FRACUNIT / target->Mass; an = self->angle >> ANGLETOFINESHIFT; diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index 61c0eb9fc..2833f891b 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -33,7 +33,7 @@ static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z) if (boom != NULL) { boom->DeathSound = "misc/brainexplode"; - boom->momz = pr_brainscream() << 9; + boom->velz = pr_brainscream() << 9; const PClass *cls = PClass::FindClass("BossBrain"); if (cls != NULL) @@ -109,17 +109,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit) spit->master = self; // [RH] Do this correctly for any trajectory. Doom would divide by 0 // if the target had the same y coordinate as the spitter. - if ((spit->momx | spit->momy) == 0) + if ((spit->velx | spit->vely) == 0) { spit->reactiontime = 0; } - else if (abs(spit->momy) > abs(spit->momx)) + else if (abs(spit->vely) > abs(spit->velx)) { - spit->reactiontime = (targ->y - self->y) / spit->momy; + spit->reactiontime = (targ->y - self->y) / spit->vely; } else { - spit->reactiontime = (targ->x - self->x) / spit->momx; + spit->reactiontime = (targ->x - self->x) / spit->velx; } // [GZ] Calculates when the projectile will have reached destination spit->reactiontime += level.maptime; diff --git a/src/g_doom/a_fatso.cpp b/src/g_doom/a_fatso.cpp index b93019a3b..51e0587da 100644 --- a/src/g_doom/a_fatso.cpp +++ b/src/g_doom/a_fatso.cpp @@ -46,8 +46,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1) { missile->angle += FATSPREAD; an = missile->angle >> ANGLETOFINESHIFT; - missile->momx = FixedMul (missile->Speed, finecosine[an]); - missile->momy = FixedMul (missile->Speed, finesine[an]); + missile->velx = FixedMul (missile->Speed, finecosine[an]); + missile->vely = FixedMul (missile->Speed, finesine[an]); } } @@ -74,8 +74,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2) { missile->angle -= FATSPREAD*2; an = missile->angle >> ANGLETOFINESHIFT; - missile->momx = FixedMul (missile->Speed, finecosine[an]); - missile->momy = FixedMul (missile->Speed, finesine[an]); + missile->velx = FixedMul (missile->Speed, finecosine[an]); + missile->vely = FixedMul (missile->Speed, finesine[an]); } } @@ -99,8 +99,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3) { missile->angle -= FATSPREAD/2; an = missile->angle >> ANGLETOFINESHIFT; - missile->momx = FixedMul (missile->Speed, finecosine[an]); - missile->momy = FixedMul (missile->Speed, finesine[an]); + missile->velx = FixedMul (missile->Speed, finecosine[an]); + missile->vely = FixedMul (missile->Speed, finesine[an]); } missile = P_SpawnMissile (self, self->target, spawntype); @@ -108,8 +108,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3) { missile->angle += FATSPREAD/2; an = missile->angle >> ANGLETOFINESHIFT; - missile->momx = FixedMul (missile->Speed, finecosine[an]); - missile->momy = FixedMul (missile->Speed, finesine[an]); + missile->velx = FixedMul (missile->Speed, finecosine[an]); + missile->vely = FixedMul (missile->Speed, finesine[an]); } } @@ -149,9 +149,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom) mo = P_SpawnMissile (self, target, spawntype); // Launch fireball if (mo != NULL) { - mo->momx >>= 1; - mo->momy >>= 1; // Slow it down a bit - mo->momz >>= 1; + mo->velx >>= 1; + mo->vely >>= 1; // Slow it down a bit + mo->velz >>= 1; mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity } } diff --git a/src/g_doom/a_lostsoul.cpp b/src/g_doom/a_lostsoul.cpp index df7cd743b..46dec259b 100644 --- a/src/g_doom/a_lostsoul.cpp +++ b/src/g_doom/a_lostsoul.cpp @@ -35,14 +35,14 @@ void A_SkullAttack(AActor *self, fixed_t speed) S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM); A_FaceTarget (self); an = self->angle >> ANGLETOFINESHIFT; - self->momx = FixedMul (speed, finecosine[an]); - self->momy = FixedMul (speed, finesine[an]); + self->velx = FixedMul (speed, finecosine[an]); + self->vely = FixedMul (speed, finesine[an]); dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); dist = dist / speed; if (dist < 1) dist = 1; - self->momz = (dest->z+(dest->height>>1) - self->z) / dist; + self->velz = (dest->z + (dest->height>>1) - self->z) / dist; } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullAttack) diff --git a/src/g_doom/a_painelemental.cpp b/src/g_doom/a_painelemental.cpp index d99a215d4..c6bac8ae9 100644 --- a/src/g_doom/a_painelemental.cpp +++ b/src/g_doom/a_painelemental.cpp @@ -45,7 +45,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype) { if (self->flags & MF_FLOAT) { - self->momz -= 2*FRACUNIT; + self->velz -= 2*FRACUNIT; self->flags |= MF_INFLOAT; self->flags4 |= MF4_VFRICTION; } diff --git a/src/g_doom/a_revenant.cpp b/src/g_doom/a_revenant.cpp index 397f0ce58..807422ff6 100644 --- a/src/g_doom/a_revenant.cpp +++ b/src/g_doom/a_revenant.cpp @@ -31,8 +31,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile) if (missile != NULL) { - missile->x += missile->momx; - missile->y += missile->momy; + missile->x += missile->velx; + missile->y += missile->vely; missile->tracer = self->target; } } @@ -62,10 +62,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer) // spawn a puff of smoke behind the rocket P_SpawnPuff (self, PClass::FindClass(NAME_BulletPuff), self->x, self->y, self->z, 0, 3); - smoke = Spawn ("RevenantTracerSmoke", self->x - self->momx, - self->y - self->momy, self->z, ALLOW_REPLACE); + smoke = Spawn ("RevenantTracerSmoke", self->x - self->velx, + self->y - self->vely, self->z, ALLOW_REPLACE); - smoke->momz = FRACUNIT; + smoke->velz = FRACUNIT; smoke->tics -= pr_tracer()&3; if (smoke->tics < 1) smoke->tics = 1; @@ -96,8 +96,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer) } exact = self->angle>>ANGLETOFINESHIFT; - self->momx = FixedMul (self->Speed, finecosine[exact]); - self->momy = FixedMul (self->Speed, finesine[exact]); + self->velx = FixedMul (self->Speed, finecosine[exact]); + self->vely = FixedMul (self->Speed, finesine[exact]); // change slope dist = P_AproxDistance (dest->x - self->x, @@ -117,10 +117,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer) slope = (dest->z + self->height*2/3 - self->z) / dist; } - if (slope < self->momz) - self->momz -= FRACUNIT/8; + if (slope < self->velz) + self->velz -= FRACUNIT/8; else - self->momz += FRACUNIT/8; + self->velz += FRACUNIT/8; } diff --git a/src/g_heretic/a_chicken.cpp b/src/g_heretic/a_chicken.cpp index dd2983afc..86e71774f 100644 --- a/src/g_heretic/a_chicken.cpp +++ b/src/g_heretic/a_chicken.cpp @@ -41,13 +41,13 @@ void AChickenPlayer::MorphPlayerThink () { return; } - if (!(momx | momy) && pr_chickenplayerthink () < 160) + if (!(velx | vely) && pr_chickenplayerthink () < 160) { // Twitch view angle angle += pr_chickenplayerthink.Random2 () << 19; } if ((z <= floorz) && (pr_chickenplayerthink() < 32)) { // Jump and noise - momz += JumpZ; + velz += JumpZ; FState * painstate = FindState(NAME_Pain); if (painstate != NULL) SetState (painstate); @@ -102,9 +102,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Feathers) { mo = Spawn("Feather", self->x, self->y, self->z+20*FRACUNIT, NO_REPLACE); mo->target = self; - mo->momx = pr_feathers.Random2() << 8; - mo->momy = pr_feathers.Random2() << 8; - mo->momz = FRACUNIT + (pr_feathers() << 9); + mo->velx = pr_feathers.Random2() << 8; + mo->vely = pr_feathers.Random2() << 8; + mo->velz = FRACUNIT + (pr_feathers() << 9); mo->SetState (mo->SpawnState + (pr_feathers()&7)); } } diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index a02e28ed3..b2940167a 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -59,7 +59,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor1Chase) DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack) { AActor *mo; - fixed_t momz; + fixed_t velz; angle_t angle; if (!self->target) @@ -85,10 +85,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack) mo = P_SpawnMissileZ (self, self->z + 48*FRACUNIT, self->target, fx); if (mo != NULL) { - momz = mo->momz; + velz = mo->velz; angle = mo->angle; - P_SpawnMissileAngleZ (self, self->z + 48*FRACUNIT, fx, angle-ANGLE_1*3, momz); - P_SpawnMissileAngleZ (self, self->z + 48*FRACUNIT, fx, angle+ANGLE_1*3, momz); + P_SpawnMissileAngleZ (self, self->z + 48*FRACUNIT, fx, angle-ANGLE_1*3, velz); + P_SpawnMissileAngleZ (self, self->z + 48*FRACUNIT, fx, angle+ANGLE_1*3, velz); } if (self->health < self->GetDefault()->health/3) { // Maybe attack again @@ -153,7 +153,7 @@ void P_DSparilTeleport (AActor *actor) S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->z = actor->floorz; actor->angle = spot->angle; - actor->momx = actor->momy = actor->momz = 0; + actor->velx = actor->vely = actor->velz = 0; } } @@ -236,9 +236,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark) for (i = 0; i < 2; i++) { mo = Spawn("Sorcerer2FXSpark", self->x, self->y, self->z, ALLOW_REPLACE); - mo->momx = pr_bluespark.Random2() << 9; - mo->momy = pr_bluespark.Random2() << 9; - mo->momz = FRACUNIT + (pr_bluespark()<<8); + mo->velx = pr_bluespark.Random2() << 9; + mo->vely = pr_bluespark.Random2() << 9; + mo->velz = FRACUNIT + (pr_bluespark()<<8); } } @@ -265,7 +265,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard) { // [RH] Make the new wizards inherit D'Sparil's target mo->CopyFriendliness (self->target, true); - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; self->SetState (self->FindState(NAME_Death)); self->flags &= ~MF_MISSILE; mo->master = self->target; diff --git a/src/g_heretic/a_hereticimp.cpp b/src/g_heretic/a_hereticimp.cpp index ef586a067..b2c92426e 100644 --- a/src/g_heretic/a_hereticimp.cpp +++ b/src/g_heretic/a_hereticimp.cpp @@ -24,14 +24,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode) self->flags &= ~MF_NOGRAVITY; chunk = Spawn("HereticImpChunk1", self->x, self->y, self->z, ALLOW_REPLACE); - chunk->momx = pr_imp.Random2 () << 10; - chunk->momy = pr_imp.Random2 () << 10; - chunk->momz = 9*FRACUNIT; + chunk->velx = pr_imp.Random2 () << 10; + chunk->vely = pr_imp.Random2 () << 10; + chunk->velz = 9*FRACUNIT; chunk = Spawn("HereticImpChunk2", self->x, self->y, self->z, ALLOW_REPLACE); - chunk->momx = pr_imp.Random2 () << 10; - chunk->momy = pr_imp.Random2 () << 10; - chunk->momz = 9*FRACUNIT; + chunk->velx = pr_imp.Random2 () << 10; + chunk->vely = pr_imp.Random2 () << 10; + chunk->velz = 9*FRACUNIT; if (self->special1 == 666) { // Extreme death crash self->SetState (self->FindState("XCrash")); diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index 67f2d4d0c..7fc249378 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -58,9 +58,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain) { goo = Spawn(gootype, self->x, self->y, self->z + 48*FRACUNIT, ALLOW_REPLACE); goo->target = self; - goo->momx = pr_podpain.Random2() << 9; - goo->momy = pr_podpain.Random2() << 9; - goo->momz = FRACUNIT/2 + (pr_podpain() << 9); + goo->velx = pr_podpain.Random2() << 9; + goo->vely = pr_podpain.Random2() << 9; + goo->velz = FRACUNIT/2 + (pr_podpain() << 9); } } @@ -132,7 +132,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter) { if (++self->health > 35) { - self->momz += self->momz/2; + self->velz += self->velz/2; } } @@ -170,9 +170,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast) angle = pr_blast () << 24; blast->angle = angle; angle >>= ANGLETOFINESHIFT; - blast->momx = FixedMul (1*FRACUNIT, finecosine[angle]); - blast->momy = FixedMul (1*FRACUNIT, finesine[angle]); - blast->momz = (FRACUNIT*5/2) + (pr_blast() << 10); + blast->velx = FixedMul (1*FRACUNIT, finecosine[angle]); + blast->vely = FixedMul (1*FRACUNIT, finesine[angle]); + blast->velz = (FRACUNIT*5/2) + (pr_blast() << 10); S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM); P_CheckMissileSpawn (blast); } @@ -195,7 +195,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact) self->flags |= MF_NOGRAVITY; self->gravity = FRACUNIT; self->z += 28*FRACUNIT; - //self->momz = 3*FRACUNIT; + //self->velz = 3*FRACUNIT; } P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, true); for (i = 0; i < 4; i++) @@ -205,9 +205,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact) angle = i*ANG90; tiny->angle = angle; angle >>= ANGLETOFINESHIFT; - tiny->momx = FixedMul (FRACUNIT*7/10, finecosine[angle]); - tiny->momy = FixedMul (FRACUNIT*7/10, finesine[angle]); - tiny->momz = FRACUNIT + (pr_volcimpact() << 9); + tiny->velx = FixedMul (FRACUNIT*7/10, finecosine[angle]); + tiny->vely = FixedMul (FRACUNIT*7/10, finesine[angle]); + tiny->velz = FRACUNIT + (pr_volcimpact() << 9); P_CheckMissileSpawn (tiny); } } diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 65f073f72..8c2d18f60 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -141,7 +141,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2) int i; angle_t angle; int damage; - fixed_t momz; + fixed_t velz; player_t *player; if (NULL == (player = self->player)) @@ -156,10 +156,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2) return; } angle_t pitch = P_BulletSlope(self); - momz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed, + velz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed, finetangent[FINEANGLES/4-((signed)pitch>>ANGLETOFINESHIFT)]); - P_SpawnMissileAngle (self, PClass::FindClass("GoldWandFX2"), self->angle-(ANG45/8), momz); - P_SpawnMissileAngle (self, PClass::FindClass("GoldWandFX2"), self->angle+(ANG45/8), momz); + P_SpawnMissileAngle (self, PClass::FindClass("GoldWandFX2"), self->angle-(ANG45/8), velz); + P_SpawnMissileAngle (self, PClass::FindClass("GoldWandFX2"), self->angle+(ANG45/8), velz); angle = self->angle-(ANG45/8); for(i = 0; i < 5; i++) { @@ -385,15 +385,15 @@ void FireMacePL1B (AActor *actor) } ball = Spawn("MaceFX2", actor->x, actor->y, actor->z + 28*FRACUNIT - actor->floorclip, ALLOW_REPLACE); - ball->momz = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/ + ball->velz = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/ finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]; angle = actor->angle; ball->target = actor; ball->angle = angle; ball->z += 2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]; angle >>= ANGLETOFINESHIFT; - ball->momx = (actor->momx>>1)+FixedMul(ball->Speed, finecosine[angle]); - ball->momy = (actor->momy>>1)+FixedMul(ball->Speed, finesine[angle]); + ball->velx = (actor->velx>>1) + FixedMul(ball->Speed, finecosine[angle]); + ball->vely = (actor->vely>>1) + FixedMul(ball->Speed, finesine[angle]); S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM); P_CheckMissileSpawn (ball); } @@ -455,19 +455,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check) self->special1 = 0; self->flags &= ~MF_NOGRAVITY; self->gravity = FRACUNIT/8; - // [RH] Avoid some precision loss by scaling the momentum directly + // [RH] Avoid some precision loss by scaling the velocity directly #if 0 + // This is the original code, for reference. angle_t angle = self->angle>>ANGLETOFINESHIFT; - self->momx = FixedMul(7*FRACUNIT, finecosine[angle]); - self->momy = FixedMul(7*FRACUNIT, finesine[angle]); + self->velx = FixedMul(7*FRACUNIT, finecosine[angle]); + self->vely = FixedMul(7*FRACUNIT, finesine[angle]); #else - float momscale = sqrtf ((float)self->momx * (float)self->momx + - (float)self->momy * (float)self->momy); - momscale = 458752.f / momscale; - self->momx = (int)(self->momx * momscale); - self->momy = (int)(self->momy * momscale); + double velscale = sqrtf ((float)self->velx * (float)self->velx + + (float)self->vely * (float)self->vely); + velscale = 458752 / velscale; + self->velx = (int)(self->velx * velscale); + self->vely = (int)(self->vely * velscale); #endif - self->momz -= self->momz>>1; + self->velz -= self->velz >> 1; } //---------------------------------------------------------------------------- @@ -481,14 +482,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact) if ((self->health != MAGIC_JUNK) && (self->flags & MF_INBOUNCE)) { // Bounce self->health = MAGIC_JUNK; - self->momz = (self->momz * 192) >> 8; + self->velz = (self->velz * 192) >> 8; self->bouncetype = BOUNCE_None; self->SetState (self->SpawnState); S_Sound (self, CHAN_BODY, "weapons/macebounce", 1, ATTN_NORM); } else { // Explode - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; self->flags |= MF_NOGRAVITY; self->gravity = FRACUNIT; S_Sound (self, CHAN_BODY, "weapons/macehit", 1, ATTN_NORM); @@ -514,11 +515,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2) if (floordist <= ceildist) { - vel = MulScale32 (self->momz, self->Sector->floorplane.c); + vel = MulScale32 (self->velz, self->Sector->floorplane.c); } else { - vel = MulScale32 (self->momz, self->Sector->ceilingplane.c); + vel = MulScale32 (self->velz, self->Sector->ceilingplane.c); } if (vel < 2) { @@ -526,7 +527,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2) } // Bounce - self->momz = (self->momz * 192) >> 8; + self->velz = (self->velz * 192) >> 8; self->SetState (self->SpawnState); tiny = Spawn("MaceFX3", self->x, self->y, self->z, ALLOW_REPLACE); @@ -534,11 +535,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2) tiny->target = self->target; tiny->angle = angle; angle >>= ANGLETOFINESHIFT; - tiny->momx = (self->momx>>1)+FixedMul(self->momz-FRACUNIT, - finecosine[angle]); - tiny->momy = (self->momy>>1)+FixedMul(self->momz-FRACUNIT, - finesine[angle]); - tiny->momz = self->momz; + tiny->velx = (self->velx>>1) + FixedMul(self->velz-FRACUNIT, finecosine[angle]); + tiny->vely = (self->vely>>1) + FixedMul(self->velz-FRACUNIT, finesine[angle]); + tiny->velz = self->velz; P_CheckMissileSpawn (tiny); tiny = Spawn("MaceFX3", self->x, self->y, self->z, ALLOW_REPLACE); @@ -546,17 +545,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2) tiny->target = self->target; tiny->angle = angle; angle >>= ANGLETOFINESHIFT; - tiny->momx = (self->momx>>1)+FixedMul(self->momz-FRACUNIT, - finecosine[angle]); - tiny->momy = (self->momy>>1)+FixedMul(self->momz-FRACUNIT, - finesine[angle]); - tiny->momz = self->momz; + tiny->velx = (self->velx>>1) + FixedMul(self->velz-FRACUNIT, finecosine[angle]); + tiny->vely = (self->vely>>1) + FixedMul(self->velz-FRACUNIT, finesine[angle]); + tiny->velz = self->velz; P_CheckMissileSpawn (tiny); } else { // Explode boom: - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; self->flags |= MF_NOGRAVITY; self->bouncetype = BOUNCE_None; self->gravity = FRACUNIT; @@ -589,9 +586,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2) mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->angle, &linetarget); if (mo) { - mo->momx += self->momx; - mo->momy += self->momy; - mo->momz = 2*FRACUNIT+ + mo->velx += self->velx; + mo->vely += self->vely; + mo->velz = 2*FRACUNIT+ clamp(finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], -5*FRACUNIT, 5*FRACUNIT); if (linetarget) { @@ -628,11 +625,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact) if (floordist <= ceildist) { - vel = MulScale32 (self->momz, self->Sector->floorplane.c); + vel = MulScale32 (self->velz, self->Sector->floorplane.c); } else { - vel = MulScale32 (self->momz, self->Sector->ceilingplane.c); + vel = MulScale32 (self->velz, self->Sector->ceilingplane.c); } if (vel < 2) { @@ -676,8 +673,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact) { self->angle = angle; angle >>= ANGLETOFINESHIFT; - self->momx = FixedMul (self->Speed, finecosine[angle]); - self->momy = FixedMul (self->Speed, finesine[angle]); + self->velx = FixedMul (self->Speed, finecosine[angle]); + self->vely = FixedMul (self->Speed, finesine[angle]); } self->SetState (self->SpawnState); S_Sound (self, CHAN_BODY, "weapons/macestop", 1, ATTN_NORM); @@ -685,7 +682,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact) else { // Explode boom: - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; self->flags |= MF_NOGRAVITY; self->gravity = FRACUNIT; S_Sound (self, CHAN_BODY, "weapons/maceexplode", 1, ATTN_NORM); @@ -810,8 +807,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers) ripper->target = self->target; ripper->angle = angle; angle >>= ANGLETOFINESHIFT; - ripper->momx = FixedMul (ripper->Speed, finecosine[angle]); - ripper->momy = FixedMul (ripper->Speed, finesine[angle]); + ripper->velx = FixedMul (ripper->Speed, finecosine[angle]); + ripper->vely = FixedMul (ripper->Speed, finesine[angle]); P_CheckMissileSpawn (ripper); } } @@ -1051,8 +1048,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm) mo->Translation = multiplayer ? TRANSLATION(TRANSLATION_PlayersExtra,self->special2) : 0; mo->target = self->target; - mo->momx = 1; // Force collision detection - mo->momz = -mo->Speed; + mo->velx = 1; // Force collision detection + mo->velz = -mo->Speed; mo->special2 = self->special2; // Transfer player number P_CheckMissileSpawn (mo); if (self->special1 != -1 && !S_IsActorPlayingSomething (self, CHAN_BODY, -1)) @@ -1188,8 +1185,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1) P_SpawnPlayerMissile (self, RUNTIME_CLASS(APhoenixFX1)); angle = self->angle + ANG180; angle >>= ANGLETOFINESHIFT; - self->momx += FixedMul (4*FRACUNIT, finecosine[angle]); - self->momy += FixedMul (4*FRACUNIT, finesine[angle]); + self->velx += FixedMul (4*FRACUNIT, finecosine[angle]); + self->vely += FixedMul (4*FRACUNIT, finesine[angle]); } //---------------------------------------------------------------------------- @@ -1208,15 +1205,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff) puff = Spawn("PhoenixPuff", self->x, self->y, self->z, ALLOW_REPLACE); angle = self->angle + ANG90; angle >>= ANGLETOFINESHIFT; - puff->momx = FixedMul (FRACUNIT*13/10, finecosine[angle]); - puff->momy = FixedMul (FRACUNIT*13/10, finesine[angle]); - puff->momz = 0; + puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]); + puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]); + puff->velz = 0; puff = Spawn("PhoenixPuff", self->x, self->y, self->z, ALLOW_REPLACE); angle = self->angle - ANG90; angle >>= ANGLETOFINESHIFT; - puff->momx = FixedMul (FRACUNIT*13/10, finecosine[angle]); - puff->momy = FixedMul (FRACUNIT*13/10, finesine[angle]); - puff->momz = 0; + puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]); + puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]); + puff->velz = 0; } //---------------------------------------------------------------------------- @@ -1279,9 +1276,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2) mo = Spawn("PhoenixFX2", x, y, z, ALLOW_REPLACE); mo->target = self; mo->angle = angle; - mo->momx = self->momx + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]); - mo->momy = self->momy + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]); - mo->momz = FixedMul (mo->Speed, slope); + mo->velx = self->velx + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]); + mo->vely = self->vely + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]); + mo->velz = FixedMul (mo->Speed, slope); if (!player->refire || !S_IsActorPlayingSomething (self, CHAN_WEAPON, -1)) { S_Sound (self, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); @@ -1320,7 +1317,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShutdownPhoenixPL2) DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd) { - self->momz += FRACUNIT*3/2; + self->velz += FRACUNIT*3/2; } //---------------------------------------------------------------------------- @@ -1331,6 +1328,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd) DEFINE_ACTION_FUNCTION(AActor, A_FloatPuff) { - self->momz += FRACUNIT*18/10; + self->velz += FRACUNIT*18/10; } diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index db4fa270b..61220f419 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -29,8 +29,8 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage) int randVal; target->angle += pr_foo.Random2() << 20; - target->momx += pr_foo.Random2() << 10; - target->momy += pr_foo.Random2() << 10; + target->velx += pr_foo.Random2() << 10; + target->vely += pr_foo.Random2() << 10; if ((level.time & 16) && !(target->flags2 & MF2_BOSS)) { randVal = pr_foo(); @@ -38,10 +38,10 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage) { randVal = 160; } - target->momz += randVal << 11; - if (target->momz > 12*FRACUNIT) + target->velz += randVal << 11; + if (target->velz > 12*FRACUNIT) { - target->momz = 12*FRACUNIT; + target->velz = 12*FRACUNIT; } } if (!(level.time & 7)) @@ -111,9 +111,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack) } fire->target = baseFire->target; fire->angle = baseFire->angle; - fire->momx = baseFire->momx; - fire->momy = baseFire->momy; - fire->momz = baseFire->momz; + fire->velx = baseFire->velx; + fire->vely = baseFire->vely; + fire->velz = baseFire->velz; fire->Damage = 0; fire->health = (i+1) * 2; P_CheckMissileSpawn (fire); @@ -146,7 +146,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek) self->health -= 3; if (self->health < 0) { - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; self->SetState (self->FindState(NAME_Death)); self->flags &= ~MF_MISSILE; return; @@ -182,9 +182,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact) shard->target = self->target; shard->angle = angle; angle >>= ANGLETOFINESHIFT; - shard->momx = FixedMul (shard->Speed, finecosine[angle]); - shard->momy = FixedMul (shard->Speed, finesine[angle]); - shard->momz = -FRACUNIT*6/10; + shard->velx = FixedMul (shard->Speed, finecosine[angle]); + shard->vely = FixedMul (shard->Speed, finesine[angle]); + shard->velz = -FRACUNIT*6/10; P_CheckMissileSpawn (shard); } } diff --git a/src/g_heretic/a_knight.cpp b/src/g_heretic/a_knight.cpp index bc830b398..2fb8a0ef4 100644 --- a/src/g_heretic/a_knight.cpp +++ b/src/g_heretic/a_knight.cpp @@ -27,8 +27,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DripBlood) x = self->x + (pr_dripblood.Random2 () << 11); y = self->y + (pr_dripblood.Random2 () << 11); mo = Spawn ("Blood", x, y, self->z, ALLOW_REPLACE); - mo->momx = pr_dripblood.Random2 () << 10; - mo->momy = pr_dripblood.Random2 () << 10; + mo->velx = pr_dripblood.Random2 () << 10; + mo->vely = pr_dripblood.Random2 () << 10; mo->gravity = FRACUNIT/8; } diff --git a/src/g_heretic/a_wizard.cpp b/src/g_heretic/a_wizard.cpp index df1429849..119a1b1ef 100644 --- a/src/g_heretic/a_wizard.cpp +++ b/src/g_heretic/a_wizard.cpp @@ -77,7 +77,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3) mo = P_SpawnMissile (self, self->target, fx); if (mo != NULL) { - P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->momz); - P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->momz); + P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->velz); + P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->velz); } } diff --git a/src/g_hexen/a_bats.cpp b/src/g_hexen/a_bats.cpp index 89802fd43..c1674d218 100644 --- a/src/g_hexen/a_bats.cpp +++ b/src/g_hexen/a_bats.cpp @@ -73,10 +73,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatMove) newangle = self->angle - ANGLE_1*self->args[4]; } - // Adjust momentum vector to new direction + // Adjust velocity vector to new direction newangle >>= ANGLETOFINESHIFT; - self->momx = FixedMul (self->Speed, finecosine[newangle]); - self->momy = FixedMul (self->Speed, finesine[newangle]); + self->velx = FixedMul (self->Speed, finecosine[newangle]); + self->vely = FixedMul (self->Speed, finesine[newangle]); if (pr_batmove()<15) { diff --git a/src/g_hexen/a_bishop.cpp b/src/g_hexen/a_bishop.cpp index 33ae5dd97..1e4109748 100644 --- a/src/g_hexen/a_bishop.cpp +++ b/src/g_hexen/a_bishop.cpp @@ -148,8 +148,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur) if (!--self->special1) { - self->momx = 0; - self->momy = 0; + self->velx = 0; + self->vely = 0; if (pr_sblur() > 96) { self->SetState (self->SeeState); @@ -192,7 +192,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopPuff) mo = Spawn ("BishopPuff", self->x, self->y, self->z + 40*FRACUNIT, ALLOW_REPLACE); if (mo) { - mo->momz = FRACUNIT/2; + mo->velz = FRACUNIT/2; } } diff --git a/src/g_hexen/a_blastradius.cpp b/src/g_hexen/a_blastradius.cpp index 53ed19635..540ed11cc 100644 --- a/src/g_hexen/a_blastradius.cpp +++ b/src/g_hexen/a_blastradius.cpp @@ -102,8 +102,8 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) angle >>= ANGLETOFINESHIFT; if (strength < BLAST_FULLSTRENGTH) { - victim->momx = FixedMul (strength, finecosine[angle]); - victim->momy = FixedMul (strength, finesine[angle]); + victim->velx = FixedMul (strength, finecosine[angle]); + victim->vely = FixedMul (strength, finesine[angle]); if (victim->player) { // Players handled automatically @@ -125,8 +125,8 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) } #endif } - victim->momx = FixedMul (BLAST_SPEED, finecosine[angle]); - victim->momy = FixedMul (BLAST_SPEED, finesine[angle]); + victim->velx = FixedMul (BLAST_SPEED, finecosine[angle]); + victim->vely = FixedMul (BLAST_SPEED, finesine[angle]); // Spawn blast puff ang = R_PointToAngle2 (victim->x, victim->y, Owner->x, Owner->y); @@ -137,8 +137,8 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) mo = Spawn ("BlastEffect", x, y, z, ALLOW_REPLACE); if (mo) { - mo->momx = victim->momx; - mo->momy = victim->momy; + mo->velx = victim->velx; + mo->vely = victim->vely; } if (victim->flags & MF_MISSILE) @@ -146,13 +146,13 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) // [RH] Floor and ceiling huggers should not be blasted vertically. if (!(victim->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))) { - victim->momz = 8*FRACUNIT; - mo->momz = victim->momz; + victim->velz = 8*FRACUNIT; + mo->velz = victim->velz; } } else { - victim->momz = (1000 / victim->Mass) << FRACBITS; + victim->velz = (1000 / victim->Mass) << FRACBITS; } if (victim->player) { diff --git a/src/g_hexen/a_clericflame.cpp b/src/g_hexen/a_clericflame.cpp index 14913f304..0fe482ede 100644 --- a/src/g_hexen/a_clericflame.cpp +++ b/src/g_hexen/a_clericflame.cpp @@ -94,9 +94,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack) DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff) { self->renderflags &= ~RF_INVISIBLE; - self->momx = 0; - self->momy = 0; - self->momz = 0; + self->velx = 0; + self->vely = 0; + self->velz = 0; S_Sound (self, CHAN_BODY, "ClericFlameExplode", 1, ATTN_NORM); } @@ -130,8 +130,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile) { mo->angle = an<target = self->target; - mo->momx = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]); - mo->momy = mo->special2 = FixedMul(FLAMESPEED, finesine[an]); + mo->velx = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]); + mo->vely = mo->special2 = FixedMul(FLAMESPEED, finesine[an]); mo->tics -= pr_missile()&3; } mo = Spawn ("CircleFlame", BlockingMobj->x-FixedMul(dist, finecosine[an]), @@ -141,8 +141,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile) { mo->angle = ANG180+(an<target = self->target; - mo->momx = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]); - mo->momy = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]); + mo->velx = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]); + mo->vely = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]); mo->tics -= pr_missile()&3; } } @@ -161,7 +161,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameRotate) int an; an = (self->angle+ANG90)>>ANGLETOFINESHIFT; - self->momx = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]); - self->momy = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]); + self->velx = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]); + self->vely = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]); self->angle += ANG90/15; } diff --git a/src/g_hexen/a_clericholy.cpp b/src/g_hexen/a_clericholy.cpp index f4bf83204..6ad6522c3 100644 --- a/src/g_hexen/a_clericholy.cpp +++ b/src/g_hexen/a_clericholy.cpp @@ -460,8 +460,8 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax) actor->angle -= delta; } angle = actor->angle>>ANGLETOFINESHIFT; - actor->momx = FixedMul (actor->Speed, finecosine[angle]); - actor->momy = FixedMul (actor->Speed, finesine[angle]); + actor->velx = FixedMul (actor->Speed, finecosine[angle]); + actor->vely = FixedMul (actor->Speed, finesine[angle]); if (!(level.time&15) || actor->z > target->z+(target->height) || actor->z+actor->height < target->z) @@ -485,7 +485,7 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax) { dist = 1; } - actor->momz = deltaZ/dist; + actor->velz = deltaZ / dist; } return; } @@ -532,9 +532,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek) self->health--; if (self->health <= 0) { - self->momx >>= 2; - self->momy >>= 2; - self->momz = 0; + self->velx >>= 2; + self->vely >>= 2; + self->velz = 0; self->SetState (self->FindState(NAME_Death)); self->tics -= pr_holyseek()&3; return; diff --git a/src/g_hexen/a_dragon.cpp b/src/g_hexen/a_dragon.cpp index 569aff6b8..8ef10e245 100644 --- a/src/g_hexen/a_dragon.cpp +++ b/src/g_hexen/a_dragon.cpp @@ -57,8 +57,8 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax) actor->angle -= delta; } angle = actor->angle>>ANGLETOFINESHIFT; - actor->momx = FixedMul (actor->Speed, finecosine[angle]); - actor->momy = FixedMul (actor->Speed, finesine[angle]); + actor->velx = FixedMul (actor->Speed, finecosine[angle]); + actor->vely = FixedMul (actor->Speed, finesine[angle]); if (actor->z+actor->height < target->z || target->z+target->height < actor->z) { @@ -68,7 +68,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax) { dist = 1; } - actor->momz = (target->z-actor->z)/dist; + actor->velz = (target->z - actor->z)/dist; } else { diff --git a/src/g_hexen/a_fighterquietus.cpp b/src/g_hexen/a_fighterquietus.cpp index 3012913a6..dc930a34f 100644 --- a/src/g_hexen/a_fighterquietus.cpp +++ b/src/g_hexen/a_fighterquietus.cpp @@ -76,9 +76,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces) AActor *piece = Spawn (cls, self->x, self->y, self->z, ALLOW_REPLACE); if (piece != NULL) { - piece->momx = self->momx + finecosine[fineang]; - piece->momy = self->momy + finesine[fineang]; - piece->momz = self->momz; + piece->velx = self->velx + finecosine[fineang]; + piece->vely = self->vely + finesine[fineang]; + piece->velz = self->velz; piece->flags |= MF_DROPPED; fineang += FINEANGLES/3; j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j; diff --git a/src/g_hexen/a_firedemon.cpp b/src/g_hexen/a_firedemon.cpp index bf26dbcd0..884a12f27 100644 --- a/src/g_hexen/a_firedemon.cpp +++ b/src/g_hexen/a_firedemon.cpp @@ -62,9 +62,9 @@ void A_FiredSpawnRock (AActor *actor) if (mo) { mo->target = actor; - mo->momx = (pr_firedemonrock() - 128) <<10; - mo->momy = (pr_firedemonrock() - 128) <<10; - mo->momz = (pr_firedemonrock() << 10); + mo->velx = (pr_firedemonrock() - 128) <<10; + mo->vely = (pr_firedemonrock() - 128) <<10; + mo->velz = (pr_firedemonrock() << 10); mo->special1 = 2; // Number bounces } @@ -96,11 +96,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredRocks) DEFINE_ACTION_FUNCTION(AActor, A_SmBounce) { - // give some more momentum (x,y,&z) + // give some more velocity (x,y,&z) self->z = self->floorz + FRACUNIT; - self->momz = (2*FRACUNIT) + (pr_smbounce() << 10); - self->momx = pr_smbounce()%3<momy = pr_smbounce()%3<velz = (2*FRACUNIT) + (pr_smbounce() << 10); + self->velx = pr_smbounce()%3<vely = pr_smbounce()%3<special2 = 0; - self->momx = self->momy = 0; + self->velx = self->vely = 0; dist = P_AproxDistance (self->x - target->x, self->y - target->y); if (dist < FIREDEMON_ATTACK_RANGE) { @@ -169,8 +169,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase) else ang -= ANGLE_90; ang >>= ANGLETOFINESHIFT; - self->momx = finecosine[ang] << 3; //FixedMul (8*FRACUNIT, finecosine[ang]); - self->momy = finesine[ang] << 3; //FixedMul (8*FRACUNIT, finesine[ang]); + self->velx = finecosine[ang] << 3; //FixedMul (8*FRACUNIT, finecosine[ang]); + self->vely = finesine[ang] << 3; //FixedMul (8*FRACUNIT, finesine[ang]); self->special2 = 3; // strafe time } } @@ -222,15 +222,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch) mo = Spawn ("FireDemonSplotch1", self->x, self->y, self->z, ALLOW_REPLACE); if (mo) { - mo->momx = (pr_firedemonsplotch() - 128) << 11; - mo->momy = (pr_firedemonsplotch() - 128) << 11; - mo->momz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; + mo->velx = (pr_firedemonsplotch() - 128) << 11; + mo->vely = (pr_firedemonsplotch() - 128) << 11; + mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; } mo = Spawn ("FireDemonSplotch2", self->x, self->y, self->z, ALLOW_REPLACE); if (mo) { - mo->momx = (pr_firedemonsplotch() - 128) << 11; - mo->momy = (pr_firedemonsplotch() - 128) << 11; - mo->momz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; + mo->velx = (pr_firedemonsplotch() - 128) << 11; + mo->vely = (pr_firedemonsplotch() - 128) << 11; + mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; } } diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index ce33a1895..68c304bd5 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -111,11 +111,11 @@ bool AArtiPoisonBag3::Use (bool pickup) angle_t pitch = (angle_t)Owner->pitch >> ANGLETOFINESHIFT; mo->angle = Owner->angle+(((pr_poisonbag()&7)-4)<<24); - mo->momz = 4*FRACUNIT + 2*finesine[pitch]; + mo->velz = 4*FRACUNIT + 2*finesine[pitch]; mo->z += 2*finesine[pitch]; P_ThrustMobj (mo, mo->angle, mo->Speed); - mo->momx += Owner->momx>>1; - mo->momy += Owner->momy>>1; + mo->velx += Owner->velx >> 1; + mo->vely += Owner->vely >> 1; mo->target = Owner; mo->tics -= pr_poisonbag()&3; P_CheckMissileSpawn (mo); @@ -242,7 +242,7 @@ IMPLEMENT_CLASS (APoisonCloud) void APoisonCloud::BeginPlay () { - momx = 1; // missile objects must move to impact other objects + velx = 1; // missile objects must move to impact other objects special1 = 24+(pr_poisoncloud()&7); special2 = 0; } @@ -362,16 +362,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb) DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2) { - // [RH] Check using actual velocity, although the momz < 2 check still stands - //if (abs(self->momx) < FRACUNIT*3/2 && abs(self->momy) < FRACUNIT*3/2 - // && self->momz < 2*FRACUNIT) - if (self->momz < 2*FRACUNIT && - TMulScale32 (self->momx, self->momx, self->momy, self->momy, self->momz, self->momz) + // [RH] Check using actual velocity, although the velz < 2 check still stands + //if (abs(self->velx) < FRACUNIT*3/2 && abs(self->vely) < FRACUNIT*3/2 + // && self->velz < 2*FRACUNIT) + if (self->velz < 2*FRACUNIT && + TMulScale32 (self->velx, self->velx, self->vely, self->vely, self->velz, self->velz) < (3*3)/(2*2)) { self->SetState (self->SpawnState + 6); self->z = self->floorz; - self->momz = 0; + self->velz = 0; self->bouncetype = BOUNCE_None; self->flags &= ~MF_MISSILE; } diff --git a/src/g_hexen/a_fog.cpp b/src/g_hexen/a_fog.cpp index ea4864fff..34b1537ea 100644 --- a/src/g_hexen/a_fog.cpp +++ b/src/g_hexen/a_fog.cpp @@ -85,7 +85,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogMove) } angle = self->angle>>ANGLETOFINESHIFT; - self->momx = FixedMul(speed, finecosine[angle]); - self->momy = FixedMul(speed, finesine[angle]); + self->velx = FixedMul(speed, finecosine[angle]); + self->vely = FixedMul(speed, finesine[angle]); } diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index 6ce8bf6db..d8982641c 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -176,11 +176,11 @@ class ASorcFX1 : public AActor public: bool FloorBounceMissile (secplane_t &plane) { - fixed_t orgmomz = momz; + fixed_t orgvelz = velz; if (!Super::FloorBounceMissile (plane)) { - momz = -orgmomz; // no energy absorbed + velz = -orgvelz; // no energy absorbed return false; } return true; @@ -668,7 +668,7 @@ void A_SorcOffense2(AActor *actor) dist = P_AproxDistance(dest->x - mo->x, dest->y - mo->y); dist = dist/mo->Speed; if(dist < 1) dist = 1; - mo->momz = (dest->z-mo->z)/dist; + mo->velz = (dest->z - mo->z) / dist; } } @@ -713,9 +713,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle) if (mo) { rangle = angle + ((pr_heresiarch()%5) << 1); - mo->momx = FixedMul(pr_heresiarch()%speed,finecosine[rangle]); - mo->momy = FixedMul(pr_heresiarch()%speed,finesine[rangle]); - mo->momz = FRACUNIT*2; + mo->velx = FixedMul(pr_heresiarch()%speed, finecosine[rangle]); + mo->vely = FixedMul(pr_heresiarch()%speed, finesine[rangle]); + mo->velz = FRACUNIT*2; } } } @@ -912,9 +912,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallPop) S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE); self->flags &= ~MF_NOGRAVITY; self->gravity = FRACUNIT/8; - self->momx = ((pr_heresiarch()%10)-5) << FRACBITS; - self->momy = ((pr_heresiarch()%10)-5) << FRACBITS; - self->momz = (2+(pr_heresiarch()%3)) << FRACBITS; + self->velx = ((pr_heresiarch()%10)-5) << FRACBITS; + self->vely = ((pr_heresiarch()%10)-5) << FRACBITS; + self->velz = (2+(pr_heresiarch()%3)) << FRACBITS; self->special2 = 4*FRACUNIT; // Initial bounce factor self->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit self->args[3] = 5; // Bounce time in seconds diff --git a/src/g_hexen/a_hexenspecialdecs.cpp b/src/g_hexen/a_hexenspecialdecs.cpp index d9a704a04..a3fee8557 100644 --- a/src/g_hexen/a_hexenspecialdecs.cpp +++ b/src/g_hexen/a_hexenspecialdecs.cpp @@ -64,9 +64,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode) mo->SetState (mo->SpawnState + (pr_pottery()%5)); if (mo) { - mo->momz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4); - mo->momx = (pr_pottery.Random2())<<(FRACBITS-6); - mo->momy = (pr_pottery.Random2())<<(FRACBITS-6); + mo->velz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4); + mo->velx = (pr_pottery.Random2())<<(FRACBITS-6); + mo->vely = (pr_pottery.Random2())<<(FRACBITS-6); } } S_Sound (mo, CHAN_BODY, "PotteryExplode", 1, ATTN_NORM); @@ -166,9 +166,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode) if (mo) { mo->SetState (mo->SpawnState + (pr_foo()%3)); - mo->momz = ((pr_foo()&7)+5)*(3*FRACUNIT/4); - mo->momx = pr_foo.Random2()<<(FRACBITS-6); - mo->momy = pr_foo.Random2()<<(FRACBITS-6); + mo->velz = ((pr_foo()&7)+5)*(3*FRACUNIT/4); + mo->velx = pr_foo.Random2()<<(FRACBITS-6); + mo->vely = pr_foo.Random2()<<(FRACBITS-6); } } // Spawn a skull @@ -176,9 +176,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode) if (mo) { mo->SetState (mo->SpawnState + 3); - mo->momz = ((pr_foo()&7)+5)*(3*FRACUNIT/4); - mo->momx = pr_foo.Random2()<<(FRACBITS-6); - mo->momy = pr_foo.Random2()<<(FRACBITS-6); + mo->velz = ((pr_foo()&7)+5)*(3*FRACUNIT/4); + mo->velx = pr_foo.Random2()<<(FRACBITS-6); + mo->vely = pr_foo.Random2()<<(FRACBITS-6); } S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_IDLE); self->Destroy (); @@ -220,7 +220,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust) { if (pr_leafthrust() <= 96) { - self->momz += (pr_leafthrust()<<9)+FRACUNIT; + self->velz += (pr_leafthrust()<<9)+FRACUNIT; } } @@ -241,14 +241,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck) angle_t ang = self->target ? self->target->angle : self->angle; if (pr_leafcheck() > 64) { - if (!self->momx && !self->momy) + if (!self->velx && !self->vely) { P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+FRACUNIT); } return; } self->SetState (self->SpawnState + 7); - self->momz = (pr_leafcheck()<<9)+FRACUNIT; + self->velz = (pr_leafcheck()<<9)+FRACUNIT; P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+2*FRACUNIT); self->flags |= MF_MISSILE; } @@ -283,9 +283,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode) if (mo) { mo->SetState (mo->SpawnState + i); - mo->momz = ((pr_soaexplode()&7)+5)*FRACUNIT; - mo->momx = pr_soaexplode.Random2()<<(FRACBITS-6); - mo->momy = pr_soaexplode.Random2()<<(FRACBITS-6); + mo->velz = ((pr_soaexplode()&7)+5)*FRACUNIT; + mo->velx = pr_soaexplode.Random2()<<(FRACBITS-6); + mo->vely = pr_soaexplode.Random2()<<(FRACBITS-6); } } if (self->args[0]>=0 && self->args[0]<=255 && SpawnableThings[self->args[0]]) diff --git a/src/g_hexen/a_iceguy.cpp b/src/g_hexen/a_iceguy.cpp index cbc9a54af..2d908f974 100644 --- a/src/g_hexen/a_iceguy.cpp +++ b/src/g_hexen/a_iceguy.cpp @@ -66,9 +66,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase) self->z+60*FRACUNIT, ALLOW_REPLACE); if (mo) { - mo->momx = self->momx; - mo->momy = self->momy; - mo->momz = self->momz; + mo->velx = self->velx; + mo->vely = self->vely; + mo->velz = self->velz; mo->target = self; } } @@ -109,9 +109,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack) DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie) { - self->momx = 0; - self->momy = 0; - self->momz = 0; + self->velx = 0; + self->vely = 0; + self->velz = 0; self->height = self->GetDefault()->height; CALL_ACTION(A_FreezeDeathChunks, self); } diff --git a/src/g_hexen/a_korax.cpp b/src/g_hexen/a_korax.cpp index 242c39066..103125148 100644 --- a/src/g_hexen/a_korax.cpp +++ b/src/g_hexen/a_korax.cpp @@ -391,8 +391,8 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax) actor->angle -= delta; } angle = actor->angle>>ANGLETOFINESHIFT; - actor->momx = FixedMul (actor->Speed, finecosine[angle]); - actor->momy = FixedMul (actor->Speed, finesine[angle]); + actor->velx = FixedMul (actor->Speed, finecosine[angle]); + actor->vely = FixedMul (actor->Speed, finesine[angle]); if (!(level.time&15) || actor->z > target->z+(target->GetDefault()->height) @@ -417,7 +417,7 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax) { dist = 1; } - actor->momz = deltaZ/dist; + actor->velz = deltaZ/dist; } return; } @@ -516,14 +516,14 @@ AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z, } th->angle = an; an >>= ANGLETOFINESHIFT; - th->momx = FixedMul (th->Speed, finecosine[an]); - th->momy = FixedMul (th->Speed, finesine[an]); + th->velx = FixedMul (th->Speed, finecosine[an]); + th->vely = FixedMul (th->Speed, finesine[an]); dist = P_AproxDistance (dest->x - x, dest->y - y); dist = dist/th->Speed; if (dist < 1) { dist = 1; } - th->momz = (dest->z-z+(30*FRACUNIT))/dist; + th->velz = (dest->z-z+(30*FRACUNIT))/dist; return (P_CheckMissileSpawn(th) ? th : NULL); } diff --git a/src/g_hexen/a_magecone.cpp b/src/g_hexen/a_magecone.cpp index ebf94f29a..a80eae659 100644 --- a/src/g_hexen/a_magecone.cpp +++ b/src/g_hexen/a_magecone.cpp @@ -126,7 +126,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard) { mo->special1 = SHARDSPAWN_LEFT; mo->special2 = spermcount; - mo->momz = self->momz; + mo->velz = self->velz; mo->args[0] = (spermcount==3)?2:0; } } @@ -138,7 +138,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard) { mo->special1 = SHARDSPAWN_RIGHT; mo->special2 = spermcount; - mo->momz = self->momz; + mo->velz = self->velz; mo->args[0] = (spermcount==3)?2:0; } } @@ -148,7 +148,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard) 0, (15+2*spermcount)<target); if (mo) { - mo->momz = self->momz; + mo->velz = self->velz; if (spermcount & 1) // Every other reproduction mo->special1 = SHARDSPAWN_UP | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT; else @@ -163,7 +163,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard) 0, (15+2*spermcount)<target); if (mo) { - mo->momz = self->momz; + mo->velz = self->velz; if (spermcount & 1) // Every other reproduction mo->special1 = SHARDSPAWN_DOWN | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT; else diff --git a/src/g_hexen/a_magelightning.cpp b/src/g_hexen/a_magelightning.cpp index a430aa544..c213afdbe 100644 --- a/src/g_hexen/a_magelightning.cpp +++ b/src/g_hexen/a_magelightning.cpp @@ -42,8 +42,8 @@ int ALightning::SpecialMissileHit (AActor *thing) { if (thing->Mass != INT_MAX) { - thing->momx += momx>>4; - thing->momy += momy>>4; + thing->velx += velx>>4; + thing->vely += vely>>4; } if ((!thing->player && !(thing->flags2&MF2_BOSS)) || !(level.time&1)) @@ -191,8 +191,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip) else { self->angle = R_PointToAngle2(self->x, self->y, target->x, target->y); - self->momx = 0; - self->momy = 0; + self->velx = 0; + self->vely = 0; P_ThrustMobj (self, self->angle, self->Speed>>1); } } @@ -235,16 +235,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap) if (mo) { mo->lastenemy = self; - mo->momx = self->momx; - mo->momy = self->momy; + mo->velx = self->velx; + mo->vely = self->vely; mo->target = self->target; if (self->flags3 & MF3_FLOORHUGGER) { - mo->momz = 20*FRACUNIT; + mo->velz = 20*FRACUNIT; } else { - mo->momz = -20*FRACUNIT; + mo->velz = -20*FRACUNIT; } } if ((self->flags3 & MF3_FLOORHUGGER) && pr_zapf() < 160) @@ -312,8 +312,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic) } else { - self->momx = mo->momx; - self->momy = mo->momy; + self->velx = mo->velx; + self->vely = mo->vely; } } } @@ -335,7 +335,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LastZap) if (mo) { mo->SetState (mo->FindState (NAME_Death)); - mo->momz = 40*FRACUNIT; + mo->velz = 40*FRACUNIT; mo->Damage = 0; } } diff --git a/src/g_hexen/a_pig.cpp b/src/g_hexen/a_pig.cpp index e86efffb5..21d2ab936 100644 --- a/src/g_hexen/a_pig.cpp +++ b/src/g_hexen/a_pig.cpp @@ -37,7 +37,7 @@ void APigPlayer::MorphPlayerThink () { return; } - if(!(momx | momy) && pr_pigplayerthink() < 64) + if(!(velx | vely) && pr_pigplayerthink() < 64) { // Snout sniff if (player->ReadyWeapon != NULL) { @@ -98,6 +98,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_PigPain) CALL_ACTION(A_Pain, self); if (self->z <= self->floorz) { - self->momz = FRACUNIT*7/2; + self->velz = FRACUNIT*7/2; } } diff --git a/src/g_hexen/a_serpent.cpp b/src/g_hexen/a_serpent.cpp index bf4f8be63..b44a6175d 100644 --- a/src/g_hexen/a_serpent.cpp +++ b/src/g_hexen/a_serpent.cpp @@ -208,8 +208,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs) self->floorz+FRACUNIT, ALLOW_REPLACE); if (mo) { - mo->momx = (pr_serpentgibs()-128)<<6; - mo->momy = (pr_serpentgibs()-128)<<6; + mo->velx = (pr_serpentgibs()-128)<<6; + mo->vely = (pr_serpentgibs()-128)<<6; mo->floorclip = 6*FRACUNIT; } } diff --git a/src/g_hexen/a_summon.cpp b/src/g_hexen/a_summon.cpp index 4335abed0..69c0238ba 100644 --- a/src/g_hexen/a_summon.cpp +++ b/src/g_hexen/a_summon.cpp @@ -36,7 +36,7 @@ bool AArtiDarkServant::Use (bool pickup) { mo->target = Owner; mo->tracer = Owner; - mo->momz = 5*FRACUNIT; + mo->velz = 5*FRACUNIT; } return true; } diff --git a/src/g_hexen/a_teleportother.cpp b/src/g_hexen/a_teleportother.cpp index 2b1bbcc55..22f0673f5 100644 --- a/src/g_hexen/a_teleportother.cpp +++ b/src/g_hexen/a_teleportother.cpp @@ -57,9 +57,9 @@ static void TeloSpawn (AActor *source, const char *type) fx->special1 = TELEPORT_LIFE; // Lifetime countdown fx->angle = source->angle; fx->target = source->target; - fx->momx = source->momx >> 1; - fx->momy = source->momy >> 1; - fx->momz = source->momz >> 1; + fx->velx = source->velx >> 1; + fx->vely = source->vely >> 1; + fx->velz = source->velz >> 1; } } diff --git a/src/g_hexen/a_wraith.cpp b/src/g_hexen/a_wraith.cpp index 3cf4b987d..219c3a6bb 100644 --- a/src/g_hexen/a_wraith.cpp +++ b/src/g_hexen/a_wraith.cpp @@ -121,10 +121,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2) { angle = self->angle-(pr_wraithfx2()<<22); } - mo->momz = 0; - mo->momx = FixedMul((pr_wraithfx2()<<7)+FRACUNIT, + mo->velz = 0; + mo->velx = FixedMul((pr_wraithfx2()<<7)+FRACUNIT, finecosine[angle>>ANGLETOFINESHIFT]); - mo->momy = FixedMul((pr_wraithfx2()<<7)+FRACUNIT, + mo->vely = FixedMul((pr_wraithfx2()<<7)+FRACUNIT, finesine[angle>>ANGLETOFINESHIFT]); mo->target = self; mo->floorclip = 10*FRACUNIT; diff --git a/src/g_level.cpp b/src/g_level.cpp index efba61cbd..689bf7e31 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1167,9 +1167,9 @@ void G_FinishTravel () pawn->x = pawndup->x; pawn->y = pawndup->y; pawn->z = pawndup->z; - pawn->momx = pawndup->momx; - pawn->momy = pawndup->momy; - pawn->momz = pawndup->momz; + pawn->velx = pawndup->velx; + pawn->vely = pawndup->vely; + pawn->velz = pawndup->velz; pawn->Sector = pawndup->Sector; pawn->floorz = pawndup->floorz; pawn->ceilingz = pawndup->ceilingz; diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 8d70429c9..e6b2a159d 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -243,8 +243,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide) } A_FaceTarget (self); angle = self->angle>>ANGLETOFINESHIFT; - self->momx = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]); - self->momy = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]); + self->velx = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]); + self->vely = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]); self->special1 = TICRATE/2; // Charge duration } else if (target->z == target->floorz @@ -287,7 +287,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge) type = PClass::FindClass ("PunchPuff"); } puff = Spawn (type, self->x, self->y, self->z, ALLOW_REPLACE); - puff->momz = 2*FRACUNIT; + puff->velz = 2*FRACUNIT; self->special1--; } else @@ -310,7 +310,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2) { AActor *mo; angle_t angle; - fixed_t momz; + fixed_t velz; fixed_t z; bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER); @@ -335,12 +335,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2) if (mo != NULL) { // S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM); - momz = mo->momz; + velz = mo->velz; angle = mo->angle; - P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), momz); - P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), momz); - P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), momz); - P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), momz); + P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), velz); + P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), velz); + P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), velz); + P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), velz); } } } @@ -416,7 +416,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MntrFloorFire) y = self->y + (pr_fire.Random2 () << 10); mo = Spawn("MinotaurFX3", x, y, self->floorz, ALLOW_REPLACE); mo->target = self->target; - mo->momx = 1; // Force block checking + mo->velx = 1; // Force block checking P_CheckMissileSpawn (mo); } @@ -435,8 +435,8 @@ void P_MinotaurSlam (AActor *source, AActor *target) angle = R_PointToAngle2 (source->x, source->y, target->x, target->y); angle >>= ANGLETOFINESHIFT; thrust = 16*FRACUNIT+(pr_minotaurslam()<<10); - target->momx += FixedMul (thrust, finecosine[angle]); - target->momy += FixedMul (thrust, finesine[angle]); + target->velx += FixedMul (thrust, finecosine[angle]); + target->vely += FixedMul (thrust, finesine[angle]); damage = pr_minotaurslam.HitDice (static_cast(source) ? 4 : 6); P_DamageMobj (target, NULL, NULL, damage, NAME_Melee); P_TraceBleed (damage, target, angle, 0); diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index 7b3469e48..767d282b8 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -233,7 +233,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks) int numChunks; AActor *mo; - if (self->momx || self->momy || self->momz) + if (self->velx || self->vely || self->velz) { self->tics = 3*TICRATE; return; @@ -256,9 +256,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks) mo->SetState (mo->SpawnState + (pr_freeze()%3)); if (mo) { - mo->momz = FixedDiv(mo->z-self->z, self->height)<<2; - mo->momx = pr_freeze.Random2 () << (FRACBITS-7); - mo->momy = pr_freeze.Random2 () << (FRACBITS-7); + mo->velz = FixedDiv(mo->z - self->z, self->height)<<2; + mo->velx = pr_freeze.Random2 () << (FRACBITS-7); + mo->vely = pr_freeze.Random2 () << (FRACBITS-7); CALL_ACTION(A_IceSetTics, mo); // set a random tic wait mo->RenderStyle = self->RenderStyle; mo->alpha = self->alpha; @@ -268,9 +268,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks) { // attach the player's view to a chunk of ice AActor *head = Spawn("IceChunkHead", self->x, self->y, self->z + self->player->mo->ViewHeight, ALLOW_REPLACE); - head->momz = FixedDiv(head->z-self->z, self->height)<<2; - head->momx = pr_freeze.Random2 () << (FRACBITS-7); - head->momy = pr_freeze.Random2 () << (FRACBITS-7); + head->velz = FixedDiv(head->z - self->z, self->height)<<2; + head->velx = pr_freeze.Random2 () << (FRACBITS-7); + head->vely = pr_freeze.Random2 () << (FRACBITS-7); head->health = self->health; head->angle = self->angle; if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn))) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 72985da1c..4d36e34fd 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -961,9 +961,9 @@ void APowerFlight::InitEffect () Owner->flags |= MF_NOGRAVITY; if (Owner->z <= Owner->floorz) { - Owner->momz = 4*FRACUNIT; // thrust the player in the air a bit + Owner->velz = 4*FRACUNIT; // thrust the player in the air a bit } - if (Owner->momz <= -35*FRACUNIT) + if (Owner->velz <= -35*FRACUNIT) { // stop falling scream S_StopSound (Owner, CHAN_VOICE); } @@ -1200,7 +1200,7 @@ void APowerSpeed::DoEffect () if (Inventory != NULL && Inventory->GetSpeedFactor() > FRACUNIT) return; - if (P_AproxDistance (Owner->momx, Owner->momy) <= 12*FRACUNIT) + if (P_AproxDistance (Owner->velx, Owner->vely) <= 12*FRACUNIT) return; AActor *speedMo = Spawn (Owner->x, Owner->y, Owner->z, NO_REPLACE); diff --git a/src/g_shared/a_debris.cpp b/src/g_shared/a_debris.cpp index 6f9a4299d..e6fc79b0a 100644 --- a/src/g_shared/a_debris.cpp +++ b/src/g_shared/a_debris.cpp @@ -15,7 +15,7 @@ public: { if (!Super::FloorBounceMissile (plane)) { - if (abs (momz) < (FRACUNIT/2)) + if (abs (velz) < (FRACUNIT/2)) { Destroy (); } @@ -49,7 +49,7 @@ void P_SpawnDirt (AActor *actor, fixed_t radius) mo = Spawn (dtype, x, y, z, ALLOW_REPLACE); if (mo) { - mo->momz = pr_dirt()<<10; + mo->velz = pr_dirt()<<10; } } } diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index fecf0c2f0..0127ed0d7 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -44,7 +44,7 @@ void AFastProjectile::Tick () int count = 8; if (radius > 0) { - while ( ((abs(momx) >> shift) > radius) || ((abs(momy) >> shift) > radius)) + while ( ((abs(velx) >> shift) > radius) || ((abs(vely) >> shift) > radius)) { // we need to take smaller steps. shift++; @@ -53,11 +53,11 @@ void AFastProjectile::Tick () } // Handle movement - if (momx || momy || (z != floorz) || momz) + if (velx || vely || (z != floorz) || velz) { - xfrac = momx>>shift; - yfrac = momy>>shift; - zfrac = momz>>shift; + xfrac = velx >> shift; + yfrac = vely >> shift; + zfrac = velz >> shift; changexy = xfrac || yfrac; int ripcount = count >> 3; for (i = 0; i < count; i++) diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index 3c7deebf6..1a29cd7f7 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -113,7 +113,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog); p->health = morphed->health; p->mo = morphed; - p->momx = p->momy = 0; + p->velx = p->vely = 0; morphed->ObtainInventory (actor); // Remove all armor for (item = morphed->Inventory; item != NULL; ) @@ -232,11 +232,11 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, bool force) mo->player = player; mo->reactiontime = 18; mo->flags = pmo->special2 & ~MF_JUSTHIT; - mo->momx = 0; - mo->momy = 0; - player->momx = 0; - player->momy = 0; - mo->momz = pmo->momz; + mo->velx = 0; + mo->vely = 0; + player->velx = 0; + player->vely = 0; + mo->velz = pmo->velz; if (!(pmo->special2 & MF_JUSTHIT)) { mo->renderflags &= ~RF_INVISIBLE; @@ -451,9 +451,9 @@ bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force) if (!(beast->FlagsSave & MF_JUSTHIT)) actor->renderflags &= ~RF_INVISIBLE; actor->health = actor->GetDefault()->health; - actor->momx = beast->momx; - actor->momy = beast->momy; - actor->momz = beast->momz; + actor->velx = beast->velx; + actor->vely = beast->vely; + actor->velz = beast->velz; actor->tid = beast->tid; actor->special = beast->special; memcpy (actor->args, beast->args, sizeof(actor->args)); diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index 88e0e79c5..715e6a8a6 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -72,9 +72,9 @@ class ARandomSpawner : public AActor newmobj->HandleSpawnFlags(); newmobj->tid = tid; newmobj->AddToHash(); - newmobj->momx = momx; - newmobj->momy = momy; - newmobj->momz = momz; + newmobj->velx = velx; + newmobj->vely = vely; + newmobj->velz = velz; newmobj->master = master; // For things such as DamageMaster/DamageChildren, transfer mastery. newmobj->target = target; newmobj->tracer = tracer; diff --git a/src/g_strife/a_alienspectres.cpp b/src/g_strife/a_alienspectres.cpp index bd2c0d72f..6506cdb1c 100644 --- a/src/g_strife/a_alienspectres.cpp +++ b/src/g_strife/a_alienspectres.cpp @@ -29,12 +29,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall) int t; t = pr_spectrechunk() & 15; - foo->momx = (t - (pr_spectrechunk() & 7)) << FRACBITS; + foo->velx = (t - (pr_spectrechunk() & 7)) << FRACBITS; t = pr_spectrechunk() & 15; - foo->momy = (t - (pr_spectrechunk() & 7)) << FRACBITS; + foo->vely = (t - (pr_spectrechunk() & 7)) << FRACBITS; - foo->momz = (pr_spectrechunk() & 15) << FRACBITS; + foo->velz = (pr_spectrechunk() & 15) << FRACBITS; } } @@ -47,12 +47,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkLarge) int t; t = pr_spectrechunk() & 7; - foo->momx = (t - (pr_spectrechunk() & 15)) << FRACBITS; + foo->velx = (t - (pr_spectrechunk() & 15)) << FRACBITS; t = pr_spectrechunk() & 7; - foo->momy = (t - (pr_spectrechunk() & 15)) << FRACBITS; + foo->vely = (t - (pr_spectrechunk() & 15)) << FRACBITS; - foo->momz = (pr_spectrechunk() & 7) << FRACBITS; + foo->velz = (pr_spectrechunk() & 7) << FRACBITS; } } @@ -64,7 +64,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack) AActor *foo = Spawn("SpectralLightningV2", self->x, self->y, self->z + 32*FRACUNIT, ALLOW_REPLACE); - foo->momz = -12*FRACUNIT; + foo->velz = -12*FRACUNIT; foo->target = self; foo->health = -2; foo->tracer = self->target; diff --git a/src/g_strife/a_crusader.cpp b/src/g_strife/a_crusader.cpp index cd0a14ea5..f4f0024fd 100644 --- a/src/g_strife/a_crusader.cpp +++ b/src/g_strife/a_crusader.cpp @@ -52,7 +52,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft) AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile")); if (misl != NULL) { - misl->momz += FRACUNIT; + misl->velz += FRACUNIT; } } @@ -62,7 +62,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepRight) AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile")); if (misl != NULL) { - misl->momz += FRACUNIT; + misl->velz += FRACUNIT; } } diff --git a/src/g_strife/a_entityboss.cpp b/src/g_strife/a_entityboss.cpp index b221c7c2d..51501c503 100644 --- a/src/g_strife/a_entityboss.cpp +++ b/src/g_strife/a_entityboss.cpp @@ -76,7 +76,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity) { entity->angle = self->angle; entity->CopyFriendliness(self, true); - entity->momz = 5*FRACUNIT; + entity->velz = 5*FRACUNIT; entity->tracer = self; } } @@ -101,16 +101,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath) //second->target = self->target; A_FaceTarget (second); an = second->angle >> ANGLETOFINESHIFT; - second->momx += FixedMul (finecosine[an], 320000); - second->momy += FixedMul (finesine[an], 320000); + second->velx += FixedMul (finecosine[an], 320000); + second->vely += FixedMul (finesine[an], 320000); an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT; second = Spawn("EntitySecond", SpawnX + FixedMul (secondRadius, finecosine[an]), SpawnY + FixedMul (secondRadius, finesine[an]), SpawnZ, ALLOW_REPLACE); second->CopyFriendliness(self, true); //second->target = self->target; - second->momx = FixedMul (secondRadius, finecosine[an]) << 2; - second->momy = FixedMul (secondRadius, finesine[an]) << 2; + second->velx = FixedMul (secondRadius, finecosine[an]) << 2; + second->vely = FixedMul (secondRadius, finesine[an]) << 2; A_FaceTarget (second); an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT; @@ -118,7 +118,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath) SpawnY + FixedMul (secondRadius, finesine[an]), SpawnZ, ALLOW_REPLACE); second->CopyFriendliness(self, true); //second->target = self->target; - second->momx = FixedMul (secondRadius, finecosine[an]) << 2; - second->momy = FixedMul (secondRadius, finesine[an]) << 2; + second->velx = FixedMul (secondRadius, finecosine[an]) << 2; + second->vely = FixedMul (secondRadius, finesine[an]) << 2; A_FaceTarget (second); } diff --git a/src/g_strife/a_inquisitor.cpp b/src/g_strife/a_inquisitor.cpp index e6aabff16..14bfdf57f 100644 --- a/src/g_strife/a_inquisitor.cpp +++ b/src/g_strife/a_inquisitor.cpp @@ -58,13 +58,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack) proj = P_SpawnMissileZAimed (self, self->z, self->target, PClass::FindClass("InquisitorShot")); if (proj != NULL) { - proj->momz += 9*FRACUNIT; + proj->velz += 9*FRACUNIT; } self->angle += ANGLE_45/16; proj = P_SpawnMissileZAimed (self, self->z, self->target, PClass::FindClass("InquisitorShot")); if (proj != NULL) { - proj->momz += 16*FRACUNIT; + proj->velz += 16*FRACUNIT; } self->z -= 32*FRACBITS; } @@ -83,15 +83,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump) A_FaceTarget (self); an = self->angle >> ANGLETOFINESHIFT; speed = self->Speed * 2/3; - self->momx += FixedMul (speed, finecosine[an]); - self->momy += FixedMul (speed, finesine[an]); + self->velx += FixedMul (speed, finecosine[an]); + self->vely += FixedMul (speed, finesine[an]); dist = P_AproxDistance (self->target->x - self->x, self->target->y - self->y); dist /= speed; if (dist < 1) { dist = 1; } - self->momz = (self->target->z - self->z) / dist; + self->velz = (self->target->z - self->z) / dist; self->reactiontime = 60; self->flags |= MF_NOGRAVITY; } @@ -100,8 +100,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorCheckLand) { self->reactiontime--; if (self->reactiontime < 0 || - self->momx == 0 || - self->momy == 0 || + self->velx == 0 || + self->vely == 0 || self->z <= self->floorz) { self->SetState (self->SeeState); @@ -121,8 +121,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossArm) { AActor *foo = Spawn("InquisitorArm", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); foo->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22); - foo->momx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3; - foo->momy = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3; - foo->momz = pr_inq() << 10; + foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3; + foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3; + foo->velz = pr_inq() << 10; } diff --git a/src/g_strife/a_loremaster.cpp b/src/g_strife/a_loremaster.cpp index ebe5c6a6d..8613aacee 100644 --- a/src/g_strife/a_loremaster.cpp +++ b/src/g_strife/a_loremaster.cpp @@ -32,9 +32,9 @@ int ALoreShot::DoSpecialDamage (AActor *target, int damage) thrust.MakeUnit(); thrust *= float((255*50*FRACUNIT) / (target->Mass ? target->Mass : 1)); - target->momx += fixed_t(thrust.X); - target->momy += fixed_t(thrust.Y); - target->momz += fixed_t(thrust.Z); + target->velx += fixed_t(thrust.X); + target->vely += fixed_t(thrust.Y); + target->velz += fixed_t(thrust.Z); } return damage; } @@ -43,6 +43,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain) { S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM); Spawn("LoreShot2", self->x, self->y, self->z, ALLOW_REPLACE); - Spawn("LoreShot2", self->x - (self->momx >> 1), self->y - (self->momy >> 1), self->z - (self->momz >> 1), ALLOW_REPLACE); - Spawn("LoreShot2", self->x - self->momx, self->y - self->momy, self->z - self->momz, ALLOW_REPLACE); + Spawn("LoreShot2", self->x - (self->velx >> 1), self->y - (self->vely >> 1), self->z - (self->velz >> 1), ALLOW_REPLACE); + Spawn("LoreShot2", self->x - self->velx, self->y - self->vely, self->z - self->velz, ALLOW_REPLACE); } diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index d3f259300..196fae584 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -127,9 +127,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase) if (foo != NULL) { foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22); - foo->momx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]); - foo->momy = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]); - foo->momz = pr_prog() << 9; + foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]); + foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]); + foo->velz = pr_prog() << 9; } } diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index 141ad2b8b..65c7483d3 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -15,7 +15,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob) if (self->flags & MF_INFLOAT) { - self->momz = 0; + self->velz = 0; return; } if (self->threshold != 0) @@ -29,11 +29,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob) } if (minz < self->z) { - self->momz -= FRACUNIT; + self->velz -= FRACUNIT; } else { - self->momz += FRACUNIT; + self->velz += FRACUNIT; } self->reactiontime = (minz >= self->z) ? 4 : 0; } @@ -44,24 +44,24 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack) missile = P_SpawnMissileZAimed (self, self->z + 32*FRACUNIT, self->target, PClass::FindClass("SentinelFX2")); - if (missile != NULL && (missile->momx|missile->momy) != 0) + if (missile != NULL && (missile->velx | missile->vely) != 0) { for (int i = 8; i > 1; --i) { trail = Spawn("SentinelFX1", self->x + FixedMul (missile->radius * i, finecosine[missile->angle >> ANGLETOFINESHIFT]), self->y + FixedMul (missile->radius * i, finesine[missile->angle >> ANGLETOFINESHIFT]), - missile->z + (missile->momz / 4 * i), ALLOW_REPLACE); + missile->z + (missile->velz / 4 * i), ALLOW_REPLACE); if (trail != NULL) { trail->target = self; - trail->momx = missile->momx; - trail->momy = missile->momy; - trail->momz = missile->momz; + trail->velx = missile->velx; + trail->vely = missile->vely; + trail->velz = missile->velz; P_CheckMissileSpawn (trail); } } - missile->z += missile->momz >> 2; + missile->z += missile->velz >> 2; } } diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index 10efceffc..0c54842c5 100644 --- a/src/g_strife/a_spectral.cpp +++ b/src/g_strife/a_spectral.cpp @@ -28,7 +28,7 @@ void ASpectralMonster::Touch (AActor *toucher) DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail) { - AActor *foo = Spawn("SpectralLightningHTail", self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE); + AActor *foo = Spawn("SpectralLightningHTail", self->x - self->velx, self->y - self->vely, self->z, ALLOW_REPLACE); foo->angle = self->angle; foo->health = self->health; @@ -58,8 +58,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning) if (self->threshold != 0) --self->threshold; - self->momx += pr_zap5.Random2(3) << FRACBITS; - self->momy += pr_zap5.Random2(3) << FRACBITS; + self->velx += pr_zap5.Random2(3) << FRACBITS; + self->vely += pr_zap5.Random2(3) << FRACBITS; x = self->x + pr_zap5.Random2(3) * FRACUNIT * 50; y = self->y + pr_zap5.Random2(3) * FRACUNIT * 50; @@ -68,13 +68,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning) PClass::FindClass("SpectralLightningV1"), x, y, ONCEILINGZ, ALLOW_REPLACE); flash->target = self->target; - flash->momz = -18*FRACUNIT; + flash->velz = -18*FRACUNIT; flash->health = self->health; flash = Spawn("SpectralLightningV2", self->x, self->y, ONCEILINGZ, ALLOW_REPLACE); flash->target = self->target; - flash->momz = -18*FRACUNIT; + flash->velz = -18*FRACUNIT; flash->health = self->health; } @@ -114,8 +114,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2) } exact = self->angle >> ANGLETOFINESHIFT; - self->momx = FixedMul (self->Speed, finecosine[exact]); - self->momy = FixedMul (self->Speed, finesine[exact]); + self->velx = FixedMul (self->Speed, finecosine[exact]); + self->vely = FixedMul (self->Speed, finesine[exact]); // change slope dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); @@ -133,12 +133,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2) { slope = (dest->z + self->height*2/3 - self->z) / dist; } - if (slope < self->momz) + if (slope < self->velz) { - self->momz -= FRACUNIT/8; + self->velz -= FRACUNIT/8; } else { - self->momz += FRACUNIT/8; + self->velz += FRACUNIT/8; } } diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 5f7de6519..2764a2c0b 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -591,9 +591,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib) an = pr_gibtosser() << 24; gib->angle = an; speed = pr_gibtosser() & 15; - gib->momx = speed * finecosine[an >> ANGLETOFINESHIFT]; - gib->momy = speed * finesine[an >> ANGLETOFINESHIFT]; - gib->momz = (pr_gibtosser() & 15) << FRACBITS; + gib->velx = speed * finecosine[an >> ANGLETOFINESHIFT]; + gib->vely = speed * finesine[an >> ANGLETOFINESHIFT]; + gib->velz = (pr_gibtosser() & 15) << FRACBITS; } //============================================================================ @@ -639,8 +639,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain) fixed_t speed = (anglespeed % 10) << (FRACBITS - 4); angle_t finean = (anglespeed / 10) << (32-3); finean >>= ANGLETOFINESHIFT; - self->momx += FixedMul (speed, finecosine[finean]); - self->momy += FixedMul (speed, finesine[finean]); + self->velx += FixedMul (speed, finecosine[finean]); + self->vely += FixedMul (speed, finesine[finean]); } } } @@ -681,7 +681,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns) DEFINE_ACTION_FUNCTION(AActor, A_DropFire) { AActor *drop = Spawn("FireDroplet", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); - drop->momz = -FRACUNIT; + drop->velz = -FRACUNIT; P_RadiusAttack (self, self, 64, 64, NAME_Fire, false); } diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 0dbab29cb..6c53fa247 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -339,10 +339,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight) S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM); P_SpawnPuff (self, PClass::FindClass("MiniMissilePuff"), self->x, self->y, self->z, self->angle - ANGLE_180, 2, PF_HITTHING); - trail = Spawn("RocketTrail", self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE); + trail = Spawn("RocketTrail", self->x - self->velx, self->y - self->vely, self->z, ALLOW_REPLACE); if (trail != NULL) { - trail->momz = FRACUNIT; + trail->velz = FRACUNIT; } } @@ -357,7 +357,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight) DEFINE_ACTION_FUNCTION(AActor, A_FlameDie) { self->flags |= MF_NOGRAVITY; - self->momz = (pr_flamedie() & 3) << FRACBITS; + self->velz = (pr_flamedie() & 3) << FRACBITS; } //============================================================================ @@ -385,7 +385,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer) self = P_SpawnPlayerMissile (self, PClass::FindClass("FlameMissile")); if (self != NULL) { - self->momz += 5*FRACUNIT; + self->velz += 5*FRACUNIT; } } @@ -520,8 +520,8 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target) other->target = target; other->angle = source->angle; - other->momx = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]); - other->momy = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]); + other->velx = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]); + other->vely = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]); if (other->flags4 & MF4_SPECTRAL) { @@ -542,7 +542,7 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target) if (P_CheckMissileSpawn (other)) { angle_t pitch = P_AimLineAttack (source, source->angle, 1024*FRACUNIT); - other->momz = FixedMul (-finesine[pitch>>ANGLETOFINESHIFT], other->Speed); + other->velz = FixedMul (-finesine[pitch>>ANGLETOFINESHIFT], other->Speed); return other; } return NULL; @@ -573,9 +573,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_BurnArea) DEFINE_ACTION_FUNCTION(AActor, A_Burnination) { - self->momz -= 8*FRACUNIT; - self->momx += (pr_phburn.Random2 (3)) << FRACBITS; - self->momy += (pr_phburn.Random2 (3)) << FRACBITS; + self->velz -= 8*FRACUNIT; + self->velx += (pr_phburn.Random2 (3)) << FRACBITS; + self->vely += (pr_phburn.Random2 (3)) << FRACBITS; S_Sound (self, CHAN_VOICE, "world/largefire", 1, ATTN_NORM); // Only the main fire spawns more. @@ -617,9 +617,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination) self->z + 4*FRACUNIT, ALLOW_REPLACE); if (drop != NULL) { - drop->momx = self->momx + ((pr_phburn.Random2 (7)) << FRACBITS); - drop->momy = self->momy + ((pr_phburn.Random2 (7)) << FRACBITS); - drop->momz = self->momz - FRACUNIT; + drop->velx = self->velx + ((pr_phburn.Random2 (7)) << FRACBITS); + drop->vely = self->vely + ((pr_phburn.Random2 (7)) << FRACBITS); + drop->velz = self->velz - FRACUNIT; drop->reactiontime = (pr_phburn() & 3) + 2; drop->flags |= MF_DROPPED; } @@ -669,7 +669,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade) S_Sound (grenade, CHAN_VOICE, grenade->SeeSound, 1, ATTN_NORM); } - grenade->momz = FixedMul (finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], grenade->Speed) + 8*FRACUNIT; + grenade->velz = FixedMul (finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], grenade->Speed) + 8*FRACUNIT; an = self->angle >> ANGLETOFINESHIFT; tworadii = self->radius + grenade->radius; @@ -915,8 +915,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1) spot = Spawn("SpectralLightningSpot", self->x, self->y, self->z, ALLOW_REPLACE); if (spot != NULL) { - spot->momx += 28 * finecosine[self->angle >> ANGLETOFINESHIFT]; - spot->momy += 28 * finesine[self->angle >> ANGLETOFINESHIFT]; + spot->velx += 28 * finecosine[self->angle >> ANGLETOFINESHIFT]; + spot->vely += 28 * finesine[self->angle >> ANGLETOFINESHIFT]; } } if (spot != NULL) @@ -1008,8 +1008,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4) spot = P_SpawnPlayerMissile (self, PClass::FindClass("SpectralLightningBigV1")); if (spot != NULL) { - spot->momx += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]); - spot->momy += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]); + spot->velx += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]); + spot->vely += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]); } } } diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index d0271e3e6..95348600a 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -101,9 +101,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightGoesOut) if (foo != NULL) { int t = pr_lightout() & 15; - foo->momx = (t - (pr_lightout() & 7)) << FRACBITS; - foo->momy = (pr_lightout.Random2() & 7) << FRACBITS; - foo->momz = (7 + (pr_lightout() & 3)) << FRACBITS; + foo->velx = (t - (pr_lightout() & 7)) << FRACBITS; + foo->vely = (pr_lightout.Random2() & 7) << FRACBITS; + foo->velz = (7 + (pr_lightout() & 3)) << FRACBITS; } } } diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 7e8a50a85..04f73b70f 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -108,9 +108,9 @@ void cht_DoCheat (player_t *player, int cheat) msg = GStrings("STSTR_NCOFF"); break; - case CHT_NOMOMENTUM: - player->cheats ^= CF_NOMOMENTUM; - if (player->cheats & CF_NOMOMENTUM) + case CHT_NOVELOCITY: + player->cheats ^= CF_NOVELOCITY; + if (player->cheats & CF_NOVELOCITY) msg = GStrings("TXT_LEADBOOTSON"); else msg = GStrings("TXT_LEADBOOTSOFF"); diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 903cf1efc..9fd7c4402 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -2791,9 +2791,9 @@ enum EACSFunctions ACSF_GetSectorUDMFFixed, ACSF_GetSideUDMFInt, ACSF_GetSideUDMFFixed, - ACSF_GetActorMomX, - ACSF_GetActorMomY, - ACSF_GetActorMomZ, + ACSF_GetActorVelX, + ACSF_GetActorVelY, + ACSF_GetActorVelZ, ACSF_SetActivator, ACSF_SetActivatorToTarget, ACSF_GetActorViewHeight, @@ -2865,17 +2865,17 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args) case ACSF_GetSideUDMFFixed: return GetUDMFFixed(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2])); - case ACSF_GetActorMomX: + case ACSF_GetActorVelX: actor = SingleActorFromTID(args[0], activator); - return actor != NULL? actor->momx : 0; + return actor != NULL? actor->velx : 0; - case ACSF_GetActorMomY: + case ACSF_GetActorVelY: actor = SingleActorFromTID(args[0], activator); - return actor != NULL? actor->momy : 0; + return actor != NULL? actor->vely : 0; - case ACSF_GetActorMomZ: + case ACSF_GetActorVelZ: actor = SingleActorFromTID(args[0], activator); - return actor != NULL? actor->momz : 0; + return actor != NULL? actor->velz : 0; case ACSF_SetActivator: activator = SingleActorFromTID(args[0], NULL); diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 026073e3f..35fcf5517 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -673,8 +673,8 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang return; } - pc->momx = pc->momy = 0; // Stop moving - pc->player->momx = pc->player->momy = 0; + pc->velx = pc->vely = 0; // Stop moving + pc->player->velx = pc->player->vely = 0; static_cast(pc)->PlayIdle (); pc->player->ConversationPC = pc; diff --git a/src/p_effect.cpp b/src/p_effect.cpp index a76412844..19b623b38 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -235,7 +235,7 @@ static void MakeFountain (AActor *actor, int color1, int color2) void P_RunEffect (AActor *actor, int effects) { - angle_t moveangle = R_PointToAngle2(0,0,actor->momx,actor->momy); + angle_t moveangle = R_PointToAngle2(0,0,actor->velx,actor->vely); particle_t *particle; int i; @@ -245,7 +245,7 @@ void P_RunEffect (AActor *actor, int effects) fixed_t backx = actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2); fixed_t backy = actor->y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2); - fixed_t backz = actor->z - (actor->height>>3) * (actor->momz>>16) + (2*actor->height)/3; + fixed_t backz = actor->z - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3; angle_t an = (moveangle + ANG90) >> ANGLETOFINESHIFT; int speed; @@ -253,9 +253,9 @@ void P_RunEffect (AActor *actor, int effects) particle = JitterParticle (3 + (M_Random() & 31)); if (particle) { fixed_t pathdist = M_Random()<<8; - particle->x = backx - FixedMul(actor->momx, pathdist); - particle->y = backy - FixedMul(actor->momy, pathdist); - particle->z = backz - FixedMul(actor->momz, pathdist); + particle->x = backx - FixedMul(actor->velx, pathdist); + particle->y = backy - FixedMul(actor->vely, pathdist); + particle->z = backz - FixedMul(actor->velz, pathdist); speed = (M_Random () - 128) * (FRACUNIT/200); particle->velx += FixedMul (speed, finecosine[an]); particle->vely += FixedMul (speed, finesine[an]); @@ -268,9 +268,9 @@ void P_RunEffect (AActor *actor, int effects) particle_t *particle = JitterParticle (3 + (M_Random() & 31)); if (particle) { fixed_t pathdist = M_Random()<<8; - particle->x = backx - FixedMul(actor->momx, pathdist); - particle->y = backy - FixedMul(actor->momy, pathdist); - particle->z = backz - FixedMul(actor->momz, pathdist) + (M_Random() << 10); + particle->x = backx - FixedMul(actor->velx, pathdist); + particle->y = backy - FixedMul(actor->vely, pathdist); + particle->z = backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10); speed = (M_Random () - 128) * (FRACUNIT/200); particle->velx += FixedMul (speed, finecosine[an]); particle->vely += FixedMul (speed, finesine[an]); @@ -292,7 +292,7 @@ void P_RunEffect (AActor *actor, int effects) P_DrawSplash2 (6, actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2), actor->y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2), - actor->z - (actor->height>>3) * (actor->momz>>16) + (2*actor->height)/3, + actor->z - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3, moveangle + ANG180, 2, 2); } if (effects & FX_FOUNTAINMASK) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index f8433acde..91d8145f2 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -65,7 +65,7 @@ static FRandom pr_slook ("SlooK"); static FRandom pr_skiptarget("SkipTarget"); // movement interpolation is fine for objects that are moved by their own -// momentum. But for monsters it is problematic. +// velocity. But for monsters it is problematic. // 1. They don't move every tic // 2. Their animation is not designed for movement interpolation // The result is that they tend to 'glide' across the floor @@ -475,8 +475,8 @@ bool P_Move (AActor *actor) actor->x = origx; actor->y = origy; movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4; - actor->momx += FixedMul (deltax, movefactor); - actor->momy += FixedMul (deltay, movefactor); + actor->velx += FixedMul (deltax, movefactor); + actor->vely += FixedMul (deltay, movefactor); } if (!try_ok) @@ -1522,7 +1522,7 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround) { if ((P_AproxDistance (player->mo->x - actor->x, player->mo->y - actor->y) > 2*MELEERANGE) - && P_AproxDistance (player->mo->momx, player->mo->momy) + && P_AproxDistance (player->mo->velx, player->mo->vely) < 5*FRACUNIT) { // Player is sneaking - can't detect return false; @@ -1994,8 +1994,8 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi else { actor->FastChaseStrafeCount = 0; - actor->momx = 0; - actor->momy = 0; + actor->velx = 0; + actor->vely = 0; fixed_t dist = P_AproxDistance (actor->x - actor->target->x, actor->y - actor->target->y); if (dist < CLASS_BOSS_STRAFE_RANGE) { @@ -2004,8 +2004,8 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi angle_t ang = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y); if (pr_chase() < 128) ang += ANGLE_90; else ang -= ANGLE_90; - actor->momx = 13 * finecosine[ang>>ANGLETOFINESHIFT]; - actor->momy = 13 * finesine[ang>>ANGLETOFINESHIFT]; + actor->velx = 13 * finecosine[ang>>ANGLETOFINESHIFT]; + actor->vely = 13 * finesine[ang>>ANGLETOFINESHIFT]; actor->FastChaseStrafeCount = 3; // strafe time } } @@ -2165,7 +2165,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) abs(corpsehit-> y - viletryy) > maxdist ) continue; // not actually touching - corpsehit->momx = corpsehit->momy = 0; + corpsehit->velx = corpsehit->vely = 0; // [RH] Check against real height and radius fixed_t oldheight = corpsehit->height; @@ -2371,8 +2371,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail) // Let the aim trail behind the player self->angle = R_PointToAngle2 (self->x, self->y, - self->target->x - self->target->momx * 3, - self->target->y - self->target->momy * 3); + self->target->x - self->target->velx * 3, + self->target->y - self->target->vely * 3); if (self->target->flags & MF_SHADOW) { @@ -2562,14 +2562,14 @@ void P_TossItem (AActor *item) if (style==2) { - item->momx += pr_dropitem.Random2(7) << FRACBITS; - item->momy += pr_dropitem.Random2(7) << FRACBITS; + item->velx += pr_dropitem.Random2(7) << FRACBITS; + item->vely += pr_dropitem.Random2(7) << FRACBITS; } else { - item->momx = pr_dropitem.Random2() << 8; - item->momy = pr_dropitem.Random2() << 8; - item->momz = FRACUNIT*5 + (pr_dropitem() << 10); + item->velx = pr_dropitem.Random2() << 8; + item->vely = pr_dropitem.Random2() << 8; + item->velz = FRACUNIT*5 + (pr_dropitem() << 10); } } diff --git a/src/p_enemy_a_lookex.cpp b/src/p_enemy_a_lookex.cpp index 757267b7f..8312e5ae7 100644 --- a/src/p_enemy_a_lookex.cpp +++ b/src/p_enemy_a_lookex.cpp @@ -681,7 +681,7 @@ bool P_NewLookPlayers (AActor *actor, angle_t fov, fixed_t mindist, fixed_t maxd { if ((P_AproxDistance (player->mo->x - actor->x, player->mo->y - actor->y) > 2*MELEERANGE) - && P_AproxDistance (player->mo->momx, player->mo->momy) + && P_AproxDistance (player->mo->velx, player->mo->vely) < 5*FRACUNIT) { // Player is sneaking - can't detect return false; diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index baa9f0e94..6c63967df 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -910,7 +910,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage else if (target->flags & MF_ICECORPSE) // frozen { target->tics = 1; - target->momx = target->momy = target->momz = 0; + target->velx = target->vely = target->velz = 0; } return; } @@ -946,7 +946,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage } if (target->flags & MF_SKULLFLY) { - target->momx = target->momy = target->momz = 0; + target->velx = target->vely = target->velz = 0; } if (!(flags & DMG_FORCED)) // DMG_FORCED skips all special damage checks { @@ -1064,17 +1064,17 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage (source->player->ReadyWeapon->WeaponFlags & WIF_STAFF2_KICKBACK)) { // Staff power level 2 - target->momx += FixedMul (10*FRACUNIT, finecosine[ang]); - target->momy += FixedMul (10*FRACUNIT, finesine[ang]); + target->velx += FixedMul (10*FRACUNIT, finecosine[ang]); + target->vely += FixedMul (10*FRACUNIT, finesine[ang]); if (!(target->flags & MF_NOGRAVITY)) { - target->momz += 5*FRACUNIT; + target->velz += 5*FRACUNIT; } } else { - target->momx += FixedMul (thrust, finecosine[ang]); - target->momy += FixedMul (thrust, finesine[ang]); + target->velx += FixedMul (thrust, finecosine[ang]); + target->vely += FixedMul (thrust, finesine[ang]); } } } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index fa477c25f..6391db2ae 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -871,12 +871,12 @@ FUNC(LS_ThrustThing) static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit) { angle >>= ANGLETOFINESHIFT; - it->momx += force * finecosine[angle]; - it->momy += force * finesine[angle]; + it->velx += force * finecosine[angle]; + it->vely += force * finesine[angle]; if (!nolimit) { - it->momx = clamp (it->momx, -MAXMOVE, MAXMOVE); - it->momy = clamp (it->momy, -MAXMOVE, MAXMOVE); + it->velx = clamp (it->velx, -MAXMOVE, MAXMOVE); + it->vely = clamp (it->vely, -MAXMOVE, MAXMOVE); } } @@ -897,18 +897,18 @@ FUNC(LS_ThrustThingZ) // [BC] while ( (victim = iterator.Next ()) ) { if (!arg3) - victim->momz = thrust; + victim->velz = thrust; else - victim->momz += thrust; + victim->velz += thrust; } return true; } else if (it) { if (!arg3) - it->momz = thrust; + it->velz = thrust; else - it->momz += thrust; + it->velz += thrust; return true; } return false; @@ -1386,7 +1386,7 @@ static bool DoThingRaise(AActor *thing) AActor *info = thing->GetDefault (); - thing->momx = thing->momy = 0; + thing->velx = thing->vely = 0; // [RH] Check against real height and radius fixed_t oldheight = thing->height; @@ -1455,8 +1455,8 @@ FUNC(LS_Thing_Stop) { if (it != NULL) { - it->momx = it->momy = it->momz = 0; - if (it->player != NULL) it->player->momx = it->player->momy = 0; + it->velx = it->vely = it->velz = 0; + if (it->player != NULL) it->player->velx = it->player->vely = 0; ok = true; } } @@ -1466,8 +1466,8 @@ FUNC(LS_Thing_Stop) while ( (target = iterator.Next ()) ) { - target->momx = target->momy = target->momz = 0; - if (target->player != NULL) target->player->momx = target->player->momy = 0; + target->velx = target->vely = target->velz = 0; + if (target->player != NULL) target->player->velx = target->player->vely = 0; ok = true; } } @@ -2899,9 +2899,9 @@ FUNC(LS_GlassBreak) glass->angle = an; an >>= ANGLETOFINESHIFT; speed = pr_glass() & 3; - glass->momx = finecosine[an] * speed; - glass->momy = finesine[an] * speed; - glass->momz = (pr_glass() & 7) << FRACBITS; + glass->velx = finecosine[an] * speed; + glass->vely = finesine[an] * speed; + glass->velz = (pr_glass() & 7) << FRACBITS; // [RH] Let the shards stick around longer than they did in Strife. glass->tics += pr_glass(); } diff --git a/src/p_local.h b/src/p_local.h index cb9ab4a86..306655d8d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -113,10 +113,10 @@ void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target); AActor *P_SpawnMissile (AActor* source, AActor* dest, const PClass *type); AActor *P_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, const PClass *type); AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, AActor *source, AActor *dest, const PClass *type, bool checkspawn = true); -AActor *P_SpawnMissileAngle (AActor *source, const PClass *type, angle_t angle, fixed_t momz); -AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type, angle_t angle, fixed_t momz, fixed_t speed); -AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t momz); -AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner=NULL, bool checkspawn = true); +AActor *P_SpawnMissileAngle (AActor *source, const PClass *type, angle_t angle, fixed_t velz); +AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type, angle_t angle, fixed_t velz, fixed_t speed); +AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t velz); +AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner=NULL, bool checkspawn = true); AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type); AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type); diff --git a/src/p_map.cpp b/src/p_map.cpp index df7974eba..03871229d 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -524,13 +524,13 @@ int P_GetMoveFactor (const AActor *mo, int *frictionp) // phares 3/11/98: you start off slowly, then increase as // you get better footing - int momentum = P_AproxDistance(mo->momx,mo->momy); + int velocity = P_AproxDistance(mo->velx, mo->vely); - if (momentum > MORE_FRICTION_MOMENTUM<<2) + if (velocity > MORE_FRICTION_VELOCITY<<2) movefactor <<= 3; - else if (momentum > MORE_FRICTION_MOMENTUM<<1) + else if (velocity > MORE_FRICTION_VELOCITY<<1) movefactor <<= 2; - else if (momentum > MORE_FRICTION_MOMENTUM) + else if (velocity > MORE_FRICTION_VELOCITY) movefactor <<= 1; } @@ -812,9 +812,9 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm) { if (!(thing->flags2 & MF2_BOSS) && (thing->flags3 & MF3_ISMONSTER)) { - thing->momx += tm.thing->momx; - thing->momy += tm.thing->momy; - if ((thing->momx + thing->momy) > 3*FRACUNIT) + thing->velx += tm.thing->velx; + thing->vely += tm.thing->vely; + if ((thing->velx + thing->vely) > 3*FRACUNIT) { damage = (tm.thing->Mass / 100) + 1; P_DamageMobj (thing, tm.thing, tm.thing, damage, tm.thing->DamageType); @@ -1010,8 +1010,8 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm) { // Push thing if (thing->lastpush != tm.PushTime) { - thing->momx += FixedMul(tm.thing->momx, thing->pushfactor); - thing->momy += FixedMul(tm.thing->momy, thing->pushfactor); + thing->velx += FixedMul(tm.thing->velx, thing->pushfactor); + thing->vely += FixedMul(tm.thing->vely, thing->pushfactor); thing->lastpush = tm.PushTime; } } @@ -1054,8 +1054,8 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm) { // Push thing if (thing->lastpush != tm.PushTime) { - thing->momx += FixedMul(tm.thing->momx, thing->pushfactor); - thing->momy += FixedMul(tm.thing->momy, thing->pushfactor); + thing->velx += FixedMul(tm.thing->velx, thing->pushfactor); + thing->vely += FixedMul(tm.thing->vely, thing->pushfactor); thing->lastpush = tm.PushTime; } } @@ -1427,7 +1427,7 @@ void P_FakeZMovement (AActor *mo) // // adjust height // - mo->z += mo->momz; + mo->z += mo->velz; if ((mo->flags&MF_FLOAT) && mo->target) { // float down towards target if too close if (!(mo->flags & MF_SKULLFLY) && !(mo->flags & MF_INFLOAT)) @@ -1584,12 +1584,12 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y, // is not blocked. if (thing->z+thing->height > tmceilingz) { - thing->momz = -8*FRACUNIT; + thing->velz = -8*FRACUNIT; goto pushline; } else if (thing->z < tmfloorz && tmfloorz-tmdropoffz > thing->MaxDropOffHeight) { - thing->momz = 8*FRACUNIT; + thing->velz = 8*FRACUNIT; goto pushline; } #endif @@ -1619,7 +1619,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y, } // compatibility check: Doom originally did not allow monsters to cross dropoffs at all. - // If the compatibility flag is on, only allow this when the momentum comes from a scroller + // If the compatibility flag is on, only allow this when the velocity comes from a scroller if ((i_compatflags & COMPATF_CROSSDROPOFF) && !(thing->flags4 & MF4_SCROLLMOVE)) { dropoff = false; @@ -1669,8 +1669,8 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y, { thing->player->prev = thing->player->dest; thing->player->dest = NULL; - thing->momx = 0; - thing->momy = 0; + thing->velx = 0; + thing->vely = 0; thing->z = oldz; return false; } @@ -1981,7 +1981,7 @@ void FSlide::HitSlideLine (line_t* ld) // | // Under icy conditions, if the angle of approach to the wall // V // is more than 45 degrees, then you'll bounce and lose half - // your momentum. If less than 45 degrees, you'll slide along + // your velocity. If less than 45 degrees, you'll slide along // the wall. 45 is arbitrary and is believable. // Check for the special cases of horz or vert walls. @@ -1997,7 +1997,7 @@ void FSlide::HitSlideLine (line_t* ld) { if (icyfloor && (abs(tmymove) > abs(tmxmove))) { - tmxmove /= 2; // absorb half the momentum + tmxmove /= 2; // absorb half the velocity tmymove = -tmymove/2; if (slidemo->player && slidemo->health > 0 && !(slidemo->player->cheats & CF_PREDICTING)) { @@ -2013,7 +2013,7 @@ void FSlide::HitSlideLine (line_t* ld) { if (icyfloor && (abs(tmxmove) > abs(tmymove))) { - tmxmove = -tmxmove/2; // absorb half the momentum + tmxmove = -tmxmove/2; // absorb half the velocity tmymove /= 2; if (slidemo->player && slidemo->health > 0 && !(slidemo->player->cheats & CF_PREDICTING)) { @@ -2194,7 +2194,7 @@ void FSlide::SlideTraverse (fixed_t startx, fixed_t starty, fixed_t endx, fixed_ // // P_SlideMove // -// The momx / momy move is bad, so try to slide along a wall. +// The velx / vely move is bad, so try to slide along a wall. // // Find the first line hit, move flush to it, and slide along it // @@ -2289,16 +2289,16 @@ void FSlide::SlideMove (AActor *mo, fixed_t tryx, fixed_t tryy, int numsteps) HitSlideLine (bestslideline); // clip the moves - mo->momx = tmxmove * numsteps; - mo->momy = tmymove * numsteps; + mo->velx = tmxmove * numsteps; + mo->vely = tmymove * numsteps; // killough 10/98: affect the bobbing the same way (but not voodoo dolls) if (mo->player && mo->player->mo == mo) { - if (abs(mo->player->momx) > abs(mo->momx)) - mo->player->momx = mo->momx; - if (abs(mo->player->momy) > abs(mo->momy)) - mo->player->momy = mo->momy; + if (abs(mo->player->velx) > abs(mo->velx)) + mo->player->velx = mo->velx; + if (abs(mo->player->vely) > abs(mo->vely)) + mo->player->vely = mo->vely; } walkplane = P_CheckSlopeWalk (mo, tmxmove, tmymove); @@ -2421,8 +2421,8 @@ const secplane_t * P_CheckSlopeWalk (AActor *actor, fixed_t &xmove, fixed_t &ymo } if (dopush) { - xmove = actor->momx = plane->a * 2; - ymove = actor->momy = plane->b * 2; + xmove = actor->velx = plane->a * 2; + ymove = actor->vely = plane->b * 2; } return (actor->floorsector == actor->Sector) ? plane : NULL; } @@ -2539,7 +2539,7 @@ bool FSlide::BounceWall (AActor *mo) // // trace along the three leading corners // - if (mo->momx > 0) + if (mo->velx > 0) { leadx = mo->x+mo->radius; } @@ -2547,7 +2547,7 @@ bool FSlide::BounceWall (AActor *mo) { leadx = mo->x-mo->radius; } - if (mo->momy > 0) + if (mo->vely > 0) { leady = mo->y+mo->radius; } @@ -2557,7 +2557,7 @@ bool FSlide::BounceWall (AActor *mo) } bestslidefrac = FRACUNIT+1; bestslideline = mo->BlockingLine; - if (BounceTraverse(leadx, leady, leadx+mo->momx, leady+mo->momy) && mo->BlockingLine == NULL) + if (BounceTraverse(leadx, leady, leadx+mo->velx, leady+mo->vely) && mo->BlockingLine == NULL) { // Could not find a wall, so bounce off the floor/ceiling instead. fixed_t floordist = mo->z - mo->floorz; fixed_t ceildist = mo->ceilingz - mo->z; @@ -2594,14 +2594,14 @@ bool FSlide::BounceWall (AActor *mo) { lineangle += ANG180; } - moveangle = R_PointToAngle2 (0, 0, mo->momx, mo->momy); + moveangle = R_PointToAngle2 (0, 0, mo->velx, mo->vely); deltaangle = (2*lineangle)-moveangle; mo->angle = deltaangle; lineangle >>= ANGLETOFINESHIFT; deltaangle >>= ANGLETOFINESHIFT; - movelen = P_AproxDistance (mo->momx, mo->momy); + movelen = P_AproxDistance (mo->velx, mo->vely); movelen = FixedMul(movelen, mo->wallbouncefactor); FBoundingBox box(mo->x, mo->y, mo->radius); @@ -2614,8 +2614,8 @@ bool FSlide::BounceWall (AActor *mo) { movelen = 2*FRACUNIT; } - mo->momx = FixedMul(movelen, finecosine[deltaangle]); - mo->momy = FixedMul(movelen, finesine[deltaangle]); + mo->velx = FixedMul(movelen, finecosine[deltaangle]); + mo->vely = FixedMul(movelen, finesine[deltaangle]); return true; } @@ -3412,11 +3412,11 @@ void P_TraceBleed (int damage, AActor *target, AActor *missile) return; } - if (missile->momz != 0) + if (missile->velz != 0) { double aim; - aim = atan ((double)missile->momz / (double)P_AproxDistance (missile->x - target->x, missile->y - target->y)); + aim = atan ((double)missile->velz / (double)P_AproxDistance (missile->x - target->x, missile->y - target->y)); pitch = -(int)(aim * ANGLE_180/PI); } else @@ -4006,7 +4006,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b if (points > 0.f && P_CheckSight (thing, bombspot, 1)) { // OK to damage; target is in direct path - float momz; + float velz; float thrust; int damage = (int)points; @@ -4024,19 +4024,20 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b { thrust *= selfthrustscale; } - momz = (float)(thing->z + (thing->height>>1) - bombspot->z) * thrust; + velz = (float)(thing->z + (thing->height>>1) - bombspot->z) * thrust; if (bombsource != thing) { - momz *= 0.5f; + velz *= 0.5f; } else { - momz *= 0.8f; + velz *= 0.8f; } angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT; - thing->momx += fixed_t (finecosine[ang] * thrust); - thing->momy += fixed_t (finesine[ang] * thrust); - if (bombdodamage) thing->momz += (fixed_t)momz; // this really doesn't work well + thing->velx += fixed_t (finecosine[ang] * thrust); + thing->vely += fixed_t (finesine[ang] * thrust); + if (bombdodamage) + thing->velz += (fixed_t)velz; // this really doesn't work well } } } @@ -4256,8 +4257,8 @@ void P_DoCrunch (AActor *thing, FChangePosition *cpos) mo = Spawn (bloodcls, thing->x, thing->y, thing->z + thing->height/2, ALLOW_REPLACE); - mo->momx = pr_crunch.Random2 () << 12; - mo->momy = pr_crunch.Random2 () << 12; + mo->velx = pr_crunch.Random2 () << 12; + mo->vely = pr_crunch.Random2 () << 12; if (bloodcolor != 0 && !(mo->flags2 & MF2_DONTTRANSLATE)) { mo->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a); @@ -4379,7 +4380,7 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos) if (oldfloorz == thing->floorz) return; - if (thing->momz == 0 && + if (thing->velz == 0 && (!(thing->flags & MF_NOGRAVITY) || (thing->z == oldfloorz && !(thing->flags & MF_NOLIFTDROP)))) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c1ab00994..c8c380607 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -222,9 +222,9 @@ void AActor::Serialize (FArchive &arc) << radius << height << projectilepassheight - << momx - << momy - << momz + << velx + << vely + << velz << tics << state << Damage @@ -752,9 +752,9 @@ AInventory *AActor::DropInventory (AInventory *item) drop->z = z + 10*FRACUNIT; P_TryMove (drop, x, y, true); drop->angle = angle; - drop->momx = momx + 5 * finecosine[an]; - drop->momy = momy + 5 * finesine[an]; - drop->momz = momz + FRACUNIT; + drop->velx = velx + 5 * finecosine[an]; + drop->vely = vely + 5 * finesine[an]; + drop->velz = velz + FRACUNIT; drop->flags &= ~MF_NOGRAVITY; // Don't float return drop; } @@ -1044,7 +1044,7 @@ bool AActor::Grind(bool items) if (this->flags & MF_ICECORPSE) { this->tics = 1; - this->momx = this->momy = this->momz = 0; + this->velx = this->vely = this->velz = 0; } else if (this->player) { @@ -1120,7 +1120,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target) return; } } - mo->momx = mo->momy = mo->momz = 0; + mo->velx = mo->vely = mo->velz = 0; mo->effects = 0; // [RH] FState *nextstate=NULL; @@ -1310,16 +1310,15 @@ bool AActor::FloorBounceMissile (secplane_t &plane) return true; } - fixed_t dot = TMulScale16 (momx, plane.a, momy, plane.b, momz, plane.c); + fixed_t dot = TMulScale16 (velx, plane.a, vely, plane.b, velz, plane.c); int bt = bouncetype & BOUNCE_TypeMask; - if (bt == BOUNCE_Heretic) { - momx -= MulScale15 (plane.a, dot); - momy -= MulScale15 (plane.b, dot); - momz -= MulScale15 (plane.c, dot); - angle = R_PointToAngle2 (0, 0, momx, momy); + velx -= MulScale15 (plane.a, dot); + vely -= MulScale15 (plane.b, dot); + velz -= MulScale15 (plane.c, dot); + angle = R_PointToAngle2 (0, 0, velx, vely); flags |= MF_INBOUNCE; SetState (FindState(NAME_Death)); flags &= ~MF_INBOUNCE; @@ -1328,15 +1327,15 @@ bool AActor::FloorBounceMissile (secplane_t &plane) // The reflected velocity keeps only about 70% of its original speed long bouncescale = 0x4000 * bouncefactor; - momx = MulScale30 (momx - MulScale15 (plane.a, dot), bouncescale); - momy = MulScale30 (momy - MulScale15 (plane.b, dot), bouncescale); - momz = MulScale30 (momz - MulScale15 (plane.c, dot), bouncescale); - angle = R_PointToAngle2 (0, 0, momx, momy); + velx = MulScale30 (velx - MulScale15 (plane.a, dot), bouncescale); + vely = MulScale30 (vely - MulScale15 (plane.b, dot), bouncescale); + velz = MulScale30 (velz - MulScale15 (plane.c, dot), bouncescale); + angle = R_PointToAngle2 (0, 0, velx, vely); PlayBounceSound(true); if (bt == BOUNCE_Doom) { - if (!(flags & MF_NOGRAVITY) && (momz < 3*FRACUNIT)) + if (!(flags & MF_NOGRAVITY) && (velz < 3*FRACUNIT)) { bouncetype = BOUNCE_None; } @@ -1353,8 +1352,8 @@ bool AActor::FloorBounceMissile (secplane_t &plane) void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move) { angle >>= ANGLETOFINESHIFT; - mo->momx += FixedMul (move, finecosine[angle]); - mo->momy += FixedMul (move, finesine[angle]); + mo->velx += FixedMul (move, finecosine[angle]); + mo->vely += FixedMul (move, finesine[angle]); } //---------------------------------------------------------------------------- @@ -1470,8 +1469,8 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax) actor->angle -= delta; } angle = actor->angle>>ANGLETOFINESHIFT; - actor->momx = FixedMul (actor->Speed, finecosine[angle]); - actor->momy = FixedMul (actor->Speed, finesine[angle]); + actor->velx = FixedMul (actor->Speed, finecosine[angle]); + actor->vely = FixedMul (actor->Speed, finesine[angle]); if (actor->z + actor->height < target->z || target->z + target->height < actor->z) { // Need to seek vertically @@ -1481,7 +1480,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax) { dist = 1; } - actor->momz = ((target->z+target->height/2) - (actor->z+actor->height/2)) / dist; + actor->velz = ((target->z+target->height/2) - (actor->z+actor->height/2)) / dist; } return true; } @@ -1540,20 +1539,20 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) (mo->player != NULL && mo->player->crouchfactor < FRACUNIT*3/4)) { // preserve the direction instead of clamping x and y independently. - xmove = clamp (mo->momx, -maxmove, maxmove); - ymove = clamp (mo->momy, -maxmove, maxmove); + xmove = clamp (mo->velx, -maxmove, maxmove); + ymove = clamp (mo->vely, -maxmove, maxmove); - fixed_t xfac = FixedDiv(xmove, mo->momx); - fixed_t yfac = FixedDiv(ymove, mo->momy); + fixed_t xfac = FixedDiv(xmove, mo->velx); + fixed_t yfac = FixedDiv(ymove, mo->vely); fixed_t fac = MIN(xfac, yfac); - xmove = mo->momx = FixedMul(mo->momx, fac); - ymove = mo->momy = FixedMul(mo->momy, fac); + xmove = mo->velx = FixedMul(mo->velx, fac); + ymove = mo->vely = FixedMul(mo->vely, fac); } else { - xmove = mo->momx; - ymove = mo->momy; + xmove = mo->velx; + ymove = mo->vely; } // [RH] Carrying sectors didn't work with low speeds in BOOM. This is // because BOOM relied on the speed being fast enough to accumulate @@ -1563,13 +1562,13 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) if (abs(scrollx) > CARRYSTOPSPEED) { scrollx = FixedMul (scrollx, CARRYFACTOR); - mo->momx += scrollx; + mo->velx += scrollx; mo->flags4 |= MF4_SCROLLMOVE; } if (abs(scrolly) > CARRYSTOPSPEED) { scrolly = FixedMul (scrolly, CARRYFACTOR); - mo->momy += scrolly; + mo->vely += scrolly; mo->flags4 |= MF4_SCROLLMOVE; } xmove += scrollx; @@ -1581,7 +1580,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) { // the skull slammed into something mo->flags &= ~MF_SKULLFLY; - mo->momx = mo->momy = mo->momz = 0; + mo->velx = mo->vely = mo->velz = 0; if (!(mo->flags2 & MF2_DORMANT)) { if (mo->SeeState != NULL) mo->SetState (mo->SeeState); @@ -1689,7 +1688,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) (mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove) && mo->BlockingLine->sidenum[1] != NO_SIDE) { - mo->momz = WATER_JUMP_SPEED; + mo->velz = WATER_JUMP_SPEED; } if (player && (i_compatflags & COMPATF_WALLRUN)) { @@ -1697,13 +1696,13 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) // If the move is done a second time (because it was too fast for one move), it // is still clipped against the wall at its full speed, so you effectively // execute two moves in one tic. - P_SlideMove (mo, mo->momx, mo->momy, 1); + P_SlideMove (mo, mo->velx, mo->vely, 1); } else { P_SlideMove (mo, onestepx, onestepy, totalsteps); } - if ((mo->momx | mo->momy) == 0) + if ((mo->velx | mo->vely) == 0) { steps = 0; } @@ -1711,8 +1710,8 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) { if (!player || !(i_compatflags & COMPATF_WALLRUN)) { - xmove = mo->momx; - ymove = mo->momy; + xmove = mo->velx; + ymove = mo->vely; onestepx = xmove / steps; onestepy = ymove / steps; P_CheckSlopeWalk (mo, xmove, ymove); @@ -1728,7 +1727,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) walkplane = P_CheckSlopeWalk (mo, tx, ty); if (P_TryMove (mo, mo->x + tx, mo->y + ty, true, walkplane, tm)) { - mo->momx = 0; + mo->velx = 0; } else { @@ -1736,19 +1735,19 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) walkplane = P_CheckSlopeWalk (mo, tx, ty); if (P_TryMove (mo, mo->x + tx, mo->y + ty, true, walkplane, tm)) { - mo->momy = 0; + mo->vely = 0; } else { - mo->momx = mo->momy = 0; + mo->velx = mo->vely = 0; } } if (player && player->mo == mo) { - if (mo->momx == 0) - player->momx = 0; - if (mo->momy == 0) - player->momy = 0; + if (mo->velx == 0) + player->velx = 0; + if (mo->vely == 0) + player->vely = 0; } steps = 0; } @@ -1772,12 +1771,12 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) angle = R_PointToAngle2 (BlockingMobj->x, BlockingMobj->y, mo->x, mo->y) +ANGLE_1*((pr_bounce()%16)-8); - speed = P_AproxDistance (mo->momx, mo->momy); + speed = P_AproxDistance (mo->velx, mo->vely); speed = FixedMul (speed, (fixed_t)(0.75*FRACUNIT)); mo->angle = angle; angle >>= ANGLETOFINESHIFT; - mo->momx = FixedMul (speed, finecosine[angle]); - mo->momy = FixedMul (speed, finesine[angle]); + mo->velx = FixedMul (speed, finecosine[angle]); + mo->vely = FixedMul (speed, finesine[angle]); mo->PlayBounceSound(true); return oldfloorz; } @@ -1813,9 +1812,9 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) // Reflect the missile along angle mo->angle = angle; angle >>= ANGLETOFINESHIFT; - mo->momx = FixedMul (mo->Speed>>1, finecosine[angle]); - mo->momy = FixedMul (mo->Speed>>1, finesine[angle]); - mo->momz = -mo->momz/2; + mo->velx = FixedMul (mo->Speed>>1, finecosine[angle]); + mo->vely = FixedMul (mo->Speed>>1, finesine[angle]); + mo->velz = -mo->velz/2; if (mo->flags2 & MF2_SEEKERMISSILE) { mo->tracer = mo->target; @@ -1847,7 +1846,7 @@ explode: } else { - mo->momx = mo->momy = 0; + mo->velx = mo->vely = 0; steps = 0; } } @@ -1859,7 +1858,7 @@ explode: // must have gone through a teleporter, so stop moving right now if it // was a regular teleporter. If it was a line-to-line or fogless teleporter, // the move should continue, but startx and starty need to change. - if (mo->momx == 0 && mo->momy == 0) + if (mo->velx == 0 && mo->vely == 0) { step = steps; } @@ -1874,10 +1873,10 @@ explode: // Friction - if (player && player->mo == mo && player->cheats & CF_NOMOMENTUM) + if (player && player->mo == mo && player->cheats & CF_NOVELOCITY) { // debug option for no sliding at all - mo->momx = mo->momy = 0; - player->momx = player->momy = 0; + mo->velx = mo->vely = 0; + player->velx = player->vely = 0; return oldfloorz; } @@ -1891,22 +1890,22 @@ explode: { // [RH] Friction when falling is available for larger aircontrols if (player != NULL && level.airfriction != FRACUNIT) { - mo->momx = FixedMul (mo->momx, level.airfriction); - mo->momy = FixedMul (mo->momy, level.airfriction); + mo->velx = FixedMul (mo->velx, level.airfriction); + mo->vely = FixedMul (mo->vely, level.airfriction); if (player->mo == mo) // Not voodoo dolls { - player->momx = FixedMul (player->momx, level.airfriction); - player->momy = FixedMul (player->momy, level.airfriction); + player->velx = FixedMul (player->velx, level.airfriction); + player->vely = FixedMul (player->vely, level.airfriction); } } return oldfloorz; } if (mo->flags & MF_CORPSE) - { // Don't stop sliding if halfway off a step with some momentum - if (mo->momx > FRACUNIT/4 || mo->momx < -FRACUNIT/4 - || mo->momy > FRACUNIT/4 || mo->momy < -FRACUNIT/4) + { // Don't stop sliding if halfway off a step with some velocity + if (mo->velx > FRACUNIT/4 || mo->velx < -FRACUNIT/4 + || mo->vely > FRACUNIT/4 || mo->vely < -FRACUNIT/4) { if (mo->floorz > mo->Sector->floorplane.ZatPoint (mo->x, mo->y)) { @@ -1933,8 +1932,8 @@ explode: // killough 11/98: // Stop voodoo dolls that have come to rest, despite any // moving corresponding player: - if (mo->momx > -STOPSPEED && mo->momx < STOPSPEED - && mo->momy > -STOPSPEED && mo->momy < STOPSPEED + if (mo->velx > -STOPSPEED && mo->velx < STOPSPEED + && mo->vely > -STOPSPEED && mo->vely < STOPSPEED && (!player || (player->mo != mo) || !(player->cmd.ucmd.forwardmove | player->cmd.ucmd.sidemove))) { @@ -1946,12 +1945,12 @@ explode: player->mo->PlayIdle (); } - mo->momx = mo->momy = 0; + mo->velx = mo->vely = 0; mo->flags4 &= ~MF4_SCROLLMOVE; - // killough 10/98: kill any bobbing momentum too (except in voodoo dolls) + // killough 10/98: kill any bobbing velocity too (except in voodoo dolls) if (player && player->mo == mo) - player->momx = player->momy = 0; + player->velx = player->vely = 0; } else { @@ -1965,13 +1964,13 @@ explode: // determine friction (and thus only when it is needed). // // killough 10/98: changed to work with new bobbing method. - // Reducing player momentum is no longer needed to reduce + // Reducing player velocity is no longer needed to reduce // bobbing, so ice works much better now. fixed_t friction = P_GetFriction (mo, NULL); - mo->momx = FixedMul (mo->momx, friction); - mo->momy = FixedMul (mo->momy, friction); + mo->velx = FixedMul (mo->velx, friction); + mo->vely = FixedMul (mo->vely, friction); // killough 10/98: Always decrease player bobbing by ORIG_FRICTION. // This prevents problems with bobbing on ice, where it was not being @@ -1979,8 +1978,8 @@ explode: if (player && player->mo == mo) // Not voodoo dolls { - player->momx = FixedMul (player->momx, ORIG_FRICTION); - player->momy = FixedMul (player->momy, ORIG_FRICTION); + player->velx = FixedMul (player->velx, ORIG_FRICTION); + player->vely = FixedMul (player->vely, ORIG_FRICTION); } } return oldfloorz; @@ -1990,21 +1989,21 @@ explode: void P_MonsterFallingDamage (AActor *mo) { int damage; - int mom; + int vel; if (!(level.flags2 & LEVEL2_MONSTERFALLINGDAMAGE)) return; if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE) return; - mom = abs(mo->momz); - if (mom > 35*FRACUNIT) + vel = abs(mo->velz); + if (vel > 35*FRACUNIT) { // automatic death damage = 1000000; } else { - damage = ((mom - (23*FRACUNIT))*6)>>FRACBITS; + damage = ((vel - (23*FRACUNIT))*6)>>FRACBITS; } damage = 1000000; // always kill 'em P_DamageMobj (mo, NULL, NULL, damage, NAME_Falling); @@ -2030,7 +2029,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) if (!(mo->flags2 & MF2_FLOATBOB)) { - mo->z += mo->momz; + mo->z += mo->velz; } // @@ -2038,7 +2037,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) // if (mo->z > mo->floorz && !(mo->flags & MF_NOGRAVITY)) { - fixed_t startmomz = mo->momz; + fixed_t startvelz = mo->velz; if (!mo->waterlevel || mo->flags & MF_CORPSE || (mo->player && !(mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove))) @@ -2048,26 +2047,26 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) // [RH] Double gravity only if running off a ledge. Coming down from // an upward thrust (e.g. a jump) should not double it. - if (mo->momz == 0 && oldfloorz > mo->floorz && mo->z == oldfloorz) + if (mo->velz == 0 && oldfloorz > mo->floorz && mo->z == oldfloorz) { - mo->momz -= grav + grav; + mo->velz -= grav + grav; } else { - mo->momz -= grav; + mo->velz -= grav; } } if (mo->waterlevel > 1) { fixed_t sinkspeed = mo->flags & MF_CORPSE ? -WATER_SINK_SPEED/3 : -WATER_SINK_SPEED; - if (mo->momz < sinkspeed) + if (mo->velz < sinkspeed) { - mo->momz = (startmomz < sinkspeed) ? startmomz : sinkspeed; + mo->velz = (startvelz < sinkspeed) ? startvelz : sinkspeed; } else { - mo->momz = startmomz + ((mo->momz - startmomz) >> + mo->velz = startvelz + ((mo->velz - startvelz) >> (mo->waterlevel == 1 ? WATER_SINK_SMALL_FACTOR : WATER_SINK_FACTOR)); } } @@ -2075,7 +2074,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) if (mo->flags2 & MF2_FLOATBOB) { - mo->z += mo->momz; + mo->z += mo->velz; } // @@ -2088,19 +2087,19 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) dist = P_AproxDistance (mo->x - mo->target->x, mo->y - mo->target->y); delta = (mo->target->z + (mo->height>>1)) - mo->z; if (delta < 0 && dist < -(delta*3)) - mo->z -= mo->FloatSpeed, mo->momz = 0; + mo->z -= mo->FloatSpeed, mo->velz = 0; else if (delta > 0 && dist < (delta*3)) - mo->z += mo->FloatSpeed, mo->momz = 0; + mo->z += mo->FloatSpeed, mo->velz = 0; } } if (mo->player && (mo->flags & MF_NOGRAVITY) && (mo->z > mo->floorz)) { mo->z += finesine[(FINEANGLES/80*level.maptime)&FINEMASK]/8; - mo->momz = FixedMul (mo->momz, FRICTION_FLY); + mo->velz = FixedMul (mo->velz, FRICTION_FLY); } if (mo->waterlevel && !(mo->flags & MF_NOGRAVITY)) { - mo->momz = FixedMul (mo->momz, mo->Sector->friction); + mo->velz = FixedMul (mo->velz, mo->Sector->friction); } // @@ -2130,7 +2129,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) } else if (mo->flags3 & MF3_NOEXPLODEFLOOR) { - mo->momz = 0; + mo->velz = 0; P_HitFloor (mo); return; } @@ -2154,24 +2153,24 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) } if (mo->flags3 & MF3_ISMONSTER) // Blasted mobj falling { - if (mo->momz < -(23*FRACUNIT)) + if (mo->velz < -(23*FRACUNIT)) { P_MonsterFallingDamage (mo); } } mo->z = mo->floorz; - if (mo->momz < 0) + if (mo->velz < 0) { - const fixed_t minmom = -9*FRACUNIT; // landing speed from a jump with normal gravity + const fixed_t minvel = -9*FRACUNIT; // landing speed from a jump with normal gravity // Spawn splashes, etc. P_HitFloor (mo); - if (mo->DamageType == NAME_Ice && mo->momz < minmom) + if (mo->DamageType == NAME_Ice && mo->velz < minvel) { mo->tics = 1; - mo->momx = 0; - mo->momy = 0; - mo->momz = 0; + mo->velx = 0; + mo->vely = 0; + mo->velz = 0; return; } // Let the actor do something special for hitting the floor @@ -2179,7 +2178,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) if (mo->player) { mo->player->jumpTics = 7; // delay any jumping for a short while - if (mo->momz < minmom && !(mo->flags & MF_NOGRAVITY)) + if (mo->velz < minvel && !(mo->flags & MF_NOGRAVITY)) { // Squat down. // Decrease viewheight for a moment after hitting the ground (hard), @@ -2187,11 +2186,11 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) PlayerLandedOnThing (mo, NULL); } } - mo->momz = 0; + mo->velz = 0; } if (mo->flags & MF_SKULLFLY) { // The skull slammed into something - mo->momz = -mo->momz; + mo->velz = -mo->velz; } mo->Crash(); } @@ -2221,11 +2220,11 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) mo->FloorBounceMissile (mo->ceilingsector->ceilingplane); return; } - if (mo->momz > 0) - mo->momz = 0; + if (mo->velz > 0) + mo->velz = 0; if (mo->flags & MF_SKULLFLY) { // the skull slammed into something - mo->momz = -mo->momz; + mo->velz = -mo->velz; } if (mo->flags & MF_MISSILE && (!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP))) @@ -2325,7 +2324,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj) if (mo->player->mo == mo) { - mo->player->deltaviewheight = mo->momz>>3; + mo->player->deltaviewheight = mo->velz >> 3; } if (mo->player->cheats & CF_PREDICTING) @@ -2338,7 +2337,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj) { grunted = false; // Why should this number vary by gravity? - if (mo->momz < (fixed_t)(800.f /*level.gravity * mo->Sector->gravity*/ * -983.04f) && mo->health > 0) + if (mo->velz < (fixed_t)(800.f /*level.gravity * mo->Sector->gravity*/ * -983.04f) && mo->health > 0) { S_Sound (mo, CHAN_VOICE, "*grunt", 1, ATTN_NORM); grunted = true; @@ -2546,7 +2545,7 @@ void AActor::HitFloor () bool AActor::Slam (AActor *thing) { flags &= ~MF_SKULLFLY; - momx = momy = momz = 0; + velx = vely = velz = 0; if (health > 0) { if (!(flags2 & MF2_DORMANT)) @@ -2705,7 +2704,7 @@ void AActor::Tick () { // only do the minimally necessary things here to save time: // Check the time freezer - // apply momentum + // apply velocity // ensure that the actor is not linked into the blockmap if (!(flags5 & MF5_NOTIMEFREEZE)) @@ -2719,9 +2718,9 @@ void AActor::Tick () UnlinkFromWorld (); flags |= MF_NOBLOCKMAP; - x += momx; - y += momy; - z += momz; + x += velx; + y += vely; + z += velz; LinkToWorld (); } else @@ -2765,7 +2764,7 @@ void AActor::Tick () { // add some smoke behind the rocket smokecounter = 0; - AActor * th = Spawn("RocketSmokeTrail", x-momx, y-momy, z-momz, ALLOW_REPLACE); + AActor * th = Spawn("RocketSmokeTrail", x-velx, y-vely, z-velz, ALLOW_REPLACE); if (th) { th->tics -= pr_rockettrail()&3; @@ -2778,11 +2777,11 @@ void AActor::Tick () if (++smokecounter==8) { smokecounter = 0; - angle_t moveangle = R_PointToAngle2(0,0,momx,momy); + angle_t moveangle = R_PointToAngle2(0,0,velx,vely); AActor * th = Spawn("GrenadeSmokeTrail", x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), - z - (height>>3) * (momz>>16) + (2*height)/3, ALLOW_REPLACE); + z - (height>>3) * (velz>>16) + (2*height)/3, ALLOW_REPLACE); if (th) { th->tics -= pr_rockettrail()&3; @@ -2801,14 +2800,14 @@ void AActor::Tick () { if (health >0) { - if (abs (momz) < FRACUNIT/4) + if (abs (velz) < FRACUNIT/4) { - momz = 0; + velz = 0; flags4 &= ~MF4_VFRICTION; } else { - momz = FixedMul (momz, 0xe800); + velz = FixedMul (velz, 0xe800); } } } @@ -3044,7 +3043,7 @@ void AActor::Tick () // [RH] If standing on a steep slope, fall down it if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) && !(flags & MF_NOBLOCKMAP) && - momz <= 0 && + velz <= 0 && floorz == z) { const secplane_t * floorplane = &floorsector->floorplane; @@ -3091,8 +3090,8 @@ void AActor::Tick () } if (dopush) { - momx += floorplane->a; - momy += floorplane->b; + velx += floorplane->a; + vely += floorplane->b; } } } @@ -3101,20 +3100,20 @@ void AActor::Tick () // won't hurt anything. Don't do this if damage is 0! That way, you can // still have missiles that go straight up and down through actors without // damaging anything. - if ((flags & MF_MISSILE) && (momx|momy) == 0 && Damage != 0) + if ((flags & MF_MISSILE) && (velx|vely) == 0 && Damage != 0) { - momx = 1; + velx = 1; } - // Handle X and Y momemtums + // Handle X and Y velocities BlockingMobj = NULL; fixed_t oldfloorz = P_XYMovement (this, cummx, cummy); if (ObjectFlags & OF_EuthanizeMe) { // actor was destroyed return; } - if ((momx | momy) == 0 && (flags2 & MF2_BLASTED)) - { // Reset to not blasted when momentums are gone + if ((velx | vely) == 0 && (flags2 & MF2_BLASTED)) + { // Reset to not blasted when velocitiess are gone flags2 &= ~MF2_BLASTED; } @@ -3122,11 +3121,11 @@ void AActor::Tick () { // Floating item bobbing motion z += FloatBobDiffs[(FloatBobPhase + level.maptime) & 63]; } - if (momz || BlockingMobj || + if (velz || BlockingMobj || (z != floorz && (!(flags2 & MF2_FLOATBOB) || (z - FloatBobOffsets[(FloatBobPhase + level.maptime) & 63] != floorz) ))) - { // Handle Z momentum and gravity + { // Handle Z velocity and gravity if (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ)) { if (!(onmo = P_CheckOnmobj (this))) @@ -3138,7 +3137,7 @@ void AActor::Tick () { if (player) { - if (momz < (fixed_t)(level.gravity * Sector->gravity * -655.36f) + if (velz < (fixed_t)(level.gravity * Sector->gravity * -655.36f) && !(flags&MF_NOGRAVITY)) { PlayerLandedOnThing (this, onmo); @@ -3158,7 +3157,7 @@ void AActor::Tick () z = onmo->z + onmo->height; } flags2 |= MF2_ONMOBJ; - momz = 0; + velz = 0; Crash(); } } @@ -3851,7 +3850,7 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) p->mo->ResetAirSupply(false); p->Uncrouch(); - p->momx = p->momy = 0; // killough 10/98: initialize bobbing to 0. + p->velx = p->vely = 0; // killough 10/98: initialize bobbing to 0. if (players[consoleplayer].camera == oldactor) { @@ -4339,7 +4338,7 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc { z += pr_spawnblood.Random2 () << 10; th = Spawn (bloodcls, x, y, z, ALLOW_REPLACE); - th->momz = FRACUNIT*2; + th->velz = FRACUNIT*2; th->angle = dir; if (gameinfo.gametype & GAME_DoomChex) { @@ -4398,9 +4397,9 @@ void P_BloodSplatter (fixed_t x, fixed_t y, fixed_t z, AActor *originator) mo = Spawn(bloodcls, x, y, z, ALLOW_REPLACE); mo->target = originator; - mo->momx = pr_splatter.Random2 () << 10; - mo->momy = pr_splatter.Random2 () << 10; - mo->momz = 3*FRACUNIT; + mo->velx = pr_splatter.Random2 () << 10; + mo->vely = pr_splatter.Random2 () << 10; + mo->velz = 3*FRACUNIT; // colorize the blood! if (bloodcolor!=0 && !(mo->flags2 & MF2_DONTTRANSLATE)) @@ -4468,8 +4467,8 @@ void P_RipperBlood (AActor *mo, AActor *bleeder) th = Spawn (bloodcls, x, y, z, ALLOW_REPLACE); if (gameinfo.gametype == GAME_Heretic) th->flags |= MF_NOGRAVITY; - th->momx = mo->momx >> 1; - th->momy = mo->momy >> 1; + th->velx = mo->velx >> 1; + th->vely = mo->vely >> 1; th->tics += pr_ripperblood () & 3; // colorize the blood! @@ -4573,7 +4572,8 @@ foundone: // Don't splash for living things with small vertical velocities. // There are levels where the constant splashing from the monsters gets extremely annoying - if ((thing->flags3&MF3_ISMONSTER || thing->player) && thing->momz>=-6*FRACUNIT) return Terrains[terrainnum].IsLiquid; + if ((thing->flags3&MF3_ISMONSTER || thing->player) && thing->velz >= -6*FRACUNIT) + return Terrains[terrainnum].IsLiquid; splash = &Splashes[splashnum]; @@ -4594,13 +4594,13 @@ foundone: mo->target = thing; if (splash->ChunkXVelShift != 255) { - mo->momx = pr_chunk.Random2() << splash->ChunkXVelShift; + mo->velx = pr_chunk.Random2() << splash->ChunkXVelShift; } if (splash->ChunkYVelShift != 255) { - mo->momy = pr_chunk.Random2() << splash->ChunkYVelShift; + mo->vely = pr_chunk.Random2() << splash->ChunkYVelShift; } - mo->momz = splash->ChunkBaseZVel + (pr_chunk() << splash->ChunkZVelShift); + mo->velz = splash->ChunkBaseZVel + (pr_chunk() << splash->ChunkZVelShift); } if (splash->SplashBase) { @@ -4707,7 +4707,7 @@ bool P_CheckMissileSpawn (AActor* th) if (th->radius > 0) { - while ( ((th->momx >> shift) > th->radius) || ((th->momy >> shift) > th->radius)) + while ( ((th->velx >> shift) > th->radius) || ((th->vely >> shift) > th->radius)) { // we need to take smaller steps but to produce the same end result // we have to do more of them. @@ -4720,9 +4720,9 @@ bool P_CheckMissileSpawn (AActor* th) for(int i=0; ix += th->momx>>shift; - th->y += th->momy>>shift; - th->z += th->momz>>shift; + th->x += th->velx >> shift; + th->y += th->vely >> shift; + th->z += th->velz >> shift; // killough 3/15/98: no dropoff (really = don't care for missiles) @@ -4874,9 +4874,9 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, velocity.Z += dest->height - z + source->z; } velocity.Resize (speed); - th->momx = (fixed_t)(velocity.X); - th->momy = (fixed_t)(velocity.Y); - th->momz = (fixed_t)(velocity.Z); + th->velx = (fixed_t)(velocity.X); + th->vely = (fixed_t)(velocity.Y); + th->velz = (fixed_t)(velocity.Z); // invisible target: rotate velocity vector in 2D if (dest->flags & MF_SHADOW) @@ -4884,13 +4884,13 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, angle_t an = pr_spawnmissile.Random2 () << 20; an >>= ANGLETOFINESHIFT; - fixed_t newx = DMulScale16 (th->momx, finecosine[an], -th->momy, finesine[an]); - fixed_t newy = DMulScale16 (th->momx, finesine[an], th->momy, finecosine[an]); - th->momx = newx; - th->momy = newy; + fixed_t newx = DMulScale16 (th->velx, finecosine[an], -th->vely, finesine[an]); + fixed_t newy = DMulScale16 (th->velx, finesine[an], th->vely, finecosine[an]); + th->velx = newx; + th->vely = newy; } - th->angle = R_PointToAngle2 (0, 0, th->momx, th->momy); + th->angle = R_PointToAngle2 (0, 0, th->velx, th->vely); return (!checkspawn || P_CheckMissileSpawn (th)) ? th : NULL; } @@ -4905,16 +4905,16 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, //--------------------------------------------------------------------------- AActor *P_SpawnMissileAngle (AActor *source, const PClass *type, - angle_t angle, fixed_t momz) + angle_t angle, fixed_t velz) { return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT, - type, angle, momz, GetDefaultSpeed (type)); + type, angle, velz, GetDefaultSpeed (type)); } AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, - const PClass *type, angle_t angle, fixed_t momz) + const PClass *type, angle_t angle, fixed_t velz) { - return P_SpawnMissileAngleZSpeed (source, z, type, angle, momz, + return P_SpawnMissileAngleZSpeed (source, z, type, angle, velz, GetDefaultSpeed (type)); } @@ -4923,7 +4923,7 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl angle_t an; fixed_t dist; fixed_t speed; - fixed_t momz; + fixed_t velz; an = source->angle; @@ -4934,8 +4934,8 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl dist = P_AproxDistance (dest->x - source->x, dest->y - source->y); speed = GetDefaultSpeed (type); dist /= speed; - momz = dist != 0 ? (dest->z - source->z)/dist : speed; - return P_SpawnMissileAngleZSpeed (source, z, type, an, momz, speed); + velz = dist != 0 ? (dest->z - source->z)/dist : speed; + return P_SpawnMissileAngleZSpeed (source, z, type, an, velz, speed); } //--------------------------------------------------------------------------- @@ -4948,14 +4948,14 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl //--------------------------------------------------------------------------- AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type, - angle_t angle, fixed_t momz, fixed_t speed) + angle_t angle, fixed_t velz, fixed_t speed) { return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT, - type, angle, momz, speed); + type, angle, velz, speed); } AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, - const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner, bool checkspawn) + const PClass *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn) { AActor *mo; @@ -4970,9 +4970,9 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, mo->target = owner != NULL ? owner : source; // Originator mo->angle = angle; angle >>= ANGLETOFINESHIFT; - mo->momx = FixedMul (speed, finecosine[angle]); - mo->momy = FixedMul (speed, finesine[angle]); - mo->momz = momz; + mo->velx = FixedMul (speed, finecosine[angle]); + mo->vely = FixedMul (speed, finesine[angle]); + mo->velz = velz; return (!checkspawn || P_CheckMissileSpawn(mo)) ? mo : NULL; } @@ -5078,9 +5078,9 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, vz = -finesine[pitch>>ANGLETOFINESHIFT]; speed = MissileActor->Speed; - MissileActor->momx = FixedMul (vx, speed); - MissileActor->momy = FixedMul (vy, speed); - MissileActor->momz = FixedMul (vz, speed); + MissileActor->velx = FixedMul (vx, speed); + MissileActor->vely = FixedMul (vy, speed); + MissileActor->velz = FixedMul (vz, speed); if (MissileActor->flags4 & MF4_SPECTRAL) MissileActor->health = -1; diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 5756c95ac..f740815a5 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -1450,7 +1450,7 @@ static void P_SpawnScrollers(void) // phares 3/12/98: Start of friction effects // As the player moves, friction is applied by decreasing the x and y -// momentum values on each tic. By varying the percentage of decrease, +// velocity values on each tic. By varying the percentage of decrease, // we can simulate muddy or icy conditions. In mud, the player slows // down faster. In ice, the player slows down more slowly. // @@ -1541,7 +1541,7 @@ void P_SetSectorFriction (int tag, int amount, bool alterFlag) // the move distance is multiplied by 'friction/0x10000', so a // higher friction value actually means 'less friction'. - // [RH] Twiddled these values so that momentum on ice (with + // [RH] Twiddled these values so that velocity on ice (with // friction 0xf900) is the same as in Heretic/Hexen. if (friction >= ORIG_FRICTION) // ice // movefactor = ((0x10092 - friction)*(0x70))/0x158; @@ -1732,8 +1732,8 @@ void DPusher::Tick () if (m_Source->GetClass()->TypeName == NAME_PointPusher) pushangle += ANG180; // away pushangle >>= ANGLETOFINESHIFT; - thing->momx += FixedMul (speed, finecosine[pushangle]); - thing->momy += FixedMul (speed, finesine[pushangle]); + thing->velx += FixedMul (speed, finecosine[pushangle]); + thing->vely += FixedMul (speed, finesine[pushangle]); } } } @@ -1806,8 +1806,8 @@ void DPusher::Tick () yspeed = m_Ymag; } } - thing->momx += xspeed<<(FRACBITS-PUSH_FACTOR); - thing->momy += yspeed<<(FRACBITS-PUSH_FACTOR); + thing->velx += xspeed<<(FRACBITS-PUSH_FACTOR); + thing->vely += yspeed<<(FRACBITS-PUSH_FACTOR); } } diff --git a/src/p_spec.h b/src/p_spec.h index 26fcb4f27..f2473f3f1 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -959,8 +959,8 @@ bool EV_DoChange (line_t *line, EChange changetype, int tag); // // P_TELEPT // -bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, bool useFog, bool sourceFog, bool keepOrientation, bool haltMomentum = true); -bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool fog, bool sourceFog, bool keepOrientation, bool haltMomentum = true); +bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, bool useFog, bool sourceFog, bool keepOrientation, bool haltVelocity = true); +bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool fog, bool sourceFog, bool keepOrientation, bool haltVelocity = true); bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBOOL reverse); bool EV_TeleportOther (int other_tid, int dest_tid, bool fog); bool EV_TeleportGroup (int group_tid, AActor *victim, int source_tid, int dest_tid, bool moveSource, bool fog); diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index b60fe0bd7..ca75de03d 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -97,7 +97,7 @@ void P_SpawnTeleportFog(fixed_t x, fixed_t y, fixed_t z, int spawnid) // bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, - bool useFog, bool sourceFog, bool keepOrientation, bool bHaltMomentum) + bool useFog, bool sourceFog, bool keepOrientation, bool bHaltVelocity) { fixed_t oldx; fixed_t oldy; @@ -189,13 +189,13 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, if (thing->player) { // [RH] Zoom player's field of vision - // [BC] && bHaltMomentum. - if (telezoom && thing->player->mo == thing && bHaltMomentum) + // [BC] && bHaltVelocity. + if (telezoom && thing->player->mo == thing && bHaltVelocity) thing->player->FOV = MIN (175.f, thing->player->DesiredFOV + 45.f); } } - // [BC] && bHaltMomentum. - if (thing->player && (useFog || !keepOrientation) && bHaltMomentum) + // [BC] && bHaltVelocity. + if (thing->player && (useFog || !keepOrientation) && bHaltVelocity) { // Freeze player for about .5 sec if (thing->Inventory == NULL || thing->Inventory->GetSpeedFactor() <= FRACUNIT) @@ -204,16 +204,16 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, if (thing->flags & MF_MISSILE) { angle >>= ANGLETOFINESHIFT; - thing->momx = FixedMul (thing->Speed, finecosine[angle]); - thing->momy = FixedMul (thing->Speed, finesine[angle]); + thing->velx = FixedMul (thing->Speed, finecosine[angle]); + thing->vely = FixedMul (thing->Speed, finesine[angle]); } - // [BC] && bHaltMomentum. - else if (!keepOrientation && bHaltMomentum) // no fog doesn't alter the player's momentum + // [BC] && bHaltVelocity. + else if (!keepOrientation && bHaltVelocity) // no fog doesn't alter the player's momentum { - thing->momx = thing->momy = thing->momz = 0; - // killough 10/98: kill all bobbing momentum too + thing->velx = thing->vely = thing->velz = 0; + // killough 10/98: kill all bobbing velocity too if (player) - player->momx = player->momy = 0; + player->velx = player->vely = 0; } return true; } @@ -310,13 +310,13 @@ static AActor *SelectTeleDest (int tid, int tag) } bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool fog, - bool sourceFog, bool keepOrientation, bool haltMomentum) + bool sourceFog, bool keepOrientation, bool haltVelocity) { AActor *searcher; fixed_t z; angle_t angle = 0; fixed_t s = 0, c = 0; - fixed_t momx = 0, momy = 0; + fixed_t velx = 0, vely = 0; if (thing == NULL) { // Teleport function called with an invalid actor @@ -348,9 +348,9 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool s = finesine[angle>>ANGLETOFINESHIFT]; c = finecosine[angle>>ANGLETOFINESHIFT]; - // Momentum of thing crossing teleporter linedef - momx = thing->momx; - momy = thing->momy; + // Velocity of thing crossing teleporter linedef + velx = thing->velx; + vely = thing->vely; z = searcher->z; } @@ -362,7 +362,7 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool { z = ONFLOORZ; } - if (P_Teleport (thing, searcher->x, searcher->y, z, searcher->angle, fog, sourceFog, keepOrientation, haltMomentum)) + if (P_Teleport (thing, searcher->x, searcher->y, z, searcher->angle, fog, sourceFog, keepOrientation, haltVelocity)) { // [RH] Lee Killough's changes for silent teleporters from BOOM if (!fog && line && keepOrientation) @@ -370,11 +370,11 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool // Rotate thing according to difference in angles thing->angle += angle; - // Rotate thing's momentum to come out of exit just like it entered - thing->momx = FixedMul(momx, c) - FixedMul(momy, s); - thing->momy = FixedMul(momy, c) + FixedMul(momx, s); + // Rotate thing's velocity to come out of exit just like it entered + thing->velx = FixedMul(velx, c) - FixedMul(vely, s); + thing->vely = FixedMul(vely, c) + FixedMul(velx, s); } - if ((momx | momy) == 0 && thing->player != NULL && thing->player->mo == thing) + if ((velx | vely) == 0 && thing->player != NULL && thing->player->mo == thing) { thing->player->mo->PlayIdle (); } @@ -442,7 +442,7 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO } // Get the angle between the two linedefs, for rotating - // orientation and momentum. Rotate 180 degrees, and flip + // orientation and velocity. Rotate 180 degrees, and flip // the position across the exit linedef, if reversed. angle_t angle = R_PointToAngle2(0, 0, l->dx, l->dy) - @@ -496,22 +496,22 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO // Rotate thing's orientation according to difference in linedef angles thing->angle += angle; - // Momentum of thing crossing teleporter linedef - x = thing->momx; - y = thing->momy; + // Velocity of thing crossing teleporter linedef + x = thing->velx; + y = thing->vely; - // Rotate thing's momentum to come out of exit just like it entered - thing->momx = DMulScale16 (x, c, -y, s); - thing->momy = DMulScale16 (y, c, x, s); + // Rotate thing's velocity to come out of exit just like it entered + thing->velx = DMulScale16 (x, c, -y, s); + thing->vely = DMulScale16 (y, c, x, s); // Adjust a player's view, in case there has been a height change if (player && player->mo == thing) { - // Adjust player's local copy of momentum - x = player->momx; - y = player->momy; - player->momx = DMulScale16 (x, c, -y, s); - player->momy = DMulScale16 (y, c, x, s); + // Adjust player's local copy of velocity + x = player->velx; + y = player->vely; + player->velx = DMulScale16 (x, c, -y, s); + player->vely = DMulScale16 (y, c, x, s); // Save the current deltaviewheight, used in stepping fixed_t deltaviewheight = player->deltaviewheight; diff --git a/src/p_things.cpp b/src/p_things.cpp index 0404ac37b..dd1e22300 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -262,7 +262,7 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam fixed_t spot[3] = { targ->x, targ->y, targ->z+targ->height/2 }; FVector3 aim(float(spot[0] - mobj->x), float(spot[1] - mobj->y), float(spot[2] - mobj->z)); - if (leadTarget && speed > 0 && (targ->momx | targ->momy | targ->momz)) + if (leadTarget && speed > 0 && (targ->velx | targ->vely | targ->velz)) { // Aiming at the target's position some time in the future // is basically just an application of the law of sines: @@ -271,14 +271,14 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam // with the math. I don't think I would have thought of using // trig alone had I been left to solve it by myself. - FVector3 tvel(targ->momx, targ->momy, targ->momz); + FVector3 tvel(targ->velx, targ->vely, targ->velz); if (!(targ->flags & MF_NOGRAVITY) && targ->waterlevel < 3) { // If the target is subject to gravity and not underwater, // assume that it isn't moving vertically. Thanks to gravity, // even if we did consider the vertical component of the target's // velocity, we would still miss more often than not. tvel.Z = 0.0; - if ((targ->momx | targ->momy) == 0) + if ((targ->velx | targ->vely) == 0) { goto nolead; } @@ -302,18 +302,18 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam FVector3 aimvec = rm * aim; // And make the projectile follow that vector at the desired speed. double aimscale = fspeed / dist; - mobj->momx = fixed_t (aimvec[0] * aimscale); - mobj->momy = fixed_t (aimvec[1] * aimscale); - mobj->momz = fixed_t (aimvec[2] * aimscale); - mobj->angle = R_PointToAngle2 (0, 0, mobj->momx, mobj->momy); + mobj->velx = fixed_t (aimvec[0] * aimscale); + mobj->vely = fixed_t (aimvec[1] * aimscale); + mobj->velz = fixed_t (aimvec[2] * aimscale); + mobj->angle = R_PointToAngle2 (0, 0, mobj->velx, mobj->vely); } else { nolead: mobj->angle = R_PointToAngle2 (mobj->x, mobj->y, targ->x, targ->y); aim.Resize (fspeed); - mobj->momx = fixed_t(aim[0]); - mobj->momy = fixed_t(aim[1]); - mobj->momz = fixed_t(aim[2]); + mobj->velx = fixed_t(aim[0]); + mobj->vely = fixed_t(aim[1]); + mobj->velz = fixed_t(aim[2]); } if (mobj->flags2 & MF2_SEEKERMISSILE) { @@ -323,19 +323,19 @@ nolead: mobj->angle = R_PointToAngle2 (mobj->x, mobj->y, targ->x, targ->y); else { mobj->angle = angle; - mobj->momx = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]); - mobj->momy = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]); - mobj->momz = vspeed; + mobj->velx = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]); + mobj->vely = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]); + mobj->velz = vspeed; } // Set the missile's speed to reflect the speed it was spawned at. if (mobj->flags & MF_MISSILE) { - mobj->Speed = fixed_t (sqrt (double(mobj->momx)*mobj->momx + double(mobj->momy)*mobj->momy + double(mobj->momz)*mobj->momz)); + mobj->Speed = fixed_t (sqrt (double(mobj->velx)*mobj->velx + double(mobj->vely)*mobj->vely + double(mobj->velz)*mobj->velz)); } // Hugger missiles don't have any vertical velocity if (mobj->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)) { - mobj->momz = 0; + mobj->velz = 0; } if (mobj->flags & MF_SPECIAL) { diff --git a/src/p_user.cpp b/src/p_user.cpp index 73c68c983..9b1ceddc1 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -217,8 +217,8 @@ player_t::player_t() viewheight(0), deltaviewheight(0), bob(0), - momx(0), - momy(0), + velx(0), + vely(0), centering(0), turnticks(0), attackdown(0), @@ -1267,7 +1267,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream) // Handle the different player death screams if ((((level.flags >> 15) | (dmflags)) & (DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) && - self->momz <= -39*FRACUNIT) + self->velz <= -39*FRACUNIT) { sound = S_FindSkinnedSound (self, "*splat"); chan = CHAN_BODY; @@ -1337,9 +1337,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop) self->flags &= ~MF_SOLID; mo = (APlayerPawn *)Spawn (spawntype, self->x, self->y, self->z + 48*FRACUNIT, NO_REPLACE); //mo->target = self; - mo->momx = pr_skullpop.Random2() << 9; - mo->momy = pr_skullpop.Random2() << 9; - mo->momz = 2*FRACUNIT + (pr_skullpop() << 6); + mo->velx = pr_skullpop.Random2() << 9; + mo->vely = pr_skullpop.Random2() << 9; + mo->velz = 2*FRACUNIT + (pr_skullpop() << 6); // Attach player mobj to bloody skull player = self->player; self->player = NULL; @@ -1457,8 +1457,8 @@ void P_SideThrust (player_t *player, angle_t angle, fixed_t move) { angle = (angle - ANGLE_90) >> ANGLETOFINESHIFT; - player->mo->momx += FixedMul (move, finecosine[angle]); - player->mo->momy += FixedMul (move, finesine[angle]); + player->mo->velx += FixedMul (move, finecosine[angle]); + player->mo->vely += FixedMul (move, finesine[angle]); } void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move) @@ -1472,11 +1472,11 @@ void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move) fixed_t zpush = FixedMul (move, finesine[pitch]); if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0) zpush = 0; - player->mo->momz -= zpush; + player->mo->velz -= zpush; move = FixedMul (move, finecosine[pitch]); } - player->mo->momx += FixedMul (move, finecosine[angle]); - player->mo->momy += FixedMul (move, finesine[angle]); + player->mo->velx += FixedMul (move, finecosine[angle]); + player->mo->vely += FixedMul (move, finesine[angle]); } // @@ -1494,8 +1494,8 @@ void P_Bob (player_t *player, angle_t angle, fixed_t move) { angle >>= ANGLETOFINESHIFT; - player->momx += FixedMul(move,finecosine[angle]); - player->momy += FixedMul(move,finesine[angle]); + player->velx += FixedMul(move, finecosine[angle]); + player->vely += FixedMul(move, finesine[angle]); } /* @@ -1530,7 +1530,7 @@ void P_CalcHeight (player_t *player) } else { - player->bob = DMulScale16 (player->momx, player->momx, player->momy, player->momy); + player->bob = DMulScale16 (player->velx, player->velx, player->vely, player->vely); if (player->bob == 0) { still = true; @@ -1546,7 +1546,7 @@ void P_CalcHeight (player_t *player) fixed_t defaultviewheight = player->mo->ViewHeight + player->crouchviewdelta; - if (player->cheats & CF_NOMOMENTUM) + if (player->cheats & CF_NOVELOCITY) { player->viewz = player->mo->z + defaultviewheight; @@ -1739,7 +1739,7 @@ void P_FallingDamage (AActor *actor) { int damagestyle; int damage; - fixed_t mom; + fixed_t vel; damagestyle = ((level.flags >> 15) | (dmflags)) & (DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX); @@ -1750,7 +1750,7 @@ void P_FallingDamage (AActor *actor) if (actor->floorsector->Flags & SECF_NOFALLINGDAMAGE) return; - mom = abs (actor->momz); + vel = abs(actor->velz); // Since Hexen falling damage is stronger than ZDoom's, it takes // precedence. ZDoom falling damage may not be as strong, but it @@ -1759,19 +1759,19 @@ void P_FallingDamage (AActor *actor) switch (damagestyle) { case DF_FORCE_FALLINGHX: // Hexen falling damage - if (mom <= 23*FRACUNIT) + if (vel <= 23*FRACUNIT) { // Not fast enough to hurt return; } - if (mom >= 63*FRACUNIT) + if (vel >= 63*FRACUNIT) { // automatic death damage = 1000000; } else { - mom = FixedMul (mom, 16*FRACUNIT/23); - damage = ((FixedMul (mom, mom) / 10) >> FRACBITS) - 24; - if (actor->momz > -39*FRACUNIT && damage > actor->health + vel = FixedMul (vel, 16*FRACUNIT/23); + damage = ((FixedMul (vel, vel) / 10) >> FRACBITS) - 24; + if (actor->velz > -39*FRACUNIT && damage > actor->health && actor->health != 1) { // No-death threshold damage = actor->health-1; @@ -1780,17 +1780,17 @@ void P_FallingDamage (AActor *actor) break; case DF_FORCE_FALLINGZD: // ZDoom falling damage - if (mom <= 19*FRACUNIT) + if (vel <= 19*FRACUNIT) { // Not fast enough to hurt return; } - if (mom >= 84*FRACUNIT) + if (vel >= 84*FRACUNIT) { // automatic death damage = 1000000; } else { - damage = ((MulScale23 (mom, mom*11) >> FRACBITS) - 30) / 2; + damage = ((MulScale23 (vel, vel*11) >> FRACBITS) - 30) / 2; if (damage < 1) { damage = 1; @@ -1799,13 +1799,13 @@ void P_FallingDamage (AActor *actor) break; case DF_FORCE_FALLINGST: // Strife falling damage - if (mom <= 20*FRACUNIT) + if (vel <= 20*FRACUNIT) { // Not fast enough to hurt return; } // The minimum amount of damage you take from falling in Strife // is 52. Ouch! - damage = mom / 25000; + damage = vel / 25000; break; default: @@ -2191,20 +2191,20 @@ void P_PlayerThink (player_t *player) else if (player->mo->waterlevel >= 2) { - player->mo->momz = 4*FRACUNIT; + player->mo->velz = 4*FRACUNIT; } else if (player->mo->flags & MF_NOGRAVITY) { - player->mo->momz = 3*FRACUNIT; + player->mo->velz = 3*FRACUNIT; } else if (level.IsJumpingAllowed() && onground && !player->jumpTics) { - fixed_t jumpmomz = player->mo->JumpZ * 35 / TICRATE; + fixed_t jumpvelz = player->mo->JumpZ * 35 / TICRATE; // [BC] If the player has the high jump power, double his jump velocity. - if ( player->cheats & CF_HIGHJUMP ) jumpmomz *= 2; + if ( player->cheats & CF_HIGHJUMP ) jumpvelz *= 2; - player->mo->momz += jumpmomz; + player->mo->velz += jumpvelz; S_Sound (player->mo, CHAN_BODY, "*jump", 1, ATTN_NORM); player->mo->flags2 &= ~MF2_ONMOBJ; player->jumpTics = 18*TICRATE/35; @@ -2229,12 +2229,12 @@ void P_PlayerThink (player_t *player) } if (player->mo->waterlevel >= 2 || (player->mo->flags2 & MF2_FLY)) { - player->mo->momz = cmd->ucmd.upmove << 9; + player->mo->velz = cmd->ucmd.upmove << 9; if (player->mo->waterlevel < 2 && !(player->mo->flags & MF_NOGRAVITY)) { player->mo->flags2 |= MF2_FLY; player->mo->flags |= MF_NOGRAVITY; - if (player->mo->momz <= -39*FRACUNIT) + if (player->mo->velz <= -39*FRACUNIT) { // Stop falling scream S_StopSound (player->mo, CHAN_VOICE); } @@ -2261,8 +2261,8 @@ void P_PlayerThink (player_t *player) P_PlayerInSpecialSector (player); } P_PlayerOnSpecialFlat (player, P_GetThingFloorType (player->mo)); - if (player->mo->momz <= -35*FRACUNIT && - player->mo->momz >= -40*FRACUNIT && !player->morphTics && + if (player->mo->velz <= -35*FRACUNIT && + player->mo->velz >= -40*FRACUNIT && !player->morphTics && player->mo->waterlevel == 0) { int id = S_FindSkinnedSound (player->mo, "*falling"); @@ -2482,8 +2482,8 @@ void player_t::Serialize (FArchive &arc) << viewheight << deltaviewheight << bob - << momx - << momy + << velx + << vely << centering << health << inventorytics diff --git a/src/po_man.cpp b/src/po_man.cpp index 68908ece1..d88c67589 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -771,8 +771,8 @@ void ThrustMobj (AActor *actor, seg_t *seg, FPolyObj *po) thrustX = FixedMul (force, finecosine[thrustAngle]); thrustY = FixedMul (force, finesine[thrustAngle]); - actor->momx += thrustX; - actor->momy += thrustY; + actor->velx += thrustX; + actor->vely += thrustY; if (po->crush) { if (po->bHurtOnTouch || !P_CheckMove (actor, actor->x + thrustX, actor->y + thrustY)) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index c0955cb5c..a766affcd 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -711,9 +711,9 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector, // Only actors maintain velocity information. if (type == SOURCE_Actor && actor != NULL) { - vel->X = FIXED2FLOAT(actor->momx) * TICRATE; - vel->Y = FIXED2FLOAT(actor->momz) * TICRATE; - vel->Z = FIXED2FLOAT(actor->momy) * TICRATE; + vel->X = FIXED2FLOAT(actor->velx) * TICRATE; + vel->Y = FIXED2FLOAT(actor->velz) * TICRATE; + vel->Z = FIXED2FLOAT(actor->vely) * TICRATE; } else { @@ -1862,9 +1862,9 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor) { listener.angle = (float)(listenactor->angle) * ((float)PI / 2147483648.f); /* - listener.velocity.X = listenactor->momx * (TICRATE/65536.f); - listener.velocity.Y = listenactor->momz * (TICRATE/65536.f); - listener.velocity.Z = listenactor->momy * (TICRATE/65536.f); + listener.velocity.X = listenactor->velx * (TICRATE/65536.f); + listener.velocity.Y = listenactor->velz * (TICRATE/65536.f); + listener.velocity.Z = listenactor->vely * (TICRATE/65536.f); */ listener.velocity.Zero(); listener.position.X = FIXED2FLOAT(listenactor->x); diff --git a/src/st_stuff.cpp b/src/st_stuff.cpp index f0ee5ba8f..a1ac0f290 100644 --- a/src/st_stuff.cpp +++ b/src/st_stuff.cpp @@ -249,7 +249,7 @@ static cheatseq_t StrifeCheats[] = { CheatTopo, 0, 0, 0, {0,0}, Cht_AutoMap }, { CheatDots, 0, 1, 0, {0,0}, Cht_Ticker }, { CheatOmnipotent, 0, 0, 0, {CHT_IDDQD,0}, Cht_Generic }, - { CheatGripper, 0, 0, 0, {CHT_NOMOMENTUM,0},Cht_Generic }, + { CheatGripper, 0, 0, 0, {CHT_NOVELOCITY,0},Cht_Generic }, { CheatJimmy, 0, 0, 0, {CHT_KEYS,0}, Cht_Generic }, { CheatBoomstix, 0, 0, 0, {CHT_IDFA,0}, Cht_Generic }, { CheatElvis, 0, 0, 0, {CHT_NOCLIP,0}, Cht_Generic }, diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index ccb6a483f..dfcf3f293 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -342,6 +342,10 @@ int MatchString (const char *in, const char **strings); static FVariableInfo GlobalDef__##name = { #name, myoffsetof(cls, name), RUNTIME_CLASS(cls) }; \ MSVC_MSEG FVariableInfo *infoptr_GlobalDef__##name GCC_MSEG = &GlobalDef__##name; +#define DEFINE_MEMBER_VARIABLE_ALIAS(name, alias, cls) \ + static FVariableInfo GlobalDef__##name = { #name, myoffsetof(cls, alias), RUNTIME_CLASS(cls) }; \ + MSVC_MSEG FVariableInfo *infoptr_GlobalDef__##name GCC_MSEG = &GlobalDef__##name; + diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index d30c2c78f..67f11a101 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -702,17 +702,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile) self->y-=y; // It is not necessary to use the correct angle here. - // The only important thing is that the horizontal momentum is correct. + // The only important thing is that the horizontal velocity is correct. // Therefore use 0 as the missile's angle and simplify the calculations accordingly. - // The actual momentum vector is set below. + // The actual velocity vector is set below. if (missile) { fixed_t vx = finecosine[pitch>>ANGLETOFINESHIFT]; fixed_t vz = finesine[pitch>>ANGLETOFINESHIFT]; - missile->momx = FixedMul (vx, missile->Speed); - missile->momy = 0; - missile->momz = FixedMul (vz, missile->Speed); + missile->velx = FixedMul (vx, missile->Speed); + missile->vely = 0; + missile->velz = FixedMul (vz, missile->Speed); } break; @@ -720,17 +720,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile) if (missile) { - // Use the actual momentum instead of the missile's Speed property + // Use the actual velocity instead of the missile's Speed property // so that this can handle missiles with a high vertical velocity // component properly. - FVector3 velocity (missile->momx, missile->momy, 0); + FVector3 velocity (missile->velx, missile->vely, 0); fixed_t missilespeed = (fixed_t)velocity.Length(); missile->angle += Angle; ang = missile->angle >> ANGLETOFINESHIFT; - missile->momx = FixedMul (missilespeed, finecosine[ang]); - missile->momy = FixedMul (missilespeed, finesine[ang]); + missile->velx = FixedMul (missilespeed, finecosine[ang]); + missile->vely = FixedMul (missilespeed, finesine[ang]); // handle projectile shooting projectiles - track the // links back to a real owner @@ -1022,12 +1022,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile) { // This original implementation is to aim straight ahead and then offset // the angle from the resulting direction. - FVector3 velocity(misl->momx, misl->momy, 0); + FVector3 velocity(misl->velx, misl->vely, 0); fixed_t missilespeed = (fixed_t)velocity.Length(); misl->angle += Angle; angle_t an = misl->angle >> ANGLETOFINESHIFT; - misl->momx = FixedMul (missilespeed, finecosine[an]); - misl->momy = FixedMul (missilespeed, finesine[an]); + misl->velx = FixedMul (missilespeed, finecosine[an]); + misl->vely = FixedMul (missilespeed, finesine[an]); } } } @@ -1176,8 +1176,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) if (aim) { saved_angle = self->angle = R_PointToAngle2 (self->x, self->y, - self->target->x - self->target->momx * 3, - self->target->y - self->target->momy * 3); + self->target->x - self->target->velx * 3, + self->target->y - self->target->vely * 3); if (aim == CRF_AIMDIRECT) { @@ -1187,8 +1187,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) self->y += Spawnofs_XY * finesine[self->angle]; Spawnofs_XY = 0; self->angle = R_PointToAngle2 (self->x, self->y, - self->target->x - self->target->momx * 3, - self->target->y - self->target->momy * 3); + self->target->x - self->target->velx * 3, + self->target->y - self->target->vely * 3); } if (self->target->flags & MF_SHADOW) @@ -1317,7 +1317,7 @@ enum SIX_Flags SIXF_TRANSFERTRANSLATION=1, SIXF_ABSOLUTEPOSITION=2, SIXF_ABSOLUTEANGLE=4, - SIXF_ABSOLUTEMOMENTUM=8, + SIXF_ABSOLUTEVELOCITY=8, SIXF_SETMASTER=16, SIXF_NOCHECKPOSITION=32, SIXF_TELEFRAG=64, @@ -1466,9 +1466,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx) ACTION_PARAM_FIXED(xofs, 1); ACTION_PARAM_FIXED(yofs, 2); ACTION_PARAM_FIXED(zofs, 3); - ACTION_PARAM_FIXED(xmom, 4); - ACTION_PARAM_FIXED(ymom, 5); - ACTION_PARAM_FIXED(zmom, 6); + ACTION_PARAM_FIXED(xvel, 4); + ACTION_PARAM_FIXED(yvel, 5); + ACTION_PARAM_FIXED(zvel, 6); ACTION_PARAM_ANGLE(Angle, 7); ACTION_PARAM_INT(flags, 8); ACTION_PARAM_INT(chance, 9); @@ -1506,24 +1506,25 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx) y = self->y + FixedMul(xofs, finesine[ang]) - FixedMul(yofs, finecosine[ang]); } - if (!(flags & SIXF_ABSOLUTEMOMENTUM)) + if (!(flags & SIXF_ABSOLUTEVELOCITY)) { // Same orientation issue here! - fixed_t newxmom = FixedMul(xmom, finecosine[ang]) + FixedMul(ymom, finesine[ang]); - ymom = FixedMul(xmom, finesine[ang]) - FixedMul(ymom, finecosine[ang]); - xmom = newxmom; + fixed_t newxvel = FixedMul(xvel, finecosine[ang]) + FixedMul(yvel, finesine[ang]); + yvel = FixedMul(xvel, finesine[ang]) - FixedMul(yvel, finecosine[ang]); + xvel = newxvel; } - AActor * mo = Spawn( missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE); + AActor * mo = Spawn(missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE); bool res = InitSpawnedItem(self, mo, flags); ACTION_SET_RESULT(res); // for an inventory item's use state if (mo) { - mo->momx=xmom; - mo->momy=ymom; - mo->momz=zmom; - mo->angle=Angle; - if (flags & SIXF_TRANSFERAMBUSHFLAG) mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH); + mo->velx = xvel; + mo->vely = yvel; + mo->velz = zvel; + mo->angle = Angle; + if (flags & SIXF_TRANSFERAMBUSHFLAG) + mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH); } } @@ -1539,8 +1540,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade) ACTION_PARAM_START(5); ACTION_PARAM_CLASS(missile, 0); ACTION_PARAM_FIXED(zheight, 1); - ACTION_PARAM_FIXED(xymom, 2); - ACTION_PARAM_FIXED(zmom, 3); + ACTION_PARAM_FIXED(xyvel, 2); + ACTION_PARAM_FIXED(zvel, 3); ACTION_PARAM_BOOL(useammo, 4); if (missile == NULL) return; @@ -1565,18 +1566,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade) int pitch = self->pitch; P_PlaySpawnSound(bo, self); - if (xymom) bo->Speed=xymom; - bo->angle = self->angle+(((pr_grenade()&7)-4)<<24); - bo->momz = zmom + 2*finesine[pitch>>ANGLETOFINESHIFT]; + if (xyvel) + bo->Speed = xyvel; + bo->angle = self->angle + (((pr_grenade()&7) - 4) << 24); + bo->velz = zvel + 2*finesine[pitch>>ANGLETOFINESHIFT]; bo->z += 2 * finesine[pitch>>ANGLETOFINESHIFT]; P_ThrustMobj(bo, bo->angle, bo->Speed); - bo->momx += self->momx>>1; - bo->momy += self->momy>>1; + bo->velx += self->velx >> 1; + bo->vely += self->vely >> 1; bo->target= self; if (bo->flags4&MF4_RANDOMIZE) { - bo->tics -= pr_grenade()&3; - if (bo->tics<1) bo->tics=1; + bo->tics -= pr_grenade() & 3; + if (bo->tics < 1) + bo->tics = 1; } P_CheckMissileSpawn (bo); } @@ -1592,12 +1595,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil) { ACTION_PARAM_START(1); - ACTION_PARAM_FIXED(xymom, 0); + ACTION_PARAM_FIXED(xyvel, 0); angle_t angle = self->angle + ANG180; angle >>= ANGLETOFINESHIFT; - self->momx += FixedMul (xymom, finecosine[angle]); - self->momy += FixedMul (xymom, finesine[angle]); + self->velx += FixedMul (xyvel, finecosine[angle]); + self->vely += FixedMul (xyvel, finesine[angle]); } @@ -1757,9 +1760,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnDebris) if (mo && i < mo->GetClass()->ActorInfo->NumOwnedStates) { mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i); - mo->momz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT); - mo->momx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); - mo->momy = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); + mo->velz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT); + mo->velx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); + mo->vely = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); } } } @@ -1945,7 +1948,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) if (chunk == NULL) return; - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; self->height = self->GetDefault()->height; // [RH] In Hexen, this creates a random number of shards (range [24,56]) @@ -1964,9 +1967,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) if (mo) { - mo->momz = FixedDiv(mo->z-self->z, self->height)<<2; - mo->momx = pr_burst.Random2 () << (FRACBITS-7); - mo->momy = pr_burst.Random2 () << (FRACBITS-7); + mo->velz = FixedDiv(mo->z - self->z, self->height)<<2; + mo->velx = pr_burst.Random2 () << (FRACBITS-7); + mo->vely = pr_burst.Random2 () << (FRACBITS-7); mo->RenderStyle = self->RenderStyle; mo->alpha = self->alpha; mo->CopyFriendliness(self, true); @@ -2024,18 +2027,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling) //=========================================================================== // // A_Stop -// resets all momentum of the actor to 0 +// resets all velocity of the actor to 0 // //=========================================================================== DEFINE_ACTION_FUNCTION(AActor, A_Stop) { - self->momx = self->momy = self->momz = 0; + self->velx = self->vely = self->velz = 0; if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING)) { - self->player->mo->PlayIdle (); - self->player->momx = self->player->momy = 0; + self->player->mo->PlayIdle(); + self->player->velx = self->player->vely = 0; } - } //=========================================================================== diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 4a4ab3cb9..a2fe4935e 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -69,9 +69,12 @@ DEFINE_MEMBER_VARIABLE(waterlevel, AActor) DEFINE_MEMBER_VARIABLE(x, AActor) DEFINE_MEMBER_VARIABLE(y, AActor) DEFINE_MEMBER_VARIABLE(z, AActor) -DEFINE_MEMBER_VARIABLE(momx, AActor) -DEFINE_MEMBER_VARIABLE(momy, AActor) -DEFINE_MEMBER_VARIABLE(momz, AActor) +DEFINE_MEMBER_VARIABLE(velx, AActor) +DEFINE_MEMBER_VARIABLE(vely, AActor) +DEFINE_MEMBER_VARIABLE(velz, AActor) +DEFINE_MEMBER_VARIABLE_ALIAS(momx, velx, AActor) +DEFINE_MEMBER_VARIABLE_ALIAS(momy, vely, AActor) +DEFINE_MEMBER_VARIABLE_ALIAS(momz, velz, AActor) DEFINE_MEMBER_VARIABLE(Damage, AActor) //========================================================================== diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 9d56c7d07..804ae3687 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -982,7 +982,7 @@ DEFINE_PROPERTY(cameraheight, F, Actor) DEFINE_PROPERTY(vspeed, F, Actor) { PROP_FIXED_PARM(i, 0); - defaults->momz = i; + defaults->velz = i; } //========================================================================== diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 8a40a3837..dcd3c1fa6 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -38,9 +38,12 @@ ACTOR Actor native //: Thinker native fixed_t x; native fixed_t y; native fixed_t z; - native fixed_t momx; - native fixed_t momy; - native fixed_t momz; + native fixed_t velx; + native fixed_t vely; + native fixed_t velz; + native fixed_t momx; // alias for velx + native fixed_t momy; // alias for vely + native fixed_t momz; // alias for velz action native A_MonsterRail(); action native A_BFGSpray(class spraytype = "BFGExtra", int numrays = 40, int damagecount = 15); @@ -180,7 +183,7 @@ ACTOR Actor native //: Thinker action native A_GiveInventory(class itemtype, int amount = 0); action native A_TakeInventory(class itemtype, int amount = 0); action native A_SpawnItem(class itemtype, float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false); - action native A_SpawnItemEx(class itemtype, float xofs = 0, float yofs = 0, float zofs = 0, float xmom = 0, float ymom = 0, float zmom = 0, float angle = 0, int flags = 0, int failchance = 0); + action native A_SpawnItemEx(class itemtype, float xofs = 0, float yofs = 0, float zofs = 0, float xvel = 0, float yvel = 0, float zvel = 0, float angle = 0, int flags = 0, int failchance = 0); action native A_Print(string whattoprint, float time = 0, string fontname = ""); action native A_SetTranslucent(float alpha, int style = 0); action native A_FadeIn(float reduce = 0.1); @@ -201,9 +204,9 @@ ACTOR Actor native //: Thinker action native A_CheckCeiling(state label); action native A_PlayerSkinCheck(state label); action native A_BasicAttack(int meleedamage, sound meleesound, class missiletype, float missileheight); - action native A_ThrowGrenade(class itemtype, float zheight = 0, float xymom = 0, float zmom = 0, bool useammo = true); + action native A_ThrowGrenade(class itemtype, float zheight = 0, float xyvel = 0, float zvel = 0, bool useammo = true); - action native A_Recoil(float xymom); + action native A_Recoil(float xyvel); action native A_JumpIfInTargetInventory(class itemtype, int amount, state label); action native A_GiveToTarget(class itemtype, int amount = 0); action native A_TakeFromTarget(class itemtype, int amount = 0); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 14e9078f4..388344618 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -10,6 +10,7 @@ const int SXF_TRANSFERTRANSLATION=1; const int SXF_ABSOLUTEPOSITION=2; const int SXF_ABSOLUTEANGLE=4; const int SXF_ABSOLUTEMOMENTUM=8; +const int SXF_ABSOLUTEVELOCITY=8; const int SXF_SETMASTER=16; const int SXF_NOCHECKPOSITION = 32; const int SXF_TELEFRAG=64; diff --git a/wadsrc/static/actors/hexen/demons.txt b/wadsrc/static/actors/hexen/demons.txt index 6be47bf27..cb1428ee7 100644 --- a/wadsrc/static/actors/hexen/demons.txt +++ b/wadsrc/static/actors/hexen/demons.txt @@ -20,7 +20,7 @@ ACTOR Demon1 31 DeathSound "DemonDeath" ActiveSound "DemonActive" Obituary "$OB_DEMON1" - const int ChunkFlags = SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM; + const int ChunkFlags = SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEVELOCITY; States { Spawn: diff --git a/wadsrc/static/actors/hexen/ettin.txt b/wadsrc/static/actors/hexen/ettin.txt index b6cd9259b..e5104aa11 100644 --- a/wadsrc/static/actors/hexen/ettin.txt +++ b/wadsrc/static/actors/hexen/ettin.txt @@ -51,7 +51,7 @@ ACTOR Ettin 10030 ETTB C 4 A_SpawnItemEx("EttinMace", 0,0,8.5, random[DropMace](-128,127) * 0.03125, random[DropMace](-128,127) * 0.03125, - 10 + random[DropMace](0,255) * 0.015625, 0, SXF_ABSOLUTEMOMENTUM) + 10 + random[DropMace](0,255) * 0.015625, 0, SXF_ABSOLUTEVELOCITY) ETTB D 4 A_Scream ETTB E 4 A_QueueCorpse ETTB FGHIJK 4