mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-24 03:32:22 +00:00
* You can now bounce off of springs without unbouncing.
* You can now bounce off the bottom of goop areas. * Fixed that long-standing bug where you could accelerate whilst rolling.
This commit is contained in:
parent
7b4688732b
commit
8cdcb2c416
3 changed files with 32 additions and 14 deletions
15
src/p_map.c
15
src/p_map.c
|
@ -203,7 +203,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
}
|
||||
}
|
||||
|
||||
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these.
|
||||
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY|PF_BOUNCING); // I still need these.
|
||||
jumping = object->player->jumping;
|
||||
secondjump = object->player->secondjump;
|
||||
P_ResetPlayer(object->player);
|
||||
|
@ -213,13 +213,10 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
object->player->pflags |= PF_JUMPED;
|
||||
P_SetPlayerMobjState(object, S_PLAY_JUMP);
|
||||
}
|
||||
else if (P_MobjFlip(object)*vertispeed > 0)
|
||||
P_SetPlayerMobjState(object, S_PLAY_SPRING);
|
||||
else if (P_MobjFlip(object)*vertispeed < 0)
|
||||
P_SetPlayerMobjState(object, S_PLAY_FALL);
|
||||
else // horizontal spring
|
||||
else if (!vertispeed || (pflags & PF_BOUNCING)) // horizontal spring or bouncing
|
||||
{
|
||||
if (pflags & (PF_JUMPED|PF_SPINNING) && (object->player->panim == PA_ROLL || object->player->panim == PA_JUMP || object->player->panim == PA_FALL))
|
||||
if ((pflags & PF_BOUNCING)
|
||||
|| (pflags & (PF_JUMPED|PF_SPINNING) && (object->player->panim == PA_ROLL || object->player->panim == PA_JUMP || object->player->panim == PA_FALL)))
|
||||
{
|
||||
object->player->pflags |= pflags;
|
||||
object->player->jumping = jumping;
|
||||
|
@ -228,6 +225,10 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
else
|
||||
P_SetPlayerMobjState(object, S_PLAY_WALK);
|
||||
}
|
||||
else if (P_MobjFlip(object)*vertispeed > 0)
|
||||
P_SetPlayerMobjState(object, S_PLAY_SPRING);
|
||||
else
|
||||
P_SetPlayerMobjState(object, S_PLAY_FALL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1924,9 +1924,12 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
|
|||
// spinning friction
|
||||
if (player->pflags & PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH))
|
||||
{
|
||||
const fixed_t ns = FixedDiv(549*ORIG_FRICTION,500*FRACUNIT);
|
||||
mo->momx = FixedMul(mo->momx, ns);
|
||||
mo->momy = FixedMul(mo->momy, ns);
|
||||
if (twodlevel || player->mo->flags2 & MF2_TWOD) // Otherwise handled in P_3DMovement
|
||||
{
|
||||
const fixed_t ns = FixedDiv(549*ORIG_FRICTION,500*FRACUNIT);
|
||||
mo->momx = FixedMul(mo->momx, ns);
|
||||
mo->momy = FixedMul(mo->momy, ns);
|
||||
}
|
||||
}
|
||||
else if (abs(player->rmomx) < FixedMul(STOPSPEED, mo->scale)
|
||||
&& abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale)
|
||||
|
|
22
src/p_user.c
22
src/p_user.c
|
@ -1185,7 +1185,7 @@ boolean P_IsObjectInGoop(mobj_t *mo)
|
|||
//
|
||||
boolean P_IsObjectOnGround(mobj_t *mo)
|
||||
{
|
||||
if (P_IsObjectInGoop(mo))
|
||||
if (P_IsObjectInGoop(mo) && !(mo->player && mo->player->pflags & PF_BOUNCING))
|
||||
{
|
||||
/*
|
||||
// It's a crazy hack that checking if you're on the ground
|
||||
|
@ -3998,8 +3998,8 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz)
|
|||
return;
|
||||
if (changemomz)
|
||||
{
|
||||
prevmomz = P_MobjFlip(player->mo)*player->mo->momz;
|
||||
if (prevmomz < 0)
|
||||
prevmomz = player->mo->momz;
|
||||
if (P_MobjFlip(player->mo)*prevmomz < 0)
|
||||
prevmomz = 0;
|
||||
else if (player->mo->eflags & MFE_UNDERWATER)
|
||||
prevmomz /= 2;
|
||||
|
@ -4532,6 +4532,8 @@ static void P_2dMovement(player_t *player)
|
|||
player->skidtime = 0;
|
||||
}
|
||||
}
|
||||
if (player->pflags & PF_BOUNCING)
|
||||
player->pflags &= ~PF_BOUNCING;
|
||||
if (player->pflags & PF_SPINNING && !player->exiting)
|
||||
{
|
||||
player->pflags &= ~PF_SPINNING;
|
||||
|
@ -4691,6 +4693,7 @@ static void P_3dMovement(player_t *player)
|
|||
angle_t dangle; // replaces old quadrants bits
|
||||
fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
||||
boolean analogmove = false;
|
||||
boolean spin = (player->pflags & PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH));
|
||||
fixed_t oldMagnitude, newMagnitude;
|
||||
#ifdef ESLOPE
|
||||
vector3_t totalthrust;
|
||||
|
@ -4720,6 +4723,8 @@ static void P_3dMovement(player_t *player)
|
|||
player->skidtime = 0;
|
||||
}
|
||||
}
|
||||
if (player->pflags & PF_BOUNCING)
|
||||
player->pflags &= ~PF_BOUNCING;
|
||||
if (player->pflags & PF_SPINNING && !player->exiting)
|
||||
{
|
||||
player->pflags &= ~PF_SPINNING;
|
||||
|
@ -4838,6 +4843,15 @@ static void P_3dMovement(player_t *player)
|
|||
topspeed = normalspd;
|
||||
}
|
||||
|
||||
if (spin) // Prevent gaining speed whilst rolling!
|
||||
{
|
||||
const fixed_t ns = FixedDiv(549*ORIG_FRICTION,500*FRACUNIT); // P_XYFriction
|
||||
if (onground)
|
||||
topspeed = FixedMul(oldMagnitude, ns);
|
||||
else
|
||||
topspeed = oldMagnitude;
|
||||
}
|
||||
|
||||
// Better maneuverability while flying
|
||||
if (player->powers[pw_tailsfly])
|
||||
{
|
||||
|
@ -5015,7 +5029,7 @@ static void P_3dMovement(player_t *player)
|
|||
if (newMagnitude > topspeed)
|
||||
{
|
||||
fixed_t tempmomx, tempmomy;
|
||||
if (oldMagnitude > topspeed)
|
||||
if (oldMagnitude > topspeed && !spin)
|
||||
{
|
||||
if (newMagnitude > oldMagnitude)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue