mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Let jawz wall transfer; don't thrust in air
This commit is contained in:
parent
b6b7d7a93e
commit
79f4454016
2 changed files with 43 additions and 50 deletions
|
|
@ -13210,7 +13210,6 @@ void A_ItemPop(mobj_t *actor)
|
||||||
|
|
||||||
void A_JawzChase(mobj_t *actor)
|
void A_JawzChase(mobj_t *actor)
|
||||||
{
|
{
|
||||||
const fixed_t currentspeed = R_PointToDist2(0, 0, actor->momx, actor->momy);
|
|
||||||
player_t *player;
|
player_t *player;
|
||||||
fixed_t thrustamount = 0;
|
fixed_t thrustamount = 0;
|
||||||
fixed_t frictionsafety = (actor->friction == 0) ? 1 : actor->friction;
|
fixed_t frictionsafety = (actor->friction == 0) ? 1 : actor->friction;
|
||||||
|
|
@ -13295,30 +13294,29 @@ void A_JawzChase(mobj_t *actor)
|
||||||
P_SetTarget(&actor->tracer, NULL);
|
P_SetTarget(&actor->tracer, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!P_IsObjectOnGround(actor))
|
|
||||||
{
|
|
||||||
// No friction in the air
|
|
||||||
frictionsafety = FRACUNIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentspeed >= topspeed)
|
|
||||||
{
|
|
||||||
// Thrust as if you were at top speed, slow down naturally
|
|
||||||
thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed;
|
|
||||||
// Thrust to immediately get to top speed
|
|
||||||
thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!actor->tracer)
|
if (!actor->tracer)
|
||||||
{
|
{
|
||||||
actor->angle = K_MomentumAngle(actor);
|
actor->angle = K_MomentumAngle(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
P_Thrust(actor, actor->angle, thrustamount);
|
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
|
||||||
|
thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed;
|
||||||
|
// Thrust to immediately get to top speed
|
||||||
|
thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety);
|
||||||
|
}
|
||||||
|
|
||||||
|
P_Thrust(actor, actor->angle, thrustamount);
|
||||||
|
}
|
||||||
|
|
||||||
if ((actor->tracer != NULL) && (actor->tracer->health > 0))
|
if ((actor->tracer != NULL) && (actor->tracer->health > 0))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
55
src/p_mobj.c
55
src/p_mobj.c
|
|
@ -1594,21 +1594,7 @@ void P_XYMovement(mobj_t *mo)
|
||||||
else if (P_MobjWasRemoved(mo))
|
else if (P_MobjWasRemoved(mo))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//{ SRB2kart - Jawz
|
if (mo->flags & MF_MISSILE)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
// explode a missile
|
// explode a missile
|
||||||
if (P_CheckSkyHit(mo))
|
if (P_CheckSkyHit(mo))
|
||||||
|
|
@ -1745,23 +1731,32 @@ void P_XYMovement(mobj_t *mo)
|
||||||
fx->scale = mo->scale;
|
fx->scale = mo->scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mo->type == MT_ORBINAUT) // Orbinaut speed decreasing
|
switch (mo->type)
|
||||||
{
|
{
|
||||||
if (mo->health > 1)
|
case MT_ORBINAUT: // Orbinaut speed decreasing
|
||||||
{
|
if (mo->health > 1)
|
||||||
S_StartSound(mo, mo->info->attacksound);
|
{
|
||||||
mo->health--;
|
S_StartSound(mo, mo->info->attacksound);
|
||||||
mo->threshold = 0;
|
mo->health--;
|
||||||
}
|
mo->threshold = 0;
|
||||||
else if (mo->health == 1)
|
}
|
||||||
{
|
/*FALLTHRU*/
|
||||||
// This Item Damage
|
|
||||||
S_StartSound(mo, mo->info->deathsound);
|
|
||||||
P_KillMobj(mo, NULL, NULL, DMG_NORMAL);
|
|
||||||
|
|
||||||
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
|
case MT_JAWZ:
|
||||||
P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT);
|
case 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);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bubble bounce
|
// Bubble bounce
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue