mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Improve glide bounces
This commit is contained in:
parent
7d57d53d45
commit
5bbd56b6fa
1 changed files with 13 additions and 4 deletions
|
@ -471,10 +471,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
toucher->momy = -toucher->momy;
|
||||
if (player->charability == CA_FLY && player->panim == PA_ABILITY)
|
||||
toucher->momz = -toucher->momz/2;
|
||||
else if (player->charability == CA_GLIDEANDCLIMB && player->pflags & PF_GLIDING && !P_IsObjectOnGround(player->mo))
|
||||
else if (player->pflags & PF_GLIDING && !P_IsObjectOnGround(toucher))
|
||||
{
|
||||
player->pflags &= ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE);
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
|
||||
P_SetPlayerMobjState(toucher, S_PLAY_FALL);
|
||||
toucher->momz += P_MobjFlip(toucher) * (player->speed >> 3);
|
||||
toucher->momx = 7*toucher->momx>>3;
|
||||
toucher->momy = 7*toucher->momy>>3;
|
||||
}
|
||||
}
|
||||
P_DamageMobj(special, toucher, toucher, 1, 0);
|
||||
|
@ -1514,10 +1517,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
toucher->momx = P_ReturnThrustX(special, angle, touchspeed);
|
||||
toucher->momy = P_ReturnThrustY(special, angle, touchspeed);
|
||||
toucher->momz = -toucher->momz;
|
||||
if (player->pflags & PF_GLIDING)
|
||||
if (player->pflags & PF_GLIDING && !P_IsObjectOnGround(toucher))
|
||||
{
|
||||
player->pflags &= ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE);
|
||||
P_SetPlayerMobjState(toucher, S_PLAY_FALL);
|
||||
toucher->momz += P_MobjFlip(toucher) * (player->speed >> 3);
|
||||
toucher->momx = 7*toucher->momx>>3;
|
||||
toucher->momy = 7*toucher->momy>>3;
|
||||
}
|
||||
player->homing = 0;
|
||||
|
||||
|
@ -1562,10 +1568,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
toucher->momx = P_ReturnThrustX(special, special->angle, touchspeed);
|
||||
toucher->momy = P_ReturnThrustY(special, special->angle, touchspeed);
|
||||
toucher->momz = -toucher->momz;
|
||||
if (player->pflags & PF_GLIDING)
|
||||
if (player->pflags & PF_GLIDING && !P_IsObjectOnGround(toucher))
|
||||
{
|
||||
player->pflags &= ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE);
|
||||
P_SetPlayerMobjState(toucher, S_PLAY_FALL);
|
||||
toucher->momz += P_MobjFlip(toucher) * (player->speed >> 3);
|
||||
toucher->momx = 7*toucher->momx>>3;
|
||||
toucher->momy = 7*toucher->momy>>3;
|
||||
}
|
||||
player->homing = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue