Merge branch 'pw-justlaunched' into 'next'

Add pw_justlaunched to tell modders when a player launches from a slope

See merge request STJr/SRB2!792
This commit is contained in:
James R 2020-02-18 21:53:05 -05:00
commit 26825a2b4c
4 changed files with 13 additions and 3 deletions

View file

@ -278,6 +278,7 @@ typedef enum
pw_nights_linkfreeze,
pw_nocontrol, //for linedef exec 427
pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch)
NUMPOWERS
} powertype_t;

View file

@ -9134,7 +9134,8 @@ static const char *const POWERS_LIST[] = {
"NIGHTS_LINKFREEZE",
//for linedef exec 427
"NOCONTROL"
"NOCONTROL",
"JUSTLAUNCHED",
};
static const char *const HUDITEMS_LIST[] = {

View file

@ -1997,10 +1997,14 @@ void P_XYMovement(mobj_t *mo)
{
mo->momz = transfermomz;
mo->standingslope = NULL;
if (player && (player->pflags & PF_SPINNING))
if (player)
{
player->powers[pw_justlaunched] = 2;
if (player->pflags & PF_SPINNING)
player->pflags |= PF_THOKKED;
}
}
}
#endif
}
else if (mo->type == MT_SPINFIRE)
@ -3922,6 +3926,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
// Needed for gravity boots
P_CheckGravity(mobj, false);
mobj->player->powers[pw_justlaunched] = 0;
if (mobj->momx || mobj->momy)
{
P_XYMovement(mobj);

View file

@ -726,6 +726,9 @@ void P_SlopeLaunch(mobj_t *mo)
//CONS_Printf("Launched off of slope.\n");
mo->standingslope = NULL;
if (mo->player)
mo->player->powers[pw_justlaunched] = 1;
}
//