mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Transparent Ring Debt indicator for local player, if it's sticking around
This commit is contained in:
parent
136bb810e2
commit
b458e28a52
2 changed files with 29 additions and 25 deletions
|
|
@ -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.
|
||||||
|
|
||||||
|
|
|
||||||
52
src/k_kart.c
52
src/k_kart.c
|
|
@ -8429,32 +8429,36 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
// 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)
|
||||||
{
|
{
|
||||||
mobj_t *debtflag = P_SpawnMobj(player->mo->x + player->mo->momx, player->mo->y + player->mo->momy,
|
UINT8 doubler;
|
||||||
player->mo->z + P_GetMobjZMovement(player->mo) + player->mo->height + (24*player->mo->scale), MT_THOK);
|
|
||||||
|
|
||||||
P_SetMobjState(debtflag, S_RINGDEBT);
|
// GROSS. In order to have a transparent version of this for a splitscreen local player, we actually need to spawn two!
|
||||||
P_SetScale(debtflag, (debtflag->destscale = player->mo->scale));
|
for (doubler = 0; doubler < 2; doubler++)
|
||||||
|
|
||||||
K_MatchGenericExtraFlags(debtflag, player->mo);
|
|
||||||
debtflag->frame += (leveltime % 4);
|
|
||||||
|
|
||||||
if ((leveltime/12) & 1)
|
|
||||||
debtflag->frame += 4;
|
|
||||||
|
|
||||||
debtflag->color = player->skincolor;
|
|
||||||
debtflag->fuse = 2;
|
|
||||||
|
|
||||||
if (!(gametyperules & GTR_SPHERES))
|
|
||||||
{
|
{
|
||||||
P_SetScale(debtflag,
|
mobj_t *debtflag = P_SpawnMobj(player->mo->x + player->mo->momx, player->mo->y + player->mo->momy,
|
||||||
Easing_InQuint(
|
player->mo->z + P_GetMobjZMovement(player->mo) + player->mo->height + (24*player->mo->scale), MT_THOK);
|
||||||
min(FRACUNIT, FRACUNIT*player->ringvisualwarning/(TICRATE*3)),
|
|
||||||
debtflag->scale,
|
P_SetMobjState(debtflag, S_RINGDEBT);
|
||||||
debtflag->scale*2
|
P_SetScale(debtflag, (debtflag->destscale = player->mo->scale));
|
||||||
)
|
|
||||||
);
|
K_MatchGenericExtraFlags(debtflag, player->mo);
|
||||||
if (player->ringvisualwarning <= 1)
|
debtflag->frame += (leveltime % 4);
|
||||||
debtflag->renderflags = K_GetPlayerDontDrawFlag(player);
|
|
||||||
|
if ((leveltime/12) & 1)
|
||||||
|
debtflag->frame += 4;
|
||||||
|
|
||||||
|
debtflag->color = player->skincolor;
|
||||||
|
debtflag->fuse = 2;
|
||||||
|
|
||||||
|
if (doubler == 0) // Real copy. Draw for everyone but us.
|
||||||
|
{
|
||||||
|
debtflag->renderflags |= K_GetPlayerDontDrawFlag(player);
|
||||||
|
}
|
||||||
|
else if (doubler == 1) // Fake copy. Draw for only us, and go transparent after a bit.
|
||||||
|
{
|
||||||
|
debtflag->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(player));
|
||||||
|
if (player->ringvisualwarning <= 1 || gametyperules & GTR_SPHERES)
|
||||||
|
debtflag->renderflags |= RF_TRANS50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue