mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 23:42:11 +00:00
Force Shield's air ability is now the Drop Dash (thanks, Sonic Mania, for making me like the momentum redirection idea by recontextualising it to collision with the ground only!)
* Press spin in midair to make the shield flash solid repeatedly and make a number of ding noises. * When the player with a flashing, dinging shield hits the ground, they are sent off in spinning form at the maximum of 2*abs(momz) VS the 3D hypotenuse of momx, momy, and momz.
This commit is contained in:
parent
0fefd86d1e
commit
ad03bb5278
2 changed files with 44 additions and 8 deletions
43
src/p_mobj.c
43
src/p_mobj.c
|
@ -2981,14 +2981,25 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||||
if (!(mo->player->pflags & PF_GLIDING))
|
if (!(mo->player->pflags & PF_GLIDING))
|
||||||
mo->player->pflags &= ~PF_JUMPED;
|
mo->player->pflags &= ~PF_JUMPED;
|
||||||
|
|
||||||
if (((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mo->player->pflags & PF_SHIELDABILITY)) // Elemental pierce attack.
|
if (mo->player->pflags & PF_SHIELDABILITY)
|
||||||
{
|
{
|
||||||
if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound
|
if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) // Elemental shield's stomp attack.
|
||||||
S_StartSound(mo, sfx_s3k4c);
|
|
||||||
else // create a fire pattern on the ground
|
|
||||||
{
|
{
|
||||||
S_StartSound(mo, sfx_s3k47);
|
if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound
|
||||||
P_ElementalFire(mo->player, true);
|
S_StartSound(mo, sfx_s3k4c);
|
||||||
|
else // create a fire pattern on the ground
|
||||||
|
{
|
||||||
|
S_StartSound(mo, sfx_s3k47);
|
||||||
|
P_ElementalFire(mo->player, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash.
|
||||||
|
{
|
||||||
|
fixed_t magnitude = max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2); // vertical momentum is amplified here, since otherwise this was kind of weak.
|
||||||
|
P_InstaThrust(mo, mo->angle, magnitude);
|
||||||
|
S_StartSound(mo, sfx_zoom);
|
||||||
|
mo->player->pflags |= PF_SPINNING;
|
||||||
|
P_SetPlayerMobjState(mo, S_PLAY_SPIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY);
|
mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY);
|
||||||
|
@ -6482,7 +6493,6 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
case MT_BLACKORB:
|
case MT_BLACKORB:
|
||||||
case MT_WHITEORB:
|
case MT_WHITEORB:
|
||||||
case MT_GREENORB:
|
case MT_GREENORB:
|
||||||
case MT_BLUEORB:
|
|
||||||
case MT_PITYORB:
|
case MT_PITYORB:
|
||||||
if (!P_AddShield(mobj))
|
if (!P_AddShield(mobj))
|
||||||
return;
|
return;
|
||||||
|
@ -6490,9 +6500,26 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
case MT_YELLOWORB:
|
case MT_YELLOWORB:
|
||||||
if (!P_AddShield(mobj))
|
if (!P_AddShield(mobj))
|
||||||
return;
|
return;
|
||||||
if (mobj->target->player->homing)
|
if ((mobj->target)
|
||||||
|
&& (mobj->target->player)
|
||||||
|
&& (mobj->target->player->homing))
|
||||||
P_SetMobjState(mobj, mobj->info->painstate);
|
P_SetMobjState(mobj, mobj->info->painstate);
|
||||||
break;
|
break;
|
||||||
|
case MT_BLUEORB:
|
||||||
|
if (!P_AddShield(mobj))
|
||||||
|
return;
|
||||||
|
if ((mobj->target)
|
||||||
|
&& (mobj->target->player)
|
||||||
|
&& (mobj->target->player->pflags & PF_SHIELDABILITY))
|
||||||
|
{
|
||||||
|
mobj->frame &= ~FF_TRANSMASK;
|
||||||
|
if (!(leveltime & 15))
|
||||||
|
{
|
||||||
|
S_StopSound(mobj->target);
|
||||||
|
S_StartSound(mobj->target, sfx_ding);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MT_WATERDROP:
|
case MT_WATERDROP:
|
||||||
P_SceneryCheckWater(mobj);
|
P_SceneryCheckWater(mobj);
|
||||||
if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop)
|
if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop)
|
||||||
|
|
|
@ -6940,6 +6940,15 @@ static void P_MovePlayer(player_t *player)
|
||||||
P_SetObjectMomZ(player->mo, -24*FRACUNIT, false);
|
P_SetObjectMomZ(player->mo, -24*FRACUNIT, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Force shield activation
|
||||||
|
if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE)
|
||||||
|
{
|
||||||
|
if (!(player->pflags & PF_THOKKED))
|
||||||
|
{
|
||||||
|
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
|
||||||
|
S_StartSound(player->mo, sfx_ding);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Super Sonic move
|
// Super Sonic move
|
||||||
if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
|
if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
|
||||||
|
|
Loading…
Reference in a new issue