- 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.


SVN r1689 (trunk)
This commit is contained in:
Randy Heit 2009-06-30 20:57:51 +00:00
parent ed0d804792
commit e4af82ae96
88 changed files with 881 additions and 863 deletions

View file

@ -1,4 +1,11 @@
June 30, 2009 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 - 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 maintains its own FOV scale independent from any other weapons the player
may have. may have.

View file

@ -256,7 +256,7 @@ enum
MF4_LOOKALLAROUND = 0x00010000, // Monster has eyes in the back of its head MF4_LOOKALLAROUND = 0x00010000, // Monster has eyes in the back of its head
MF4_STANDSTILL = 0x00020000, // Monster should not chase targets unless attacked? MF4_STANDSTILL = 0x00020000, // Monster should not chase targets unless attacked?
MF4_SPECTRAL = 0x00040000, 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_NOSPLASHALERT = 0x00100000, // Splashes don't alert this monster
MF4_SYNCHRONIZED = 0x00200000, // For actors spawned at load-time only: Do not randomize tics 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 MF4_NOTARGETSWITCH = 0x00400000, // monster never switches target until current one is dead
@ -684,7 +684,7 @@ public:
FTextureID ceilingpic; // contacted sec ceilingpic FTextureID ceilingpic; // contacted sec ceilingpic
fixed_t radius, height; // for movement checking fixed_t radius, height; // for movement checking
fixed_t projectilepassheight; // height for clipping projectile movement against this actor 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 SDWORD tics; // state tic counter
FState *state; FState *state;
SDWORD Damage; // For missiles and monster railgun SDWORD Damage; // For missiles and monster railgun

View file

@ -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); fixed_t estimated_dist = P_AproxDistance (looker->x - rtarget->x, looker->y - rtarget->y);
bool reachable = true; 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; intercept_t *in;
while ((in = it.Next())) while ((in = it.Next()))
{ {
@ -56,8 +56,8 @@ bool FCajunMaster::Reachable (AActor *looker, AActor *rtarget)
frac = in->frac - FixedDiv (4*FRACUNIT, MAX_TRAVERSE_DIST); frac = in->frac - FixedDiv (4*FRACUNIT, MAX_TRAVERSE_DIST);
dist = FixedMul (frac, MAX_TRAVERSE_DIST); dist = FixedMul (frac, MAX_TRAVERSE_DIST);
hitx = it.Trace().x + FixedMul (looker->momx, frac); hitx = it.Trace().x + FixedMul (looker->velx, frac);
hity = it.Trace().y + FixedMul (looker->momy, frac); hity = it.Trace().y + FixedMul (looker->vely, frac);
if (in->isaline) if (in->isaline)
{ {
@ -171,8 +171,8 @@ void FCajunMaster::Dofire (AActor *actor, ticcmd_t *cmd)
no_fire = true; no_fire = true;
//actor->player->angle = R_PointToAngle2(actor->x, actor->y, actor->player->enemy->x, actor->player->enemy->y); //actor->player->angle = R_PointToAngle2(actor->x, actor->y, actor->player->enemy->x, actor->player->enemy->y);
//Distance to enemy. //Distance to enemy.
dist = P_AproxDistance ((actor->x + actor->momx) - (enemy->x + enemy->momx), dist = P_AproxDistance ((actor->x + actor->velx) - (enemy->x + enemy->velx),
(actor->y + actor->momy) - (enemy->y + enemy->momy)); (actor->y + actor->vely) - (enemy->y + enemy->vely));
//FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go. //FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go.
if (actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE) if (actor->player->ReadyWeapon->WeaponFlags & WIF_BOT_MELEE)
@ -225,7 +225,7 @@ void FCajunMaster::Dofire (AActor *actor, ticcmd_t *cmd)
shootmissile: shootmissile:
dist = P_AproxDistance (actor->x - enemy->x, actor->y - enemy->y); dist = P_AproxDistance (actor->x - enemy->x, actor->y - enemy->y);
m = dist / GetDefaultByType (actor->player->ReadyWeapon->ProjectileType)->Speed; 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); actor->player->angle = R_PointToAngle2 (actor->x, actor->y, body1->x, body1->y);
if (Check_LOS (actor, enemy, SHOOTFOV)) if (Check_LOS (actor, enemy, SHOOTFOV))
no_fire = false; 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[1] = FIXED2FLOAT(dest->y - source->y);
velocity[2] = FIXED2FLOAT(dest->z - source->z); velocity[2] = FIXED2FLOAT(dest->z - source->z);
velocity.MakeUnit(); velocity.MakeUnit();
th->momx = FLOAT2FIXED(velocity[0] * speed); th->velx = FLOAT2FIXED(velocity[0] * speed);
th->momy = FLOAT2FIXED(velocity[1] * speed); th->vely = FLOAT2FIXED(velocity[1] * speed);
th->momz = FLOAT2FIXED(velocity[2] * speed); th->velz = FLOAT2FIXED(velocity[2] * speed);
fixed_t dist = 0; fixed_t dist = 0;
while (dist < SAFE_SELF_MISDIST) while (dist < SAFE_SELF_MISDIST)
{ {
dist += th->Speed; 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)) if (!CleanAhead (th, th->x, th->y, cmd))
break; break;
} }
@ -509,8 +509,8 @@ angle_t FCajunMaster::FireRox (AActor *bot, AActor *enemy, ticcmd_t *cmd)
AActor *actor; AActor *actor;
int m; int m;
SetBodyAt (bot->x + FixedMul(bot->momx, 5*FRACUNIT), SetBodyAt (bot->x + FixedMul(bot->velx, 5*FRACUNIT),
bot->y + FixedMul(bot->momy, 5*FRACUNIT), bot->y + FixedMul(bot->vely, 5*FRACUNIT),
bot->z + (bot->height / 2), 2); bot->z + (bot->height / 2), 2);
actor = bglobal.body2; actor = bglobal.body2;
@ -521,8 +521,8 @@ angle_t FCajunMaster::FireRox (AActor *bot, AActor *enemy, ticcmd_t *cmd)
//Predict. //Predict.
m = (((dist+1)/FRACUNIT) / GetDefaultByName("Rocket")->Speed); m = (((dist+1)/FRACUNIT) / GetDefaultByName("Rocket")->Speed);
SetBodyAt (enemy->x + FixedMul (enemy->momx, (m+2*FRACUNIT)), SetBodyAt (enemy->x + FixedMul(enemy->velx, (m+2*FRACUNIT)),
enemy->y + FixedMul(enemy->momy, (m+2*FRACUNIT)), ONFLOORZ, 1); enemy->y + FixedMul(enemy->vely, (m+2*FRACUNIT)), ONFLOORZ, 1);
dist = P_AproxDistance(actor->x-bglobal.body1->x, actor->y-bglobal.body1->y); dist = P_AproxDistance(actor->x-bglobal.body1->x, actor->y-bglobal.body1->y);
//try the predicted location //try the predicted location
if (P_CheckSight (actor, bglobal.body1, 1)) //See the predicted location, so give a test missile if (P_CheckSight (actor, bglobal.body1, 1)) //See the predicted location, so give a test missile

View file

@ -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; dist = b->dest ? P_AproxDistance(actor->x-b->dest->x, actor->y-b->dest->y) : 0;
if (b->missile && 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->sleft = !b->sleft;
b->missile = NULL; //Probably ended its travel. b->missile = NULL; //Probably ended its travel.

View file

@ -164,7 +164,7 @@ typedef enum
{ {
CF_NOCLIP = 1 << 0, // No clipping, walk through barriers. CF_NOCLIP = 1 << 0, // No clipping, walk through barriers.
CF_GODMODE = 1 << 1, // No damage, no health loss. 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_NOTARGET = 1 << 3, // [RH] Monsters don't target
CF_FLY = 1 << 4, // [RH] Flying player CF_FLY = 1 << 4, // [RH] Flying player
CF_CHASECAM = 1 << 5, // [RH] Put camera behind 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 viewz; // focal origin above r.z
fixed_t viewheight; // base height above floor for viewz fixed_t viewheight; // base height above floor for viewz
fixed_t deltaviewheight; // squat speed. 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) // 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 only represents the thrust that the player applies himself.
// This avoids anomolies with such things as Boom ice and conveyors. // 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; bool centering;
BYTE turnticks; BYTE turnticks;

View file

@ -191,7 +191,7 @@ enum ECheatCommand
CHT_PUZZLE, CHT_PUZZLE,
CHT_MDK, // Kill actor player is aiming at CHT_MDK, // Kill actor player is aiming at
CHT_ANUBIS, CHT_ANUBIS,
CHT_NOMOMENTUM, CHT_NOVELOCITY,
CHT_DONNYTRUMP, CHT_DONNYTRUMP,
CHT_LEGO, CHT_LEGO,
CHT_RESSURECT, // [GRB] CHT_RESSURECT, // [GRB]

View file

@ -338,7 +338,7 @@ enum
// linedefs. More friction can create mud, sludge, // linedefs. More friction can create mud, sludge,
// magnetized floors, etc. Less friction can create ice. // 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 0xE800 // original value
#define ORIG_FRICTION_FACTOR 2048 // original value #define ORIG_FRICTION_FACTOR 2048 // original value
#define FRICTION_LOW 0xf900 #define FRICTION_LOW 0xf900

View file

@ -117,7 +117,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VileAttack)
S_Sound (self, CHAN_WEAPON, "vile/stop", 1, ATTN_NORM); S_Sound (self, CHAN_WEAPON, "vile/stop", 1, ATTN_NORM);
P_TraceBleed (20, target); P_TraceBleed (20, target);
P_DamageMobj (target, self, self, 20, NAME_None); P_DamageMobj (target, self, self, 20, NAME_None);
target->momz = 1000 * FRACUNIT / target->Mass; target->velz = 1000 * FRACUNIT / target->Mass;
an = self->angle >> ANGLETOFINESHIFT; an = self->angle >> ANGLETOFINESHIFT;

View file

@ -33,7 +33,7 @@ static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z)
if (boom != NULL) if (boom != NULL)
{ {
boom->DeathSound = "misc/brainexplode"; boom->DeathSound = "misc/brainexplode";
boom->momz = pr_brainscream() << 9; boom->velz = pr_brainscream() << 9;
const PClass *cls = PClass::FindClass("BossBrain"); const PClass *cls = PClass::FindClass("BossBrain");
if (cls != NULL) if (cls != NULL)
@ -109,17 +109,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
spit->master = self; spit->master = self;
// [RH] Do this correctly for any trajectory. Doom would divide by 0 // [RH] Do this correctly for any trajectory. Doom would divide by 0
// if the target had the same y coordinate as the spitter. // 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; 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 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 // [GZ] Calculates when the projectile will have reached destination
spit->reactiontime += level.maptime; spit->reactiontime += level.maptime;

View file

@ -46,8 +46,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1)
{ {
missile->angle += FATSPREAD; missile->angle += FATSPREAD;
an = missile->angle >> ANGLETOFINESHIFT; an = missile->angle >> ANGLETOFINESHIFT;
missile->momx = FixedMul (missile->Speed, finecosine[an]); missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->momy = FixedMul (missile->Speed, finesine[an]); missile->vely = FixedMul (missile->Speed, finesine[an]);
} }
} }
@ -74,8 +74,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
{ {
missile->angle -= FATSPREAD*2; missile->angle -= FATSPREAD*2;
an = missile->angle >> ANGLETOFINESHIFT; an = missile->angle >> ANGLETOFINESHIFT;
missile->momx = FixedMul (missile->Speed, finecosine[an]); missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->momy = FixedMul (missile->Speed, finesine[an]); missile->vely = FixedMul (missile->Speed, finesine[an]);
} }
} }
@ -99,8 +99,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
{ {
missile->angle -= FATSPREAD/2; missile->angle -= FATSPREAD/2;
an = missile->angle >> ANGLETOFINESHIFT; an = missile->angle >> ANGLETOFINESHIFT;
missile->momx = FixedMul (missile->Speed, finecosine[an]); missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->momy = FixedMul (missile->Speed, finesine[an]); missile->vely = FixedMul (missile->Speed, finesine[an]);
} }
missile = P_SpawnMissile (self, self->target, spawntype); missile = P_SpawnMissile (self, self->target, spawntype);
@ -108,8 +108,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
{ {
missile->angle += FATSPREAD/2; missile->angle += FATSPREAD/2;
an = missile->angle >> ANGLETOFINESHIFT; an = missile->angle >> ANGLETOFINESHIFT;
missile->momx = FixedMul (missile->Speed, finecosine[an]); missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->momy = FixedMul (missile->Speed, finesine[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 mo = P_SpawnMissile (self, target, spawntype); // Launch fireball
if (mo != NULL) if (mo != NULL)
{ {
mo->momx >>= 1; mo->velx >>= 1;
mo->momy >>= 1; // Slow it down a bit mo->vely >>= 1; // Slow it down a bit
mo->momz >>= 1; mo->velz >>= 1;
mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity
} }
} }

View file

@ -35,14 +35,14 @@ void A_SkullAttack(AActor *self, fixed_t speed)
S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM); S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM);
A_FaceTarget (self); A_FaceTarget (self);
an = self->angle >> ANGLETOFINESHIFT; an = self->angle >> ANGLETOFINESHIFT;
self->momx = FixedMul (speed, finecosine[an]); self->velx = FixedMul (speed, finecosine[an]);
self->momy = FixedMul (speed, finesine[an]); self->vely = FixedMul (speed, finesine[an]);
dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); dist = P_AproxDistance (dest->x - self->x, dest->y - self->y);
dist = dist / speed; dist = dist / speed;
if (dist < 1) if (dist < 1)
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) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullAttack)

View file

@ -45,7 +45,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
{ {
if (self->flags & MF_FLOAT) if (self->flags & MF_FLOAT)
{ {
self->momz -= 2*FRACUNIT; self->velz -= 2*FRACUNIT;
self->flags |= MF_INFLOAT; self->flags |= MF_INFLOAT;
self->flags4 |= MF4_VFRICTION; self->flags4 |= MF4_VFRICTION;
} }

View file

@ -31,8 +31,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
if (missile != NULL) if (missile != NULL)
{ {
missile->x += missile->momx; missile->x += missile->velx;
missile->y += missile->momy; missile->y += missile->vely;
missile->tracer = self->target; missile->tracer = self->target;
} }
} }
@ -62,10 +62,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
// spawn a puff of smoke behind the rocket // spawn a puff of smoke behind the rocket
P_SpawnPuff (self, PClass::FindClass(NAME_BulletPuff), self->x, self->y, self->z, 0, 3); P_SpawnPuff (self, PClass::FindClass(NAME_BulletPuff), self->x, self->y, self->z, 0, 3);
smoke = Spawn ("RevenantTracerSmoke", self->x - self->momx, smoke = Spawn ("RevenantTracerSmoke", self->x - self->velx,
self->y - self->momy, self->z, ALLOW_REPLACE); self->y - self->vely, self->z, ALLOW_REPLACE);
smoke->momz = FRACUNIT; smoke->velz = FRACUNIT;
smoke->tics -= pr_tracer()&3; smoke->tics -= pr_tracer()&3;
if (smoke->tics < 1) if (smoke->tics < 1)
smoke->tics = 1; smoke->tics = 1;
@ -96,8 +96,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
} }
exact = self->angle>>ANGLETOFINESHIFT; exact = self->angle>>ANGLETOFINESHIFT;
self->momx = FixedMul (self->Speed, finecosine[exact]); self->velx = FixedMul (self->Speed, finecosine[exact]);
self->momy = FixedMul (self->Speed, finesine[exact]); self->vely = FixedMul (self->Speed, finesine[exact]);
// change slope // change slope
dist = P_AproxDistance (dest->x - self->x, 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; 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 else
self->momz += FRACUNIT/8; self->velz += FRACUNIT/8;
} }

View file

@ -41,13 +41,13 @@ void AChickenPlayer::MorphPlayerThink ()
{ {
return; return;
} }
if (!(momx | momy) && pr_chickenplayerthink () < 160) if (!(velx | vely) && pr_chickenplayerthink () < 160)
{ // Twitch view angle { // Twitch view angle
angle += pr_chickenplayerthink.Random2 () << 19; angle += pr_chickenplayerthink.Random2 () << 19;
} }
if ((z <= floorz) && (pr_chickenplayerthink() < 32)) if ((z <= floorz) && (pr_chickenplayerthink() < 32))
{ // Jump and noise { // Jump and noise
momz += JumpZ; velz += JumpZ;
FState * painstate = FindState(NAME_Pain); FState * painstate = FindState(NAME_Pain);
if (painstate != NULL) SetState (painstate); 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 = Spawn("Feather", self->x, self->y, self->z+20*FRACUNIT, NO_REPLACE);
mo->target = self; mo->target = self;
mo->momx = pr_feathers.Random2() << 8; mo->velx = pr_feathers.Random2() << 8;
mo->momy = pr_feathers.Random2() << 8; mo->vely = pr_feathers.Random2() << 8;
mo->momz = FRACUNIT + (pr_feathers() << 9); mo->velz = FRACUNIT + (pr_feathers() << 9);
mo->SetState (mo->SpawnState + (pr_feathers()&7)); mo->SetState (mo->SpawnState + (pr_feathers()&7));
} }
} }

View file

@ -59,7 +59,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor1Chase)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack) DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
{ {
AActor *mo; AActor *mo;
fixed_t momz; fixed_t velz;
angle_t angle; angle_t angle;
if (!self->target) if (!self->target)
@ -85,10 +85,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
mo = P_SpawnMissileZ (self, self->z + 48*FRACUNIT, self->target, fx); mo = P_SpawnMissileZ (self, self->z + 48*FRACUNIT, self->target, fx);
if (mo != NULL) if (mo != NULL)
{ {
momz = mo->momz; velz = mo->velz;
angle = mo->angle; 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, velz);
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);
} }
if (self->health < self->GetDefault()->health/3) if (self->health < self->GetDefault()->health/3)
{ // Maybe attack again { // Maybe attack again
@ -153,7 +153,7 @@ void P_DSparilTeleport (AActor *actor)
S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM);
actor->z = actor->floorz; actor->z = actor->floorz;
actor->angle = spot->angle; 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++) for (i = 0; i < 2; i++)
{ {
mo = Spawn("Sorcerer2FXSpark", self->x, self->y, self->z, ALLOW_REPLACE); mo = Spawn("Sorcerer2FXSpark", self->x, self->y, self->z, ALLOW_REPLACE);
mo->momx = pr_bluespark.Random2() << 9; mo->velx = pr_bluespark.Random2() << 9;
mo->momy = pr_bluespark.Random2() << 9; mo->vely = pr_bluespark.Random2() << 9;
mo->momz = FRACUNIT + (pr_bluespark()<<8); 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 { // [RH] Make the new wizards inherit D'Sparil's target
mo->CopyFriendliness (self->target, true); 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->SetState (self->FindState(NAME_Death));
self->flags &= ~MF_MISSILE; self->flags &= ~MF_MISSILE;
mo->master = self->target; mo->master = self->target;

View file

@ -24,14 +24,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
self->flags &= ~MF_NOGRAVITY; self->flags &= ~MF_NOGRAVITY;
chunk = Spawn("HereticImpChunk1", self->x, self->y, self->z, ALLOW_REPLACE); chunk = Spawn("HereticImpChunk1", self->x, self->y, self->z, ALLOW_REPLACE);
chunk->momx = pr_imp.Random2 () << 10; chunk->velx = pr_imp.Random2 () << 10;
chunk->momy = pr_imp.Random2 () << 10; chunk->vely = pr_imp.Random2 () << 10;
chunk->momz = 9*FRACUNIT; chunk->velz = 9*FRACUNIT;
chunk = Spawn("HereticImpChunk2", self->x, self->y, self->z, ALLOW_REPLACE); chunk = Spawn("HereticImpChunk2", self->x, self->y, self->z, ALLOW_REPLACE);
chunk->momx = pr_imp.Random2 () << 10; chunk->velx = pr_imp.Random2 () << 10;
chunk->momy = pr_imp.Random2 () << 10; chunk->vely = pr_imp.Random2 () << 10;
chunk->momz = 9*FRACUNIT; chunk->velz = 9*FRACUNIT;
if (self->special1 == 666) if (self->special1 == 666)
{ // Extreme death crash { // Extreme death crash
self->SetState (self->FindState("XCrash")); self->SetState (self->FindState("XCrash"));

View file

@ -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 = Spawn(gootype, self->x, self->y, self->z + 48*FRACUNIT, ALLOW_REPLACE);
goo->target = self; goo->target = self;
goo->momx = pr_podpain.Random2() << 9; goo->velx = pr_podpain.Random2() << 9;
goo->momy = pr_podpain.Random2() << 9; goo->vely = pr_podpain.Random2() << 9;
goo->momz = FRACUNIT/2 + (pr_podpain() << 9); goo->velz = FRACUNIT/2 + (pr_podpain() << 9);
} }
} }
@ -132,7 +132,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
{ {
if (++self->health > 35) 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; angle = pr_blast () << 24;
blast->angle = angle; blast->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
blast->momx = FixedMul (1*FRACUNIT, finecosine[angle]); blast->velx = FixedMul (1*FRACUNIT, finecosine[angle]);
blast->momy = FixedMul (1*FRACUNIT, finesine[angle]); blast->vely = FixedMul (1*FRACUNIT, finesine[angle]);
blast->momz = (FRACUNIT*5/2) + (pr_blast() << 10); blast->velz = (FRACUNIT*5/2) + (pr_blast() << 10);
S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM); S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM);
P_CheckMissileSpawn (blast); P_CheckMissileSpawn (blast);
} }
@ -195,7 +195,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
self->flags |= MF_NOGRAVITY; self->flags |= MF_NOGRAVITY;
self->gravity = FRACUNIT; self->gravity = FRACUNIT;
self->z += 28*FRACUNIT; self->z += 28*FRACUNIT;
//self->momz = 3*FRACUNIT; //self->velz = 3*FRACUNIT;
} }
P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, true); P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, true);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
@ -205,9 +205,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
angle = i*ANG90; angle = i*ANG90;
tiny->angle = angle; tiny->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
tiny->momx = FixedMul (FRACUNIT*7/10, finecosine[angle]); tiny->velx = FixedMul (FRACUNIT*7/10, finecosine[angle]);
tiny->momy = FixedMul (FRACUNIT*7/10, finesine[angle]); tiny->vely = FixedMul (FRACUNIT*7/10, finesine[angle]);
tiny->momz = FRACUNIT + (pr_volcimpact() << 9); tiny->velz = FRACUNIT + (pr_volcimpact() << 9);
P_CheckMissileSpawn (tiny); P_CheckMissileSpawn (tiny);
} }
} }

View file

@ -141,7 +141,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
int i; int i;
angle_t angle; angle_t angle;
int damage; int damage;
fixed_t momz; fixed_t velz;
player_t *player; player_t *player;
if (NULL == (player = self->player)) if (NULL == (player = self->player))
@ -156,10 +156,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
return; return;
} }
angle_t pitch = P_BulletSlope(self); angle_t pitch = P_BulletSlope(self);
momz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed, velz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed,
finetangent[FINEANGLES/4-((signed)pitch>>ANGLETOFINESHIFT)]); 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), velz);
P_SpawnMissileAngle (self, PClass::FindClass("GoldWandFX2"), self->angle+(ANG45/8), momz); P_SpawnMissileAngle (self, PClass::FindClass("GoldWandFX2"), self->angle+(ANG45/8), velz);
angle = self->angle-(ANG45/8); angle = self->angle-(ANG45/8);
for(i = 0; i < 5; i++) 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 ball = Spawn("MaceFX2", actor->x, actor->y, actor->z + 28*FRACUNIT
- actor->floorclip, ALLOW_REPLACE); - 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)]; finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)];
angle = actor->angle; angle = actor->angle;
ball->target = actor; ball->target = actor;
ball->angle = angle; ball->angle = angle;
ball->z += 2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]; ball->z += 2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)];
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
ball->momx = (actor->momx>>1)+FixedMul(ball->Speed, finecosine[angle]); ball->velx = (actor->velx>>1) + FixedMul(ball->Speed, finecosine[angle]);
ball->momy = (actor->momy>>1)+FixedMul(ball->Speed, finesine[angle]); ball->vely = (actor->vely>>1) + FixedMul(ball->Speed, finesine[angle]);
S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM); S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM);
P_CheckMissileSpawn (ball); P_CheckMissileSpawn (ball);
} }
@ -455,19 +455,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
self->special1 = 0; self->special1 = 0;
self->flags &= ~MF_NOGRAVITY; self->flags &= ~MF_NOGRAVITY;
self->gravity = FRACUNIT/8; 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 #if 0
// This is the original code, for reference.
angle_t angle = self->angle>>ANGLETOFINESHIFT; angle_t angle = self->angle>>ANGLETOFINESHIFT;
self->momx = FixedMul(7*FRACUNIT, finecosine[angle]); self->velx = FixedMul(7*FRACUNIT, finecosine[angle]);
self->momy = FixedMul(7*FRACUNIT, finesine[angle]); self->vely = FixedMul(7*FRACUNIT, finesine[angle]);
#else #else
float momscale = sqrtf ((float)self->momx * (float)self->momx + double velscale = sqrtf ((float)self->velx * (float)self->velx +
(float)self->momy * (float)self->momy); (float)self->vely * (float)self->vely);
momscale = 458752.f / momscale; velscale = 458752 / velscale;
self->momx = (int)(self->momx * momscale); self->velx = (int)(self->velx * velscale);
self->momy = (int)(self->momy * momscale); self->vely = (int)(self->vely * velscale);
#endif #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)) if ((self->health != MAGIC_JUNK) && (self->flags & MF_INBOUNCE))
{ // Bounce { // Bounce
self->health = MAGIC_JUNK; self->health = MAGIC_JUNK;
self->momz = (self->momz * 192) >> 8; self->velz = (self->velz * 192) >> 8;
self->bouncetype = BOUNCE_None; self->bouncetype = BOUNCE_None;
self->SetState (self->SpawnState); self->SetState (self->SpawnState);
S_Sound (self, CHAN_BODY, "weapons/macebounce", 1, ATTN_NORM); S_Sound (self, CHAN_BODY, "weapons/macebounce", 1, ATTN_NORM);
} }
else else
{ // Explode { // Explode
self->momx = self->momy = self->momz = 0; self->velx = self->vely = self->velz = 0;
self->flags |= MF_NOGRAVITY; self->flags |= MF_NOGRAVITY;
self->gravity = FRACUNIT; self->gravity = FRACUNIT;
S_Sound (self, CHAN_BODY, "weapons/macehit", 1, ATTN_NORM); S_Sound (self, CHAN_BODY, "weapons/macehit", 1, ATTN_NORM);
@ -514,11 +515,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
if (floordist <= ceildist) if (floordist <= ceildist)
{ {
vel = MulScale32 (self->momz, self->Sector->floorplane.c); vel = MulScale32 (self->velz, self->Sector->floorplane.c);
} }
else else
{ {
vel = MulScale32 (self->momz, self->Sector->ceilingplane.c); vel = MulScale32 (self->velz, self->Sector->ceilingplane.c);
} }
if (vel < 2) if (vel < 2)
{ {
@ -526,7 +527,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
} }
// Bounce // Bounce
self->momz = (self->momz * 192) >> 8; self->velz = (self->velz * 192) >> 8;
self->SetState (self->SpawnState); self->SetState (self->SpawnState);
tiny = Spawn("MaceFX3", self->x, self->y, self->z, ALLOW_REPLACE); 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->target = self->target;
tiny->angle = angle; tiny->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
tiny->momx = (self->momx>>1)+FixedMul(self->momz-FRACUNIT, tiny->velx = (self->velx>>1) + FixedMul(self->velz-FRACUNIT, finecosine[angle]);
finecosine[angle]); tiny->vely = (self->vely>>1) + FixedMul(self->velz-FRACUNIT, finesine[angle]);
tiny->momy = (self->momy>>1)+FixedMul(self->momz-FRACUNIT, tiny->velz = self->velz;
finesine[angle]);
tiny->momz = self->momz;
P_CheckMissileSpawn (tiny); P_CheckMissileSpawn (tiny);
tiny = Spawn("MaceFX3", self->x, self->y, self->z, ALLOW_REPLACE); 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->target = self->target;
tiny->angle = angle; tiny->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
tiny->momx = (self->momx>>1)+FixedMul(self->momz-FRACUNIT, tiny->velx = (self->velx>>1) + FixedMul(self->velz-FRACUNIT, finecosine[angle]);
finecosine[angle]); tiny->vely = (self->vely>>1) + FixedMul(self->velz-FRACUNIT, finesine[angle]);
tiny->momy = (self->momy>>1)+FixedMul(self->momz-FRACUNIT, tiny->velz = self->velz;
finesine[angle]);
tiny->momz = self->momz;
P_CheckMissileSpawn (tiny); P_CheckMissileSpawn (tiny);
} }
else else
{ // Explode { // Explode
boom: boom:
self->momx = self->momy = self->momz = 0; self->velx = self->vely = self->velz = 0;
self->flags |= MF_NOGRAVITY; self->flags |= MF_NOGRAVITY;
self->bouncetype = BOUNCE_None; self->bouncetype = BOUNCE_None;
self->gravity = FRACUNIT; 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); mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->angle, &linetarget);
if (mo) if (mo)
{ {
mo->momx += self->momx; mo->velx += self->velx;
mo->momy += self->momy; mo->vely += self->vely;
mo->momz = 2*FRACUNIT+ mo->velz = 2*FRACUNIT+
clamp<fixed_t>(finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], -5*FRACUNIT, 5*FRACUNIT); clamp<fixed_t>(finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], -5*FRACUNIT, 5*FRACUNIT);
if (linetarget) if (linetarget)
{ {
@ -628,11 +625,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
if (floordist <= ceildist) if (floordist <= ceildist)
{ {
vel = MulScale32 (self->momz, self->Sector->floorplane.c); vel = MulScale32 (self->velz, self->Sector->floorplane.c);
} }
else else
{ {
vel = MulScale32 (self->momz, self->Sector->ceilingplane.c); vel = MulScale32 (self->velz, self->Sector->ceilingplane.c);
} }
if (vel < 2) if (vel < 2)
{ {
@ -676,8 +673,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
{ {
self->angle = angle; self->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
self->momx = FixedMul (self->Speed, finecosine[angle]); self->velx = FixedMul (self->Speed, finecosine[angle]);
self->momy = FixedMul (self->Speed, finesine[angle]); self->vely = FixedMul (self->Speed, finesine[angle]);
} }
self->SetState (self->SpawnState); self->SetState (self->SpawnState);
S_Sound (self, CHAN_BODY, "weapons/macestop", 1, ATTN_NORM); S_Sound (self, CHAN_BODY, "weapons/macestop", 1, ATTN_NORM);
@ -685,7 +682,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
else else
{ // Explode { // Explode
boom: boom:
self->momx = self->momy = self->momz = 0; self->velx = self->vely = self->velz = 0;
self->flags |= MF_NOGRAVITY; self->flags |= MF_NOGRAVITY;
self->gravity = FRACUNIT; self->gravity = FRACUNIT;
S_Sound (self, CHAN_BODY, "weapons/maceexplode", 1, ATTN_NORM); 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->target = self->target;
ripper->angle = angle; ripper->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
ripper->momx = FixedMul (ripper->Speed, finecosine[angle]); ripper->velx = FixedMul (ripper->Speed, finecosine[angle]);
ripper->momy = FixedMul (ripper->Speed, finesine[angle]); ripper->vely = FixedMul (ripper->Speed, finesine[angle]);
P_CheckMissileSpawn (ripper); P_CheckMissileSpawn (ripper);
} }
} }
@ -1051,8 +1048,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
mo->Translation = multiplayer ? mo->Translation = multiplayer ?
TRANSLATION(TRANSLATION_PlayersExtra,self->special2) : 0; TRANSLATION(TRANSLATION_PlayersExtra,self->special2) : 0;
mo->target = self->target; mo->target = self->target;
mo->momx = 1; // Force collision detection mo->velx = 1; // Force collision detection
mo->momz = -mo->Speed; mo->velz = -mo->Speed;
mo->special2 = self->special2; // Transfer player number mo->special2 = self->special2; // Transfer player number
P_CheckMissileSpawn (mo); P_CheckMissileSpawn (mo);
if (self->special1 != -1 && !S_IsActorPlayingSomething (self, CHAN_BODY, -1)) 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)); P_SpawnPlayerMissile (self, RUNTIME_CLASS(APhoenixFX1));
angle = self->angle + ANG180; angle = self->angle + ANG180;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
self->momx += FixedMul (4*FRACUNIT, finecosine[angle]); self->velx += FixedMul (4*FRACUNIT, finecosine[angle]);
self->momy += FixedMul (4*FRACUNIT, finesine[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); puff = Spawn("PhoenixPuff", self->x, self->y, self->z, ALLOW_REPLACE);
angle = self->angle + ANG90; angle = self->angle + ANG90;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
puff->momx = FixedMul (FRACUNIT*13/10, finecosine[angle]); puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]);
puff->momy = FixedMul (FRACUNIT*13/10, finesine[angle]); puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]);
puff->momz = 0; puff->velz = 0;
puff = Spawn("PhoenixPuff", self->x, self->y, self->z, ALLOW_REPLACE); puff = Spawn("PhoenixPuff", self->x, self->y, self->z, ALLOW_REPLACE);
angle = self->angle - ANG90; angle = self->angle - ANG90;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
puff->momx = FixedMul (FRACUNIT*13/10, finecosine[angle]); puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]);
puff->momy = FixedMul (FRACUNIT*13/10, finesine[angle]); puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]);
puff->momz = 0; puff->velz = 0;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -1279,9 +1276,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
mo = Spawn("PhoenixFX2", x, y, z, ALLOW_REPLACE); mo = Spawn("PhoenixFX2", x, y, z, ALLOW_REPLACE);
mo->target = self; mo->target = self;
mo->angle = angle; mo->angle = angle;
mo->momx = self->momx + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]); mo->velx = self->velx + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]);
mo->momy = self->momy + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]); mo->vely = self->vely + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]);
mo->momz = FixedMul (mo->Speed, slope); mo->velz = FixedMul (mo->Speed, slope);
if (!player->refire || !S_IsActorPlayingSomething (self, CHAN_WEAPON, -1)) if (!player->refire || !S_IsActorPlayingSomething (self, CHAN_WEAPON, -1))
{ {
S_Sound (self, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM); 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) 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) DEFINE_ACTION_FUNCTION(AActor, A_FloatPuff)
{ {
self->momz += FRACUNIT*18/10; self->velz += FRACUNIT*18/10;
} }

View file

@ -29,8 +29,8 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage)
int randVal; int randVal;
target->angle += pr_foo.Random2() << 20; target->angle += pr_foo.Random2() << 20;
target->momx += pr_foo.Random2() << 10; target->velx += pr_foo.Random2() << 10;
target->momy += pr_foo.Random2() << 10; target->vely += pr_foo.Random2() << 10;
if ((level.time & 16) && !(target->flags2 & MF2_BOSS)) if ((level.time & 16) && !(target->flags2 & MF2_BOSS))
{ {
randVal = pr_foo(); randVal = pr_foo();
@ -38,10 +38,10 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage)
{ {
randVal = 160; randVal = 160;
} }
target->momz += randVal << 11; target->velz += randVal << 11;
if (target->momz > 12*FRACUNIT) if (target->velz > 12*FRACUNIT)
{ {
target->momz = 12*FRACUNIT; target->velz = 12*FRACUNIT;
} }
} }
if (!(level.time & 7)) if (!(level.time & 7))
@ -111,9 +111,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
} }
fire->target = baseFire->target; fire->target = baseFire->target;
fire->angle = baseFire->angle; fire->angle = baseFire->angle;
fire->momx = baseFire->momx; fire->velx = baseFire->velx;
fire->momy = baseFire->momy; fire->vely = baseFire->vely;
fire->momz = baseFire->momz; fire->velz = baseFire->velz;
fire->Damage = 0; fire->Damage = 0;
fire->health = (i+1) * 2; fire->health = (i+1) * 2;
P_CheckMissileSpawn (fire); P_CheckMissileSpawn (fire);
@ -146,7 +146,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
self->health -= 3; self->health -= 3;
if (self->health < 0) 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->SetState (self->FindState(NAME_Death));
self->flags &= ~MF_MISSILE; self->flags &= ~MF_MISSILE;
return; return;
@ -182,9 +182,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
shard->target = self->target; shard->target = self->target;
shard->angle = angle; shard->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
shard->momx = FixedMul (shard->Speed, finecosine[angle]); shard->velx = FixedMul (shard->Speed, finecosine[angle]);
shard->momy = FixedMul (shard->Speed, finesine[angle]); shard->vely = FixedMul (shard->Speed, finesine[angle]);
shard->momz = -FRACUNIT*6/10; shard->velz = -FRACUNIT*6/10;
P_CheckMissileSpawn (shard); P_CheckMissileSpawn (shard);
} }
} }

View file

@ -27,8 +27,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
x = self->x + (pr_dripblood.Random2 () << 11); x = self->x + (pr_dripblood.Random2 () << 11);
y = self->y + (pr_dripblood.Random2 () << 11); y = self->y + (pr_dripblood.Random2 () << 11);
mo = Spawn ("Blood", x, y, self->z, ALLOW_REPLACE); mo = Spawn ("Blood", x, y, self->z, ALLOW_REPLACE);
mo->momx = pr_dripblood.Random2 () << 10; mo->velx = pr_dripblood.Random2 () << 10;
mo->momy = pr_dripblood.Random2 () << 10; mo->vely = pr_dripblood.Random2 () << 10;
mo->gravity = FRACUNIT/8; mo->gravity = FRACUNIT/8;
} }

View file

@ -77,7 +77,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
mo = P_SpawnMissile (self, self->target, fx); mo = P_SpawnMissile (self, self->target, fx);
if (mo != NULL) if (mo != NULL)
{ {
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->momz); P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->velz);
} }
} }

View file

@ -73,10 +73,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatMove)
newangle = self->angle - ANGLE_1*self->args[4]; newangle = self->angle - ANGLE_1*self->args[4];
} }
// Adjust momentum vector to new direction // Adjust velocity vector to new direction
newangle >>= ANGLETOFINESHIFT; newangle >>= ANGLETOFINESHIFT;
self->momx = FixedMul (self->Speed, finecosine[newangle]); self->velx = FixedMul (self->Speed, finecosine[newangle]);
self->momy = FixedMul (self->Speed, finesine[newangle]); self->vely = FixedMul (self->Speed, finesine[newangle]);
if (pr_batmove()<15) if (pr_batmove()<15)
{ {

View file

@ -148,8 +148,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
if (!--self->special1) if (!--self->special1)
{ {
self->momx = 0; self->velx = 0;
self->momy = 0; self->vely = 0;
if (pr_sblur() > 96) if (pr_sblur() > 96)
{ {
self->SetState (self->SeeState); 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); mo = Spawn ("BishopPuff", self->x, self->y, self->z + 40*FRACUNIT, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momz = FRACUNIT/2; mo->velz = FRACUNIT/2;
} }
} }

View file

@ -102,8 +102,8 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength)
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
if (strength < BLAST_FULLSTRENGTH) if (strength < BLAST_FULLSTRENGTH)
{ {
victim->momx = FixedMul (strength, finecosine[angle]); victim->velx = FixedMul (strength, finecosine[angle]);
victim->momy = FixedMul (strength, finesine[angle]); victim->vely = FixedMul (strength, finesine[angle]);
if (victim->player) if (victim->player)
{ {
// Players handled automatically // Players handled automatically
@ -125,8 +125,8 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength)
} }
#endif #endif
} }
victim->momx = FixedMul (BLAST_SPEED, finecosine[angle]); victim->velx = FixedMul (BLAST_SPEED, finecosine[angle]);
victim->momy = FixedMul (BLAST_SPEED, finesine[angle]); victim->vely = FixedMul (BLAST_SPEED, finesine[angle]);
// Spawn blast puff // Spawn blast puff
ang = R_PointToAngle2 (victim->x, victim->y, Owner->x, Owner->y); 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); mo = Spawn ("BlastEffect", x, y, z, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momx = victim->momx; mo->velx = victim->velx;
mo->momy = victim->momy; mo->vely = victim->vely;
} }
if (victim->flags & MF_MISSILE) 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. // [RH] Floor and ceiling huggers should not be blasted vertically.
if (!(victim->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))) if (!(victim->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
{ {
victim->momz = 8*FRACUNIT; victim->velz = 8*FRACUNIT;
mo->momz = victim->momz; mo->velz = victim->velz;
} }
} }
else else
{ {
victim->momz = (1000 / victim->Mass) << FRACBITS; victim->velz = (1000 / victim->Mass) << FRACBITS;
} }
if (victim->player) if (victim->player)
{ {

View file

@ -94,9 +94,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff) DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff)
{ {
self->renderflags &= ~RF_INVISIBLE; self->renderflags &= ~RF_INVISIBLE;
self->momx = 0; self->velx = 0;
self->momy = 0; self->vely = 0;
self->momz = 0; self->velz = 0;
S_Sound (self, CHAN_BODY, "ClericFlameExplode", 1, ATTN_NORM); S_Sound (self, CHAN_BODY, "ClericFlameExplode", 1, ATTN_NORM);
} }
@ -130,8 +130,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
{ {
mo->angle = an<<ANGLETOFINESHIFT; mo->angle = an<<ANGLETOFINESHIFT;
mo->target = self->target; mo->target = self->target;
mo->momx = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]); mo->velx = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]);
mo->momy = mo->special2 = FixedMul(FLAMESPEED, finesine[an]); mo->vely = mo->special2 = FixedMul(FLAMESPEED, finesine[an]);
mo->tics -= pr_missile()&3; mo->tics -= pr_missile()&3;
} }
mo = Spawn ("CircleFlame", BlockingMobj->x-FixedMul(dist, finecosine[an]), mo = Spawn ("CircleFlame", BlockingMobj->x-FixedMul(dist, finecosine[an]),
@ -141,8 +141,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
{ {
mo->angle = ANG180+(an<<ANGLETOFINESHIFT); mo->angle = ANG180+(an<<ANGLETOFINESHIFT);
mo->target = self->target; mo->target = self->target;
mo->momx = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]); mo->velx = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]);
mo->momy = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]); mo->vely = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]);
mo->tics -= pr_missile()&3; mo->tics -= pr_missile()&3;
} }
} }
@ -161,7 +161,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameRotate)
int an; int an;
an = (self->angle+ANG90)>>ANGLETOFINESHIFT; an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
self->momx = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]); self->velx = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]);
self->momy = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]); self->vely = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]);
self->angle += ANG90/15; self->angle += ANG90/15;
} }

View file

@ -460,8 +460,8 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
actor->angle -= delta; actor->angle -= delta;
} }
angle = actor->angle>>ANGLETOFINESHIFT; angle = actor->angle>>ANGLETOFINESHIFT;
actor->momx = FixedMul (actor->Speed, finecosine[angle]); actor->velx = FixedMul (actor->Speed, finecosine[angle]);
actor->momy = FixedMul (actor->Speed, finesine[angle]); actor->vely = FixedMul (actor->Speed, finesine[angle]);
if (!(level.time&15) if (!(level.time&15)
|| actor->z > target->z+(target->height) || actor->z > target->z+(target->height)
|| actor->z+actor->height < target->z) || actor->z+actor->height < target->z)
@ -485,7 +485,7 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
{ {
dist = 1; dist = 1;
} }
actor->momz = deltaZ/dist; actor->velz = deltaZ / dist;
} }
return; return;
} }
@ -532,9 +532,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
self->health--; self->health--;
if (self->health <= 0) if (self->health <= 0)
{ {
self->momx >>= 2; self->velx >>= 2;
self->momy >>= 2; self->vely >>= 2;
self->momz = 0; self->velz = 0;
self->SetState (self->FindState(NAME_Death)); self->SetState (self->FindState(NAME_Death));
self->tics -= pr_holyseek()&3; self->tics -= pr_holyseek()&3;
return; return;

View file

@ -57,8 +57,8 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
actor->angle -= delta; actor->angle -= delta;
} }
angle = actor->angle>>ANGLETOFINESHIFT; angle = actor->angle>>ANGLETOFINESHIFT;
actor->momx = FixedMul (actor->Speed, finecosine[angle]); actor->velx = FixedMul (actor->Speed, finecosine[angle]);
actor->momy = FixedMul (actor->Speed, finesine[angle]); actor->vely = FixedMul (actor->Speed, finesine[angle]);
if (actor->z+actor->height < target->z || if (actor->z+actor->height < target->z ||
target->z+target->height < actor->z) target->z+target->height < actor->z)
{ {
@ -68,7 +68,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
{ {
dist = 1; dist = 1;
} }
actor->momz = (target->z-actor->z)/dist; actor->velz = (target->z - actor->z)/dist;
} }
else else
{ {

View file

@ -76,9 +76,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces)
AActor *piece = Spawn (cls, self->x, self->y, self->z, ALLOW_REPLACE); AActor *piece = Spawn (cls, self->x, self->y, self->z, ALLOW_REPLACE);
if (piece != NULL) if (piece != NULL)
{ {
piece->momx = self->momx + finecosine[fineang]; piece->velx = self->velx + finecosine[fineang];
piece->momy = self->momy + finesine[fineang]; piece->vely = self->vely + finesine[fineang];
piece->momz = self->momz; piece->velz = self->velz;
piece->flags |= MF_DROPPED; piece->flags |= MF_DROPPED;
fineang += FINEANGLES/3; fineang += FINEANGLES/3;
j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j; j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j;

View file

@ -62,9 +62,9 @@ void A_FiredSpawnRock (AActor *actor)
if (mo) if (mo)
{ {
mo->target = actor; mo->target = actor;
mo->momx = (pr_firedemonrock() - 128) <<10; mo->velx = (pr_firedemonrock() - 128) <<10;
mo->momy = (pr_firedemonrock() - 128) <<10; mo->vely = (pr_firedemonrock() - 128) <<10;
mo->momz = (pr_firedemonrock() << 10); mo->velz = (pr_firedemonrock() << 10);
mo->special1 = 2; // Number bounces mo->special1 = 2; // Number bounces
} }
@ -96,11 +96,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredRocks)
DEFINE_ACTION_FUNCTION(AActor, A_SmBounce) 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->z = self->floorz + FRACUNIT;
self->momz = (2*FRACUNIT) + (pr_smbounce() << 10); self->velz = (2*FRACUNIT) + (pr_smbounce() << 10);
self->momx = pr_smbounce()%3<<FRACBITS; self->velx = pr_smbounce()%3<<FRACBITS;
self->momy = pr_smbounce()%3<<FRACBITS; self->vely = pr_smbounce()%3<<FRACBITS;
} }
//============================================================================ //============================================================================
@ -157,7 +157,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
else else
{ {
self->special2 = 0; self->special2 = 0;
self->momx = self->momy = 0; self->velx = self->vely = 0;
dist = P_AproxDistance (self->x - target->x, self->y - target->y); dist = P_AproxDistance (self->x - target->x, self->y - target->y);
if (dist < FIREDEMON_ATTACK_RANGE) if (dist < FIREDEMON_ATTACK_RANGE)
{ {
@ -169,8 +169,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
else else
ang -= ANGLE_90; ang -= ANGLE_90;
ang >>= ANGLETOFINESHIFT; ang >>= ANGLETOFINESHIFT;
self->momx = finecosine[ang] << 3; //FixedMul (8*FRACUNIT, finecosine[ang]); self->velx = finecosine[ang] << 3; //FixedMul (8*FRACUNIT, finecosine[ang]);
self->momy = finesine[ang] << 3; //FixedMul (8*FRACUNIT, finesine[ang]); self->vely = finesine[ang] << 3; //FixedMul (8*FRACUNIT, finesine[ang]);
self->special2 = 3; // strafe time 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); mo = Spawn ("FireDemonSplotch1", self->x, self->y, self->z, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momx = (pr_firedemonsplotch() - 128) << 11; mo->velx = (pr_firedemonsplotch() - 128) << 11;
mo->momy = (pr_firedemonsplotch() - 128) << 11; mo->vely = (pr_firedemonsplotch() - 128) << 11;
mo->momz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
} }
mo = Spawn ("FireDemonSplotch2", self->x, self->y, self->z, ALLOW_REPLACE); mo = Spawn ("FireDemonSplotch2", self->x, self->y, self->z, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momx = (pr_firedemonsplotch() - 128) << 11; mo->velx = (pr_firedemonsplotch() - 128) << 11;
mo->momy = (pr_firedemonsplotch() - 128) << 11; mo->vely = (pr_firedemonsplotch() - 128) << 11;
mo->momz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
} }
} }

View file

@ -111,11 +111,11 @@ bool AArtiPoisonBag3::Use (bool pickup)
angle_t pitch = (angle_t)Owner->pitch >> ANGLETOFINESHIFT; angle_t pitch = (angle_t)Owner->pitch >> ANGLETOFINESHIFT;
mo->angle = Owner->angle+(((pr_poisonbag()&7)-4)<<24); 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]; mo->z += 2*finesine[pitch];
P_ThrustMobj (mo, mo->angle, mo->Speed); P_ThrustMobj (mo, mo->angle, mo->Speed);
mo->momx += Owner->momx>>1; mo->velx += Owner->velx >> 1;
mo->momy += Owner->momy>>1; mo->vely += Owner->vely >> 1;
mo->target = Owner; mo->target = Owner;
mo->tics -= pr_poisonbag()&3; mo->tics -= pr_poisonbag()&3;
P_CheckMissileSpawn (mo); P_CheckMissileSpawn (mo);
@ -242,7 +242,7 @@ IMPLEMENT_CLASS (APoisonCloud)
void APoisonCloud::BeginPlay () 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); special1 = 24+(pr_poisoncloud()&7);
special2 = 0; special2 = 0;
} }
@ -362,16 +362,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb)
DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2) DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
{ {
// [RH] Check using actual velocity, although the momz < 2 check still stands // [RH] Check using actual velocity, although the velz < 2 check still stands
//if (abs(self->momx) < FRACUNIT*3/2 && abs(self->momy) < FRACUNIT*3/2 //if (abs(self->velx) < FRACUNIT*3/2 && abs(self->vely) < FRACUNIT*3/2
// && self->momz < 2*FRACUNIT) // && self->velz < 2*FRACUNIT)
if (self->momz < 2*FRACUNIT && if (self->velz < 2*FRACUNIT &&
TMulScale32 (self->momx, self->momx, self->momy, self->momy, self->momz, self->momz) TMulScale32 (self->velx, self->velx, self->vely, self->vely, self->velz, self->velz)
< (3*3)/(2*2)) < (3*3)/(2*2))
{ {
self->SetState (self->SpawnState + 6); self->SetState (self->SpawnState + 6);
self->z = self->floorz; self->z = self->floorz;
self->momz = 0; self->velz = 0;
self->bouncetype = BOUNCE_None; self->bouncetype = BOUNCE_None;
self->flags &= ~MF_MISSILE; self->flags &= ~MF_MISSILE;
} }

View file

@ -85,7 +85,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogMove)
} }
angle = self->angle>>ANGLETOFINESHIFT; angle = self->angle>>ANGLETOFINESHIFT;
self->momx = FixedMul(speed, finecosine[angle]); self->velx = FixedMul(speed, finecosine[angle]);
self->momy = FixedMul(speed, finesine[angle]); self->vely = FixedMul(speed, finesine[angle]);
} }

View file

@ -176,11 +176,11 @@ class ASorcFX1 : public AActor
public: public:
bool FloorBounceMissile (secplane_t &plane) bool FloorBounceMissile (secplane_t &plane)
{ {
fixed_t orgmomz = momz; fixed_t orgvelz = velz;
if (!Super::FloorBounceMissile (plane)) if (!Super::FloorBounceMissile (plane))
{ {
momz = -orgmomz; // no energy absorbed velz = -orgvelz; // no energy absorbed
return false; return false;
} }
return true; return true;
@ -668,7 +668,7 @@ void A_SorcOffense2(AActor *actor)
dist = P_AproxDistance(dest->x - mo->x, dest->y - mo->y); dist = P_AproxDistance(dest->x - mo->x, dest->y - mo->y);
dist = dist/mo->Speed; dist = dist/mo->Speed;
if(dist < 1) dist = 1; 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) if (mo)
{ {
rangle = angle + ((pr_heresiarch()%5) << 1); rangle = angle + ((pr_heresiarch()%5) << 1);
mo->momx = FixedMul(pr_heresiarch()%speed,finecosine[rangle]); mo->velx = FixedMul(pr_heresiarch()%speed, finecosine[rangle]);
mo->momy = FixedMul(pr_heresiarch()%speed,finesine[rangle]); mo->vely = FixedMul(pr_heresiarch()%speed, finesine[rangle]);
mo->momz = FRACUNIT*2; mo->velz = FRACUNIT*2;
} }
} }
} }
@ -912,9 +912,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallPop)
S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE); S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE);
self->flags &= ~MF_NOGRAVITY; self->flags &= ~MF_NOGRAVITY;
self->gravity = FRACUNIT/8; self->gravity = FRACUNIT/8;
self->momx = ((pr_heresiarch()%10)-5) << FRACBITS; self->velx = ((pr_heresiarch()%10)-5) << FRACBITS;
self->momy = ((pr_heresiarch()%10)-5) << FRACBITS; self->vely = ((pr_heresiarch()%10)-5) << FRACBITS;
self->momz = (2+(pr_heresiarch()%3)) << FRACBITS; self->velz = (2+(pr_heresiarch()%3)) << FRACBITS;
self->special2 = 4*FRACUNIT; // Initial bounce factor self->special2 = 4*FRACUNIT; // Initial bounce factor
self->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit self->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit
self->args[3] = 5; // Bounce time in seconds self->args[3] = 5; // Bounce time in seconds

View file

@ -64,9 +64,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
mo->SetState (mo->SpawnState + (pr_pottery()%5)); mo->SetState (mo->SpawnState + (pr_pottery()%5));
if (mo) if (mo)
{ {
mo->momz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4); mo->velz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4);
mo->momx = (pr_pottery.Random2())<<(FRACBITS-6); mo->velx = (pr_pottery.Random2())<<(FRACBITS-6);
mo->momy = (pr_pottery.Random2())<<(FRACBITS-6); mo->vely = (pr_pottery.Random2())<<(FRACBITS-6);
} }
} }
S_Sound (mo, CHAN_BODY, "PotteryExplode", 1, ATTN_NORM); S_Sound (mo, CHAN_BODY, "PotteryExplode", 1, ATTN_NORM);
@ -166,9 +166,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
if (mo) if (mo)
{ {
mo->SetState (mo->SpawnState + (pr_foo()%3)); mo->SetState (mo->SpawnState + (pr_foo()%3));
mo->momz = ((pr_foo()&7)+5)*(3*FRACUNIT/4); mo->velz = ((pr_foo()&7)+5)*(3*FRACUNIT/4);
mo->momx = pr_foo.Random2()<<(FRACBITS-6); mo->velx = pr_foo.Random2()<<(FRACBITS-6);
mo->momy = pr_foo.Random2()<<(FRACBITS-6); mo->vely = pr_foo.Random2()<<(FRACBITS-6);
} }
} }
// Spawn a skull // Spawn a skull
@ -176,9 +176,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
if (mo) if (mo)
{ {
mo->SetState (mo->SpawnState + 3); mo->SetState (mo->SpawnState + 3);
mo->momz = ((pr_foo()&7)+5)*(3*FRACUNIT/4); mo->velz = ((pr_foo()&7)+5)*(3*FRACUNIT/4);
mo->momx = pr_foo.Random2()<<(FRACBITS-6); mo->velx = pr_foo.Random2()<<(FRACBITS-6);
mo->momy = pr_foo.Random2()<<(FRACBITS-6); mo->vely = pr_foo.Random2()<<(FRACBITS-6);
} }
S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_IDLE); S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_IDLE);
self->Destroy (); self->Destroy ();
@ -220,7 +220,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust)
{ {
if (pr_leafthrust() <= 96) 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; angle_t ang = self->target ? self->target->angle : self->angle;
if (pr_leafcheck() > 64) if (pr_leafcheck() > 64)
{ {
if (!self->momx && !self->momy) if (!self->velx && !self->vely)
{ {
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+FRACUNIT); P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+FRACUNIT);
} }
return; return;
} }
self->SetState (self->SpawnState + 7); 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); P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+2*FRACUNIT);
self->flags |= MF_MISSILE; self->flags |= MF_MISSILE;
} }
@ -283,9 +283,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode)
if (mo) if (mo)
{ {
mo->SetState (mo->SpawnState + i); mo->SetState (mo->SpawnState + i);
mo->momz = ((pr_soaexplode()&7)+5)*FRACUNIT; mo->velz = ((pr_soaexplode()&7)+5)*FRACUNIT;
mo->momx = pr_soaexplode.Random2()<<(FRACBITS-6); mo->velx = pr_soaexplode.Random2()<<(FRACBITS-6);
mo->momy = 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]]) if (self->args[0]>=0 && self->args[0]<=255 && SpawnableThings[self->args[0]])

View file

@ -66,9 +66,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
self->z+60*FRACUNIT, ALLOW_REPLACE); self->z+60*FRACUNIT, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momx = self->momx; mo->velx = self->velx;
mo->momy = self->momy; mo->vely = self->vely;
mo->momz = self->momz; mo->velz = self->velz;
mo->target = self; mo->target = self;
} }
} }
@ -109,9 +109,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie) DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
{ {
self->momx = 0; self->velx = 0;
self->momy = 0; self->vely = 0;
self->momz = 0; self->velz = 0;
self->height = self->GetDefault()->height; self->height = self->GetDefault()->height;
CALL_ACTION(A_FreezeDeathChunks, self); CALL_ACTION(A_FreezeDeathChunks, self);
} }

View file

@ -391,8 +391,8 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
actor->angle -= delta; actor->angle -= delta;
} }
angle = actor->angle>>ANGLETOFINESHIFT; angle = actor->angle>>ANGLETOFINESHIFT;
actor->momx = FixedMul (actor->Speed, finecosine[angle]); actor->velx = FixedMul (actor->Speed, finecosine[angle]);
actor->momy = FixedMul (actor->Speed, finesine[angle]); actor->vely = FixedMul (actor->Speed, finesine[angle]);
if (!(level.time&15) if (!(level.time&15)
|| actor->z > target->z+(target->GetDefault()->height) || actor->z > target->z+(target->GetDefault()->height)
@ -417,7 +417,7 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
{ {
dist = 1; dist = 1;
} }
actor->momz = deltaZ/dist; actor->velz = deltaZ/dist;
} }
return; return;
} }
@ -516,14 +516,14 @@ AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z,
} }
th->angle = an; th->angle = an;
an >>= ANGLETOFINESHIFT; an >>= ANGLETOFINESHIFT;
th->momx = FixedMul (th->Speed, finecosine[an]); th->velx = FixedMul (th->Speed, finecosine[an]);
th->momy = FixedMul (th->Speed, finesine[an]); th->vely = FixedMul (th->Speed, finesine[an]);
dist = P_AproxDistance (dest->x - x, dest->y - y); dist = P_AproxDistance (dest->x - x, dest->y - y);
dist = dist/th->Speed; dist = dist/th->Speed;
if (dist < 1) if (dist < 1)
{ {
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); return (P_CheckMissileSpawn(th) ? th : NULL);
} }

View file

@ -126,7 +126,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
{ {
mo->special1 = SHARDSPAWN_LEFT; mo->special1 = SHARDSPAWN_LEFT;
mo->special2 = spermcount; mo->special2 = spermcount;
mo->momz = self->momz; mo->velz = self->velz;
mo->args[0] = (spermcount==3)?2:0; mo->args[0] = (spermcount==3)?2:0;
} }
} }
@ -138,7 +138,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
{ {
mo->special1 = SHARDSPAWN_RIGHT; mo->special1 = SHARDSPAWN_RIGHT;
mo->special2 = spermcount; mo->special2 = spermcount;
mo->momz = self->momz; mo->velz = self->velz;
mo->args[0] = (spermcount==3)?2:0; mo->args[0] = (spermcount==3)?2:0;
} }
} }
@ -148,7 +148,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
0, (15+2*spermcount)<<FRACBITS, self->target); 0, (15+2*spermcount)<<FRACBITS, self->target);
if (mo) if (mo)
{ {
mo->momz = self->momz; mo->velz = self->velz;
if (spermcount & 1) // Every other reproduction if (spermcount & 1) // Every other reproduction
mo->special1 = SHARDSPAWN_UP | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT; mo->special1 = SHARDSPAWN_UP | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
else else
@ -163,7 +163,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
0, (15+2*spermcount)<<FRACBITS, self->target); 0, (15+2*spermcount)<<FRACBITS, self->target);
if (mo) if (mo)
{ {
mo->momz = self->momz; mo->velz = self->velz;
if (spermcount & 1) // Every other reproduction if (spermcount & 1) // Every other reproduction
mo->special1 = SHARDSPAWN_DOWN | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT; mo->special1 = SHARDSPAWN_DOWN | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
else else

View file

@ -42,8 +42,8 @@ int ALightning::SpecialMissileHit (AActor *thing)
{ {
if (thing->Mass != INT_MAX) if (thing->Mass != INT_MAX)
{ {
thing->momx += momx>>4; thing->velx += velx>>4;
thing->momy += momy>>4; thing->vely += vely>>4;
} }
if ((!thing->player && !(thing->flags2&MF2_BOSS)) if ((!thing->player && !(thing->flags2&MF2_BOSS))
|| !(level.time&1)) || !(level.time&1))
@ -191,8 +191,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
else else
{ {
self->angle = R_PointToAngle2(self->x, self->y, target->x, target->y); self->angle = R_PointToAngle2(self->x, self->y, target->x, target->y);
self->momx = 0; self->velx = 0;
self->momy = 0; self->vely = 0;
P_ThrustMobj (self, self->angle, self->Speed>>1); P_ThrustMobj (self, self->angle, self->Speed>>1);
} }
} }
@ -235,16 +235,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
if (mo) if (mo)
{ {
mo->lastenemy = self; mo->lastenemy = self;
mo->momx = self->momx; mo->velx = self->velx;
mo->momy = self->momy; mo->vely = self->vely;
mo->target = self->target; mo->target = self->target;
if (self->flags3 & MF3_FLOORHUGGER) if (self->flags3 & MF3_FLOORHUGGER)
{ {
mo->momz = 20*FRACUNIT; mo->velz = 20*FRACUNIT;
} }
else else
{ {
mo->momz = -20*FRACUNIT; mo->velz = -20*FRACUNIT;
} }
} }
if ((self->flags3 & MF3_FLOORHUGGER) && pr_zapf() < 160) if ((self->flags3 & MF3_FLOORHUGGER) && pr_zapf() < 160)
@ -312,8 +312,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
} }
else else
{ {
self->momx = mo->momx; self->velx = mo->velx;
self->momy = mo->momy; self->vely = mo->vely;
} }
} }
} }
@ -335,7 +335,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
if (mo) if (mo)
{ {
mo->SetState (mo->FindState (NAME_Death)); mo->SetState (mo->FindState (NAME_Death));
mo->momz = 40*FRACUNIT; mo->velz = 40*FRACUNIT;
mo->Damage = 0; mo->Damage = 0;
} }
} }

View file

@ -37,7 +37,7 @@ void APigPlayer::MorphPlayerThink ()
{ {
return; return;
} }
if(!(momx | momy) && pr_pigplayerthink() < 64) if(!(velx | vely) && pr_pigplayerthink() < 64)
{ // Snout sniff { // Snout sniff
if (player->ReadyWeapon != NULL) if (player->ReadyWeapon != NULL)
{ {
@ -98,6 +98,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_PigPain)
CALL_ACTION(A_Pain, self); CALL_ACTION(A_Pain, self);
if (self->z <= self->floorz) if (self->z <= self->floorz)
{ {
self->momz = FRACUNIT*7/2; self->velz = FRACUNIT*7/2;
} }
} }

View file

@ -208,8 +208,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
self->floorz+FRACUNIT, ALLOW_REPLACE); self->floorz+FRACUNIT, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momx = (pr_serpentgibs()-128)<<6; mo->velx = (pr_serpentgibs()-128)<<6;
mo->momy = (pr_serpentgibs()-128)<<6; mo->vely = (pr_serpentgibs()-128)<<6;
mo->floorclip = 6*FRACUNIT; mo->floorclip = 6*FRACUNIT;
} }
} }

View file

@ -36,7 +36,7 @@ bool AArtiDarkServant::Use (bool pickup)
{ {
mo->target = Owner; mo->target = Owner;
mo->tracer = Owner; mo->tracer = Owner;
mo->momz = 5*FRACUNIT; mo->velz = 5*FRACUNIT;
} }
return true; return true;
} }

View file

@ -57,9 +57,9 @@ static void TeloSpawn (AActor *source, const char *type)
fx->special1 = TELEPORT_LIFE; // Lifetime countdown fx->special1 = TELEPORT_LIFE; // Lifetime countdown
fx->angle = source->angle; fx->angle = source->angle;
fx->target = source->target; fx->target = source->target;
fx->momx = source->momx >> 1; fx->velx = source->velx >> 1;
fx->momy = source->momy >> 1; fx->vely = source->vely >> 1;
fx->momz = source->momz >> 1; fx->velz = source->velz >> 1;
} }
} }

View file

@ -121,10 +121,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
{ {
angle = self->angle-(pr_wraithfx2()<<22); angle = self->angle-(pr_wraithfx2()<<22);
} }
mo->momz = 0; mo->velz = 0;
mo->momx = FixedMul((pr_wraithfx2()<<7)+FRACUNIT, mo->velx = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
finecosine[angle>>ANGLETOFINESHIFT]); finecosine[angle>>ANGLETOFINESHIFT]);
mo->momy = FixedMul((pr_wraithfx2()<<7)+FRACUNIT, mo->vely = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
finesine[angle>>ANGLETOFINESHIFT]); finesine[angle>>ANGLETOFINESHIFT]);
mo->target = self; mo->target = self;
mo->floorclip = 10*FRACUNIT; mo->floorclip = 10*FRACUNIT;

View file

@ -1167,9 +1167,9 @@ void G_FinishTravel ()
pawn->x = pawndup->x; pawn->x = pawndup->x;
pawn->y = pawndup->y; pawn->y = pawndup->y;
pawn->z = pawndup->z; pawn->z = pawndup->z;
pawn->momx = pawndup->momx; pawn->velx = pawndup->velx;
pawn->momy = pawndup->momy; pawn->vely = pawndup->vely;
pawn->momz = pawndup->momz; pawn->velz = pawndup->velz;
pawn->Sector = pawndup->Sector; pawn->Sector = pawndup->Sector;
pawn->floorz = pawndup->floorz; pawn->floorz = pawndup->floorz;
pawn->ceilingz = pawndup->ceilingz; pawn->ceilingz = pawndup->ceilingz;

View file

@ -243,8 +243,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
} }
A_FaceTarget (self); A_FaceTarget (self);
angle = self->angle>>ANGLETOFINESHIFT; angle = self->angle>>ANGLETOFINESHIFT;
self->momx = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]); self->velx = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]);
self->momy = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]); self->vely = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]);
self->special1 = TICRATE/2; // Charge duration self->special1 = TICRATE/2; // Charge duration
} }
else if (target->z == target->floorz else if (target->z == target->floorz
@ -287,7 +287,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
type = PClass::FindClass ("PunchPuff"); type = PClass::FindClass ("PunchPuff");
} }
puff = Spawn (type, self->x, self->y, self->z, ALLOW_REPLACE); puff = Spawn (type, self->x, self->y, self->z, ALLOW_REPLACE);
puff->momz = 2*FRACUNIT; puff->velz = 2*FRACUNIT;
self->special1--; self->special1--;
} }
else else
@ -310,7 +310,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
{ {
AActor *mo; AActor *mo;
angle_t angle; angle_t angle;
fixed_t momz; fixed_t velz;
fixed_t z; fixed_t z;
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER); bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
@ -335,12 +335,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
if (mo != NULL) if (mo != NULL)
{ {
// S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM); // S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
momz = mo->momz; velz = mo->velz;
angle = mo->angle; angle = mo->angle;
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), momz); P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), velz);
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), momz); P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), velz);
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), momz); P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), velz);
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), momz); 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); y = self->y + (pr_fire.Random2 () << 10);
mo = Spawn("MinotaurFX3", x, y, self->floorz, ALLOW_REPLACE); mo = Spawn("MinotaurFX3", x, y, self->floorz, ALLOW_REPLACE);
mo->target = self->target; mo->target = self->target;
mo->momx = 1; // Force block checking mo->velx = 1; // Force block checking
P_CheckMissileSpawn (mo); 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 = R_PointToAngle2 (source->x, source->y, target->x, target->y);
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
thrust = 16*FRACUNIT+(pr_minotaurslam()<<10); thrust = 16*FRACUNIT+(pr_minotaurslam()<<10);
target->momx += FixedMul (thrust, finecosine[angle]); target->velx += FixedMul (thrust, finecosine[angle]);
target->momy += FixedMul (thrust, finesine[angle]); target->vely += FixedMul (thrust, finesine[angle]);
damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6); damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6);
P_DamageMobj (target, NULL, NULL, damage, NAME_Melee); P_DamageMobj (target, NULL, NULL, damage, NAME_Melee);
P_TraceBleed (damage, target, angle, 0); P_TraceBleed (damage, target, angle, 0);

View file

@ -233,7 +233,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
int numChunks; int numChunks;
AActor *mo; AActor *mo;
if (self->momx || self->momy || self->momz) if (self->velx || self->vely || self->velz)
{ {
self->tics = 3*TICRATE; self->tics = 3*TICRATE;
return; return;
@ -256,9 +256,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
mo->SetState (mo->SpawnState + (pr_freeze()%3)); mo->SetState (mo->SpawnState + (pr_freeze()%3));
if (mo) if (mo)
{ {
mo->momz = FixedDiv(mo->z-self->z, self->height)<<2; mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
mo->momx = pr_freeze.Random2 () << (FRACBITS-7); mo->velx = pr_freeze.Random2 () << (FRACBITS-7);
mo->momy = pr_freeze.Random2 () << (FRACBITS-7); mo->vely = pr_freeze.Random2 () << (FRACBITS-7);
CALL_ACTION(A_IceSetTics, mo); // set a random tic wait CALL_ACTION(A_IceSetTics, mo); // set a random tic wait
mo->RenderStyle = self->RenderStyle; mo->RenderStyle = self->RenderStyle;
mo->alpha = self->alpha; mo->alpha = self->alpha;
@ -268,9 +268,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
{ // attach the player's view to a chunk of ice { // attach the player's view to a chunk of ice
AActor *head = Spawn("IceChunkHead", self->x, self->y, AActor *head = Spawn("IceChunkHead", self->x, self->y,
self->z + self->player->mo->ViewHeight, ALLOW_REPLACE); self->z + self->player->mo->ViewHeight, ALLOW_REPLACE);
head->momz = FixedDiv(head->z-self->z, self->height)<<2; head->velz = FixedDiv(head->z - self->z, self->height)<<2;
head->momx = pr_freeze.Random2 () << (FRACBITS-7); head->velx = pr_freeze.Random2 () << (FRACBITS-7);
head->momy = pr_freeze.Random2 () << (FRACBITS-7); head->vely = pr_freeze.Random2 () << (FRACBITS-7);
head->health = self->health; head->health = self->health;
head->angle = self->angle; head->angle = self->angle;
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn))) if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))

View file

@ -961,9 +961,9 @@ void APowerFlight::InitEffect ()
Owner->flags |= MF_NOGRAVITY; Owner->flags |= MF_NOGRAVITY;
if (Owner->z <= Owner->floorz) 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 { // stop falling scream
S_StopSound (Owner, CHAN_VOICE); S_StopSound (Owner, CHAN_VOICE);
} }
@ -1200,7 +1200,7 @@ void APowerSpeed::DoEffect ()
if (Inventory != NULL && Inventory->GetSpeedFactor() > FRACUNIT) if (Inventory != NULL && Inventory->GetSpeedFactor() > FRACUNIT)
return; return;
if (P_AproxDistance (Owner->momx, Owner->momy) <= 12*FRACUNIT) if (P_AproxDistance (Owner->velx, Owner->vely) <= 12*FRACUNIT)
return; return;
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->x, Owner->y, Owner->z, NO_REPLACE); AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->x, Owner->y, Owner->z, NO_REPLACE);

View file

@ -15,7 +15,7 @@ public:
{ {
if (!Super::FloorBounceMissile (plane)) if (!Super::FloorBounceMissile (plane))
{ {
if (abs (momz) < (FRACUNIT/2)) if (abs (velz) < (FRACUNIT/2))
{ {
Destroy (); Destroy ();
} }
@ -49,7 +49,7 @@ void P_SpawnDirt (AActor *actor, fixed_t radius)
mo = Spawn (dtype, x, y, z, ALLOW_REPLACE); mo = Spawn (dtype, x, y, z, ALLOW_REPLACE);
if (mo) if (mo)
{ {
mo->momz = pr_dirt()<<10; mo->velz = pr_dirt()<<10;
} }
} }
} }

View file

@ -44,7 +44,7 @@ void AFastProjectile::Tick ()
int count = 8; int count = 8;
if (radius > 0) 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. // we need to take smaller steps.
shift++; shift++;
@ -53,11 +53,11 @@ void AFastProjectile::Tick ()
} }
// Handle movement // Handle movement
if (momx || momy || (z != floorz) || momz) if (velx || vely || (z != floorz) || velz)
{ {
xfrac = momx>>shift; xfrac = velx >> shift;
yfrac = momy>>shift; yfrac = vely >> shift;
zfrac = momz>>shift; zfrac = velz >> shift;
changexy = xfrac || yfrac; changexy = xfrac || yfrac;
int ripcount = count >> 3; int ripcount = count >> 3;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)

View file

@ -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->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
p->health = morphed->health; p->health = morphed->health;
p->mo = morphed; p->mo = morphed;
p->momx = p->momy = 0; p->velx = p->vely = 0;
morphed->ObtainInventory (actor); morphed->ObtainInventory (actor);
// Remove all armor // Remove all armor
for (item = morphed->Inventory; item != NULL; ) 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->player = player;
mo->reactiontime = 18; mo->reactiontime = 18;
mo->flags = pmo->special2 & ~MF_JUSTHIT; mo->flags = pmo->special2 & ~MF_JUSTHIT;
mo->momx = 0; mo->velx = 0;
mo->momy = 0; mo->vely = 0;
player->momx = 0; player->velx = 0;
player->momy = 0; player->vely = 0;
mo->momz = pmo->momz; mo->velz = pmo->velz;
if (!(pmo->special2 & MF_JUSTHIT)) if (!(pmo->special2 & MF_JUSTHIT))
{ {
mo->renderflags &= ~RF_INVISIBLE; mo->renderflags &= ~RF_INVISIBLE;
@ -451,9 +451,9 @@ bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force)
if (!(beast->FlagsSave & MF_JUSTHIT)) if (!(beast->FlagsSave & MF_JUSTHIT))
actor->renderflags &= ~RF_INVISIBLE; actor->renderflags &= ~RF_INVISIBLE;
actor->health = actor->GetDefault()->health; actor->health = actor->GetDefault()->health;
actor->momx = beast->momx; actor->velx = beast->velx;
actor->momy = beast->momy; actor->vely = beast->vely;
actor->momz = beast->momz; actor->velz = beast->velz;
actor->tid = beast->tid; actor->tid = beast->tid;
actor->special = beast->special; actor->special = beast->special;
memcpy (actor->args, beast->args, sizeof(actor->args)); memcpy (actor->args, beast->args, sizeof(actor->args));

View file

@ -72,9 +72,9 @@ class ARandomSpawner : public AActor
newmobj->HandleSpawnFlags(); newmobj->HandleSpawnFlags();
newmobj->tid = tid; newmobj->tid = tid;
newmobj->AddToHash(); newmobj->AddToHash();
newmobj->momx = momx; newmobj->velx = velx;
newmobj->momy = momy; newmobj->vely = vely;
newmobj->momz = momz; newmobj->velz = velz;
newmobj->master = master; // For things such as DamageMaster/DamageChildren, transfer mastery. newmobj->master = master; // For things such as DamageMaster/DamageChildren, transfer mastery.
newmobj->target = target; newmobj->target = target;
newmobj->tracer = tracer; newmobj->tracer = tracer;

View file

@ -29,12 +29,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall)
int t; int t;
t = pr_spectrechunk() & 15; t = pr_spectrechunk() & 15;
foo->momx = (t - (pr_spectrechunk() & 7)) << FRACBITS; foo->velx = (t - (pr_spectrechunk() & 7)) << FRACBITS;
t = pr_spectrechunk() & 15; 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; int t;
t = pr_spectrechunk() & 7; t = pr_spectrechunk() & 7;
foo->momx = (t - (pr_spectrechunk() & 15)) << FRACBITS; foo->velx = (t - (pr_spectrechunk() & 15)) << FRACBITS;
t = pr_spectrechunk() & 7; 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); 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->target = self;
foo->health = -2; foo->health = -2;
foo->tracer = self->target; foo->tracer = self->target;

View file

@ -52,7 +52,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft)
AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile")); AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile"));
if (misl != NULL) 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")); AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile"));
if (misl != NULL) if (misl != NULL)
{ {
misl->momz += FRACUNIT; misl->velz += FRACUNIT;
} }
} }

View file

@ -76,7 +76,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
{ {
entity->angle = self->angle; entity->angle = self->angle;
entity->CopyFriendliness(self, true); entity->CopyFriendliness(self, true);
entity->momz = 5*FRACUNIT; entity->velz = 5*FRACUNIT;
entity->tracer = self; entity->tracer = self;
} }
} }
@ -101,16 +101,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
//second->target = self->target; //second->target = self->target;
A_FaceTarget (second); A_FaceTarget (second);
an = second->angle >> ANGLETOFINESHIFT; an = second->angle >> ANGLETOFINESHIFT;
second->momx += FixedMul (finecosine[an], 320000); second->velx += FixedMul (finecosine[an], 320000);
second->momy += FixedMul (finesine[an], 320000); second->vely += FixedMul (finesine[an], 320000);
an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT; an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT;
second = Spawn("EntitySecond", SpawnX + FixedMul (secondRadius, finecosine[an]), second = Spawn("EntitySecond", SpawnX + FixedMul (secondRadius, finecosine[an]),
SpawnY + FixedMul (secondRadius, finesine[an]), SpawnZ, ALLOW_REPLACE); SpawnY + FixedMul (secondRadius, finesine[an]), SpawnZ, ALLOW_REPLACE);
second->CopyFriendliness(self, true); second->CopyFriendliness(self, true);
//second->target = self->target; //second->target = self->target;
second->momx = FixedMul (secondRadius, finecosine[an]) << 2; second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
second->momy = FixedMul (secondRadius, finesine[an]) << 2; second->vely = FixedMul (secondRadius, finesine[an]) << 2;
A_FaceTarget (second); A_FaceTarget (second);
an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT; an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
@ -118,7 +118,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
SpawnY + FixedMul (secondRadius, finesine[an]), SpawnZ, ALLOW_REPLACE); SpawnY + FixedMul (secondRadius, finesine[an]), SpawnZ, ALLOW_REPLACE);
second->CopyFriendliness(self, true); second->CopyFriendliness(self, true);
//second->target = self->target; //second->target = self->target;
second->momx = FixedMul (secondRadius, finecosine[an]) << 2; second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
second->momy = FixedMul (secondRadius, finesine[an]) << 2; second->vely = FixedMul (secondRadius, finesine[an]) << 2;
A_FaceTarget (second); A_FaceTarget (second);
} }

View file

@ -58,13 +58,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
proj = P_SpawnMissileZAimed (self, self->z, self->target, PClass::FindClass("InquisitorShot")); proj = P_SpawnMissileZAimed (self, self->z, self->target, PClass::FindClass("InquisitorShot"));
if (proj != NULL) if (proj != NULL)
{ {
proj->momz += 9*FRACUNIT; proj->velz += 9*FRACUNIT;
} }
self->angle += ANGLE_45/16; self->angle += ANGLE_45/16;
proj = P_SpawnMissileZAimed (self, self->z, self->target, PClass::FindClass("InquisitorShot")); proj = P_SpawnMissileZAimed (self, self->z, self->target, PClass::FindClass("InquisitorShot"));
if (proj != NULL) if (proj != NULL)
{ {
proj->momz += 16*FRACUNIT; proj->velz += 16*FRACUNIT;
} }
self->z -= 32*FRACBITS; self->z -= 32*FRACBITS;
} }
@ -83,15 +83,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
A_FaceTarget (self); A_FaceTarget (self);
an = self->angle >> ANGLETOFINESHIFT; an = self->angle >> ANGLETOFINESHIFT;
speed = self->Speed * 2/3; speed = self->Speed * 2/3;
self->momx += FixedMul (speed, finecosine[an]); self->velx += FixedMul (speed, finecosine[an]);
self->momy += FixedMul (speed, finesine[an]); self->vely += FixedMul (speed, finesine[an]);
dist = P_AproxDistance (self->target->x - self->x, self->target->y - self->y); dist = P_AproxDistance (self->target->x - self->x, self->target->y - self->y);
dist /= speed; dist /= speed;
if (dist < 1) if (dist < 1)
{ {
dist = 1; dist = 1;
} }
self->momz = (self->target->z - self->z) / dist; self->velz = (self->target->z - self->z) / dist;
self->reactiontime = 60; self->reactiontime = 60;
self->flags |= MF_NOGRAVITY; self->flags |= MF_NOGRAVITY;
} }
@ -100,8 +100,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorCheckLand)
{ {
self->reactiontime--; self->reactiontime--;
if (self->reactiontime < 0 || if (self->reactiontime < 0 ||
self->momx == 0 || self->velx == 0 ||
self->momy == 0 || self->vely == 0 ||
self->z <= self->floorz) self->z <= self->floorz)
{ {
self->SetState (self->SeeState); 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); 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->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22);
foo->momx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3; foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
foo->momy = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3; foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
foo->momz = pr_inq() << 10; foo->velz = pr_inq() << 10;
} }

View file

@ -32,9 +32,9 @@ int ALoreShot::DoSpecialDamage (AActor *target, int damage)
thrust.MakeUnit(); thrust.MakeUnit();
thrust *= float((255*50*FRACUNIT) / (target->Mass ? target->Mass : 1)); thrust *= float((255*50*FRACUNIT) / (target->Mass ? target->Mass : 1));
target->momx += fixed_t(thrust.X); target->velx += fixed_t(thrust.X);
target->momy += fixed_t(thrust.Y); target->vely += fixed_t(thrust.Y);
target->momz += fixed_t(thrust.Z); target->velz += fixed_t(thrust.Z);
} }
return damage; return damage;
} }
@ -43,6 +43,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain)
{ {
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM); 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->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->velx >> 1), self->y - (self->vely >> 1), self->z - (self->velz >> 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, self->y - self->vely, self->z - self->velz, ALLOW_REPLACE);
} }

View file

@ -127,9 +127,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
if (foo != NULL) if (foo != NULL)
{ {
foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22); foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22);
foo->momx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]); foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]);
foo->momy = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]); foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]);
foo->momz = pr_prog() << 9; foo->velz = pr_prog() << 9;
} }
} }

View file

@ -15,7 +15,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob)
if (self->flags & MF_INFLOAT) if (self->flags & MF_INFLOAT)
{ {
self->momz = 0; self->velz = 0;
return; return;
} }
if (self->threshold != 0) if (self->threshold != 0)
@ -29,11 +29,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob)
} }
if (minz < self->z) if (minz < self->z)
{ {
self->momz -= FRACUNIT; self->velz -= FRACUNIT;
} }
else else
{ {
self->momz += FRACUNIT; self->velz += FRACUNIT;
} }
self->reactiontime = (minz >= self->z) ? 4 : 0; 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")); 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) for (int i = 8; i > 1; --i)
{ {
trail = Spawn("SentinelFX1", trail = Spawn("SentinelFX1",
self->x + FixedMul (missile->radius * i, finecosine[missile->angle >> ANGLETOFINESHIFT]), self->x + FixedMul (missile->radius * i, finecosine[missile->angle >> ANGLETOFINESHIFT]),
self->y + FixedMul (missile->radius * i, finesine[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) if (trail != NULL)
{ {
trail->target = self; trail->target = self;
trail->momx = missile->momx; trail->velx = missile->velx;
trail->momy = missile->momy; trail->vely = missile->vely;
trail->momz = missile->momz; trail->velz = missile->velz;
P_CheckMissileSpawn (trail); P_CheckMissileSpawn (trail);
} }
} }
missile->z += missile->momz >> 2; missile->z += missile->velz >> 2;
} }
} }

View file

@ -28,7 +28,7 @@ void ASpectralMonster::Touch (AActor *toucher)
DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail) 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->angle = self->angle;
foo->health = self->health; foo->health = self->health;
@ -58,8 +58,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
if (self->threshold != 0) if (self->threshold != 0)
--self->threshold; --self->threshold;
self->momx += pr_zap5.Random2(3) << FRACBITS; self->velx += pr_zap5.Random2(3) << FRACBITS;
self->momy += pr_zap5.Random2(3) << FRACBITS; self->vely += pr_zap5.Random2(3) << FRACBITS;
x = self->x + pr_zap5.Random2(3) * FRACUNIT * 50; x = self->x + pr_zap5.Random2(3) * FRACUNIT * 50;
y = self->y + 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); PClass::FindClass("SpectralLightningV1"), x, y, ONCEILINGZ, ALLOW_REPLACE);
flash->target = self->target; flash->target = self->target;
flash->momz = -18*FRACUNIT; flash->velz = -18*FRACUNIT;
flash->health = self->health; flash->health = self->health;
flash = Spawn("SpectralLightningV2", self->x, self->y, ONCEILINGZ, ALLOW_REPLACE); flash = Spawn("SpectralLightningV2", self->x, self->y, ONCEILINGZ, ALLOW_REPLACE);
flash->target = self->target; flash->target = self->target;
flash->momz = -18*FRACUNIT; flash->velz = -18*FRACUNIT;
flash->health = self->health; flash->health = self->health;
} }
@ -114,8 +114,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
} }
exact = self->angle >> ANGLETOFINESHIFT; exact = self->angle >> ANGLETOFINESHIFT;
self->momx = FixedMul (self->Speed, finecosine[exact]); self->velx = FixedMul (self->Speed, finecosine[exact]);
self->momy = FixedMul (self->Speed, finesine[exact]); self->vely = FixedMul (self->Speed, finesine[exact]);
// change slope // change slope
dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); 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; 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 else
{ {
self->momz += FRACUNIT/8; self->velz += FRACUNIT/8;
} }
} }

View file

@ -591,9 +591,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
an = pr_gibtosser() << 24; an = pr_gibtosser() << 24;
gib->angle = an; gib->angle = an;
speed = pr_gibtosser() & 15; speed = pr_gibtosser() & 15;
gib->momx = speed * finecosine[an >> ANGLETOFINESHIFT]; gib->velx = speed * finecosine[an >> ANGLETOFINESHIFT];
gib->momy = speed * finesine[an >> ANGLETOFINESHIFT]; gib->vely = speed * finesine[an >> ANGLETOFINESHIFT];
gib->momz = (pr_gibtosser() & 15) << FRACBITS; gib->velz = (pr_gibtosser() & 15) << FRACBITS;
} }
//============================================================================ //============================================================================
@ -639,8 +639,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
fixed_t speed = (anglespeed % 10) << (FRACBITS - 4); fixed_t speed = (anglespeed % 10) << (FRACBITS - 4);
angle_t finean = (anglespeed / 10) << (32-3); angle_t finean = (anglespeed / 10) << (32-3);
finean >>= ANGLETOFINESHIFT; finean >>= ANGLETOFINESHIFT;
self->momx += FixedMul (speed, finecosine[finean]); self->velx += FixedMul (speed, finecosine[finean]);
self->momy += FixedMul (speed, finesine[finean]); self->vely += FixedMul (speed, finesine[finean]);
} }
} }
} }
@ -681,7 +681,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
DEFINE_ACTION_FUNCTION(AActor, A_DropFire) DEFINE_ACTION_FUNCTION(AActor, A_DropFire)
{ {
AActor *drop = Spawn("FireDroplet", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); 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); P_RadiusAttack (self, self, 64, 64, NAME_Fire, false);
} }

View file

@ -339,10 +339,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM); 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); 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) 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) DEFINE_ACTION_FUNCTION(AActor, A_FlameDie)
{ {
self->flags |= MF_NOGRAVITY; 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")); self = P_SpawnPlayerMissile (self, PClass::FindClass("FlameMissile"));
if (self != NULL) 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->target = target;
other->angle = source->angle; other->angle = source->angle;
other->momx = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]); other->velx = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]);
other->momy = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]); other->vely = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]);
if (other->flags4 & MF4_SPECTRAL) if (other->flags4 & MF4_SPECTRAL)
{ {
@ -542,7 +542,7 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target)
if (P_CheckMissileSpawn (other)) if (P_CheckMissileSpawn (other))
{ {
angle_t pitch = P_AimLineAttack (source, source->angle, 1024*FRACUNIT); 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 other;
} }
return NULL; return NULL;
@ -573,9 +573,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_BurnArea)
DEFINE_ACTION_FUNCTION(AActor, A_Burnination) DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
{ {
self->momz -= 8*FRACUNIT; self->velz -= 8*FRACUNIT;
self->momx += (pr_phburn.Random2 (3)) << FRACBITS; self->velx += (pr_phburn.Random2 (3)) << FRACBITS;
self->momy += (pr_phburn.Random2 (3)) << FRACBITS; self->vely += (pr_phburn.Random2 (3)) << FRACBITS;
S_Sound (self, CHAN_VOICE, "world/largefire", 1, ATTN_NORM); S_Sound (self, CHAN_VOICE, "world/largefire", 1, ATTN_NORM);
// Only the main fire spawns more. // Only the main fire spawns more.
@ -617,9 +617,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
self->z + 4*FRACUNIT, ALLOW_REPLACE); self->z + 4*FRACUNIT, ALLOW_REPLACE);
if (drop != NULL) if (drop != NULL)
{ {
drop->momx = self->momx + ((pr_phburn.Random2 (7)) << FRACBITS); drop->velx = self->velx + ((pr_phburn.Random2 (7)) << FRACBITS);
drop->momy = self->momy + ((pr_phburn.Random2 (7)) << FRACBITS); drop->vely = self->vely + ((pr_phburn.Random2 (7)) << FRACBITS);
drop->momz = self->momz - FRACUNIT; drop->velz = self->velz - FRACUNIT;
drop->reactiontime = (pr_phburn() & 3) + 2; drop->reactiontime = (pr_phburn() & 3) + 2;
drop->flags |= MF_DROPPED; 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); 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; an = self->angle >> ANGLETOFINESHIFT;
tworadii = self->radius + grenade->radius; 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); spot = Spawn("SpectralLightningSpot", self->x, self->y, self->z, ALLOW_REPLACE);
if (spot != NULL) if (spot != NULL)
{ {
spot->momx += 28 * finecosine[self->angle >> ANGLETOFINESHIFT]; spot->velx += 28 * finecosine[self->angle >> ANGLETOFINESHIFT];
spot->momy += 28 * finesine[self->angle >> ANGLETOFINESHIFT]; spot->vely += 28 * finesine[self->angle >> ANGLETOFINESHIFT];
} }
} }
if (spot != NULL) if (spot != NULL)
@ -1008,8 +1008,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
spot = P_SpawnPlayerMissile (self, PClass::FindClass("SpectralLightningBigV1")); spot = P_SpawnPlayerMissile (self, PClass::FindClass("SpectralLightningBigV1"));
if (spot != NULL) if (spot != NULL)
{ {
spot->momx += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]); spot->velx += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]);
spot->momy += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]); spot->vely += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]);
} }
} }
} }

View file

@ -101,9 +101,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightGoesOut)
if (foo != NULL) if (foo != NULL)
{ {
int t = pr_lightout() & 15; int t = pr_lightout() & 15;
foo->momx = (t - (pr_lightout() & 7)) << FRACBITS; foo->velx = (t - (pr_lightout() & 7)) << FRACBITS;
foo->momy = (pr_lightout.Random2() & 7) << FRACBITS; foo->vely = (pr_lightout.Random2() & 7) << FRACBITS;
foo->momz = (7 + (pr_lightout() & 3)) << FRACBITS; foo->velz = (7 + (pr_lightout() & 3)) << FRACBITS;
} }
} }
} }

View file

@ -108,9 +108,9 @@ void cht_DoCheat (player_t *player, int cheat)
msg = GStrings("STSTR_NCOFF"); msg = GStrings("STSTR_NCOFF");
break; break;
case CHT_NOMOMENTUM: case CHT_NOVELOCITY:
player->cheats ^= CF_NOMOMENTUM; player->cheats ^= CF_NOVELOCITY;
if (player->cheats & CF_NOMOMENTUM) if (player->cheats & CF_NOVELOCITY)
msg = GStrings("TXT_LEADBOOTSON"); msg = GStrings("TXT_LEADBOOTSON");
else else
msg = GStrings("TXT_LEADBOOTSOFF"); msg = GStrings("TXT_LEADBOOTSOFF");

View file

@ -2791,9 +2791,9 @@ enum EACSFunctions
ACSF_GetSectorUDMFFixed, ACSF_GetSectorUDMFFixed,
ACSF_GetSideUDMFInt, ACSF_GetSideUDMFInt,
ACSF_GetSideUDMFFixed, ACSF_GetSideUDMFFixed,
ACSF_GetActorMomX, ACSF_GetActorVelX,
ACSF_GetActorMomY, ACSF_GetActorVelY,
ACSF_GetActorMomZ, ACSF_GetActorVelZ,
ACSF_SetActivator, ACSF_SetActivator,
ACSF_SetActivatorToTarget, ACSF_SetActivatorToTarget,
ACSF_GetActorViewHeight, ACSF_GetActorViewHeight,
@ -2865,17 +2865,17 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
case ACSF_GetSideUDMFFixed: case ACSF_GetSideUDMFFixed:
return GetUDMFFixed(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2])); return GetUDMFFixed(UDMF_Side, SideFromID(args[0], args[1]), FBehavior::StaticLookupString(args[2]));
case ACSF_GetActorMomX: case ACSF_GetActorVelX:
actor = SingleActorFromTID(args[0], activator); 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); 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); actor = SingleActorFromTID(args[0], activator);
return actor != NULL? actor->momz : 0; return actor != NULL? actor->velz : 0;
case ACSF_SetActivator: case ACSF_SetActivator:
activator = SingleActorFromTID(args[0], NULL); activator = SingleActorFromTID(args[0], NULL);

View file

@ -673,8 +673,8 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
return; return;
} }
pc->momx = pc->momy = 0; // Stop moving pc->velx = pc->vely = 0; // Stop moving
pc->player->momx = pc->player->momy = 0; pc->player->velx = pc->player->vely = 0;
static_cast<APlayerPawn*>(pc)->PlayIdle (); static_cast<APlayerPawn*>(pc)->PlayIdle ();
pc->player->ConversationPC = pc; pc->player->ConversationPC = pc;

View file

@ -235,7 +235,7 @@ static void MakeFountain (AActor *actor, int color1, int color2)
void P_RunEffect (AActor *actor, int effects) 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; particle_t *particle;
int i; 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 backx = actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
fixed_t backy = actor->y - FixedMul (finesine[(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; angle_t an = (moveangle + ANG90) >> ANGLETOFINESHIFT;
int speed; int speed;
@ -253,9 +253,9 @@ void P_RunEffect (AActor *actor, int effects)
particle = JitterParticle (3 + (M_Random() & 31)); particle = JitterParticle (3 + (M_Random() & 31));
if (particle) { if (particle) {
fixed_t pathdist = M_Random()<<8; fixed_t pathdist = M_Random()<<8;
particle->x = backx - FixedMul(actor->momx, pathdist); particle->x = backx - FixedMul(actor->velx, pathdist);
particle->y = backy - FixedMul(actor->momy, pathdist); particle->y = backy - FixedMul(actor->vely, pathdist);
particle->z = backz - FixedMul(actor->momz, pathdist); particle->z = backz - FixedMul(actor->velz, pathdist);
speed = (M_Random () - 128) * (FRACUNIT/200); speed = (M_Random () - 128) * (FRACUNIT/200);
particle->velx += FixedMul (speed, finecosine[an]); particle->velx += FixedMul (speed, finecosine[an]);
particle->vely += FixedMul (speed, finesine[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)); particle_t *particle = JitterParticle (3 + (M_Random() & 31));
if (particle) { if (particle) {
fixed_t pathdist = M_Random()<<8; fixed_t pathdist = M_Random()<<8;
particle->x = backx - FixedMul(actor->momx, pathdist); particle->x = backx - FixedMul(actor->velx, pathdist);
particle->y = backy - FixedMul(actor->momy, pathdist); particle->y = backy - FixedMul(actor->vely, pathdist);
particle->z = backz - FixedMul(actor->momz, pathdist) + (M_Random() << 10); particle->z = backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10);
speed = (M_Random () - 128) * (FRACUNIT/200); speed = (M_Random () - 128) * (FRACUNIT/200);
particle->velx += FixedMul (speed, finecosine[an]); particle->velx += FixedMul (speed, finecosine[an]);
particle->vely += FixedMul (speed, finesine[an]); particle->vely += FixedMul (speed, finesine[an]);
@ -292,7 +292,7 @@ void P_RunEffect (AActor *actor, int effects)
P_DrawSplash2 (6, P_DrawSplash2 (6,
actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2), actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2),
actor->y - FixedMul (finesine[(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); moveangle + ANG180, 2, 2);
} }
if (effects & FX_FOUNTAINMASK) if (effects & FX_FOUNTAINMASK)

View file

@ -65,7 +65,7 @@ static FRandom pr_slook ("SlooK");
static FRandom pr_skiptarget("SkipTarget"); static FRandom pr_skiptarget("SkipTarget");
// movement interpolation is fine for objects that are moved by their own // 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 // 1. They don't move every tic
// 2. Their animation is not designed for movement interpolation // 2. Their animation is not designed for movement interpolation
// The result is that they tend to 'glide' across the floor // The result is that they tend to 'glide' across the floor
@ -475,8 +475,8 @@ bool P_Move (AActor *actor)
actor->x = origx; actor->x = origx;
actor->y = origy; actor->y = origy;
movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4; movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4;
actor->momx += FixedMul (deltax, movefactor); actor->velx += FixedMul (deltax, movefactor);
actor->momy += FixedMul (deltay, movefactor); actor->vely += FixedMul (deltay, movefactor);
} }
if (!try_ok) if (!try_ok)
@ -1522,7 +1522,7 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround)
{ {
if ((P_AproxDistance (player->mo->x - actor->x, if ((P_AproxDistance (player->mo->x - actor->x,
player->mo->y - actor->y) > 2*MELEERANGE) 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) < 5*FRACUNIT)
{ // Player is sneaking - can't detect { // Player is sneaking - can't detect
return false; return false;
@ -1994,8 +1994,8 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
else else
{ {
actor->FastChaseStrafeCount = 0; actor->FastChaseStrafeCount = 0;
actor->momx = 0; actor->velx = 0;
actor->momy = 0; actor->vely = 0;
fixed_t dist = P_AproxDistance (actor->x - actor->target->x, actor->y - actor->target->y); fixed_t dist = P_AproxDistance (actor->x - actor->target->x, actor->y - actor->target->y);
if (dist < CLASS_BOSS_STRAFE_RANGE) 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); angle_t ang = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y);
if (pr_chase() < 128) ang += ANGLE_90; if (pr_chase() < 128) ang += ANGLE_90;
else ang -= ANGLE_90; else ang -= ANGLE_90;
actor->momx = 13 * finecosine[ang>>ANGLETOFINESHIFT]; actor->velx = 13 * finecosine[ang>>ANGLETOFINESHIFT];
actor->momy = 13 * finesine[ang>>ANGLETOFINESHIFT]; actor->vely = 13 * finesine[ang>>ANGLETOFINESHIFT];
actor->FastChaseStrafeCount = 3; // strafe time actor->FastChaseStrafeCount = 3; // strafe time
} }
} }
@ -2165,7 +2165,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates)
abs(corpsehit-> y - viletryy) > maxdist ) abs(corpsehit-> y - viletryy) > maxdist )
continue; // not actually touching continue; // not actually touching
corpsehit->momx = corpsehit->momy = 0; corpsehit->velx = corpsehit->vely = 0;
// [RH] Check against real height and radius // [RH] Check against real height and radius
fixed_t oldheight = corpsehit->height; fixed_t oldheight = corpsehit->height;
@ -2371,8 +2371,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
// Let the aim trail behind the player // Let the aim trail behind the player
self->angle = R_PointToAngle2 (self->x, self->angle = R_PointToAngle2 (self->x,
self->y, self->y,
self->target->x - self->target->momx * 3, self->target->x - self->target->velx * 3,
self->target->y - self->target->momy * 3); self->target->y - self->target->vely * 3);
if (self->target->flags & MF_SHADOW) if (self->target->flags & MF_SHADOW)
{ {
@ -2562,14 +2562,14 @@ void P_TossItem (AActor *item)
if (style==2) if (style==2)
{ {
item->momx += pr_dropitem.Random2(7) << FRACBITS; item->velx += pr_dropitem.Random2(7) << FRACBITS;
item->momy += pr_dropitem.Random2(7) << FRACBITS; item->vely += pr_dropitem.Random2(7) << FRACBITS;
} }
else else
{ {
item->momx = pr_dropitem.Random2() << 8; item->velx = pr_dropitem.Random2() << 8;
item->momy = pr_dropitem.Random2() << 8; item->vely = pr_dropitem.Random2() << 8;
item->momz = FRACUNIT*5 + (pr_dropitem() << 10); item->velz = FRACUNIT*5 + (pr_dropitem() << 10);
} }
} }

View file

@ -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, if ((P_AproxDistance (player->mo->x - actor->x,
player->mo->y - actor->y) > 2*MELEERANGE) 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) < 5*FRACUNIT)
{ // Player is sneaking - can't detect { // Player is sneaking - can't detect
return false; return false;

View file

@ -910,7 +910,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
else if (target->flags & MF_ICECORPSE) // frozen else if (target->flags & MF_ICECORPSE) // frozen
{ {
target->tics = 1; target->tics = 1;
target->momx = target->momy = target->momz = 0; target->velx = target->vely = target->velz = 0;
} }
return; return;
} }
@ -946,7 +946,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
} }
if (target->flags & MF_SKULLFLY) 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 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)) (source->player->ReadyWeapon->WeaponFlags & WIF_STAFF2_KICKBACK))
{ {
// Staff power level 2 // Staff power level 2
target->momx += FixedMul (10*FRACUNIT, finecosine[ang]); target->velx += FixedMul (10*FRACUNIT, finecosine[ang]);
target->momy += FixedMul (10*FRACUNIT, finesine[ang]); target->vely += FixedMul (10*FRACUNIT, finesine[ang]);
if (!(target->flags & MF_NOGRAVITY)) if (!(target->flags & MF_NOGRAVITY))
{ {
target->momz += 5*FRACUNIT; target->velz += 5*FRACUNIT;
} }
} }
else else
{ {
target->momx += FixedMul (thrust, finecosine[ang]); target->velx += FixedMul (thrust, finecosine[ang]);
target->momy += FixedMul (thrust, finesine[ang]); target->vely += FixedMul (thrust, finesine[ang]);
} }
} }
} }

View file

@ -871,12 +871,12 @@ FUNC(LS_ThrustThing)
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit) static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit)
{ {
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
it->momx += force * finecosine[angle]; it->velx += force * finecosine[angle];
it->momy += force * finesine[angle]; it->vely += force * finesine[angle];
if (!nolimit) if (!nolimit)
{ {
it->momx = clamp<fixed_t> (it->momx, -MAXMOVE, MAXMOVE); it->velx = clamp<fixed_t> (it->velx, -MAXMOVE, MAXMOVE);
it->momy = clamp<fixed_t> (it->momy, -MAXMOVE, MAXMOVE); it->vely = clamp<fixed_t> (it->vely, -MAXMOVE, MAXMOVE);
} }
} }
@ -897,18 +897,18 @@ FUNC(LS_ThrustThingZ) // [BC]
while ( (victim = iterator.Next ()) ) while ( (victim = iterator.Next ()) )
{ {
if (!arg3) if (!arg3)
victim->momz = thrust; victim->velz = thrust;
else else
victim->momz += thrust; victim->velz += thrust;
} }
return true; return true;
} }
else if (it) else if (it)
{ {
if (!arg3) if (!arg3)
it->momz = thrust; it->velz = thrust;
else else
it->momz += thrust; it->velz += thrust;
return true; return true;
} }
return false; return false;
@ -1386,7 +1386,7 @@ static bool DoThingRaise(AActor *thing)
AActor *info = thing->GetDefault (); AActor *info = thing->GetDefault ();
thing->momx = thing->momy = 0; thing->velx = thing->vely = 0;
// [RH] Check against real height and radius // [RH] Check against real height and radius
fixed_t oldheight = thing->height; fixed_t oldheight = thing->height;
@ -1455,8 +1455,8 @@ FUNC(LS_Thing_Stop)
{ {
if (it != NULL) if (it != NULL)
{ {
it->momx = it->momy = it->momz = 0; it->velx = it->vely = it->velz = 0;
if (it->player != NULL) it->player->momx = it->player->momy = 0; if (it->player != NULL) it->player->velx = it->player->vely = 0;
ok = true; ok = true;
} }
} }
@ -1466,8 +1466,8 @@ FUNC(LS_Thing_Stop)
while ( (target = iterator.Next ()) ) while ( (target = iterator.Next ()) )
{ {
target->momx = target->momy = target->momz = 0; target->velx = target->vely = target->velz = 0;
if (target->player != NULL) target->player->momx = target->player->momy = 0; if (target->player != NULL) target->player->velx = target->player->vely = 0;
ok = true; ok = true;
} }
} }
@ -2899,9 +2899,9 @@ FUNC(LS_GlassBreak)
glass->angle = an; glass->angle = an;
an >>= ANGLETOFINESHIFT; an >>= ANGLETOFINESHIFT;
speed = pr_glass() & 3; speed = pr_glass() & 3;
glass->momx = finecosine[an] * speed; glass->velx = finecosine[an] * speed;
glass->momy = finesine[an] * speed; glass->vely = finesine[an] * speed;
glass->momz = (pr_glass() & 7) << FRACBITS; glass->velz = (pr_glass() & 7) << FRACBITS;
// [RH] Let the shards stick around longer than they did in Strife. // [RH] Let the shards stick around longer than they did in Strife.
glass->tics += pr_glass(); glass->tics += pr_glass();
} }

View file

@ -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_SpawnMissile (AActor* source, AActor* dest, const PClass *type);
AActor *P_SpawnMissileZ (AActor* source, fixed_t z, 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_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_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 momz, fixed_t speed); 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 momz); 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 momz, fixed_t speed, AActor *owner=NULL, bool checkspawn = true); 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_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type);
AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type); AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type);

View file

@ -524,13 +524,13 @@ int P_GetMoveFactor (const AActor *mo, int *frictionp)
// phares 3/11/98: you start off slowly, then increase as // phares 3/11/98: you start off slowly, then increase as
// you get better footing // 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; movefactor <<= 3;
else if (momentum > MORE_FRICTION_MOMENTUM<<1) else if (velocity > MORE_FRICTION_VELOCITY<<1)
movefactor <<= 2; movefactor <<= 2;
else if (momentum > MORE_FRICTION_MOMENTUM) else if (velocity > MORE_FRICTION_VELOCITY)
movefactor <<= 1; movefactor <<= 1;
} }
@ -812,9 +812,9 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
{ {
if (!(thing->flags2 & MF2_BOSS) && (thing->flags3 & MF3_ISMONSTER)) if (!(thing->flags2 & MF2_BOSS) && (thing->flags3 & MF3_ISMONSTER))
{ {
thing->momx += tm.thing->momx; thing->velx += tm.thing->velx;
thing->momy += tm.thing->momy; thing->vely += tm.thing->vely;
if ((thing->momx + thing->momy) > 3*FRACUNIT) if ((thing->velx + thing->vely) > 3*FRACUNIT)
{ {
damage = (tm.thing->Mass / 100) + 1; damage = (tm.thing->Mass / 100) + 1;
P_DamageMobj (thing, tm.thing, tm.thing, damage, tm.thing->DamageType); P_DamageMobj (thing, tm.thing, tm.thing, damage, tm.thing->DamageType);
@ -1010,8 +1010,8 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
{ // Push thing { // Push thing
if (thing->lastpush != tm.PushTime) if (thing->lastpush != tm.PushTime)
{ {
thing->momx += FixedMul(tm.thing->momx, thing->pushfactor); thing->velx += FixedMul(tm.thing->velx, thing->pushfactor);
thing->momy += FixedMul(tm.thing->momy, thing->pushfactor); thing->vely += FixedMul(tm.thing->vely, thing->pushfactor);
thing->lastpush = tm.PushTime; thing->lastpush = tm.PushTime;
} }
} }
@ -1054,8 +1054,8 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
{ // Push thing { // Push thing
if (thing->lastpush != tm.PushTime) if (thing->lastpush != tm.PushTime)
{ {
thing->momx += FixedMul(tm.thing->momx, thing->pushfactor); thing->velx += FixedMul(tm.thing->velx, thing->pushfactor);
thing->momy += FixedMul(tm.thing->momy, thing->pushfactor); thing->vely += FixedMul(tm.thing->vely, thing->pushfactor);
thing->lastpush = tm.PushTime; thing->lastpush = tm.PushTime;
} }
} }
@ -1427,7 +1427,7 @@ void P_FakeZMovement (AActor *mo)
// //
// adjust height // adjust height
// //
mo->z += mo->momz; mo->z += mo->velz;
if ((mo->flags&MF_FLOAT) && mo->target) if ((mo->flags&MF_FLOAT) && mo->target)
{ // float down towards target if too close { // float down towards target if too close
if (!(mo->flags & MF_SKULLFLY) && !(mo->flags & MF_INFLOAT)) 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. // is not blocked.
if (thing->z+thing->height > tmceilingz) if (thing->z+thing->height > tmceilingz)
{ {
thing->momz = -8*FRACUNIT; thing->velz = -8*FRACUNIT;
goto pushline; goto pushline;
} }
else if (thing->z < tmfloorz && tmfloorz-tmdropoffz > thing->MaxDropOffHeight) else if (thing->z < tmfloorz && tmfloorz-tmdropoffz > thing->MaxDropOffHeight)
{ {
thing->momz = 8*FRACUNIT; thing->velz = 8*FRACUNIT;
goto pushline; goto pushline;
} }
#endif #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. // 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)) if ((i_compatflags & COMPATF_CROSSDROPOFF) && !(thing->flags4 & MF4_SCROLLMOVE))
{ {
dropoff = false; 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->prev = thing->player->dest;
thing->player->dest = NULL; thing->player->dest = NULL;
thing->momx = 0; thing->velx = 0;
thing->momy = 0; thing->vely = 0;
thing->z = oldz; thing->z = oldz;
return false; return false;
} }
@ -1981,7 +1981,7 @@ void FSlide::HitSlideLine (line_t* ld)
// | // |
// Under icy conditions, if the angle of approach to the wall // V // Under icy conditions, if the angle of approach to the wall // V
// is more than 45 degrees, then you'll bounce and lose half // 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. // the wall. 45 is arbitrary and is believable.
// Check for the special cases of horz or vert walls. // 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))) if (icyfloor && (abs(tmymove) > abs(tmxmove)))
{ {
tmxmove /= 2; // absorb half the momentum tmxmove /= 2; // absorb half the velocity
tmymove = -tmymove/2; tmymove = -tmymove/2;
if (slidemo->player && slidemo->health > 0 && !(slidemo->player->cheats & CF_PREDICTING)) 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))) if (icyfloor && (abs(tmxmove) > abs(tmymove)))
{ {
tmxmove = -tmxmove/2; // absorb half the momentum tmxmove = -tmxmove/2; // absorb half the velocity
tmymove /= 2; tmymove /= 2;
if (slidemo->player && slidemo->health > 0 && !(slidemo->player->cheats & CF_PREDICTING)) 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 // 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 // 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 HitSlideLine (bestslideline); // clip the moves
mo->momx = tmxmove * numsteps; mo->velx = tmxmove * numsteps;
mo->momy = tmymove * numsteps; mo->vely = tmymove * numsteps;
// killough 10/98: affect the bobbing the same way (but not voodoo dolls) // killough 10/98: affect the bobbing the same way (but not voodoo dolls)
if (mo->player && mo->player->mo == mo) if (mo->player && mo->player->mo == mo)
{ {
if (abs(mo->player->momx) > abs(mo->momx)) if (abs(mo->player->velx) > abs(mo->velx))
mo->player->momx = mo->momx; mo->player->velx = mo->velx;
if (abs(mo->player->momy) > abs(mo->momy)) if (abs(mo->player->vely) > abs(mo->vely))
mo->player->momy = mo->momy; mo->player->vely = mo->vely;
} }
walkplane = P_CheckSlopeWalk (mo, tmxmove, tmymove); 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) if (dopush)
{ {
xmove = actor->momx = plane->a * 2; xmove = actor->velx = plane->a * 2;
ymove = actor->momy = plane->b * 2; ymove = actor->vely = plane->b * 2;
} }
return (actor->floorsector == actor->Sector) ? plane : NULL; return (actor->floorsector == actor->Sector) ? plane : NULL;
} }
@ -2539,7 +2539,7 @@ bool FSlide::BounceWall (AActor *mo)
// //
// trace along the three leading corners // trace along the three leading corners
// //
if (mo->momx > 0) if (mo->velx > 0)
{ {
leadx = mo->x+mo->radius; leadx = mo->x+mo->radius;
} }
@ -2547,7 +2547,7 @@ bool FSlide::BounceWall (AActor *mo)
{ {
leadx = mo->x-mo->radius; leadx = mo->x-mo->radius;
} }
if (mo->momy > 0) if (mo->vely > 0)
{ {
leady = mo->y+mo->radius; leady = mo->y+mo->radius;
} }
@ -2557,7 +2557,7 @@ bool FSlide::BounceWall (AActor *mo)
} }
bestslidefrac = FRACUNIT+1; bestslidefrac = FRACUNIT+1;
bestslideline = mo->BlockingLine; 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. { // Could not find a wall, so bounce off the floor/ceiling instead.
fixed_t floordist = mo->z - mo->floorz; fixed_t floordist = mo->z - mo->floorz;
fixed_t ceildist = mo->ceilingz - mo->z; fixed_t ceildist = mo->ceilingz - mo->z;
@ -2594,14 +2594,14 @@ bool FSlide::BounceWall (AActor *mo)
{ {
lineangle += ANG180; lineangle += ANG180;
} }
moveangle = R_PointToAngle2 (0, 0, mo->momx, mo->momy); moveangle = R_PointToAngle2 (0, 0, mo->velx, mo->vely);
deltaangle = (2*lineangle)-moveangle; deltaangle = (2*lineangle)-moveangle;
mo->angle = deltaangle; mo->angle = deltaangle;
lineangle >>= ANGLETOFINESHIFT; lineangle >>= ANGLETOFINESHIFT;
deltaangle >>= ANGLETOFINESHIFT; deltaangle >>= ANGLETOFINESHIFT;
movelen = P_AproxDistance (mo->momx, mo->momy); movelen = P_AproxDistance (mo->velx, mo->vely);
movelen = FixedMul(movelen, mo->wallbouncefactor); movelen = FixedMul(movelen, mo->wallbouncefactor);
FBoundingBox box(mo->x, mo->y, mo->radius); FBoundingBox box(mo->x, mo->y, mo->radius);
@ -2614,8 +2614,8 @@ bool FSlide::BounceWall (AActor *mo)
{ {
movelen = 2*FRACUNIT; movelen = 2*FRACUNIT;
} }
mo->momx = FixedMul(movelen, finecosine[deltaangle]); mo->velx = FixedMul(movelen, finecosine[deltaangle]);
mo->momy = FixedMul(movelen, finesine[deltaangle]); mo->vely = FixedMul(movelen, finesine[deltaangle]);
return true; return true;
} }
@ -3412,11 +3412,11 @@ void P_TraceBleed (int damage, AActor *target, AActor *missile)
return; return;
} }
if (missile->momz != 0) if (missile->velz != 0)
{ {
double aim; 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); pitch = -(int)(aim * ANGLE_180/PI);
} }
else 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)) if (points > 0.f && P_CheckSight (thing, bombspot, 1))
{ // OK to damage; target is in direct path { // OK to damage; target is in direct path
float momz; float velz;
float thrust; float thrust;
int damage = (int)points; int damage = (int)points;
@ -4024,19 +4024,20 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
{ {
thrust *= selfthrustscale; 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) if (bombsource != thing)
{ {
momz *= 0.5f; velz *= 0.5f;
} }
else else
{ {
momz *= 0.8f; velz *= 0.8f;
} }
angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT; angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT;
thing->momx += fixed_t (finecosine[ang] * thrust); thing->velx += fixed_t (finecosine[ang] * thrust);
thing->momy += fixed_t (finesine[ang] * thrust); thing->vely += fixed_t (finesine[ang] * thrust);
if (bombdodamage) thing->momz += (fixed_t)momz; // this really doesn't work well 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, mo = Spawn (bloodcls, thing->x, thing->y,
thing->z + thing->height/2, ALLOW_REPLACE); thing->z + thing->height/2, ALLOW_REPLACE);
mo->momx = pr_crunch.Random2 () << 12; mo->velx = pr_crunch.Random2 () << 12;
mo->momy = pr_crunch.Random2 () << 12; mo->vely = pr_crunch.Random2 () << 12;
if (bloodcolor != 0 && !(mo->flags2 & MF2_DONTTRANSLATE)) if (bloodcolor != 0 && !(mo->flags2 & MF2_DONTTRANSLATE))
{ {
mo->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a); mo->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a);
@ -4379,7 +4380,7 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos)
if (oldfloorz == thing->floorz) return; if (oldfloorz == thing->floorz) return;
if (thing->momz == 0 && if (thing->velz == 0 &&
(!(thing->flags & MF_NOGRAVITY) || (!(thing->flags & MF_NOGRAVITY) ||
(thing->z == oldfloorz && !(thing->flags & MF_NOLIFTDROP)))) (thing->z == oldfloorz && !(thing->flags & MF_NOLIFTDROP))))
{ {

View file

@ -222,9 +222,9 @@ void AActor::Serialize (FArchive &arc)
<< radius << radius
<< height << height
<< projectilepassheight << projectilepassheight
<< momx << velx
<< momy << vely
<< momz << velz
<< tics << tics
<< state << state
<< Damage << Damage
@ -752,9 +752,9 @@ AInventory *AActor::DropInventory (AInventory *item)
drop->z = z + 10*FRACUNIT; drop->z = z + 10*FRACUNIT;
P_TryMove (drop, x, y, true); P_TryMove (drop, x, y, true);
drop->angle = angle; drop->angle = angle;
drop->momx = momx + 5 * finecosine[an]; drop->velx = velx + 5 * finecosine[an];
drop->momy = momy + 5 * finesine[an]; drop->vely = vely + 5 * finesine[an];
drop->momz = momz + FRACUNIT; drop->velz = velz + FRACUNIT;
drop->flags &= ~MF_NOGRAVITY; // Don't float drop->flags &= ~MF_NOGRAVITY; // Don't float
return drop; return drop;
} }
@ -1044,7 +1044,7 @@ bool AActor::Grind(bool items)
if (this->flags & MF_ICECORPSE) if (this->flags & MF_ICECORPSE)
{ {
this->tics = 1; this->tics = 1;
this->momx = this->momy = this->momz = 0; this->velx = this->vely = this->velz = 0;
} }
else if (this->player) else if (this->player)
{ {
@ -1120,7 +1120,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
return; return;
} }
} }
mo->momx = mo->momy = mo->momz = 0; mo->velx = mo->vely = mo->velz = 0;
mo->effects = 0; // [RH] mo->effects = 0; // [RH]
FState *nextstate=NULL; FState *nextstate=NULL;
@ -1310,16 +1310,15 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
return true; 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; int bt = bouncetype & BOUNCE_TypeMask;
if (bt == BOUNCE_Heretic) if (bt == BOUNCE_Heretic)
{ {
momx -= MulScale15 (plane.a, dot); velx -= MulScale15 (plane.a, dot);
momy -= MulScale15 (plane.b, dot); vely -= MulScale15 (plane.b, dot);
momz -= MulScale15 (plane.c, dot); velz -= MulScale15 (plane.c, dot);
angle = R_PointToAngle2 (0, 0, momx, momy); angle = R_PointToAngle2 (0, 0, velx, vely);
flags |= MF_INBOUNCE; flags |= MF_INBOUNCE;
SetState (FindState(NAME_Death)); SetState (FindState(NAME_Death));
flags &= ~MF_INBOUNCE; flags &= ~MF_INBOUNCE;
@ -1328,15 +1327,15 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
// The reflected velocity keeps only about 70% of its original speed // The reflected velocity keeps only about 70% of its original speed
long bouncescale = 0x4000 * bouncefactor; long bouncescale = 0x4000 * bouncefactor;
momx = MulScale30 (momx - MulScale15 (plane.a, dot), bouncescale); velx = MulScale30 (velx - MulScale15 (plane.a, dot), bouncescale);
momy = MulScale30 (momy - MulScale15 (plane.b, dot), bouncescale); vely = MulScale30 (vely - MulScale15 (plane.b, dot), bouncescale);
momz = MulScale30 (momz - MulScale15 (plane.c, dot), bouncescale); velz = MulScale30 (velz - MulScale15 (plane.c, dot), bouncescale);
angle = R_PointToAngle2 (0, 0, momx, momy); angle = R_PointToAngle2 (0, 0, velx, vely);
PlayBounceSound(true); PlayBounceSound(true);
if (bt == BOUNCE_Doom) if (bt == BOUNCE_Doom)
{ {
if (!(flags & MF_NOGRAVITY) && (momz < 3*FRACUNIT)) if (!(flags & MF_NOGRAVITY) && (velz < 3*FRACUNIT))
{ {
bouncetype = BOUNCE_None; bouncetype = BOUNCE_None;
} }
@ -1353,8 +1352,8 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move) void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move)
{ {
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
mo->momx += FixedMul (move, finecosine[angle]); mo->velx += FixedMul (move, finecosine[angle]);
mo->momy += FixedMul (move, finesine[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; actor->angle -= delta;
} }
angle = actor->angle>>ANGLETOFINESHIFT; angle = actor->angle>>ANGLETOFINESHIFT;
actor->momx = FixedMul (actor->Speed, finecosine[angle]); actor->velx = FixedMul (actor->Speed, finecosine[angle]);
actor->momy = FixedMul (actor->Speed, finesine[angle]); actor->vely = FixedMul (actor->Speed, finesine[angle]);
if (actor->z + actor->height < target->z || if (actor->z + actor->height < target->z ||
target->z + target->height < actor->z) target->z + target->height < actor->z)
{ // Need to seek vertically { // Need to seek vertically
@ -1481,7 +1480,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
{ {
dist = 1; 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; 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)) (mo->player != NULL && mo->player->crouchfactor < FRACUNIT*3/4))
{ {
// preserve the direction instead of clamping x and y independently. // preserve the direction instead of clamping x and y independently.
xmove = clamp (mo->momx, -maxmove, maxmove); xmove = clamp (mo->velx, -maxmove, maxmove);
ymove = clamp (mo->momy, -maxmove, maxmove); ymove = clamp (mo->vely, -maxmove, maxmove);
fixed_t xfac = FixedDiv(xmove, mo->momx); fixed_t xfac = FixedDiv(xmove, mo->velx);
fixed_t yfac = FixedDiv(ymove, mo->momy); fixed_t yfac = FixedDiv(ymove, mo->vely);
fixed_t fac = MIN(xfac, yfac); fixed_t fac = MIN(xfac, yfac);
xmove = mo->momx = FixedMul(mo->momx, fac); xmove = mo->velx = FixedMul(mo->velx, fac);
ymove = mo->momy = FixedMul(mo->momy, fac); ymove = mo->vely = FixedMul(mo->vely, fac);
} }
else else
{ {
xmove = mo->momx; xmove = mo->velx;
ymove = mo->momy; ymove = mo->vely;
} }
// [RH] Carrying sectors didn't work with low speeds in BOOM. This is // [RH] Carrying sectors didn't work with low speeds in BOOM. This is
// because BOOM relied on the speed being fast enough to accumulate // 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) if (abs(scrollx) > CARRYSTOPSPEED)
{ {
scrollx = FixedMul (scrollx, CARRYFACTOR); scrollx = FixedMul (scrollx, CARRYFACTOR);
mo->momx += scrollx; mo->velx += scrollx;
mo->flags4 |= MF4_SCROLLMOVE; mo->flags4 |= MF4_SCROLLMOVE;
} }
if (abs(scrolly) > CARRYSTOPSPEED) if (abs(scrolly) > CARRYSTOPSPEED)
{ {
scrolly = FixedMul (scrolly, CARRYFACTOR); scrolly = FixedMul (scrolly, CARRYFACTOR);
mo->momy += scrolly; mo->vely += scrolly;
mo->flags4 |= MF4_SCROLLMOVE; mo->flags4 |= MF4_SCROLLMOVE;
} }
xmove += scrollx; xmove += scrollx;
@ -1581,7 +1580,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
{ {
// the skull slammed into something // the skull slammed into something
mo->flags &= ~MF_SKULLFLY; 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->flags2 & MF2_DORMANT))
{ {
if (mo->SeeState != NULL) mo->SetState (mo->SeeState); 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->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove) &&
mo->BlockingLine->sidenum[1] != NO_SIDE) mo->BlockingLine->sidenum[1] != NO_SIDE)
{ {
mo->momz = WATER_JUMP_SPEED; mo->velz = WATER_JUMP_SPEED;
} }
if (player && (i_compatflags & COMPATF_WALLRUN)) 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 // 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 // is still clipped against the wall at its full speed, so you effectively
// execute two moves in one tic. // execute two moves in one tic.
P_SlideMove (mo, mo->momx, mo->momy, 1); P_SlideMove (mo, mo->velx, mo->vely, 1);
} }
else else
{ {
P_SlideMove (mo, onestepx, onestepy, totalsteps); P_SlideMove (mo, onestepx, onestepy, totalsteps);
} }
if ((mo->momx | mo->momy) == 0) if ((mo->velx | mo->vely) == 0)
{ {
steps = 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)) if (!player || !(i_compatflags & COMPATF_WALLRUN))
{ {
xmove = mo->momx; xmove = mo->velx;
ymove = mo->momy; ymove = mo->vely;
onestepx = xmove / steps; onestepx = xmove / steps;
onestepy = ymove / steps; onestepy = ymove / steps;
P_CheckSlopeWalk (mo, xmove, ymove); 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); walkplane = P_CheckSlopeWalk (mo, tx, ty);
if (P_TryMove (mo, mo->x + tx, mo->y + ty, true, walkplane, tm)) if (P_TryMove (mo, mo->x + tx, mo->y + ty, true, walkplane, tm))
{ {
mo->momx = 0; mo->velx = 0;
} }
else else
{ {
@ -1736,19 +1735,19 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
walkplane = P_CheckSlopeWalk (mo, tx, ty); walkplane = P_CheckSlopeWalk (mo, tx, ty);
if (P_TryMove (mo, mo->x + tx, mo->y + ty, true, walkplane, tm)) if (P_TryMove (mo, mo->x + tx, mo->y + ty, true, walkplane, tm))
{ {
mo->momy = 0; mo->vely = 0;
} }
else else
{ {
mo->momx = mo->momy = 0; mo->velx = mo->vely = 0;
} }
} }
if (player && player->mo == mo) if (player && player->mo == mo)
{ {
if (mo->momx == 0) if (mo->velx == 0)
player->momx = 0; player->velx = 0;
if (mo->momy == 0) if (mo->vely == 0)
player->momy = 0; player->vely = 0;
} }
steps = 0; steps = 0;
} }
@ -1772,12 +1771,12 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
angle = R_PointToAngle2 (BlockingMobj->x, angle = R_PointToAngle2 (BlockingMobj->x,
BlockingMobj->y, mo->x, mo->y) BlockingMobj->y, mo->x, mo->y)
+ANGLE_1*((pr_bounce()%16)-8); +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)); speed = FixedMul (speed, (fixed_t)(0.75*FRACUNIT));
mo->angle = angle; mo->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
mo->momx = FixedMul (speed, finecosine[angle]); mo->velx = FixedMul (speed, finecosine[angle]);
mo->momy = FixedMul (speed, finesine[angle]); mo->vely = FixedMul (speed, finesine[angle]);
mo->PlayBounceSound(true); mo->PlayBounceSound(true);
return oldfloorz; return oldfloorz;
} }
@ -1813,9 +1812,9 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
// Reflect the missile along angle // Reflect the missile along angle
mo->angle = angle; mo->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
mo->momx = FixedMul (mo->Speed>>1, finecosine[angle]); mo->velx = FixedMul (mo->Speed>>1, finecosine[angle]);
mo->momy = FixedMul (mo->Speed>>1, finesine[angle]); mo->vely = FixedMul (mo->Speed>>1, finesine[angle]);
mo->momz = -mo->momz/2; mo->velz = -mo->velz/2;
if (mo->flags2 & MF2_SEEKERMISSILE) if (mo->flags2 & MF2_SEEKERMISSILE)
{ {
mo->tracer = mo->target; mo->tracer = mo->target;
@ -1847,7 +1846,7 @@ explode:
} }
else else
{ {
mo->momx = mo->momy = 0; mo->velx = mo->vely = 0;
steps = 0; steps = 0;
} }
} }
@ -1859,7 +1858,7 @@ explode:
// must have gone through a teleporter, so stop moving right now if it // 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, // 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. // 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; step = steps;
} }
@ -1874,10 +1873,10 @@ explode:
// Friction // 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 { // debug option for no sliding at all
mo->momx = mo->momy = 0; mo->velx = mo->vely = 0;
player->momx = player->momy = 0; player->velx = player->vely = 0;
return oldfloorz; return oldfloorz;
} }
@ -1891,22 +1890,22 @@ explode:
{ // [RH] Friction when falling is available for larger aircontrols { // [RH] Friction when falling is available for larger aircontrols
if (player != NULL && level.airfriction != FRACUNIT) if (player != NULL && level.airfriction != FRACUNIT)
{ {
mo->momx = FixedMul (mo->momx, level.airfriction); mo->velx = FixedMul (mo->velx, level.airfriction);
mo->momy = FixedMul (mo->momy, level.airfriction); mo->vely = FixedMul (mo->vely, level.airfriction);
if (player->mo == mo) // Not voodoo dolls if (player->mo == mo) // Not voodoo dolls
{ {
player->momx = FixedMul (player->momx, level.airfriction); player->velx = FixedMul (player->velx, level.airfriction);
player->momy = FixedMul (player->momy, level.airfriction); player->vely = FixedMul (player->vely, level.airfriction);
} }
} }
return oldfloorz; return oldfloorz;
} }
if (mo->flags & MF_CORPSE) if (mo->flags & MF_CORPSE)
{ // Don't stop sliding if halfway off a step with some momentum { // Don't stop sliding if halfway off a step with some velocity
if (mo->momx > FRACUNIT/4 || mo->momx < -FRACUNIT/4 if (mo->velx > FRACUNIT/4 || mo->velx < -FRACUNIT/4
|| mo->momy > FRACUNIT/4 || mo->momy < -FRACUNIT/4) || mo->vely > FRACUNIT/4 || mo->vely < -FRACUNIT/4)
{ {
if (mo->floorz > mo->Sector->floorplane.ZatPoint (mo->x, mo->y)) if (mo->floorz > mo->Sector->floorplane.ZatPoint (mo->x, mo->y))
{ {
@ -1933,8 +1932,8 @@ explode:
// killough 11/98: // killough 11/98:
// Stop voodoo dolls that have come to rest, despite any // Stop voodoo dolls that have come to rest, despite any
// moving corresponding player: // moving corresponding player:
if (mo->momx > -STOPSPEED && mo->momx < STOPSPEED if (mo->velx > -STOPSPEED && mo->velx < STOPSPEED
&& mo->momy > -STOPSPEED && mo->momy < STOPSPEED && mo->vely > -STOPSPEED && mo->vely < STOPSPEED
&& (!player || (player->mo != mo) && (!player || (player->mo != mo)
|| !(player->cmd.ucmd.forwardmove | player->cmd.ucmd.sidemove))) || !(player->cmd.ucmd.forwardmove | player->cmd.ucmd.sidemove)))
{ {
@ -1946,12 +1945,12 @@ explode:
player->mo->PlayIdle (); player->mo->PlayIdle ();
} }
mo->momx = mo->momy = 0; mo->velx = mo->vely = 0;
mo->flags4 &= ~MF4_SCROLLMOVE; 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) if (player && player->mo == mo)
player->momx = player->momy = 0; player->velx = player->vely = 0;
} }
else else
{ {
@ -1965,13 +1964,13 @@ explode:
// determine friction (and thus only when it is needed). // determine friction (and thus only when it is needed).
// //
// killough 10/98: changed to work with new bobbing method. // 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. // bobbing, so ice works much better now.
fixed_t friction = P_GetFriction (mo, NULL); fixed_t friction = P_GetFriction (mo, NULL);
mo->momx = FixedMul (mo->momx, friction); mo->velx = FixedMul (mo->velx, friction);
mo->momy = FixedMul (mo->momy, friction); mo->vely = FixedMul (mo->vely, friction);
// killough 10/98: Always decrease player bobbing by ORIG_FRICTION. // killough 10/98: Always decrease player bobbing by ORIG_FRICTION.
// This prevents problems with bobbing on ice, where it was not being // 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 if (player && player->mo == mo) // Not voodoo dolls
{ {
player->momx = FixedMul (player->momx, ORIG_FRICTION); player->velx = FixedMul (player->velx, ORIG_FRICTION);
player->momy = FixedMul (player->momy, ORIG_FRICTION); player->vely = FixedMul (player->vely, ORIG_FRICTION);
} }
} }
return oldfloorz; return oldfloorz;
@ -1990,21 +1989,21 @@ explode:
void P_MonsterFallingDamage (AActor *mo) void P_MonsterFallingDamage (AActor *mo)
{ {
int damage; int damage;
int mom; int vel;
if (!(level.flags2 & LEVEL2_MONSTERFALLINGDAMAGE)) if (!(level.flags2 & LEVEL2_MONSTERFALLINGDAMAGE))
return; return;
if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE) if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE)
return; return;
mom = abs(mo->momz); vel = abs(mo->velz);
if (mom > 35*FRACUNIT) if (vel > 35*FRACUNIT)
{ // automatic death { // automatic death
damage = 1000000; damage = 1000000;
} }
else else
{ {
damage = ((mom - (23*FRACUNIT))*6)>>FRACBITS; damage = ((vel - (23*FRACUNIT))*6)>>FRACBITS;
} }
damage = 1000000; // always kill 'em damage = 1000000; // always kill 'em
P_DamageMobj (mo, NULL, NULL, damage, NAME_Falling); 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)) 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)) 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 && if (!mo->waterlevel || mo->flags & MF_CORPSE || (mo->player &&
!(mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove))) !(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 // [RH] Double gravity only if running off a ledge. Coming down from
// an upward thrust (e.g. a jump) should not double it. // 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 else
{ {
mo->momz -= grav; mo->velz -= grav;
} }
} }
if (mo->waterlevel > 1) if (mo->waterlevel > 1)
{ {
fixed_t sinkspeed = mo->flags & MF_CORPSE ? -WATER_SINK_SPEED/3 : -WATER_SINK_SPEED; 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 else
{ {
mo->momz = startmomz + ((mo->momz - startmomz) >> mo->velz = startvelz + ((mo->velz - startvelz) >>
(mo->waterlevel == 1 ? WATER_SINK_SMALL_FACTOR : WATER_SINK_FACTOR)); (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) 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); dist = P_AproxDistance (mo->x - mo->target->x, mo->y - mo->target->y);
delta = (mo->target->z + (mo->height>>1)) - mo->z; delta = (mo->target->z + (mo->height>>1)) - mo->z;
if (delta < 0 && dist < -(delta*3)) 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)) 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)) if (mo->player && (mo->flags & MF_NOGRAVITY) && (mo->z > mo->floorz))
{ {
mo->z += finesine[(FINEANGLES/80*level.maptime)&FINEMASK]/8; 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)) 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) else if (mo->flags3 & MF3_NOEXPLODEFLOOR)
{ {
mo->momz = 0; mo->velz = 0;
P_HitFloor (mo); P_HitFloor (mo);
return; return;
} }
@ -2154,24 +2153,24 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
} }
if (mo->flags3 & MF3_ISMONSTER) // Blasted mobj falling if (mo->flags3 & MF3_ISMONSTER) // Blasted mobj falling
{ {
if (mo->momz < -(23*FRACUNIT)) if (mo->velz < -(23*FRACUNIT))
{ {
P_MonsterFallingDamage (mo); P_MonsterFallingDamage (mo);
} }
} }
mo->z = mo->floorz; 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. // Spawn splashes, etc.
P_HitFloor (mo); P_HitFloor (mo);
if (mo->DamageType == NAME_Ice && mo->momz < minmom) if (mo->DamageType == NAME_Ice && mo->velz < minvel)
{ {
mo->tics = 1; mo->tics = 1;
mo->momx = 0; mo->velx = 0;
mo->momy = 0; mo->vely = 0;
mo->momz = 0; mo->velz = 0;
return; return;
} }
// Let the actor do something special for hitting the floor // 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) if (mo->player)
{ {
mo->player->jumpTics = 7; // delay any jumping for a short while 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. // Squat down.
// Decrease viewheight for a moment after hitting the ground (hard), // 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); PlayerLandedOnThing (mo, NULL);
} }
} }
mo->momz = 0; mo->velz = 0;
} }
if (mo->flags & MF_SKULLFLY) if (mo->flags & MF_SKULLFLY)
{ // The skull slammed into something { // The skull slammed into something
mo->momz = -mo->momz; mo->velz = -mo->velz;
} }
mo->Crash(); mo->Crash();
} }
@ -2221,11 +2220,11 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
mo->FloorBounceMissile (mo->ceilingsector->ceilingplane); mo->FloorBounceMissile (mo->ceilingsector->ceilingplane);
return; return;
} }
if (mo->momz > 0) if (mo->velz > 0)
mo->momz = 0; mo->velz = 0;
if (mo->flags & MF_SKULLFLY) if (mo->flags & MF_SKULLFLY)
{ // the skull slammed into something { // the skull slammed into something
mo->momz = -mo->momz; mo->velz = -mo->velz;
} }
if (mo->flags & MF_MISSILE && if (mo->flags & MF_MISSILE &&
(!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP))) (!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP)))
@ -2325,7 +2324,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
if (mo->player->mo == mo) if (mo->player->mo == mo)
{ {
mo->player->deltaviewheight = mo->momz>>3; mo->player->deltaviewheight = mo->velz >> 3;
} }
if (mo->player->cheats & CF_PREDICTING) if (mo->player->cheats & CF_PREDICTING)
@ -2338,7 +2337,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
{ {
grunted = false; grunted = false;
// Why should this number vary by gravity? // 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); S_Sound (mo, CHAN_VOICE, "*grunt", 1, ATTN_NORM);
grunted = true; grunted = true;
@ -2546,7 +2545,7 @@ void AActor::HitFloor ()
bool AActor::Slam (AActor *thing) bool AActor::Slam (AActor *thing)
{ {
flags &= ~MF_SKULLFLY; flags &= ~MF_SKULLFLY;
momx = momy = momz = 0; velx = vely = velz = 0;
if (health > 0) if (health > 0)
{ {
if (!(flags2 & MF2_DORMANT)) if (!(flags2 & MF2_DORMANT))
@ -2705,7 +2704,7 @@ void AActor::Tick ()
{ {
// only do the minimally necessary things here to save time: // only do the minimally necessary things here to save time:
// Check the time freezer // Check the time freezer
// apply momentum // apply velocity
// ensure that the actor is not linked into the blockmap // ensure that the actor is not linked into the blockmap
if (!(flags5 & MF5_NOTIMEFREEZE)) if (!(flags5 & MF5_NOTIMEFREEZE))
@ -2719,9 +2718,9 @@ void AActor::Tick ()
UnlinkFromWorld (); UnlinkFromWorld ();
flags |= MF_NOBLOCKMAP; flags |= MF_NOBLOCKMAP;
x += momx; x += velx;
y += momy; y += vely;
z += momz; z += velz;
LinkToWorld (); LinkToWorld ();
} }
else else
@ -2765,7 +2764,7 @@ void AActor::Tick ()
{ {
// add some smoke behind the rocket // add some smoke behind the rocket
smokecounter = 0; 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) if (th)
{ {
th->tics -= pr_rockettrail()&3; th->tics -= pr_rockettrail()&3;
@ -2778,11 +2777,11 @@ void AActor::Tick ()
if (++smokecounter==8) if (++smokecounter==8)
{ {
smokecounter = 0; smokecounter = 0;
angle_t moveangle = R_PointToAngle2(0,0,momx,momy); angle_t moveangle = R_PointToAngle2(0,0,velx,vely);
AActor * th = Spawn("GrenadeSmokeTrail", AActor * th = Spawn("GrenadeSmokeTrail",
x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10),
y - FixedMul (finesine[(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) if (th)
{ {
th->tics -= pr_rockettrail()&3; th->tics -= pr_rockettrail()&3;
@ -2801,14 +2800,14 @@ void AActor::Tick ()
{ {
if (health >0) if (health >0)
{ {
if (abs (momz) < FRACUNIT/4) if (abs (velz) < FRACUNIT/4)
{ {
momz = 0; velz = 0;
flags4 &= ~MF4_VFRICTION; flags4 &= ~MF4_VFRICTION;
} }
else 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 // [RH] If standing on a steep slope, fall down it
if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) && if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) &&
!(flags & MF_NOBLOCKMAP) && !(flags & MF_NOBLOCKMAP) &&
momz <= 0 && velz <= 0 &&
floorz == z) floorz == z)
{ {
const secplane_t * floorplane = &floorsector->floorplane; const secplane_t * floorplane = &floorsector->floorplane;
@ -3091,8 +3090,8 @@ void AActor::Tick ()
} }
if (dopush) if (dopush)
{ {
momx += floorplane->a; velx += floorplane->a;
momy += floorplane->b; 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 // 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 // still have missiles that go straight up and down through actors without
// damaging anything. // 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; BlockingMobj = NULL;
fixed_t oldfloorz = P_XYMovement (this, cummx, cummy); fixed_t oldfloorz = P_XYMovement (this, cummx, cummy);
if (ObjectFlags & OF_EuthanizeMe) if (ObjectFlags & OF_EuthanizeMe)
{ // actor was destroyed { // actor was destroyed
return; return;
} }
if ((momx | momy) == 0 && (flags2 & MF2_BLASTED)) if ((velx | vely) == 0 && (flags2 & MF2_BLASTED))
{ // Reset to not blasted when momentums are gone { // Reset to not blasted when velocitiess are gone
flags2 &= ~MF2_BLASTED; flags2 &= ~MF2_BLASTED;
} }
@ -3122,11 +3121,11 @@ void AActor::Tick ()
{ // Floating item bobbing motion { // Floating item bobbing motion
z += FloatBobDiffs[(FloatBobPhase + level.maptime) & 63]; z += FloatBobDiffs[(FloatBobPhase + level.maptime) & 63];
} }
if (momz || BlockingMobj || if (velz || BlockingMobj ||
(z != floorz && (!(flags2 & MF2_FLOATBOB) || (z != floorz && (!(flags2 & MF2_FLOATBOB) ||
(z - FloatBobOffsets[(FloatBobPhase + level.maptime) & 63] != floorz) (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 (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ))
{ {
if (!(onmo = P_CheckOnmobj (this))) if (!(onmo = P_CheckOnmobj (this)))
@ -3138,7 +3137,7 @@ void AActor::Tick ()
{ {
if (player) 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)) && !(flags&MF_NOGRAVITY))
{ {
PlayerLandedOnThing (this, onmo); PlayerLandedOnThing (this, onmo);
@ -3158,7 +3157,7 @@ void AActor::Tick ()
z = onmo->z + onmo->height; z = onmo->z + onmo->height;
} }
flags2 |= MF2_ONMOBJ; flags2 |= MF2_ONMOBJ;
momz = 0; velz = 0;
Crash(); Crash();
} }
} }
@ -3851,7 +3850,7 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
p->mo->ResetAirSupply(false); p->mo->ResetAirSupply(false);
p->Uncrouch(); 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) 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; z += pr_spawnblood.Random2 () << 10;
th = Spawn (bloodcls, x, y, z, ALLOW_REPLACE); th = Spawn (bloodcls, x, y, z, ALLOW_REPLACE);
th->momz = FRACUNIT*2; th->velz = FRACUNIT*2;
th->angle = dir; th->angle = dir;
if (gameinfo.gametype & GAME_DoomChex) 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 = Spawn(bloodcls, x, y, z, ALLOW_REPLACE);
mo->target = originator; mo->target = originator;
mo->momx = pr_splatter.Random2 () << 10; mo->velx = pr_splatter.Random2 () << 10;
mo->momy = pr_splatter.Random2 () << 10; mo->vely = pr_splatter.Random2 () << 10;
mo->momz = 3*FRACUNIT; mo->velz = 3*FRACUNIT;
// colorize the blood! // colorize the blood!
if (bloodcolor!=0 && !(mo->flags2 & MF2_DONTTRANSLATE)) 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); th = Spawn (bloodcls, x, y, z, ALLOW_REPLACE);
if (gameinfo.gametype == GAME_Heretic) if (gameinfo.gametype == GAME_Heretic)
th->flags |= MF_NOGRAVITY; th->flags |= MF_NOGRAVITY;
th->momx = mo->momx >> 1; th->velx = mo->velx >> 1;
th->momy = mo->momy >> 1; th->vely = mo->vely >> 1;
th->tics += pr_ripperblood () & 3; th->tics += pr_ripperblood () & 3;
// colorize the blood! // colorize the blood!
@ -4573,7 +4572,8 @@ foundone:
// Don't splash for living things with small vertical velocities. // Don't splash for living things with small vertical velocities.
// There are levels where the constant splashing from the monsters gets extremely annoying // 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]; splash = &Splashes[splashnum];
@ -4594,13 +4594,13 @@ foundone:
mo->target = thing; mo->target = thing;
if (splash->ChunkXVelShift != 255) if (splash->ChunkXVelShift != 255)
{ {
mo->momx = pr_chunk.Random2() << splash->ChunkXVelShift; mo->velx = pr_chunk.Random2() << splash->ChunkXVelShift;
} }
if (splash->ChunkYVelShift != 255) 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) if (splash->SplashBase)
{ {
@ -4707,7 +4707,7 @@ bool P_CheckMissileSpawn (AActor* th)
if (th->radius > 0) 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 need to take smaller steps but to produce the same end result
// we have to do more of them. // we have to do more of them.
@ -4720,9 +4720,9 @@ bool P_CheckMissileSpawn (AActor* th)
for(int i=0; i<count; i++) for(int i=0; i<count; i++)
{ {
th->x += th->momx>>shift; th->x += th->velx >> shift;
th->y += th->momy>>shift; th->y += th->vely >> shift;
th->z += th->momz>>shift; th->z += th->velz >> shift;
// killough 3/15/98: no dropoff (really = don't care for missiles) // 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.Z += dest->height - z + source->z;
} }
velocity.Resize (speed); velocity.Resize (speed);
th->momx = (fixed_t)(velocity.X); th->velx = (fixed_t)(velocity.X);
th->momy = (fixed_t)(velocity.Y); th->vely = (fixed_t)(velocity.Y);
th->momz = (fixed_t)(velocity.Z); th->velz = (fixed_t)(velocity.Z);
// invisible target: rotate velocity vector in 2D // invisible target: rotate velocity vector in 2D
if (dest->flags & MF_SHADOW) 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; angle_t an = pr_spawnmissile.Random2 () << 20;
an >>= ANGLETOFINESHIFT; an >>= ANGLETOFINESHIFT;
fixed_t newx = DMulScale16 (th->momx, finecosine[an], -th->momy, finesine[an]); fixed_t newx = DMulScale16 (th->velx, finecosine[an], -th->vely, finesine[an]);
fixed_t newy = DMulScale16 (th->momx, finesine[an], th->momy, finecosine[an]); fixed_t newy = DMulScale16 (th->velx, finesine[an], th->vely, finecosine[an]);
th->momx = newx; th->velx = newx;
th->momy = newy; 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; 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, 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, 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, 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)); GetDefaultSpeed (type));
} }
@ -4923,7 +4923,7 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl
angle_t an; angle_t an;
fixed_t dist; fixed_t dist;
fixed_t speed; fixed_t speed;
fixed_t momz; fixed_t velz;
an = source->angle; 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); dist = P_AproxDistance (dest->x - source->x, dest->y - source->y);
speed = GetDefaultSpeed (type); speed = GetDefaultSpeed (type);
dist /= speed; dist /= speed;
momz = dist != 0 ? (dest->z - source->z)/dist : speed; velz = dist != 0 ? (dest->z - source->z)/dist : speed;
return P_SpawnMissileAngleZSpeed (source, z, type, an, momz, 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, 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, return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT,
type, angle, momz, speed); type, angle, velz, speed);
} }
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, 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; AActor *mo;
@ -4970,9 +4970,9 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
mo->target = owner != NULL ? owner : source; // Originator mo->target = owner != NULL ? owner : source; // Originator
mo->angle = angle; mo->angle = angle;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
mo->momx = FixedMul (speed, finecosine[angle]); mo->velx = FixedMul (speed, finecosine[angle]);
mo->momy = FixedMul (speed, finesine[angle]); mo->vely = FixedMul (speed, finesine[angle]);
mo->momz = momz; mo->velz = velz;
return (!checkspawn || P_CheckMissileSpawn(mo)) ? mo : NULL; 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]; vz = -finesine[pitch>>ANGLETOFINESHIFT];
speed = MissileActor->Speed; speed = MissileActor->Speed;
MissileActor->momx = FixedMul (vx, speed); MissileActor->velx = FixedMul (vx, speed);
MissileActor->momy = FixedMul (vy, speed); MissileActor->vely = FixedMul (vy, speed);
MissileActor->momz = FixedMul (vz, speed); MissileActor->velz = FixedMul (vz, speed);
if (MissileActor->flags4 & MF4_SPECTRAL) if (MissileActor->flags4 & MF4_SPECTRAL)
MissileActor->health = -1; MissileActor->health = -1;

View file

@ -1450,7 +1450,7 @@ static void P_SpawnScrollers(void)
// phares 3/12/98: Start of friction effects // phares 3/12/98: Start of friction effects
// As the player moves, friction is applied by decreasing the x and y // 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 // we can simulate muddy or icy conditions. In mud, the player slows
// down faster. In ice, the player slows down more slowly. // 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 // the move distance is multiplied by 'friction/0x10000', so a
// higher friction value actually means 'less friction'. // 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. // friction 0xf900) is the same as in Heretic/Hexen.
if (friction >= ORIG_FRICTION) // ice if (friction >= ORIG_FRICTION) // ice
// movefactor = ((0x10092 - friction)*(0x70))/0x158; // movefactor = ((0x10092 - friction)*(0x70))/0x158;
@ -1732,8 +1732,8 @@ void DPusher::Tick ()
if (m_Source->GetClass()->TypeName == NAME_PointPusher) if (m_Source->GetClass()->TypeName == NAME_PointPusher)
pushangle += ANG180; // away pushangle += ANG180; // away
pushangle >>= ANGLETOFINESHIFT; pushangle >>= ANGLETOFINESHIFT;
thing->momx += FixedMul (speed, finecosine[pushangle]); thing->velx += FixedMul (speed, finecosine[pushangle]);
thing->momy += FixedMul (speed, finesine[pushangle]); thing->vely += FixedMul (speed, finesine[pushangle]);
} }
} }
} }
@ -1806,8 +1806,8 @@ void DPusher::Tick ()
yspeed = m_Ymag; yspeed = m_Ymag;
} }
} }
thing->momx += xspeed<<(FRACBITS-PUSH_FACTOR); thing->velx += xspeed<<(FRACBITS-PUSH_FACTOR);
thing->momy += yspeed<<(FRACBITS-PUSH_FACTOR); thing->vely += yspeed<<(FRACBITS-PUSH_FACTOR);
} }
} }

View file

@ -959,8 +959,8 @@ bool EV_DoChange (line_t *line, EChange changetype, int tag);
// //
// P_TELEPT // 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 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 haltMomentum = 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_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_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); bool EV_TeleportGroup (int group_tid, AActor *victim, int source_tid, int dest_tid, bool moveSource, bool fog);

View file

@ -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 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 oldx;
fixed_t oldy; 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) if (thing->player)
{ {
// [RH] Zoom player's field of vision // [RH] Zoom player's field of vision
// [BC] && bHaltMomentum. // [BC] && bHaltVelocity.
if (telezoom && thing->player->mo == thing && bHaltMomentum) if (telezoom && thing->player->mo == thing && bHaltVelocity)
thing->player->FOV = MIN (175.f, thing->player->DesiredFOV + 45.f); thing->player->FOV = MIN (175.f, thing->player->DesiredFOV + 45.f);
} }
} }
// [BC] && bHaltMomentum. // [BC] && bHaltVelocity.
if (thing->player && (useFog || !keepOrientation) && bHaltMomentum) if (thing->player && (useFog || !keepOrientation) && bHaltVelocity)
{ {
// Freeze player for about .5 sec // Freeze player for about .5 sec
if (thing->Inventory == NULL || thing->Inventory->GetSpeedFactor() <= FRACUNIT) 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) if (thing->flags & MF_MISSILE)
{ {
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
thing->momx = FixedMul (thing->Speed, finecosine[angle]); thing->velx = FixedMul (thing->Speed, finecosine[angle]);
thing->momy = FixedMul (thing->Speed, finesine[angle]); thing->vely = FixedMul (thing->Speed, finesine[angle]);
} }
// [BC] && bHaltMomentum. // [BC] && bHaltVelocity.
else if (!keepOrientation && bHaltMomentum) // no fog doesn't alter the player's momentum else if (!keepOrientation && bHaltVelocity) // no fog doesn't alter the player's momentum
{ {
thing->momx = thing->momy = thing->momz = 0; thing->velx = thing->vely = thing->velz = 0;
// killough 10/98: kill all bobbing momentum too // killough 10/98: kill all bobbing velocity too
if (player) if (player)
player->momx = player->momy = 0; player->velx = player->vely = 0;
} }
return true; 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 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; AActor *searcher;
fixed_t z; fixed_t z;
angle_t angle = 0; angle_t angle = 0;
fixed_t s = 0, c = 0; fixed_t s = 0, c = 0;
fixed_t momx = 0, momy = 0; fixed_t velx = 0, vely = 0;
if (thing == NULL) if (thing == NULL)
{ // Teleport function called with an invalid actor { // 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]; s = finesine[angle>>ANGLETOFINESHIFT];
c = finecosine[angle>>ANGLETOFINESHIFT]; c = finecosine[angle>>ANGLETOFINESHIFT];
// Momentum of thing crossing teleporter linedef // Velocity of thing crossing teleporter linedef
momx = thing->momx; velx = thing->velx;
momy = thing->momy; vely = thing->vely;
z = searcher->z; z = searcher->z;
} }
@ -362,7 +362,7 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, bool
{ {
z = ONFLOORZ; 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 // [RH] Lee Killough's changes for silent teleporters from BOOM
if (!fog && line && keepOrientation) 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 // Rotate thing according to difference in angles
thing->angle += angle; thing->angle += angle;
// Rotate thing's momentum to come out of exit just like it entered // Rotate thing's velocity to come out of exit just like it entered
thing->momx = FixedMul(momx, c) - FixedMul(momy, s); thing->velx = FixedMul(velx, c) - FixedMul(vely, s);
thing->momy = FixedMul(momy, c) + FixedMul(momx, 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 (); 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 // 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. // the position across the exit linedef, if reversed.
angle_t angle = angle_t angle =
R_PointToAngle2(0, 0, l->dx, l->dy) - 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 // Rotate thing's orientation according to difference in linedef angles
thing->angle += angle; thing->angle += angle;
// Momentum of thing crossing teleporter linedef // Velocity of thing crossing teleporter linedef
x = thing->momx; x = thing->velx;
y = thing->momy; y = thing->vely;
// Rotate thing's momentum to come out of exit just like it entered // Rotate thing's velocity to come out of exit just like it entered
thing->momx = DMulScale16 (x, c, -y, s); thing->velx = DMulScale16 (x, c, -y, s);
thing->momy = DMulScale16 (y, c, x, s); thing->vely = DMulScale16 (y, c, x, s);
// Adjust a player's view, in case there has been a height change // Adjust a player's view, in case there has been a height change
if (player && player->mo == thing) if (player && player->mo == thing)
{ {
// Adjust player's local copy of momentum // Adjust player's local copy of velocity
x = player->momx; x = player->velx;
y = player->momy; y = player->vely;
player->momx = DMulScale16 (x, c, -y, s); player->velx = DMulScale16 (x, c, -y, s);
player->momy = DMulScale16 (y, c, x, s); player->vely = DMulScale16 (y, c, x, s);
// Save the current deltaviewheight, used in stepping // Save the current deltaviewheight, used in stepping
fixed_t deltaviewheight = player->deltaviewheight; fixed_t deltaviewheight = player->deltaviewheight;

View file

@ -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 }; 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)); 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 // Aiming at the target's position some time in the future
// is basically just an application of the law of sines: // 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 // with the math. I don't think I would have thought of using
// trig alone had I been left to solve it by myself. // 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 (!(targ->flags & MF_NOGRAVITY) && targ->waterlevel < 3)
{ // If the target is subject to gravity and not underwater, { // If the target is subject to gravity and not underwater,
// assume that it isn't moving vertically. Thanks to gravity, // assume that it isn't moving vertically. Thanks to gravity,
// even if we did consider the vertical component of the target's // even if we did consider the vertical component of the target's
// velocity, we would still miss more often than not. // velocity, we would still miss more often than not.
tvel.Z = 0.0; tvel.Z = 0.0;
if ((targ->momx | targ->momy) == 0) if ((targ->velx | targ->vely) == 0)
{ {
goto nolead; goto nolead;
} }
@ -302,18 +302,18 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam
FVector3 aimvec = rm * aim; FVector3 aimvec = rm * aim;
// And make the projectile follow that vector at the desired speed. // And make the projectile follow that vector at the desired speed.
double aimscale = fspeed / dist; double aimscale = fspeed / dist;
mobj->momx = fixed_t (aimvec[0] * aimscale); mobj->velx = fixed_t (aimvec[0] * aimscale);
mobj->momy = fixed_t (aimvec[1] * aimscale); mobj->vely = fixed_t (aimvec[1] * aimscale);
mobj->momz = fixed_t (aimvec[2] * aimscale); mobj->velz = fixed_t (aimvec[2] * aimscale);
mobj->angle = R_PointToAngle2 (0, 0, mobj->momx, mobj->momy); mobj->angle = R_PointToAngle2 (0, 0, mobj->velx, mobj->vely);
} }
else else
{ {
nolead: mobj->angle = R_PointToAngle2 (mobj->x, mobj->y, targ->x, targ->y); nolead: mobj->angle = R_PointToAngle2 (mobj->x, mobj->y, targ->x, targ->y);
aim.Resize (fspeed); aim.Resize (fspeed);
mobj->momx = fixed_t(aim[0]); mobj->velx = fixed_t(aim[0]);
mobj->momy = fixed_t(aim[1]); mobj->vely = fixed_t(aim[1]);
mobj->momz = fixed_t(aim[2]); mobj->velz = fixed_t(aim[2]);
} }
if (mobj->flags2 & MF2_SEEKERMISSILE) if (mobj->flags2 & MF2_SEEKERMISSILE)
{ {
@ -323,19 +323,19 @@ nolead: mobj->angle = R_PointToAngle2 (mobj->x, mobj->y, targ->x, targ->y);
else else
{ {
mobj->angle = angle; mobj->angle = angle;
mobj->momx = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]); mobj->velx = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]);
mobj->momy = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]); mobj->vely = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]);
mobj->momz = vspeed; mobj->velz = vspeed;
} }
// Set the missile's speed to reflect the speed it was spawned at. // Set the missile's speed to reflect the speed it was spawned at.
if (mobj->flags & MF_MISSILE) 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 // Hugger missiles don't have any vertical velocity
if (mobj->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)) if (mobj->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
{ {
mobj->momz = 0; mobj->velz = 0;
} }
if (mobj->flags & MF_SPECIAL) if (mobj->flags & MF_SPECIAL)
{ {

View file

@ -217,8 +217,8 @@ player_t::player_t()
viewheight(0), viewheight(0),
deltaviewheight(0), deltaviewheight(0),
bob(0), bob(0),
momx(0), velx(0),
momy(0), vely(0),
centering(0), centering(0),
turnticks(0), turnticks(0),
attackdown(0), attackdown(0),
@ -1267,7 +1267,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
// Handle the different player death screams // Handle the different player death screams
if ((((level.flags >> 15) | (dmflags)) & if ((((level.flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) && (DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
self->momz <= -39*FRACUNIT) self->velz <= -39*FRACUNIT)
{ {
sound = S_FindSkinnedSound (self, "*splat"); sound = S_FindSkinnedSound (self, "*splat");
chan = CHAN_BODY; chan = CHAN_BODY;
@ -1337,9 +1337,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
self->flags &= ~MF_SOLID; self->flags &= ~MF_SOLID;
mo = (APlayerPawn *)Spawn (spawntype, self->x, self->y, self->z + 48*FRACUNIT, NO_REPLACE); mo = (APlayerPawn *)Spawn (spawntype, self->x, self->y, self->z + 48*FRACUNIT, NO_REPLACE);
//mo->target = self; //mo->target = self;
mo->momx = pr_skullpop.Random2() << 9; mo->velx = pr_skullpop.Random2() << 9;
mo->momy = pr_skullpop.Random2() << 9; mo->vely = pr_skullpop.Random2() << 9;
mo->momz = 2*FRACUNIT + (pr_skullpop() << 6); mo->velz = 2*FRACUNIT + (pr_skullpop() << 6);
// Attach player mobj to bloody skull // Attach player mobj to bloody skull
player = self->player; player = self->player;
self->player = NULL; self->player = NULL;
@ -1457,8 +1457,8 @@ void P_SideThrust (player_t *player, angle_t angle, fixed_t move)
{ {
angle = (angle - ANGLE_90) >> ANGLETOFINESHIFT; angle = (angle - ANGLE_90) >> ANGLETOFINESHIFT;
player->mo->momx += FixedMul (move, finecosine[angle]); player->mo->velx += FixedMul (move, finecosine[angle]);
player->mo->momy += FixedMul (move, finesine[angle]); player->mo->vely += FixedMul (move, finesine[angle]);
} }
void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move) 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]); fixed_t zpush = FixedMul (move, finesine[pitch]);
if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0) if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0)
zpush = 0; zpush = 0;
player->mo->momz -= zpush; player->mo->velz -= zpush;
move = FixedMul (move, finecosine[pitch]); move = FixedMul (move, finecosine[pitch]);
} }
player->mo->momx += FixedMul (move, finecosine[angle]); player->mo->velx += FixedMul (move, finecosine[angle]);
player->mo->momy += FixedMul (move, finesine[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; angle >>= ANGLETOFINESHIFT;
player->momx += FixedMul(move,finecosine[angle]); player->velx += FixedMul(move, finecosine[angle]);
player->momy += FixedMul(move,finesine[angle]); player->vely += FixedMul(move, finesine[angle]);
} }
/* /*
@ -1530,7 +1530,7 @@ void P_CalcHeight (player_t *player)
} }
else 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) if (player->bob == 0)
{ {
still = true; still = true;
@ -1546,7 +1546,7 @@ void P_CalcHeight (player_t *player)
fixed_t defaultviewheight = player->mo->ViewHeight + player->crouchviewdelta; fixed_t defaultviewheight = player->mo->ViewHeight + player->crouchviewdelta;
if (player->cheats & CF_NOMOMENTUM) if (player->cheats & CF_NOVELOCITY)
{ {
player->viewz = player->mo->z + defaultviewheight; player->viewz = player->mo->z + defaultviewheight;
@ -1739,7 +1739,7 @@ void P_FallingDamage (AActor *actor)
{ {
int damagestyle; int damagestyle;
int damage; int damage;
fixed_t mom; fixed_t vel;
damagestyle = ((level.flags >> 15) | (dmflags)) & damagestyle = ((level.flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX); (DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX);
@ -1750,7 +1750,7 @@ void P_FallingDamage (AActor *actor)
if (actor->floorsector->Flags & SECF_NOFALLINGDAMAGE) if (actor->floorsector->Flags & SECF_NOFALLINGDAMAGE)
return; return;
mom = abs (actor->momz); vel = abs(actor->velz);
// Since Hexen falling damage is stronger than ZDoom's, it takes // Since Hexen falling damage is stronger than ZDoom's, it takes
// precedence. ZDoom falling damage may not be as strong, but it // precedence. ZDoom falling damage may not be as strong, but it
@ -1759,19 +1759,19 @@ void P_FallingDamage (AActor *actor)
switch (damagestyle) switch (damagestyle)
{ {
case DF_FORCE_FALLINGHX: // Hexen falling damage case DF_FORCE_FALLINGHX: // Hexen falling damage
if (mom <= 23*FRACUNIT) if (vel <= 23*FRACUNIT)
{ // Not fast enough to hurt { // Not fast enough to hurt
return; return;
} }
if (mom >= 63*FRACUNIT) if (vel >= 63*FRACUNIT)
{ // automatic death { // automatic death
damage = 1000000; damage = 1000000;
} }
else else
{ {
mom = FixedMul (mom, 16*FRACUNIT/23); vel = FixedMul (vel, 16*FRACUNIT/23);
damage = ((FixedMul (mom, mom) / 10) >> FRACBITS) - 24; damage = ((FixedMul (vel, vel) / 10) >> FRACBITS) - 24;
if (actor->momz > -39*FRACUNIT && damage > actor->health if (actor->velz > -39*FRACUNIT && damage > actor->health
&& actor->health != 1) && actor->health != 1)
{ // No-death threshold { // No-death threshold
damage = actor->health-1; damage = actor->health-1;
@ -1780,17 +1780,17 @@ void P_FallingDamage (AActor *actor)
break; break;
case DF_FORCE_FALLINGZD: // ZDoom falling damage case DF_FORCE_FALLINGZD: // ZDoom falling damage
if (mom <= 19*FRACUNIT) if (vel <= 19*FRACUNIT)
{ // Not fast enough to hurt { // Not fast enough to hurt
return; return;
} }
if (mom >= 84*FRACUNIT) if (vel >= 84*FRACUNIT)
{ // automatic death { // automatic death
damage = 1000000; damage = 1000000;
} }
else else
{ {
damage = ((MulScale23 (mom, mom*11) >> FRACBITS) - 30) / 2; damage = ((MulScale23 (vel, vel*11) >> FRACBITS) - 30) / 2;
if (damage < 1) if (damage < 1)
{ {
damage = 1; damage = 1;
@ -1799,13 +1799,13 @@ void P_FallingDamage (AActor *actor)
break; break;
case DF_FORCE_FALLINGST: // Strife falling damage case DF_FORCE_FALLINGST: // Strife falling damage
if (mom <= 20*FRACUNIT) if (vel <= 20*FRACUNIT)
{ // Not fast enough to hurt { // Not fast enough to hurt
return; return;
} }
// The minimum amount of damage you take from falling in Strife // The minimum amount of damage you take from falling in Strife
// is 52. Ouch! // is 52. Ouch!
damage = mom / 25000; damage = vel / 25000;
break; break;
default: default:
@ -2191,20 +2191,20 @@ void P_PlayerThink (player_t *player)
else else
if (player->mo->waterlevel >= 2) if (player->mo->waterlevel >= 2)
{ {
player->mo->momz = 4*FRACUNIT; player->mo->velz = 4*FRACUNIT;
} }
else if (player->mo->flags & MF_NOGRAVITY) else if (player->mo->flags & MF_NOGRAVITY)
{ {
player->mo->momz = 3*FRACUNIT; player->mo->velz = 3*FRACUNIT;
} }
else if (level.IsJumpingAllowed() && onground && !player->jumpTics) 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. // [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); S_Sound (player->mo, CHAN_BODY, "*jump", 1, ATTN_NORM);
player->mo->flags2 &= ~MF2_ONMOBJ; player->mo->flags2 &= ~MF2_ONMOBJ;
player->jumpTics = 18*TICRATE/35; 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)) 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)) if (player->mo->waterlevel < 2 && !(player->mo->flags & MF_NOGRAVITY))
{ {
player->mo->flags2 |= MF2_FLY; player->mo->flags2 |= MF2_FLY;
player->mo->flags |= MF_NOGRAVITY; player->mo->flags |= MF_NOGRAVITY;
if (player->mo->momz <= -39*FRACUNIT) if (player->mo->velz <= -39*FRACUNIT)
{ // Stop falling scream { // Stop falling scream
S_StopSound (player->mo, CHAN_VOICE); S_StopSound (player->mo, CHAN_VOICE);
} }
@ -2261,8 +2261,8 @@ void P_PlayerThink (player_t *player)
P_PlayerInSpecialSector (player); P_PlayerInSpecialSector (player);
} }
P_PlayerOnSpecialFlat (player, P_GetThingFloorType (player->mo)); P_PlayerOnSpecialFlat (player, P_GetThingFloorType (player->mo));
if (player->mo->momz <= -35*FRACUNIT && if (player->mo->velz <= -35*FRACUNIT &&
player->mo->momz >= -40*FRACUNIT && !player->morphTics && player->mo->velz >= -40*FRACUNIT && !player->morphTics &&
player->mo->waterlevel == 0) player->mo->waterlevel == 0)
{ {
int id = S_FindSkinnedSound (player->mo, "*falling"); int id = S_FindSkinnedSound (player->mo, "*falling");
@ -2482,8 +2482,8 @@ void player_t::Serialize (FArchive &arc)
<< viewheight << viewheight
<< deltaviewheight << deltaviewheight
<< bob << bob
<< momx << velx
<< momy << vely
<< centering << centering
<< health << health
<< inventorytics << inventorytics

View file

@ -771,8 +771,8 @@ void ThrustMobj (AActor *actor, seg_t *seg, FPolyObj *po)
thrustX = FixedMul (force, finecosine[thrustAngle]); thrustX = FixedMul (force, finecosine[thrustAngle]);
thrustY = FixedMul (force, finesine[thrustAngle]); thrustY = FixedMul (force, finesine[thrustAngle]);
actor->momx += thrustX; actor->velx += thrustX;
actor->momy += thrustY; actor->vely += thrustY;
if (po->crush) if (po->crush)
{ {
if (po->bHurtOnTouch || !P_CheckMove (actor, actor->x + thrustX, actor->y + thrustY)) if (po->bHurtOnTouch || !P_CheckMove (actor, actor->x + thrustX, actor->y + thrustY))

View file

@ -711,9 +711,9 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
// Only actors maintain velocity information. // Only actors maintain velocity information.
if (type == SOURCE_Actor && actor != NULL) if (type == SOURCE_Actor && actor != NULL)
{ {
vel->X = FIXED2FLOAT(actor->momx) * TICRATE; vel->X = FIXED2FLOAT(actor->velx) * TICRATE;
vel->Y = FIXED2FLOAT(actor->momz) * TICRATE; vel->Y = FIXED2FLOAT(actor->velz) * TICRATE;
vel->Z = FIXED2FLOAT(actor->momy) * TICRATE; vel->Z = FIXED2FLOAT(actor->vely) * TICRATE;
} }
else else
{ {
@ -1862,9 +1862,9 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor)
{ {
listener.angle = (float)(listenactor->angle) * ((float)PI / 2147483648.f); listener.angle = (float)(listenactor->angle) * ((float)PI / 2147483648.f);
/* /*
listener.velocity.X = listenactor->momx * (TICRATE/65536.f); listener.velocity.X = listenactor->velx * (TICRATE/65536.f);
listener.velocity.Y = listenactor->momz * (TICRATE/65536.f); listener.velocity.Y = listenactor->velz * (TICRATE/65536.f);
listener.velocity.Z = listenactor->momy * (TICRATE/65536.f); listener.velocity.Z = listenactor->vely * (TICRATE/65536.f);
*/ */
listener.velocity.Zero(); listener.velocity.Zero();
listener.position.X = FIXED2FLOAT(listenactor->x); listener.position.X = FIXED2FLOAT(listenactor->x);

View file

@ -249,7 +249,7 @@ static cheatseq_t StrifeCheats[] =
{ CheatTopo, 0, 0, 0, {0,0}, Cht_AutoMap }, { CheatTopo, 0, 0, 0, {0,0}, Cht_AutoMap },
{ CheatDots, 0, 1, 0, {0,0}, Cht_Ticker }, { CheatDots, 0, 1, 0, {0,0}, Cht_Ticker },
{ CheatOmnipotent, 0, 0, 0, {CHT_IDDQD,0}, Cht_Generic }, { 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 }, { CheatJimmy, 0, 0, 0, {CHT_KEYS,0}, Cht_Generic },
{ CheatBoomstix, 0, 0, 0, {CHT_IDFA,0}, Cht_Generic }, { CheatBoomstix, 0, 0, 0, {CHT_IDFA,0}, Cht_Generic },
{ CheatElvis, 0, 0, 0, {CHT_NOCLIP,0}, Cht_Generic }, { CheatElvis, 0, 0, 0, {CHT_NOCLIP,0}, Cht_Generic },

View file

@ -342,6 +342,10 @@ int MatchString (const char *in, const char **strings);
static FVariableInfo GlobalDef__##name = { #name, myoffsetof(cls, name), RUNTIME_CLASS(cls) }; \ static FVariableInfo GlobalDef__##name = { #name, myoffsetof(cls, name), RUNTIME_CLASS(cls) }; \
MSVC_MSEG FVariableInfo *infoptr_GlobalDef__##name GCC_MSEG = &GlobalDef__##name; 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;

View file

@ -702,17 +702,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
self->y-=y; self->y-=y;
// It is not necessary to use the correct angle here. // 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. // 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) if (missile)
{ {
fixed_t vx = finecosine[pitch>>ANGLETOFINESHIFT]; fixed_t vx = finecosine[pitch>>ANGLETOFINESHIFT];
fixed_t vz = finesine[pitch>>ANGLETOFINESHIFT]; fixed_t vz = finesine[pitch>>ANGLETOFINESHIFT];
missile->momx = FixedMul (vx, missile->Speed); missile->velx = FixedMul (vx, missile->Speed);
missile->momy = 0; missile->vely = 0;
missile->momz = FixedMul (vz, missile->Speed); missile->velz = FixedMul (vz, missile->Speed);
} }
break; break;
@ -720,17 +720,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
if (missile) 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 // so that this can handle missiles with a high vertical velocity
// component properly. // component properly.
FVector3 velocity (missile->momx, missile->momy, 0); FVector3 velocity (missile->velx, missile->vely, 0);
fixed_t missilespeed = (fixed_t)velocity.Length(); fixed_t missilespeed = (fixed_t)velocity.Length();
missile->angle += Angle; missile->angle += Angle;
ang = missile->angle >> ANGLETOFINESHIFT; ang = missile->angle >> ANGLETOFINESHIFT;
missile->momx = FixedMul (missilespeed, finecosine[ang]); missile->velx = FixedMul (missilespeed, finecosine[ang]);
missile->momy = FixedMul (missilespeed, finesine[ang]); missile->vely = FixedMul (missilespeed, finesine[ang]);
// handle projectile shooting projectiles - track the // handle projectile shooting projectiles - track the
// links back to a real owner // 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 // This original implementation is to aim straight ahead and then offset
// the angle from the resulting direction. // 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(); fixed_t missilespeed = (fixed_t)velocity.Length();
misl->angle += Angle; misl->angle += Angle;
angle_t an = misl->angle >> ANGLETOFINESHIFT; angle_t an = misl->angle >> ANGLETOFINESHIFT;
misl->momx = FixedMul (missilespeed, finecosine[an]); misl->velx = FixedMul (missilespeed, finecosine[an]);
misl->momy = FixedMul (missilespeed, finesine[an]); misl->vely = FixedMul (missilespeed, finesine[an]);
} }
} }
} }
@ -1176,8 +1176,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
if (aim) if (aim)
{ {
saved_angle = self->angle = R_PointToAngle2 (self->x, self->y, saved_angle = self->angle = R_PointToAngle2 (self->x, self->y,
self->target->x - self->target->momx * 3, self->target->x - self->target->velx * 3,
self->target->y - self->target->momy * 3); self->target->y - self->target->vely * 3);
if (aim == CRF_AIMDIRECT) if (aim == CRF_AIMDIRECT)
{ {
@ -1187,8 +1187,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
self->y += Spawnofs_XY * finesine[self->angle]; self->y += Spawnofs_XY * finesine[self->angle];
Spawnofs_XY = 0; Spawnofs_XY = 0;
self->angle = R_PointToAngle2 (self->x, self->y, self->angle = R_PointToAngle2 (self->x, self->y,
self->target->x - self->target->momx * 3, self->target->x - self->target->velx * 3,
self->target->y - self->target->momy * 3); self->target->y - self->target->vely * 3);
} }
if (self->target->flags & MF_SHADOW) if (self->target->flags & MF_SHADOW)
@ -1317,7 +1317,7 @@ enum SIX_Flags
SIXF_TRANSFERTRANSLATION=1, SIXF_TRANSFERTRANSLATION=1,
SIXF_ABSOLUTEPOSITION=2, SIXF_ABSOLUTEPOSITION=2,
SIXF_ABSOLUTEANGLE=4, SIXF_ABSOLUTEANGLE=4,
SIXF_ABSOLUTEMOMENTUM=8, SIXF_ABSOLUTEVELOCITY=8,
SIXF_SETMASTER=16, SIXF_SETMASTER=16,
SIXF_NOCHECKPOSITION=32, SIXF_NOCHECKPOSITION=32,
SIXF_TELEFRAG=64, SIXF_TELEFRAG=64,
@ -1466,9 +1466,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx)
ACTION_PARAM_FIXED(xofs, 1); ACTION_PARAM_FIXED(xofs, 1);
ACTION_PARAM_FIXED(yofs, 2); ACTION_PARAM_FIXED(yofs, 2);
ACTION_PARAM_FIXED(zofs, 3); ACTION_PARAM_FIXED(zofs, 3);
ACTION_PARAM_FIXED(xmom, 4); ACTION_PARAM_FIXED(xvel, 4);
ACTION_PARAM_FIXED(ymom, 5); ACTION_PARAM_FIXED(yvel, 5);
ACTION_PARAM_FIXED(zmom, 6); ACTION_PARAM_FIXED(zvel, 6);
ACTION_PARAM_ANGLE(Angle, 7); ACTION_PARAM_ANGLE(Angle, 7);
ACTION_PARAM_INT(flags, 8); ACTION_PARAM_INT(flags, 8);
ACTION_PARAM_INT(chance, 9); 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]); y = self->y + FixedMul(xofs, finesine[ang]) - FixedMul(yofs, finecosine[ang]);
} }
if (!(flags & SIXF_ABSOLUTEMOMENTUM)) if (!(flags & SIXF_ABSOLUTEVELOCITY))
{ {
// Same orientation issue here! // Same orientation issue here!
fixed_t newxmom = FixedMul(xmom, finecosine[ang]) + FixedMul(ymom, finesine[ang]); fixed_t newxvel = FixedMul(xvel, finecosine[ang]) + FixedMul(yvel, finesine[ang]);
ymom = FixedMul(xmom, finesine[ang]) - FixedMul(ymom, finecosine[ang]); yvel = FixedMul(xvel, finesine[ang]) - FixedMul(yvel, finecosine[ang]);
xmom = newxmom; 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); bool res = InitSpawnedItem(self, mo, flags);
ACTION_SET_RESULT(res); // for an inventory item's use state ACTION_SET_RESULT(res); // for an inventory item's use state
if (mo) if (mo)
{ {
mo->momx=xmom; mo->velx = xvel;
mo->momy=ymom; mo->vely = yvel;
mo->momz=zmom; mo->velz = zvel;
mo->angle=Angle; mo->angle = Angle;
if (flags & SIXF_TRANSFERAMBUSHFLAG) mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH); 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_START(5);
ACTION_PARAM_CLASS(missile, 0); ACTION_PARAM_CLASS(missile, 0);
ACTION_PARAM_FIXED(zheight, 1); ACTION_PARAM_FIXED(zheight, 1);
ACTION_PARAM_FIXED(xymom, 2); ACTION_PARAM_FIXED(xyvel, 2);
ACTION_PARAM_FIXED(zmom, 3); ACTION_PARAM_FIXED(zvel, 3);
ACTION_PARAM_BOOL(useammo, 4); ACTION_PARAM_BOOL(useammo, 4);
if (missile == NULL) return; if (missile == NULL) return;
@ -1565,18 +1566,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
int pitch = self->pitch; int pitch = self->pitch;
P_PlaySpawnSound(bo, self); P_PlaySpawnSound(bo, self);
if (xymom) bo->Speed=xymom; if (xyvel)
bo->angle = self->angle+(((pr_grenade()&7)-4)<<24); bo->Speed = xyvel;
bo->momz = zmom + 2*finesine[pitch>>ANGLETOFINESHIFT]; bo->angle = self->angle + (((pr_grenade()&7) - 4) << 24);
bo->velz = zvel + 2*finesine[pitch>>ANGLETOFINESHIFT];
bo->z += 2 * finesine[pitch>>ANGLETOFINESHIFT]; bo->z += 2 * finesine[pitch>>ANGLETOFINESHIFT];
P_ThrustMobj(bo, bo->angle, bo->Speed); P_ThrustMobj(bo, bo->angle, bo->Speed);
bo->momx += self->momx>>1; bo->velx += self->velx >> 1;
bo->momy += self->momy>>1; bo->vely += self->vely >> 1;
bo->target= self; bo->target= self;
if (bo->flags4&MF4_RANDOMIZE) if (bo->flags4&MF4_RANDOMIZE)
{ {
bo->tics -= pr_grenade()&3; bo->tics -= pr_grenade() & 3;
if (bo->tics<1) bo->tics=1; if (bo->tics < 1)
bo->tics = 1;
} }
P_CheckMissileSpawn (bo); P_CheckMissileSpawn (bo);
} }
@ -1592,12 +1595,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil)
{ {
ACTION_PARAM_START(1); ACTION_PARAM_START(1);
ACTION_PARAM_FIXED(xymom, 0); ACTION_PARAM_FIXED(xyvel, 0);
angle_t angle = self->angle + ANG180; angle_t angle = self->angle + ANG180;
angle >>= ANGLETOFINESHIFT; angle >>= ANGLETOFINESHIFT;
self->momx += FixedMul (xymom, finecosine[angle]); self->velx += FixedMul (xyvel, finecosine[angle]);
self->momy += FixedMul (xymom, finesine[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) if (mo && i < mo->GetClass()->ActorInfo->NumOwnedStates)
{ {
mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i); mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i);
mo->momz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT); mo->velz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT);
mo->momx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); mo->velx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
mo->momy = 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; if (chunk == NULL) return;
self->momx = self->momy = self->momz = 0; self->velx = self->vely = self->velz = 0;
self->height = self->GetDefault()->height; self->height = self->GetDefault()->height;
// [RH] In Hexen, this creates a random number of shards (range [24,56]) // [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) if (mo)
{ {
mo->momz = FixedDiv(mo->z-self->z, self->height)<<2; mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
mo->momx = pr_burst.Random2 () << (FRACBITS-7); mo->velx = pr_burst.Random2 () << (FRACBITS-7);
mo->momy = pr_burst.Random2 () << (FRACBITS-7); mo->vely = pr_burst.Random2 () << (FRACBITS-7);
mo->RenderStyle = self->RenderStyle; mo->RenderStyle = self->RenderStyle;
mo->alpha = self->alpha; mo->alpha = self->alpha;
mo->CopyFriendliness(self, true); mo->CopyFriendliness(self, true);
@ -2024,18 +2027,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling)
//=========================================================================== //===========================================================================
// //
// A_Stop // A_Stop
// resets all momentum of the actor to 0 // resets all velocity of the actor to 0
// //
//=========================================================================== //===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_Stop) 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)) if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING))
{ {
self->player->mo->PlayIdle (); self->player->mo->PlayIdle();
self->player->momx = self->player->momy = 0; self->player->velx = self->player->vely = 0;
} }
} }
//=========================================================================== //===========================================================================

View file

@ -69,9 +69,12 @@ DEFINE_MEMBER_VARIABLE(waterlevel, AActor)
DEFINE_MEMBER_VARIABLE(x, AActor) DEFINE_MEMBER_VARIABLE(x, AActor)
DEFINE_MEMBER_VARIABLE(y, AActor) DEFINE_MEMBER_VARIABLE(y, AActor)
DEFINE_MEMBER_VARIABLE(z, AActor) DEFINE_MEMBER_VARIABLE(z, AActor)
DEFINE_MEMBER_VARIABLE(momx, AActor) DEFINE_MEMBER_VARIABLE(velx, AActor)
DEFINE_MEMBER_VARIABLE(momy, AActor) DEFINE_MEMBER_VARIABLE(vely, AActor)
DEFINE_MEMBER_VARIABLE(momz, 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) DEFINE_MEMBER_VARIABLE(Damage, AActor)
//========================================================================== //==========================================================================

View file

@ -982,7 +982,7 @@ DEFINE_PROPERTY(cameraheight, F, Actor)
DEFINE_PROPERTY(vspeed, F, Actor) DEFINE_PROPERTY(vspeed, F, Actor)
{ {
PROP_FIXED_PARM(i, 0); PROP_FIXED_PARM(i, 0);
defaults->momz = i; defaults->velz = i;
} }
//========================================================================== //==========================================================================

View file

@ -38,9 +38,12 @@ ACTOR Actor native //: Thinker
native fixed_t x; native fixed_t x;
native fixed_t y; native fixed_t y;
native fixed_t z; native fixed_t z;
native fixed_t momx; native fixed_t velx;
native fixed_t momy; native fixed_t vely;
native fixed_t momz; 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_MonsterRail();
action native A_BFGSpray(class<Actor> spraytype = "BFGExtra", int numrays = 40, int damagecount = 15); action native A_BFGSpray(class<Actor> spraytype = "BFGExtra", int numrays = 40, int damagecount = 15);
@ -180,7 +183,7 @@ ACTOR Actor native //: Thinker
action native A_GiveInventory(class<Inventory> itemtype, int amount = 0); action native A_GiveInventory(class<Inventory> itemtype, int amount = 0);
action native A_TakeInventory(class<Inventory> itemtype, int amount = 0); action native A_TakeInventory(class<Inventory> itemtype, int amount = 0);
action native A_SpawnItem(class<Actor> itemtype, float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false); action native A_SpawnItem(class<Actor> itemtype, float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false);
action native A_SpawnItemEx(class<Actor> 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<Actor> 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_Print(string whattoprint, float time = 0, string fontname = "");
action native A_SetTranslucent(float alpha, int style = 0); action native A_SetTranslucent(float alpha, int style = 0);
action native A_FadeIn(float reduce = 0.1); 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_CheckCeiling(state label);
action native A_PlayerSkinCheck(state label); action native A_PlayerSkinCheck(state label);
action native A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, float missileheight); action native A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, float missileheight);
action native A_ThrowGrenade(class<Actor> itemtype, float zheight = 0, float xymom = 0, float zmom = 0, bool useammo = true); action native A_ThrowGrenade(class<Actor> 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<Inventory> itemtype, int amount, state label); action native A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label);
action native A_GiveToTarget(class<Inventory> itemtype, int amount = 0); action native A_GiveToTarget(class<Inventory> itemtype, int amount = 0);
action native A_TakeFromTarget(class<Inventory> itemtype, int amount = 0); action native A_TakeFromTarget(class<Inventory> itemtype, int amount = 0);

View file

@ -10,6 +10,7 @@ const int SXF_TRANSFERTRANSLATION=1;
const int SXF_ABSOLUTEPOSITION=2; const int SXF_ABSOLUTEPOSITION=2;
const int SXF_ABSOLUTEANGLE=4; const int SXF_ABSOLUTEANGLE=4;
const int SXF_ABSOLUTEMOMENTUM=8; const int SXF_ABSOLUTEMOMENTUM=8;
const int SXF_ABSOLUTEVELOCITY=8;
const int SXF_SETMASTER=16; const int SXF_SETMASTER=16;
const int SXF_NOCHECKPOSITION = 32; const int SXF_NOCHECKPOSITION = 32;
const int SXF_TELEFRAG=64; const int SXF_TELEFRAG=64;

View file

@ -20,7 +20,7 @@ ACTOR Demon1 31
DeathSound "DemonDeath" DeathSound "DemonDeath"
ActiveSound "DemonActive" ActiveSound "DemonActive"
Obituary "$OB_DEMON1" Obituary "$OB_DEMON1"
const int ChunkFlags = SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM; const int ChunkFlags = SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEVELOCITY;
States States
{ {
Spawn: Spawn:

View file

@ -51,7 +51,7 @@ ACTOR Ettin 10030
ETTB C 4 A_SpawnItemEx("EttinMace", 0,0,8.5, ETTB C 4 A_SpawnItemEx("EttinMace", 0,0,8.5,
random[DropMace](-128,127) * 0.03125, random[DropMace](-128,127) * 0.03125,
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 D 4 A_Scream
ETTB E 4 A_QueueCorpse ETTB E 4 A_QueueCorpse
ETTB FGHIJK 4 ETTB FGHIJK 4