mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Add S_PLAY_SUPER_STUN and PA_PAIN
For Super Missiles, the Super Sonic player has a seperate animation from normal pain.
This commit is contained in:
parent
d680cafc6e
commit
d2ef4d3e3c
5 changed files with 14 additions and 2 deletions
|
@ -163,6 +163,7 @@ typedef enum
|
|||
PA_IDLE,
|
||||
PA_WALK,
|
||||
PA_RUN,
|
||||
PA_PAIN,
|
||||
PA_ROLL,
|
||||
PA_JUMP,
|
||||
PA_FALL,
|
||||
|
|
|
@ -152,6 +152,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, SPR2_SWLK, 7, {NULL}, 0, 0, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_WALK
|
||||
{SPR_PLAY, SPR2_SRUN, 7, {NULL}, 0, 0, S_PLAY_SUPER_RUN}, // S_PLAY_SUPER_RUN
|
||||
{SPR_PLAY, SPR2_SPAN, -1, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_PAIN
|
||||
{SPR_PLAY, SPR2_SMSL, -1, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_STUN
|
||||
{SPR_PLAY, SPR2_SDTH, 4, {NULL}, 0, 0, S_PLAY_SUPER_DEAD}, // S_PLAY_SUPER_DEAD
|
||||
{SPR_PLAY, SPR2_SDRN, 4, {NULL}, 0, 0, S_PLAY_SUPER_DRWN}, // S_PLAY_SUPER_DRWN
|
||||
{SPR_PLAY, SPR2_SSPN, 1, {NULL}, 0, 0, S_PLAY_SUPER_SPIN}, // S_PLAY_SUPER_SPIN
|
||||
|
|
|
@ -607,6 +607,7 @@ enum playersprite
|
|||
SPR2_SWLK,
|
||||
SPR2_SRUN,
|
||||
SPR2_SPAN,
|
||||
SPR2_SMSL,
|
||||
SPR2_SDTH,
|
||||
SPR2_SDRN,
|
||||
SPR2_SSPN,
|
||||
|
@ -666,6 +667,7 @@ typedef enum state
|
|||
S_PLAY_SUPER_WALK,
|
||||
S_PLAY_SUPER_RUN,
|
||||
S_PLAY_SUPER_PAIN,
|
||||
S_PLAY_SUPER_STUN,
|
||||
S_PLAY_SUPER_DEAD,
|
||||
S_PLAY_SUPER_DRWN,
|
||||
S_PLAY_SUPER_SPIN,
|
||||
|
|
|
@ -2587,7 +2587,7 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so
|
|||
P_InstaThrust(player->mo, ang, fallbackspeed);
|
||||
|
||||
if (player->charflags & SF_SUPERANIMS)
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_PAIN);
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_STUN);
|
||||
else
|
||||
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
|
||||
|
||||
|
|
10
src/p_mobj.c
10
src/p_mobj.c
|
@ -196,6 +196,11 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
case S_PLAY_SUPER_RUN:
|
||||
player->panim = PA_RUN;
|
||||
break;
|
||||
case S_PLAY_PAIN:
|
||||
case S_PLAY_SUPER_PAIN:
|
||||
case S_PLAY_SUPER_STUN:
|
||||
player->panim = PA_PAIN;
|
||||
break;
|
||||
case S_PLAY_SPIN:
|
||||
case S_PLAY_DASH:
|
||||
case S_PLAY_SUPER_SPIN:
|
||||
|
@ -356,6 +361,9 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
case SPR2_SPAN:
|
||||
spr2 = SPR2_PAIN;
|
||||
break;
|
||||
case SPR2_SMSL:
|
||||
spr2 = SPR2_SPAN;
|
||||
break;
|
||||
case SPR2_SDTH:
|
||||
spr2 = SPR2_DEAD;
|
||||
break;
|
||||
|
@ -2165,7 +2173,7 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
goto nightsdone;
|
||||
}
|
||||
// Get up if you fell.
|
||||
if (mo->state == &states[mo->info->painstate] || mo->state-states == S_PLAY_SUPER_PAIN)
|
||||
if (mo->player->panim == PA_PAIN)
|
||||
P_SetPlayerMobjState(mo, S_PLAY_STND);
|
||||
|
||||
if (P_MobjFlip(mo)*mo->momz < 0) // falling
|
||||
|
|
Loading…
Reference in a new issue