Allow JumpSpin abilities to be used with non-ability shields

This commit is contained in:
lachwright 2020-09-16 16:50:10 +09:30
parent 543cc21bf4
commit 0a7802c8e9

View file

@ -5007,40 +5007,14 @@ static void P_DoTwinSpin(player_t *player)
}
//
// P_DoJumpStuff
// returns true if the player used a shield ability, false otherwise
// passing in the mobjs from P_DoJumpStuff is a bit hackily specific, but I don't care enough to make a more elaborate solution (I think that is more appropriately approached with a more general MT_LOCKON spawning system)
//
// Handles player jumping
//
static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
static boolean P_PlayerShieldThink(player_t *player, ticcmd_t *cmd, mobj_t *lockonthok, mobj_t *visual)
{
mobj_t *lockonthok = NULL, *lockonshield = NULL, *visual = NULL;
mobj_t *lockonshield = NULL;
if (player->pflags & PF_JUMPSTASIS)
return;
if ((player->charability == CA_HOMINGTHOK) && !player->homing && (player->pflags & PF_JUMPED) && (!(player->pflags & PF_THOKKED) || (player->charflags & SF_MULTIABILITY)) && (lockonthok = P_LookForEnemies(player, true, false)))
{
if (P_IsLocalPlayer(player)) // Only display it on your own view.
{
visual = P_SpawnMobj(lockonthok->x, lockonthok->y, lockonthok->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker
P_SetTarget(&visual->target, lockonthok);
}
}
//////////////////
//SHIELD ACTIVES//
//& SUPER FLOAT!//
//////////////////
if ((player->pflags & PF_JUMPED) && !player->exiting && !P_PlayerInPain(player))
{
if (onground || player->climbing || player->powers[pw_carry])
;
else if ((gametyperules & GTR_TEAMFLAGS) && player->gotflag)
;
else if (player->pflags & (PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player has used an ability previously
;
else if ((player->powers[pw_shield] & SH_NOSTACK) && !player->powers[pw_super] && !(player->pflags & PF_SPINDOWN)
if ((player->powers[pw_shield] & SH_NOSTACK) && !player->powers[pw_super] && !(player->pflags & PF_SPINDOWN)
&& ((!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX)))) // thokked is optional if you're bubblewrapped
{
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)
@ -5139,7 +5113,47 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
}
}
}
return player->pflags & PF_SHIELDABILITY;
}
return false;
}
//
// P_DoJumpStuff
//
// Handles player jumping
//
static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
{
mobj_t *lockonthok = NULL, *visual = NULL;
if (player->pflags & PF_JUMPSTASIS)
return;
if ((player->charability == CA_HOMINGTHOK) && !player->homing && (player->pflags & PF_JUMPED) && (!(player->pflags & PF_THOKKED) || (player->charflags & SF_MULTIABILITY)) && (lockonthok = P_LookForEnemies(player, true, false)))
{
if (P_IsLocalPlayer(player)) // Only display it on your own view.
{
visual = P_SpawnMobj(lockonthok->x, lockonthok->y, lockonthok->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker
P_SetTarget(&visual->target, lockonthok);
}
}
//////////////////
//SHIELD ACTIVES//
//& SUPER FLOAT!//
//////////////////
if ((player->pflags & PF_JUMPED) && !player->exiting && !P_PlayerInPain(player))
{
if (onground || player->climbing || player->powers[pw_carry])
;
else if ((gametyperules & GTR_TEAMFLAGS) && player->gotflag)
;
else if (player->pflags & (PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player has used an ability previously
;
else if (P_PlayerShieldThink(player, cmd, lockonthok, visual))
;
else if ((cmd->buttons & BT_SPIN))
{
if (!(player->pflags & PF_SPINDOWN) && P_SuperReady(player))