SPR2_SIGL

If you achieve a perfect race (OK hand for every lap) on Hard speed (or better), use a special taunting signpost frame.
This commit is contained in:
toaster 2023-09-18 17:35:59 +01:00
parent 35a06ed175
commit e438ef0a97
4 changed files with 29 additions and 4 deletions

View file

@ -367,6 +367,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_KART_SPINOUT",
"S_KART_DEAD",
"S_KART_SIGN",
"S_KART_SIGL",
// technically the player goes here but it's an infinite tic state
"S_OBJPLACE_DUMMY",

View file

@ -916,7 +916,7 @@ char spr2names[NUMPLAYERSPRITES][5] =
"SPIN", // Spinout
"DEAD", // Dead
"SIGN", // Finish signpost
"SIGN", "SIGL", // Finish signpost
"XTRA", // Three Faces of Darkness
"TALK", // Dialogue
};
@ -959,6 +959,7 @@ playersprite_t spr2defaults[NUMPLAYERSPRITES] = {
0, // SPR2_DEAD
0, // SPR2_SIGN
SPR2_SIGN, // SPR2_SIGL
0, // SPR2_XTRA
0, // SPR2_TALK
};
@ -1018,7 +1019,8 @@ state_t states[NUMSTATES] =
{SPR_PLAY, SPR2_DRRI, 1, {NULL}, 0, 0, S_KART_DRIFT_R_IN}, // S_KART_DRIFT_R_IN
{SPR_PLAY, SPR2_SPIN|FF_ANIMATE, 350, {NULL}, 0, 1, S_KART_STILL}, // S_KART_SPINOUT
{SPR_PLAY, SPR2_DEAD, 3, {NULL}, 0, 0, S_KART_DEAD}, // S_KART_DEAD
{SPR_PLAY, SPR2_SIGN|FF_PAPERSPRITE, 1, {NULL}, 0, 0, S_KART_SIGN}, // S_KART_SIGN
{SPR_PLAY, SPR2_SIGN|FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 0, 1, 0}, // S_KART_SIGN
{SPR_PLAY, SPR2_SIGL|FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 0, 1, 0}, // S_KART_SIGL
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_OBJPLACE_DUMMY}, // S_OBJPLACE_DUMMY

View file

@ -1469,7 +1469,7 @@ typedef enum playersprite
SPR2_DRRN, SPR2_DRRO, SPR2_DRRI,
SPR2_SPIN,
SPR2_DEAD,
SPR2_SIGN,
SPR2_SIGN, SPR2_SIGL,
SPR2_XTRA,
SPR2_TALK,
@ -1525,6 +1525,7 @@ typedef enum state
S_KART_SPINOUT,
S_KART_DEAD,
S_KART_SIGN,
S_KART_SIGL,
// technically the player goes here but it's an infinite tic state
S_OBJPLACE_DUMMY,

View file

@ -8731,6 +8731,23 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
mobj->angle += ANGLE_11hh;
}
boolean newperfect = false;
if (
(newplayer != NULL)
&& (gametyperules & GTR_CIRCUIT)
&& (gamespeed >= KARTSPEED_HARD)
&& (K_TimeAttackRules() == false)
)
{
UINT16 totalLaps = numlaps;
if (inDuel == false)
{
totalLaps *= 2;
}
newperfect = (newplayer->lapPoints >= totalLaps);
}
mobj_t *cur = mobj->hnext;
while (cur && !P_MobjWasRemoved(cur))
{
@ -8746,7 +8763,8 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
cur->frame = cur->state->frame + skincolors[newplayer->skincolor].invshade;
}
}
else if (cur->state == &states[S_KART_SIGN])
else if (cur->state == &states[S_KART_SIGN]
|| cur->state == &states[S_KART_SIGL])
{
z += (5*mobj->scale);
amt += 1;
@ -8755,6 +8773,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
{
cur->skin = &skins[newplayer->skin];
cur->color = newplayer->skincolor;
// Even if we didn't have the Perfect Sign to consider,
// it's still necessary to refresh SPR2 on skin changes.
P_SetMobjState(cur, (newperfect == true) ? S_KART_SIGL : S_KART_SIGN);
}
}
else if (cur->state == &states[S_SIGN_ERROR])