Updated player->panims.

Added PA_JUMP and PA_RIDE to handle new Super jump
and ride, and added new animations to panim finder.
This commit is contained in:
Yukita Mayako 2015-05-29 01:48:56 -04:00
parent ff181d099c
commit 98ba9ca140
4 changed files with 43 additions and 11 deletions

View file

@ -164,8 +164,10 @@ typedef enum
PA_WALK,
PA_RUN,
PA_ROLL,
PA_JUMP,
PA_FALL,
PA_ABILITY
PA_ABILITY,
PA_RIDE
} panim_t;
typedef enum

View file

@ -1853,7 +1853,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
// Don't 'step up' while springing,
// Only step up "if needed".
if (thing->state-states == S_PLAY_JUMP
if (thing->player->panim == PA_JUMP
&& P_MobjFlip(thing)*thing->momz > FixedMul(FRACUNIT, thing->scale))
maxstep = 0;
}

View file

@ -184,7 +184,6 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
case S_PLAY_STND:
case S_PLAY_WAIT:
case S_PLAY_EDGE:
case S_PLAY_RIDE:
case S_PLAY_SUPER_STND:
case S_PLAY_SUPER_EDGE:
player->panim = PA_IDLE;
@ -198,15 +197,26 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
player->panim = PA_RUN;
break;
case S_PLAY_SPIN:
case S_PLAY_DASH:
case S_PLAY_SUPER_SPIN:
player->panim = PA_ROLL;
break;
case S_PLAY_JUMP:
case S_PLAY_SUPER_JUMP:
player->panim = PA_JUMP;
break;
case S_PLAY_FALL:
case S_PLAY_SUPER_FALL:
player->panim = PA_FALL;
break;
case S_PLAY_FLY:
case S_PLAY_GLIDE:
player->panim = PA_ABILITY;
break;
case S_PLAY_RIDE:
case S_PLAY_SUPER_RIDE:
player->panim = PA_RIDE;
break;
default:
player->panim = PA_ETC;
break;

View file

@ -3438,12 +3438,32 @@ static void P_DoSuperStuff(player_t *player)
{
if ((player->pflags & PF_JUMPED) || (player->pflags & PF_SPINNING))
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
else if (player->panim == PA_RUN)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN);
else if (player->panim == PA_WALK)
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
else
else switch (player->mo->state-states)
{
default:
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
break;
case S_PLAY_DASH:
break;
case S_PLAY_SUPER_WALK:
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
break;
case S_PLAY_SUPER_RUN:
P_SetPlayerMobjState(player->mo, S_PLAY_RUN);
break;
case S_PLAY_SUPER_PAIN:
P_SetPlayerMobjState(player->mo, S_PLAY_PAIN);
break;
case S_PLAY_SUPER_JUMP:
P_SetPlayerMobjState(player->mo, S_PLAY_JUMP);
break;
case S_PLAY_SUPER_FALL:
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
break;
case S_PLAY_SUPER_RIDE:
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
break;
}
if (!player->exiting)
{
@ -6429,10 +6449,10 @@ static void P_MovePlayer(player_t *player)
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
// If Springing, but travelling DOWNWARD, change back!
if (player->mo->state == &states[S_PLAY_JUMP] && P_MobjFlip(player->mo)*player->mo->momz < 0)
if (player->panim == PA_JUMP && P_MobjFlip(player->mo)*player->mo->momz < 0)
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
// If Springing but on the ground, change back!
else if (onground && (player->mo->state == &states[S_PLAY_JUMP] || player->panim == PA_FALL || player->mo->state == &states[S_PLAY_RIDE]) && !player->mo->momz)
else if (onground && (player->panim == PA_JUMP || player->panim == PA_FALL || player->panim == PA_RIDE) && !player->mo->momz)
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
// If you are stopped and are still walking, stand still!