Add flight indicator

This commit is contained in:
lachwright 2019-11-18 15:17:27 +08:00
parent 70051bd794
commit bb67b24143
5 changed files with 24 additions and 1 deletions

View File

@ -336,7 +336,20 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
// ********
// Thinkfly overlay
// doing this later :P
if (thinkfly)
{
if (overlay == NULL)
{
overlay = P_SpawnMobjFromMobj(tails, 0, 0, 0, MT_OVERLAY);
P_SetTarget(&overlay->target, tails);
P_SetMobjState(overlay, S_FLIGHTINDICATOR);
}
}
else if (overlay != NULL)
{
P_RemoveMobj(overlay);
overlay = NULL;
}
// Turn the virtual keypresses into ticcmd_t.
B_KeysToTiccmd(tails, cmd, forward, backward, left, right, false, false, jump, spin);

View File

@ -7139,6 +7139,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FOUR2",
"S_FIVE2",
"S_FLIGHTINDICATOR",
"S_LOCKON1",
"S_LOCKON2",
"S_LOCKON3",

View File

@ -505,6 +505,7 @@ light_t *t_lspr[NUMSPRITES] =
// Game Indicators
&lspr[NOLIGHT], // SPR_SCOR
&lspr[NOLIGHT], // SPR_DRWN
&lspr[NOLIGHT], // SPR_FLII
&lspr[NOLIGHT], // SPR_LCKN
&lspr[NOLIGHT], // SPR_TTAG
&lspr[NOLIGHT], // SPR_GFLG

View File

@ -402,6 +402,7 @@ char sprnames[NUMSPRITES + 1][5] =
// Game Indicators
"SCOR", // Score logo
"DRWN", // Drowning Timer
"FLII", // Flight indicator
"LCKN", // Target
"TTAG", // Tag Sign
"GFLG", // Got Flag sign
@ -3319,6 +3320,9 @@ state_t states[NUMSTATES] =
{SPR_DRWN, 10, 40, {NULL}, 0, 0, S_NULL}, // S_FOUR2
{SPR_DRWN, 11, 40, {NULL}, 0, 0, S_NULL}, // S_FIVE2
// Flight indicator
{SPR_FLII, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 4, S_NULL}, // S_FLIGHTINDICATOR
{SPR_LCKN, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LOCKON1
{SPR_LCKN, 1|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LOCKON2
{SPR_LCKN, 2|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LOCKON3

View File

@ -664,6 +664,7 @@ typedef enum sprite
// Game Indicators
SPR_SCOR, // Score logo
SPR_DRWN, // Drowning Timer
SPR_FLII, // AI flight indicator
SPR_LCKN, // Target
SPR_TTAG, // Tag Sign
SPR_GFLG, // Got Flag sign
@ -3454,6 +3455,8 @@ typedef enum state
S_FOUR2,
S_FIVE2,
S_FLIGHTINDICATOR,
S_LOCKON1,
S_LOCKON2,
S_LOCKON3,