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:
Yukita Mayako 2015-05-29 14:57:53 -04:00
parent d680cafc6e
commit d2ef4d3e3c
5 changed files with 14 additions and 2 deletions

View file

@ -163,6 +163,7 @@ typedef enum
PA_IDLE, PA_IDLE,
PA_WALK, PA_WALK,
PA_RUN, PA_RUN,
PA_PAIN,
PA_ROLL, PA_ROLL,
PA_JUMP, PA_JUMP,
PA_FALL, PA_FALL,

View file

@ -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_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_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_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_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_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 {SPR_PLAY, SPR2_SSPN, 1, {NULL}, 0, 0, S_PLAY_SUPER_SPIN}, // S_PLAY_SUPER_SPIN

View file

@ -607,6 +607,7 @@ enum playersprite
SPR2_SWLK, SPR2_SWLK,
SPR2_SRUN, SPR2_SRUN,
SPR2_SPAN, SPR2_SPAN,
SPR2_SMSL,
SPR2_SDTH, SPR2_SDTH,
SPR2_SDRN, SPR2_SDRN,
SPR2_SSPN, SPR2_SSPN,
@ -666,6 +667,7 @@ typedef enum state
S_PLAY_SUPER_WALK, S_PLAY_SUPER_WALK,
S_PLAY_SUPER_RUN, S_PLAY_SUPER_RUN,
S_PLAY_SUPER_PAIN, S_PLAY_SUPER_PAIN,
S_PLAY_SUPER_STUN,
S_PLAY_SUPER_DEAD, S_PLAY_SUPER_DEAD,
S_PLAY_SUPER_DRWN, S_PLAY_SUPER_DRWN,
S_PLAY_SUPER_SPIN, S_PLAY_SUPER_SPIN,

View file

@ -2587,7 +2587,7 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so
P_InstaThrust(player->mo, ang, fallbackspeed); P_InstaThrust(player->mo, ang, fallbackspeed);
if (player->charflags & SF_SUPERANIMS) if (player->charflags & SF_SUPERANIMS)
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_PAIN); P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_STUN);
else else
P_SetPlayerMobjState(player->mo, player->mo->info->painstate); P_SetPlayerMobjState(player->mo, player->mo->info->painstate);

View file

@ -196,6 +196,11 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
case S_PLAY_SUPER_RUN: case S_PLAY_SUPER_RUN:
player->panim = PA_RUN; player->panim = PA_RUN;
break; 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_SPIN:
case S_PLAY_DASH: case S_PLAY_DASH:
case S_PLAY_SUPER_SPIN: case S_PLAY_SUPER_SPIN:
@ -356,6 +361,9 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
case SPR2_SPAN: case SPR2_SPAN:
spr2 = SPR2_PAIN; spr2 = SPR2_PAIN;
break; break;
case SPR2_SMSL:
spr2 = SPR2_SPAN;
break;
case SPR2_SDTH: case SPR2_SDTH:
spr2 = SPR2_DEAD; spr2 = SPR2_DEAD;
break; break;
@ -2165,7 +2173,7 @@ static void P_PlayerZMovement(mobj_t *mo)
goto nightsdone; goto nightsdone;
} }
// Get up if you fell. // 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); P_SetPlayerMobjState(mo, S_PLAY_STND);
if (P_MobjFlip(mo)*mo->momz < 0) // falling if (P_MobjFlip(mo)*mo->momz < 0) // falling