Let jawz wall transfer; don't thrust in air

This commit is contained in:
James R 2022-09-23 21:06:33 -07:00
parent b6b7d7a93e
commit 79f4454016
2 changed files with 43 additions and 50 deletions

View file

@ -13210,7 +13210,6 @@ void A_ItemPop(mobj_t *actor)
void A_JawzChase(mobj_t *actor)
{
const fixed_t currentspeed = R_PointToDist2(0, 0, actor->momx, actor->momy);
player_t *player;
fixed_t thrustamount = 0;
fixed_t frictionsafety = (actor->friction == 0) ? 1 : actor->friction;
@ -13295,12 +13294,15 @@ void A_JawzChase(mobj_t *actor)
P_SetTarget(&actor->tracer, NULL);
}
if (!P_IsObjectOnGround(actor))
if (!actor->tracer)
{
// No friction in the air
frictionsafety = FRACUNIT;
actor->angle = K_MomentumAngle(actor);
}
if (P_IsObjectOnGround(actor))
{
const fixed_t currentspeed = R_PointToDist2(0, 0, actor->momx, actor->momy);
if (currentspeed >= topspeed)
{
// Thrust as if you were at top speed, slow down naturally
@ -13313,12 +13315,8 @@ void A_JawzChase(mobj_t *actor)
thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety);
}
if (!actor->tracer)
{
actor->angle = K_MomentumAngle(actor);
}
P_Thrust(actor, actor->angle, thrustamount);
}
if ((actor->tracer != NULL) && (actor->tracer->health > 0))
return;

View file

@ -1594,21 +1594,7 @@ void P_XYMovement(mobj_t *mo)
else if (P_MobjWasRemoved(mo))
return;
//{ SRB2kart - Jawz
if (mo->type == MT_JAWZ || mo->type == MT_JAWZ_DUD)
{
if (mo->health == 1)
{
// This Item Damage
S_StartSound(mo, mo->info->deathsound);
P_KillMobj(mo, NULL, NULL, DMG_NORMAL);
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT);
}
}
//}
else if (mo->flags & MF_MISSILE)
if (mo->flags & MF_MISSILE)
{
// explode a missile
if (P_CheckSkyHit(mo))
@ -1745,15 +1731,20 @@ void P_XYMovement(mobj_t *mo)
fx->scale = mo->scale;
}
if (mo->type == MT_ORBINAUT) // Orbinaut speed decreasing
switch (mo->type)
{
case MT_ORBINAUT: // Orbinaut speed decreasing
if (mo->health > 1)
{
S_StartSound(mo, mo->info->attacksound);
mo->health--;
mo->threshold = 0;
}
else if (mo->health == 1)
/*FALLTHRU*/
case MT_JAWZ:
case MT_JAWZ_DUD:
if (mo->health == 1)
{
// This Item Damage
S_StartSound(mo, mo->info->deathsound);
@ -1762,6 +1753,10 @@ void P_XYMovement(mobj_t *mo)
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT);
}
break;
default:
break;
}
// Bubble bounce