Transparent Ring Debt indicator for local player, if it's sticking around

This commit is contained in:
AJ Martinez 2024-03-05 16:42:22 -07:00
parent 136bb810e2
commit b458e28a52
2 changed files with 29 additions and 25 deletions

View file

@ -987,7 +987,7 @@ struct player_t
INT16 incontrol; // -1 to -175 when spinning out or tumbling, 1 to 175 when not. Use to check for combo hits or emergency inputs. INT16 incontrol; // -1 to -175 when spinning out or tumbling, 1 to 175 when not. Use to check for combo hits or emergency inputs.
UINT16 progressivethrust; // When getting beat up in GTR_BUMPERS, speed up the longer you've been out of control. UINT16 progressivethrust; // When getting beat up in GTR_BUMPERS, speed up the longer you've been out of control.
UINT8 ringvisualwarning; UINT8 ringvisualwarning; // Check with > 1, not >= 1! Set when put in debt, counts down and holds at 1 when still in debt.
boolean analoginput; // Has an input been recorded that requires analog usage? For input display. boolean analoginput; // Has an input been recorded that requires analog usage? For input display.

View file

@ -8428,6 +8428,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
// Race: spawn ring debt indicator // Race: spawn ring debt indicator
// Battle: spawn zero-bumpers indicator // Battle: spawn zero-bumpers indicator
if ((gametyperules & GTR_SPHERES) ? player->mo->health <= 1 : player->rings <= 0) if ((gametyperules & GTR_SPHERES) ? player->mo->health <= 1 : player->rings <= 0)
{
UINT8 doubler;
// GROSS. In order to have a transparent version of this for a splitscreen local player, we actually need to spawn two!
for (doubler = 0; doubler < 2; doubler++)
{ {
mobj_t *debtflag = P_SpawnMobj(player->mo->x + player->mo->momx, player->mo->y + player->mo->momy, mobj_t *debtflag = P_SpawnMobj(player->mo->x + player->mo->momx, player->mo->y + player->mo->momy,
player->mo->z + P_GetMobjZMovement(player->mo) + player->mo->height + (24*player->mo->scale), MT_THOK); player->mo->z + P_GetMobjZMovement(player->mo) + player->mo->height + (24*player->mo->scale), MT_THOK);
@ -8444,17 +8449,16 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
debtflag->color = player->skincolor; debtflag->color = player->skincolor;
debtflag->fuse = 2; debtflag->fuse = 2;
if (!(gametyperules & GTR_SPHERES)) if (doubler == 0) // Real copy. Draw for everyone but us.
{ {
P_SetScale(debtflag, debtflag->renderflags |= K_GetPlayerDontDrawFlag(player);
Easing_InQuint( }
min(FRACUNIT, FRACUNIT*player->ringvisualwarning/(TICRATE*3)), else if (doubler == 1) // Fake copy. Draw for only us, and go transparent after a bit.
debtflag->scale, {
debtflag->scale*2 debtflag->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(player));
) if (player->ringvisualwarning <= 1 || gametyperules & GTR_SPHERES)
); debtflag->renderflags |= RF_TRANS50;
if (player->ringvisualwarning <= 1) }
debtflag->renderflags = K_GetPlayerDontDrawFlag(player);
} }
} }