Re-add lost player vibration frames

Separate sprites for fast moving frames
Rename some frames for a more sensible naming convention
This commit is contained in:
Sryder13 2017-11-04 17:32:47 +00:00
parent 81a077b9af
commit c9ddb7a4b5
14 changed files with 169 additions and 194 deletions

View File

@ -273,11 +273,11 @@ void B_RespawnBot(INT32 playernum)
P_TeleportMove(tails, x, y, z); P_TeleportMove(tails, x, y, z);
if (player->charability == CA_FLY) if (player->charability == CA_FLY)
{ {
P_SetPlayerMobjState(tails, S_KART_STND); // SRB2kart - was S_PLAY_ABL1 P_SetPlayerMobjState(tails, S_KART_STND1); // SRB2kart - was S_PLAY_ABL1
tails->player->powers[pw_tailsfly] = (UINT16)-1; tails->player->powers[pw_tailsfly] = (UINT16)-1;
} }
else else
P_SetPlayerMobjState(tails, S_KART_STND); // SRB2kart - was S_PLAY_FALL1 P_SetPlayerMobjState(tails, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
P_SetScale(tails, sonic->scale); P_SetScale(tails, sonic->scale);
tails->destscale = sonic->destscale; tails->destscale = sonic->destscale;
} }

View File

@ -3804,25 +3804,28 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_THOK", "S_THOK",
// SRB2kart Frames // SRB2kart Frames
"S_KART_STND", "S_KART_STND1",
"S_KART_STND_L", "S_KART_STND2",
"S_KART_STND_R", "S_KART_STND1_L",
"S_KART_STND2_L",
"S_KART_STND1_R",
"S_KART_STND2_R",
"S_KART_WALK1", "S_KART_WALK1",
"S_KART_WALK2", "S_KART_WALK2",
"S_KART_WALK_L1", "S_KART_WALK1_L",
"S_KART_WALK_L2", "S_KART_WALK2_L",
"S_KART_WALK_R1", "S_KART_WALK1_R",
"S_KART_WALK_R2", "S_KART_WALK2_R",
"S_KART_RUN1", "S_KART_RUN1",
"S_KART_RUN2", "S_KART_RUN2",
"S_KART_RUN_L1", "S_KART_RUN1_L",
"S_KART_RUN_L2", "S_KART_RUN2_L",
"S_KART_RUN_R1", "S_KART_RUN1_R",
"S_KART_RUN_R2", "S_KART_RUN2_R",
"S_KART_DRIFT_L1", "S_KART_DRIFT1_L",
"S_KART_DRIFT_L2", "S_KART_DRIFT2_L",
"S_KART_DRIFT_R1", "S_KART_DRIFT1_R",
"S_KART_DRIFT_R2", "S_KART_DRIFT2_R",
"S_KART_SPIN", "S_KART_SPIN",
"S_KART_PAIN", "S_KART_PAIN",
"S_KART_SQUISH", "S_KART_SQUISH",

View File

@ -5464,7 +5464,7 @@ void G_AddGhost(char *defdemoname)
gh->mo = P_SpawnMobj(x, y, z, MT_GHOST); gh->mo = P_SpawnMobj(x, y, z, MT_GHOST);
gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT); gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT);
} }
gh->mo->state = states+S_KART_STND; // SRB2kart - was S_PLAY_STND gh->mo->state = states+S_KART_STND1; // SRB2kart - was S_PLAY_STND
gh->mo->sprite = gh->mo->state->sprite; gh->mo->sprite = gh->mo->state->sprite;
gh->mo->frame = (gh->mo->state->frame & FF_FRAMEMASK) | tr_trans20<<FF_TRANSSHIFT; gh->mo->frame = (gh->mo->state->frame & FF_FRAMEMASK) | tr_trans20<<FF_TRANSSHIFT;
gh->mo->tics = -1; gh->mo->tics = -1;

View File

@ -1474,8 +1474,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
} }
else else
{ {
if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL)
&& !(spr->mobj->player && spr->mobj->state == &states[S_KART_STND])) // SRB2kart
{ {
const UINT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames; const UINT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames;
next = &md2->model->frames[nextframe]; next = &md2->model->frames[nextframe];

View File

@ -87,28 +87,31 @@ state_t states[NUMSTATES] =
{SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK {SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK
// Player // SRB2kart // Player // SRB2kart
{SPR_PLAY, 0, -1, {NULL}, 0, 0, S_KART_STND}, // S_KART_STND A {SPR_PLAY, 0, 1, {NULL}, 0, 0, S_KART_STND2}, // S_KART_STND1 A
{SPR_PLAY, 1, -1, {NULL}, 0, 0, S_KART_STND_L}, // S_KART_STND_L B {SPR_PLAY, 1, 1, {NULL}, 0, 0, S_KART_STND1}, // S_KART_STND2 B
{SPR_PLAY, 2, -1, {NULL}, 0, 0, S_KART_STND_R}, // S_KART_STND_R C {SPR_PLAY, 2, 1, {NULL}, 0, 0, S_KART_STND2_L}, // S_KART_STND1_L C
{SPR_PLAY, 3, 4, {NULL}, 0, 0, S_KART_WALK2}, // S_KART_WALK1 D {SPR_PLAY, 3, 1, {NULL}, 0, 0, S_KART_STND1_L}, // S_KART_STND2_L D
{SPR_PLAY, 4, 4, {NULL}, 0, 0, S_KART_WALK1}, // S_KART_WALK2 E {SPR_PLAY, 4, 1, {NULL}, 0, 0, S_KART_STND2_R}, // S_KART_STND1_R E
{SPR_PLAY, 5, 4, {NULL}, 0, 0, S_KART_WALK_L2}, // S_KART_WALK_L1 F {SPR_PLAY, 5, 1, {NULL}, 0, 0, S_KART_STND1_R}, // S_KART_STND2_R F
{SPR_PLAY, 6, 4, {NULL}, 0, 0, S_KART_WALK_L1}, // S_KART_WALK_L2 G {SPR_PLAY, 6, 4, {NULL}, 0, 0, S_KART_WALK2}, // S_KART_WALK1 G
{SPR_PLAY, 7, 4, {NULL}, 0, 0, S_KART_WALK_R2}, // S_KART_WALK_R1 H {SPR_PLAY, 7, 4, {NULL}, 0, 0, S_KART_WALK1}, // S_KART_WALK2 H
{SPR_PLAY, 8, 4, {NULL}, 0, 0, S_KART_WALK_R1}, // S_KART_WALK_R2 I {SPR_PLAY, 8, 4, {NULL}, 0, 0, S_KART_WALK2_L}, // S_KART_WALK1_L I
{SPR_PLAY, 0, 2, {NULL}, 0, 0, S_KART_RUN2}, // S_KART_RUN1 A {SPR_PLAY, 9, 4, {NULL}, 0, 0, S_KART_WALK1_L}, // S_KART_WALK2_L J
{SPR_PLAY, 3, 2, {NULL}, 0, 0, S_KART_RUN1}, // S_KART_RUN2 D {SPR_PLAY, 10, 4, {NULL}, 0, 0, S_KART_WALK2_R}, // S_KART_WALK1_R K
{SPR_PLAY, 1, 2, {NULL}, 0, 0, S_KART_RUN_L2}, // S_KART_RUN_L1 B {SPR_PLAY, 11, 4, {NULL}, 0, 0, S_KART_WALK1_R}, // S_KART_WALK2_R L
{SPR_PLAY, 5, 2, {NULL}, 0, 0, S_KART_RUN_L1}, // S_KART_RUN_L2 F {SPR_PLAY, 12, 2, {NULL}, 0, 0, S_KART_RUN2}, // S_KART_RUN1 M
{SPR_PLAY, 2, 2, {NULL}, 0, 0, S_KART_RUN_R2}, // S_KART_RUN_R1 C {SPR_PLAY, 13, 2, {NULL}, 0, 0, S_KART_RUN1}, // S_KART_RUN2 N
{SPR_PLAY, 7, 2, {NULL}, 0, 0, S_KART_RUN_R1}, // S_KART_RUN_R2 H {SPR_PLAY, 14, 2, {NULL}, 0, 0, S_KART_RUN2_L}, // S_KART_RUN1_L O
{SPR_PLAY, 9, 2, {NULL}, 0, 0, S_KART_DRIFT_L2}, // S_KART_DRIFT_L1 J {SPR_PLAY, 15, 2, {NULL}, 0, 0, S_KART_RUN1_L}, // S_KART_RUN2_L P
{SPR_PLAY, 10, 2, {NULL}, 0, 0, S_KART_DRIFT_L1}, // S_KART_DRIFT_L2 K {SPR_PLAY, 16, 2, {NULL}, 0, 0, S_KART_RUN2_R}, // S_KART_RUN1_R Q
{SPR_PLAY, 11, 2, {NULL}, 0, 0, S_KART_DRIFT_R2}, // S_KART_DRIFT_R1 L {SPR_PLAY, 17, 2, {NULL}, 0, 0, S_KART_RUN1_R}, // S_KART_RUN2_R R
{SPR_PLAY, 12, 2, {NULL}, 0, 0, S_KART_DRIFT_R1}, // S_KART_DRIFT_R2 M {SPR_PLAY, 18, 2, {NULL}, 0, 0, S_KART_DRIFT2_L}, // S_KART_DRIFT1_L S
{SPR_PLAY, 13, -1, {NULL}, 0, 0, S_KART_SPIN}, // S_KART_SPIN N {SPR_PLAY, 19, 2, {NULL}, 0, 0, S_KART_DRIFT1_L}, // S_KART_DRIFT2_L T
{SPR_PLAY, 13, 350, {NULL}, 0, 0, S_KART_STND}, // S_KART_PAIN N {SPR_PLAY, 20, 2, {NULL}, 0, 0, S_KART_DRIFT2_R}, // S_KART_DRIFT1_R U
{SPR_PLAY, 21, 350, {NULL}, 0, 0, S_KART_STND}, // S_KART_SQUISH V {SPR_PLAY, 21, 2, {NULL}, 0, 0, S_KART_DRIFT1_R}, // S_KART_DRIFT2_R V
{SPR_PLAY, 22, -1, {NULL}, 0, 0, S_KART_SPIN}, // S_KART_SPIN W
{SPR_PLAY, 22, 350, {NULL}, 0, 0, S_KART_STND1}, // S_KART_PAIN W
{SPR_PLAY, 23, 350, {NULL}, 0, 0, S_KART_STND1}, // S_KART_SQUISH X
/* /*
{SPR_PLAY, 0, 105, {NULL}, 0, 0, S_PLAY_TAP1}, // S_PLAY_STND {SPR_PLAY, 0, 105, {NULL}, 0, 0, S_PLAY_TAP1}, // S_PLAY_STND
{SPR_PLAY, 1, 16, {NULL}, 0, 0, S_PLAY_TAP2}, // S_PLAY_TAP1 {SPR_PLAY, 1, 16, {NULL}, 0, 0, S_PLAY_TAP2}, // S_PLAY_TAP1
@ -2944,7 +2947,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
{ // MT_PLAYER { // MT_PLAYER
-1, // doomednum -1, // doomednum
S_KART_STND, // spawnstate S_KART_STND1, // spawnstate
1, // spawnhealth 1, // spawnhealth
S_KART_WALK1, // seestate S_KART_WALK1, // seestate
sfx_None, // seesound sfx_None, // seesound

View File

@ -643,25 +643,28 @@ typedef enum state
S_THOK, S_THOK,
// SRB2kart Frames // SRB2kart Frames
S_KART_STND, S_KART_STND1,
S_KART_STND_L, S_KART_STND2,
S_KART_STND_R, S_KART_STND1_L,
S_KART_STND2_L,
S_KART_STND1_R,
S_KART_STND2_R,
S_KART_WALK1, S_KART_WALK1,
S_KART_WALK2, S_KART_WALK2,
S_KART_WALK_L1, S_KART_WALK1_L,
S_KART_WALK_L2, S_KART_WALK2_L,
S_KART_WALK_R1, S_KART_WALK1_R,
S_KART_WALK_R2, S_KART_WALK2_R,
S_KART_RUN1, S_KART_RUN1,
S_KART_RUN2, S_KART_RUN2,
S_KART_RUN_L1, S_KART_RUN1_L,
S_KART_RUN_L2, S_KART_RUN2_L,
S_KART_RUN_R1, S_KART_RUN1_R,
S_KART_RUN_R2, S_KART_RUN2_R,
S_KART_DRIFT_L1, S_KART_DRIFT1_L,
S_KART_DRIFT_L2, S_KART_DRIFT2_L,
S_KART_DRIFT_R1, S_KART_DRIFT1_R,
S_KART_DRIFT_R2, S_KART_DRIFT2_R,
S_KART_SPIN, S_KART_SPIN,
S_KART_PAIN, S_KART_PAIN,
S_KART_SQUISH, S_KART_SQUISH,

View File

@ -1315,6 +1315,59 @@ void K_LakituChecker(player_t *player)
} }
} }
/** \brief Handles the state changing for moving players, moved here to eliminate duplicate code
\param player player data
\return void
*/
void K_KartMoveAnimation(player_t *player)
{
ticcmd_t *cmd = &player->cmd;
// Standing frames - S_KART_STND1 S_KART_STND1_L S_KART_STND1_R
if (player->speed == 0)
{
if (cmd->buttons & BT_DRIFTRIGHT && !(player->mo->state >= &states[S_KART_STND1_R] && player->mo->state <= &states[S_KART_STND2_R]))
P_SetPlayerMobjState(player->mo, S_KART_STND1_R);
else if (cmd->buttons & BT_DRIFTLEFT && !(player->mo->state >= &states[S_KART_STND1_L] && player->mo->state <= &states[S_KART_STND2_L]))
P_SetPlayerMobjState(player->mo, S_KART_STND1_L);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(player->mo->state >= &states[S_KART_STND1] && player->mo->state <= &states[S_KART_STND2]))
P_SetPlayerMobjState(player->mo, S_KART_STND1);
}
// Drifting Left - S_KART_DRIFT1_L
else if (player->kartstuff[k_drift] > 0 && P_IsObjectOnGround(player->mo))
{
if (!(player->mo->state >= &states[S_KART_DRIFT1_L] && player->mo->state <= &states[S_KART_DRIFT2_L]))
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_L);
}
// Drifting Right - S_KART_DRIFT1_R
else if (player->kartstuff[k_drift] < 0 && P_IsObjectOnGround(player->mo))
{
if (!(player->mo->state >= &states[S_KART_DRIFT1_R] && player->mo->state <= &states[S_KART_DRIFT2_R]))
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_R);
}
// Run frames - S_KART_RUN1 S_KART_RUN1_L S_KART_RUN1_R
else if (player->speed > FixedMul(player->runspeed, player->mo->scale))
{
if (cmd->buttons & BT_DRIFTRIGHT && !(player->mo->state >= &states[S_KART_RUN1_R] && player->mo->state <= &states[S_KART_RUN2_R]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1_R);
else if (cmd->buttons & BT_DRIFTLEFT && !(player->mo->state >= &states[S_KART_RUN1_L] && player->mo->state <= &states[S_KART_RUN2_L]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1_L);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(player->mo->state >= &states[S_KART_RUN1] && player->mo->state <= &states[S_KART_RUN2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1);
}
// Walk frames - S_KART_WALK1 S_KART_WALK1_L S_KART_WALK1_R
else if (player->speed <= FixedMul(player->runspeed, player->mo->scale))
{
if (cmd->buttons & BT_DRIFTRIGHT && !(player->mo->state >= &states[S_KART_WALK1_R] && player->mo->state <= &states[S_KART_WALK2_R]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1_R);
else if (cmd->buttons & BT_DRIFTLEFT && !(player->mo->state >= &states[S_KART_WALK1_L] && player->mo->state <= &states[S_KART_WALK2_L]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1_L);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(player->mo->state >= &states[S_KART_WALK1] && player->mo->state <= &states[S_KART_WALK2]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1);
}
}
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c /** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
\param player player object passed from P_PlayerThink \param player player object passed from P_PlayerThink

View File

@ -16,6 +16,7 @@ UINT8 K_GetKartColorByName(const char *name);
void K_RegisterKartStuff(void); void K_RegisterKartStuff(void);
void K_KartBouncer(void); void K_KartBouncer(void);
void K_KartMoveAnimation(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd); void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
void K_SpinPlayer(player_t *player, mobj_t *source); void K_SpinPlayer(player_t *player, mobj_t *source);
void K_SquishPlayer(player_t *player, mobj_t *source); void K_SquishPlayer(player_t *player, mobj_t *source);

View File

@ -1279,7 +1279,7 @@ void Command_ObjectPlace_f(void)
op_oldmomy = players[0].mo->momy; op_oldmomy = players[0].mo->momy;
op_oldmomz = players[0].mo->momz; op_oldmomz = players[0].mo->momz;
op_oldheight = players[0].mo->height; op_oldheight = players[0].mo->height;
op_oldstate = S_KART_STND; // SRB2kart - was S_PLAY_STND op_oldstate = S_KART_STND1; // SRB2kart - was S_PLAY_STND
op_oldcolor = players[0].mo->color; // save color too in case of super/fireflower op_oldcolor = players[0].mo->color; // save color too in case of super/fireflower
// Remove ALL flags and motion. // Remove ALL flags and motion.

View File

@ -906,7 +906,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_ResetPlayer(player); P_ResetPlayer(player);
P_SetPlayerMobjState(toucher, S_KART_STND); // SRB2kart - was S_PLAY_FALL1 P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
} }
} }
return; return;
@ -1251,7 +1251,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->pflags & PF_GLIDING) if (player->pflags & PF_GLIDING)
{ {
player->pflags &= ~(PF_GLIDING|PF_JUMPED); player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(toucher, S_KART_STND); // SRB2kart - was S_PLAY_FALL1 P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
} }
// Play a bounce sound? // Play a bounce sound?
@ -1318,7 +1318,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->pflags & PF_GLIDING) if (player->pflags & PF_GLIDING)
{ {
player->pflags &= ~(PF_GLIDING|PF_JUMPED); player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(toucher, S_KART_STND); // SRB2kart - was S_PLAY_FALL1 P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
} }
// Play a bounce sound? // Play a bounce sound?
@ -1374,7 +1374,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
player->pflags |= PF_MACESPIN; player->pflags |= PF_MACESPIN;
S_StartSound(toucher, sfx_spin); S_StartSound(toucher, sfx_spin);
P_SetPlayerMobjState(toucher, S_KART_STND); // SRB2kart - was S_PLAY_ATK1 P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_ATK1
} }
else else
player->pflags |= PF_ITEMHANG; player->pflags |= PF_ITEMHANG;

View File

@ -226,11 +226,11 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
// Set animation state // Set animation state
// The pflags version of this was just as convoluted. // The pflags version of this was just as convoluted.
// Rewriten for SRB2kart ... though I don't know what this is. // Rewriten for SRB2kart ... though I don't know what this is.
if ((state >= S_KART_STND && state <= S_KART_STND_R) || state == S_KART_SQUISH || state == S_KART_SPIN) if ((state >= S_KART_STND1 && state <= S_KART_STND2_R) || state == S_KART_SQUISH || state == S_KART_SPIN)
player->panim = PA_IDLE; player->panim = PA_IDLE;
else if (state >= S_KART_WALK1 && state <= S_KART_WALK_R2) else if (state >= S_KART_WALK1 && state <= S_KART_WALK2_R)
player->panim = PA_WALK; player->panim = PA_WALK;
else if (state >= S_KART_RUN1 && state <= S_KART_DRIFT_R2) else if (state >= S_KART_RUN1 && state <= S_KART_DRIFT2_R)
player->panim = PA_RUN; player->panim = PA_RUN;
//else if (state >= S_PLAY_ATK1 && state <= S_PLAY_ATK4) //else if (state >= S_PLAY_ATK1 && state <= S_PLAY_ATK4)
// player->panim = PA_ROLL; // player->panim = PA_ROLL;
@ -1490,7 +1490,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
{ {
// if in a walking frame, stop moving // if in a walking frame, stop moving
if (player->panim == PA_WALK && player->kartstuff[k_spinouttimer] == 0) if (player->panim == PA_WALK && player->kartstuff[k_spinouttimer] == 0)
P_SetPlayerMobjState(mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
mo->momx = player->cmomx; mo->momx = player->cmomx;
mo->momy = player->cmomy; mo->momy = player->cmomy;
} }
@ -2764,7 +2764,7 @@ static void P_PlayerZMovement(mobj_t *mo)
// Get up if you fell. // Get up if you fell.
if ((mo->state == &states[mo->info->painstate] || mo->state == &states[S_KART_SPIN]) if ((mo->state == &states[mo->info->painstate] || mo->state == &states[S_KART_SPIN])
&& mo->player->kartstuff[k_spinouttimer] == 0 && mo->player->kartstuff[k_squishedtimer] == 0) // SRB2kart && mo->player->kartstuff[k_spinouttimer] == 0 && mo->player->kartstuff[k_squishedtimer] == 0) // SRB2kart
P_SetPlayerMobjState(mo, S_KART_STND); P_SetPlayerMobjState(mo, S_KART_STND1);
#ifdef ESLOPE #ifdef ESLOPE
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) { if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) {
@ -2877,52 +2877,7 @@ static void P_PlayerZMovement(mobj_t *mo)
else if ((mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN) else if ((mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN)
|| mo->player->powers[pw_tailsfly]) && (mo->player->kartstuff[k_spinouttimer] == 0)) // SRB2kart || mo->player->powers[pw_tailsfly]) && (mo->player->kartstuff[k_spinouttimer] == 0)) // SRB2kart
{ {
ticcmd_t *cmd; K_KartMoveAnimation(mo->player);
cmd = &mo->player->cmd;
// Standing frames - S_KART_STND S_KART_STND_L S_KART_STND_R
if (mo->player->speed == 0)
{
if (cmd->buttons & BT_DRIFTRIGHT && !(mo->state == &states[S_KART_STND_R]))
P_SetPlayerMobjState(mo, S_KART_STND_R);
else if (cmd->buttons & BT_DRIFTLEFT && !(mo->state == &states[S_KART_STND_L]))
P_SetPlayerMobjState(mo, S_KART_STND_L);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(mo->state == &states[S_KART_STND]))
P_SetPlayerMobjState(mo, S_KART_STND);
}
// Drifting Left - S_KART_DRIFT_L1
else if (mo->player->kartstuff[k_drift] > 0 && P_IsObjectOnGround(mo))
{
if (!(mo->state == &states[S_KART_DRIFT_L1] || mo->state == &states[S_KART_DRIFT_L2]))
P_SetPlayerMobjState(mo, S_KART_DRIFT_L1);
}
// Drifting Right - S_KART_DRIFT_R1
else if (mo->player->kartstuff[k_drift] < 0 && P_IsObjectOnGround(mo))
{
if (!(mo->state == &states[S_KART_DRIFT_R1] || mo->state == &states[S_KART_DRIFT_R2]))
P_SetPlayerMobjState(mo, S_KART_DRIFT_R1);
}
// Run frames - S_KART_RUN1 S_KART_RUN_L1 S_KART_RUN_R1
else if (mo->player->speed > FixedMul(mo->player->runspeed, mo->scale))
{
if (cmd->buttons & BT_DRIFTRIGHT && !(mo->state == &states[S_KART_RUN_R1] || mo->state == &states[S_KART_RUN_R2]))
P_SetPlayerMobjState(mo, S_KART_RUN_R1);
else if (cmd->buttons & BT_DRIFTLEFT && !(mo->state == &states[S_KART_RUN_L1] || mo->state == &states[S_KART_RUN_L2]))
P_SetPlayerMobjState(mo, S_KART_RUN_L1);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(mo->state == &states[S_KART_RUN1] || mo->state == &states[S_KART_RUN2]))
P_SetPlayerMobjState(mo, S_KART_RUN1);
}
// Walk frames - S_KART_WALK1 S_KART_WALK_L1 S_KART_WALK_R1
else if (mo->player->speed <= FixedMul(mo->player->runspeed, mo->scale))
{
if (cmd->buttons & BT_DRIFTRIGHT && !(mo->state == &states[S_KART_WALK_R1] || mo->state == &states[S_KART_WALK_R2]))
P_SetPlayerMobjState(mo, S_KART_WALK_R1);
else if (cmd->buttons & BT_DRIFTLEFT && !(mo->state == &states[S_KART_WALK_L1] || mo->state == &states[S_KART_WALK_L2]))
P_SetPlayerMobjState(mo, S_KART_WALK_L1);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(mo->state == &states[S_KART_WALK1] || mo->state == &states[S_KART_WALK2]))
P_SetPlayerMobjState(mo, S_KART_WALK1);
}
} }
if (mo->player->pflags & PF_JUMPED) if (mo->player->pflags & PF_JUMPED)
@ -9218,7 +9173,7 @@ void P_AfterPlayerSpawn(INT32 playernum)
else else
p->viewz = p->mo->z + p->viewheight; p->viewz = p->mo->z + p->viewheight;
P_SetPlayerMobjState(p->mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(p->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
p->pflags &= ~PF_SPINNING; p->pflags &= ~PF_SPINNING;
if (playernum == consoleplayer) if (playernum == consoleplayer)

View File

@ -2784,7 +2784,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
mo->player->rmomx = mo->player->rmomy = 1; mo->player->rmomx = mo->player->rmomy = 1;
mo->player->cmomx = mo->player->cmomy = 0; mo->player->cmomx = mo->player->cmomy = 0;
P_ResetPlayer(mo->player); P_ResetPlayer(mo->player);
P_SetPlayerMobjState(mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
// Reset bot too. // Reset bot too.
if (bot) { if (bot) {
@ -2795,7 +2795,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
bot->player->rmomx = bot->player->rmomy = 1; bot->player->rmomx = bot->player->rmomy = 1;
bot->player->cmomx = bot->player->cmomy = 0; bot->player->cmomx = bot->player->cmomy = 0;
P_ResetPlayer(bot->player); P_ResetPlayer(bot->player);
P_SetPlayerMobjState(bot, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(bot, S_KART_STND1); // SRB2kart - was S_PLAY_STND
} }
} }
break; break;

View File

@ -96,7 +96,7 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
P_ClearStarPost(starpostnum); P_ClearStarPost(starpostnum);
P_ResetPlayer(thing->player); P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_FlashPal(thing->player, PAL_MIXUP, 10); P_FlashPal(thing->player, PAL_MIXUP, 10);
} }
@ -169,7 +169,7 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
thing->player->rmomx = thing->player->rmomy = 0; thing->player->rmomx = thing->player->rmomy = 0;
thing->player->speed = 0; thing->player->speed = 0;
P_ResetPlayer(thing->player); P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND
} }
if (flash) if (flash)

View File

@ -2836,7 +2836,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
if (player->climbing && P_IsObjectOnGround(player->mo)) if (player->climbing && P_IsObjectOnGround(player->mo))
{ {
P_ResetPlayer(player); P_ResetPlayer(player);
P_SetPlayerMobjState(player->mo, S_KART_STND); // SRB2kart P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart
} }
} }
@ -3485,7 +3485,7 @@ static void P_DoSuperStuff(player_t *player)
if (!((ALL7EMERALDS(emeralds)) && (player->charflags & SF_SUPER)) && !(ALL7EMERALDS(player->powers[pw_emeralds]))) if (!((ALL7EMERALDS(emeralds)) && (player->charflags & SF_SUPER)) && !(ALL7EMERALDS(player->powers[pw_emeralds])))
{ {
player->powers[pw_super] = 0; player->powers[pw_super] = 0;
P_SetPlayerMobjState(player->mo, S_KART_STND); P_SetPlayerMobjState(player->mo, S_KART_STND1);
P_RestoreMusic(player); P_RestoreMusic(player);
P_SpawnShieldOrb(player); P_SpawnShieldOrb(player);
@ -3889,7 +3889,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
{ {
player->skidtime = 0; player->skidtime = 0;
player->pflags &= ~PF_SPINNING; player->pflags &= ~PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_KART_STND); P_SetPlayerMobjState(player->mo, S_KART_STND1);
player->mo->momx = player->cmomx; player->mo->momx = player->cmomx;
player->mo->momy = player->cmomy; player->mo->momy = player->cmomy;
} }
@ -4430,7 +4430,7 @@ static void P_2dMovement(player_t *player)
if (player->pflags & PF_SPINNING && !player->exiting) if (player->pflags & PF_SPINNING && !player->exiting)
{ {
player->pflags &= ~PF_SPINNING; player->pflags &= ~PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
} }
} }
@ -4622,7 +4622,7 @@ static void P_3dMovement(player_t *player)
if (player->pflags & PF_SPINNING && !player->exiting) if (player->pflags & PF_SPINNING && !player->exiting)
{ {
player->pflags &= ~PF_SPINNING; player->pflags &= ~PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
} }
} }
@ -6657,6 +6657,7 @@ 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] && player->mo->z > player->mo->floorz))
{ {
// If the player is moving fast enough, // If the player is moving fast enough,
@ -6668,76 +6669,12 @@ static void P_MovePlayer(player_t *player)
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_KART_WALK1); // SRB2kart - was S_PLAY_RUN1 P_SetPlayerMobjState (player->mo, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
} }
*/
//{ SRB2kart
// Kart frames
{
if (player->kartstuff[k_squishedtimer] > 0)
{
if (player->mo->state != &states[S_KART_SQUISH])
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
}
else if (player->kartstuff[k_spinouttimer] > 0)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
player->frameangle -= ANGLE_22h;
}
else if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_squishedtimer] == 0)
{
// Standing frames - S_KART_STND S_KART_STND_L S_KART_STND_R
if (player->speed == 0)
{
if (cmd->buttons & BT_DRIFTRIGHT && !(player->mo->state == &states[S_KART_STND_R]))
P_SetPlayerMobjState(player->mo, S_KART_STND_R);
else if (cmd->buttons & BT_DRIFTLEFT && !(player->mo->state == &states[S_KART_STND_L]))
P_SetPlayerMobjState(player->mo, S_KART_STND_L);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(player->mo->state == &states[S_KART_STND]))
P_SetPlayerMobjState(player->mo, S_KART_STND);
}
// Drifting Left - S_KART_DRIFT_L1
else if (player->kartstuff[k_drift] > 0 && onground)
{
if (!(player->mo->state == &states[S_KART_DRIFT_L1] || player->mo->state == &states[S_KART_DRIFT_L2]))
P_SetPlayerMobjState(player->mo, S_KART_DRIFT_L1);
}
// Drifting Right - S_KART_DRIFT_R1
else if (player->kartstuff[k_drift] < 0 && onground)
{
if (!(player->mo->state == &states[S_KART_DRIFT_R1] || player->mo->state == &states[S_KART_DRIFT_R2]))
P_SetPlayerMobjState(player->mo, S_KART_DRIFT_R1);
}
// Run frames - S_KART_RUN1 S_KART_RUN_L1 S_KART_RUN_R1
else if (player->speed > runspd)
{
if (cmd->buttons & BT_DRIFTRIGHT && !(player->mo->state == &states[S_KART_RUN_R1] || player->mo->state == &states[S_KART_RUN_R2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN_R1);
else if (cmd->buttons & BT_DRIFTLEFT && !(player->mo->state == &states[S_KART_RUN_L1] || player->mo->state == &states[S_KART_RUN_L2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN_L1);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(player->mo->state == &states[S_KART_RUN1] || player->mo->state == &states[S_KART_RUN2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1);
}
// Walk frames - S_KART_WALK1 S_KART_WALK_L1 S_KART_WALK_R1
else if (player->speed <= runspd)
{
if (cmd->buttons & BT_DRIFTRIGHT && !(player->mo->state == &states[S_KART_WALK_R1] || player->mo->state == &states[S_KART_WALK_R2]))
P_SetPlayerMobjState(player->mo, S_KART_WALK_R1);
else if (cmd->buttons & BT_DRIFTLEFT && !(player->mo->state == &states[S_KART_WALK_L1] || player->mo->state == &states[S_KART_WALK_L2]))
P_SetPlayerMobjState(player->mo, S_KART_WALK_L1);
else if (!(cmd->buttons & BT_DRIFTRIGHT || cmd->buttons & BT_DRIFTLEFT) && !(player->mo->state == &states[S_KART_WALK1] || player->mo->state == &states[S_KART_WALK2]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1);
}
player->frameangle = player->mo->angle;
}
}
//}
// 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 && player->kartstuff[k_spinouttimer] == 0) //if (player->panim == PA_RUN && player->speed < runspd && player->kartstuff[k_spinouttimer] == 0)
P_SetPlayerMobjState(player->mo, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1 //P_SetPlayerMobjState(player->mo, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
// If Springing, but travelling DOWNWARD, change back! // If Springing, but travelling DOWNWARD, change back!
//if (player->mo->state == &states[S_PLAY_SPRING] && P_MobjFlip(player->mo)*player->mo->momz < 0) //if (player->mo->state == &states[S_PLAY_SPRING] && P_MobjFlip(player->mo)*player->mo->momz < 0)
@ -6746,11 +6683,32 @@ static void P_MovePlayer(player_t *player)
//else if (onground && (player->mo->state == &states[S_PLAY_SPRING] || player->panim == PA_FALL || player->mo->state == &states[S_PLAY_CARRY]) && !player->mo->momz) //else if (onground && (player->mo->state == &states[S_PLAY_SPRING] || player->panim == PA_FALL || player->mo->state == &states[S_PLAY_CARRY]) && !player->mo->momz)
// P_SetPlayerMobjState(player->mo, S_PLAY_STND); // P_SetPlayerMobjState(player->mo, S_PLAY_STND);
// Kart frames
if (player->kartstuff[k_squishedtimer] > 0)
{
if (player->mo->state != &states[S_KART_SQUISH])
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
}
else if (player->kartstuff[k_spinouttimer] > 0)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
player->frameangle -= ANGLE_22h;
}
else if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_squishedtimer] == 0)
{
K_KartMoveAnimation(player);
player->frameangle = player->mo->angle;
}
player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame. player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame.
// If you are stopped and are still walking, stand still! // If you are stopped and are still walking, stand still!
if (!player->mo->momx && !player->mo->momy && !player->mo->momz && player->panim == PA_WALK) if (!player->mo->momx && !player->mo->momy && !player->mo->momz && player->panim == PA_WALK)
P_SetPlayerMobjState(player->mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
//{ SRB2kart //{ SRB2kart
// Engine Sounds. // Engine Sounds.
@ -6797,7 +6755,7 @@ static void P_MovePlayer(player_t *player)
player->jumping = 0; player->jumping = 0;
player->secondjump = 0; player->secondjump = 0;
player->pflags &= ~PF_THOKKED; player->pflags &= ~PF_THOKKED;
P_SetPlayerMobjState(player->mo, S_KART_STND); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
} }
// Cap the speed limit on a spindash // Cap the speed limit on a spindash
@ -9480,7 +9438,7 @@ void P_PlayerThink(player_t *player)
if (player->powers[pw_ingoop]) if (player->powers[pw_ingoop])
{ {
if (player->mo->state == &states[S_KART_STND]) // SRB2kart - was S_PLAY_STND if (player->mo->state == &states[S_KART_STND1]) // SRB2kart - was S_PLAY_STND
player->mo->tics = 2; player->mo->tics = 2;
player->powers[pw_ingoop]--; player->powers[pw_ingoop]--;