Super float animation.

When Super Sonic is "walking in the air", he has a
unique animation for it now which is similar to how
it looked in previous SRB2 versions.
This commit is contained in:
Yukita Mayako 2015-06-19 01:30:06 -04:00
parent ffec58c09c
commit 496662bec5
5 changed files with 23 additions and 5 deletions

View File

@ -3779,6 +3779,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_PLAY_SUPER_FALL",
"S_PLAY_SUPER_EDGE",
"S_PLAY_SUPER_RIDE",
"S_PLAY_SUPER_FLOAT",
// SF_SUPER
"S_PLAY_SUPERTRANS1",

View File

@ -96,7 +96,8 @@ char spr2names[NUMPLAYERSPRITES][5] =
"SJMP",
"SFAL",
"SEDG",
"SRID"
"SRID",
"SFLT"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -162,6 +163,7 @@ state_t states[NUMSTATES] =
{SPR_PLAY, SPR2_SFAL, 2, {NULL}, 0, 0, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_FALL
{SPR_PLAY, SPR2_SEDG, 12, {NULL}, 0, 0, S_PLAY_SUPER_EDGE}, // S_PLAY_SUPER_EDGE
{SPR_PLAY, SPR2_SRID, 4, {NULL}, 0, 0, S_PLAY_SUPER_RIDE}, // S_PLAY_SUPER_RIDE
{SPR_PLAY, SPR2_SFLT, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT}, // S_PLAY_SUPER_FLOAT
// Transforming into Super
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS

View File

@ -616,6 +616,7 @@ enum playersprite
SPR2_SFAL,
SPR2_SEDG,
SPR2_SRID,
SPR2_SFLT,
NUMPLAYERSPRITES
};
@ -676,6 +677,7 @@ typedef enum state
S_PLAY_SUPER_FALL,
S_PLAY_SUPER_EDGE,
S_PLAY_SUPER_RIDE,
S_PLAY_SUPER_FLOAT,
// SF_SUPER
S_PLAY_SUPER_TRANS,

View File

@ -192,6 +192,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
break;
case S_PLAY_WALK:
case S_PLAY_SUPER_WALK:
case S_PLAY_SUPER_FLOAT:
player->panim = PA_WALK;
break;
case S_PLAY_RUN:
@ -384,6 +385,9 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
case SPR2_SRID:
spr2 = SPR2_RIDE;
break;
case SPR2_SFLT:
spr2 = SPR2_SWLK;
break;
// Dunno? Just go to standing then.
default:

View File

@ -6438,13 +6438,17 @@ static void P_MovePlayer(player_t *player)
// MOVEMENT ANIMATIONS //
/////////////////////////
if ((cmd->forwardmove != 0 || cmd->sidemove != 0) || (player->powers[pw_super] && player->mo->z > player->mo->floorz))
if ((cmd->forwardmove != 0 || cmd->sidemove != 0) || (player->powers[pw_super] && !onground))
{
// If the player is moving fast enough,
// break into a run!
if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime && (onground || player->powers[pw_super]))
P_SetPlayerMobjState (player->mo, S_PLAY_RUN);
// Super floating at slow speeds has its own special animation.
else if (player->powers[pw_super] && player->panim == PA_IDLE && !onground)
P_SetPlayerMobjState (player->mo, S_PLAY_SUPER_FLOAT);
// Otherwise, just walk.
else if ((player->rmomx || player->rmomy) && player->panim == PA_IDLE)
P_SetPlayerMobjState (player->mo, S_PLAY_WALK);
@ -6453,7 +6457,12 @@ static void P_MovePlayer(player_t *player)
// If your running animation is playing, and you're
// going too slow, switch back to the walking frames.
if (player->panim == PA_RUN && player->speed < runspd)
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
{
if (!onground && player->powers[pw_super])
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT);
else
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
}
// If Springing, but travelling DOWNWARD, change back!
if (player->panim == PA_JUMP && P_MobjFlip(player->mo)*player->mo->momz < 0)
@ -6824,8 +6833,8 @@ static void P_MovePlayer(player_t *player)
if (player->charflags & SF_SUPER && player->powers[pw_super] && player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
&& P_MobjFlip(player->mo)*player->mo->momz <= 0)
{
if (player->panim == PA_ROLL || player->mo->state-states == S_PLAY_PAIN)
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_WALK);
if (player->panim == PA_ROLL || player->mo->state-states == S_PLAY_PAIN || player->panim == PA_WALK)
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT);
player->mo->momz = 0;
player->pflags &= ~PF_SPINNING;