mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Merge branch 'bubbleshieldoverhaul' into 'next'
Bubble Shield overhaul See merge request STJr/SRB2!1046
This commit is contained in:
commit
df98601b12
3 changed files with 36 additions and 10 deletions
|
@ -467,10 +467,22 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1))
|
||||
{
|
||||
if (elementalpierce == 2)
|
||||
P_DoBubbleBounce(player);
|
||||
else if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
|
||||
toucher->momz = -toucher->momz;
|
||||
if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
|
||||
{
|
||||
fixed_t setmomz = -toucher->momz; // Store this, momz get changed by P_DoJump within P_DoBubbleBounce
|
||||
|
||||
if (elementalpierce == 2) // Reset bubblewrap, part 1
|
||||
P_DoBubbleBounce(player);
|
||||
toucher->momz = setmomz;
|
||||
if (elementalpierce == 2) // Reset bubblewrap, part 2
|
||||
{
|
||||
boolean underwater = toucher->eflags & MFE_UNDERWATER;
|
||||
|
||||
if (underwater)
|
||||
toucher->momz /= 2;
|
||||
toucher->momz -= (toucher->momz/(underwater ? 8 : 4)); // Cap the height!
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player->pflags & PF_BOUNCING)
|
||||
P_DoAbilityBounce(player, false);
|
||||
|
|
18
src/p_map.c
18
src/p_map.c
|
@ -1678,13 +1678,23 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
&& (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up
|
||||
&& (elementalpierce != 1)) // you're not piercing through the monitor...
|
||||
{
|
||||
if (elementalpierce == 2)
|
||||
P_DoBubbleBounce(player);
|
||||
else if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
|
||||
if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
|
||||
{
|
||||
*momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
|
||||
fixed_t setmomz = -*momz; // Store this, momz get changed by P_DoJump within P_DoBubbleBounce
|
||||
|
||||
if (elementalpierce == 2) // Reset bubblewrap, part 1
|
||||
P_DoBubbleBounce(player);
|
||||
*momz = setmomz; // Therefore, you should be thrust in the opposite direction, vertically.
|
||||
if (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)
|
||||
P_TwinSpinRejuvenate(player, player->thokitem);
|
||||
if (elementalpierce == 2) // Reset bubblewrap, part 2
|
||||
{
|
||||
boolean underwater = tmthing->eflags & MFE_UNDERWATER;
|
||||
|
||||
if (underwater)
|
||||
*momz /= 2;
|
||||
*momz -= (*momz/(underwater ? 8 : 4)); // Cap the height!
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough.
|
||||
|
|
|
@ -4863,7 +4863,7 @@ void P_DoBubbleBounce(player_t *player)
|
|||
player->pflags |= PF_THOKKED;
|
||||
player->pflags &= ~PF_STARTJUMP;
|
||||
player->secondjump = UINT8_MAX;
|
||||
player->mo->momz = FixedMul(player->mo->momz, 5*FRACUNIT/4);
|
||||
player->mo->momz = FixedMul(player->mo->momz, 11*FRACUNIT/8);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -5112,15 +5112,19 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
boolean elem = ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL);
|
||||
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
|
||||
if (elem)
|
||||
{
|
||||
player->mo->momx = player->mo->momy = 0;
|
||||
S_StartSound(player->mo, sfx_s3k43);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->mo->momx -= (player->mo->momx/3);
|
||||
player->mo->momy -= (player->mo->momy/3);
|
||||
player->pflags &= ~PF_NOJUMPDAMAGE;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);
|
||||
S_StartSound(player->mo, sfx_s3k44);
|
||||
}
|
||||
player->secondjump = 0;
|
||||
player->mo->momx = player->mo->momy = 0;
|
||||
P_SetObjectMomZ(player->mo, -24*FRACUNIT, false);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue