mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
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:
parent
ffec58c09c
commit
496662bec5
5 changed files with 23 additions and 5 deletions
|
@ -3779,6 +3779,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_PLAY_SUPER_FALL",
|
"S_PLAY_SUPER_FALL",
|
||||||
"S_PLAY_SUPER_EDGE",
|
"S_PLAY_SUPER_EDGE",
|
||||||
"S_PLAY_SUPER_RIDE",
|
"S_PLAY_SUPER_RIDE",
|
||||||
|
"S_PLAY_SUPER_FLOAT",
|
||||||
|
|
||||||
// SF_SUPER
|
// SF_SUPER
|
||||||
"S_PLAY_SUPERTRANS1",
|
"S_PLAY_SUPERTRANS1",
|
||||||
|
|
|
@ -96,7 +96,8 @@ char spr2names[NUMPLAYERSPRITES][5] =
|
||||||
"SJMP",
|
"SJMP",
|
||||||
"SFAL",
|
"SFAL",
|
||||||
"SEDG",
|
"SEDG",
|
||||||
"SRID"
|
"SRID",
|
||||||
|
"SFLT"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
|
// 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_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_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_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
|
// Transforming into Super
|
||||||
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS
|
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS
|
||||||
|
|
|
@ -616,6 +616,7 @@ enum playersprite
|
||||||
SPR2_SFAL,
|
SPR2_SFAL,
|
||||||
SPR2_SEDG,
|
SPR2_SEDG,
|
||||||
SPR2_SRID,
|
SPR2_SRID,
|
||||||
|
SPR2_SFLT,
|
||||||
|
|
||||||
NUMPLAYERSPRITES
|
NUMPLAYERSPRITES
|
||||||
};
|
};
|
||||||
|
@ -676,6 +677,7 @@ typedef enum state
|
||||||
S_PLAY_SUPER_FALL,
|
S_PLAY_SUPER_FALL,
|
||||||
S_PLAY_SUPER_EDGE,
|
S_PLAY_SUPER_EDGE,
|
||||||
S_PLAY_SUPER_RIDE,
|
S_PLAY_SUPER_RIDE,
|
||||||
|
S_PLAY_SUPER_FLOAT,
|
||||||
|
|
||||||
// SF_SUPER
|
// SF_SUPER
|
||||||
S_PLAY_SUPER_TRANS,
|
S_PLAY_SUPER_TRANS,
|
||||||
|
|
|
@ -192,6 +192,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
||||||
break;
|
break;
|
||||||
case S_PLAY_WALK:
|
case S_PLAY_WALK:
|
||||||
case S_PLAY_SUPER_WALK:
|
case S_PLAY_SUPER_WALK:
|
||||||
|
case S_PLAY_SUPER_FLOAT:
|
||||||
player->panim = PA_WALK;
|
player->panim = PA_WALK;
|
||||||
break;
|
break;
|
||||||
case S_PLAY_RUN:
|
case S_PLAY_RUN:
|
||||||
|
@ -384,6 +385,9 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
||||||
case SPR2_SRID:
|
case SPR2_SRID:
|
||||||
spr2 = SPR2_RIDE;
|
spr2 = SPR2_RIDE;
|
||||||
break;
|
break;
|
||||||
|
case SPR2_SFLT:
|
||||||
|
spr2 = SPR2_SWLK;
|
||||||
|
break;
|
||||||
|
|
||||||
// Dunno? Just go to standing then.
|
// Dunno? Just go to standing then.
|
||||||
default:
|
default:
|
||||||
|
|
15
src/p_user.c
15
src/p_user.c
|
@ -6438,13 +6438,17 @@ static void P_MovePlayer(player_t *player)
|
||||||
// MOVEMENT ANIMATIONS //
|
// 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,
|
// If the player is moving fast enough,
|
||||||
// break into a run!
|
// break into a run!
|
||||||
if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime && (onground || player->powers[pw_super]))
|
if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime && (onground || player->powers[pw_super]))
|
||||||
P_SetPlayerMobjState (player->mo, S_PLAY_RUN);
|
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.
|
// Otherwise, just walk.
|
||||||
else if ((player->rmomx || player->rmomy) && player->panim == PA_IDLE)
|
else if ((player->rmomx || player->rmomy) && player->panim == PA_IDLE)
|
||||||
P_SetPlayerMobjState (player->mo, S_PLAY_WALK);
|
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
|
// If your running animation is playing, and you're
|
||||||
// going too slow, switch back to the walking frames.
|
// going too slow, switch back to the walking frames.
|
||||||
if (player->panim == PA_RUN && player->speed < runspd)
|
if (player->panim == PA_RUN && player->speed < runspd)
|
||||||
|
{
|
||||||
|
if (!onground && player->powers[pw_super])
|
||||||
|
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT);
|
||||||
|
else
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
|
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
|
||||||
|
}
|
||||||
|
|
||||||
// If Springing, but travelling DOWNWARD, change back!
|
// If Springing, but travelling DOWNWARD, change back!
|
||||||
if (player->panim == PA_JUMP && P_MobjFlip(player->mo)*player->mo->momz < 0)
|
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)
|
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)
|
&& P_MobjFlip(player->mo)*player->mo->momz <= 0)
|
||||||
{
|
{
|
||||||
if (player->panim == PA_ROLL || player->mo->state-states == S_PLAY_PAIN)
|
if (player->panim == PA_ROLL || player->mo->state-states == S_PLAY_PAIN || player->panim == PA_WALK)
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_WALK);
|
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT);
|
||||||
|
|
||||||
player->mo->momz = 0;
|
player->mo->momz = 0;
|
||||||
player->pflags &= ~PF_SPINNING;
|
player->pflags &= ~PF_SPINNING;
|
||||||
|
|
Loading…
Reference in a new issue