Add generic signpost sprite for skins that don't have one

This commit is contained in:
lachwright 2020-01-03 13:12:18 +08:00
parent 12e87d58b4
commit da226139f1
4 changed files with 34 additions and 17 deletions

View file

@ -6009,6 +6009,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_SIGNSTOP",
"S_SIGNBOARD",
"S_EGGMANSIGN",
"S_CLEARSIGN",
// Spike Ball
"S_SPIKEBALL1",

View file

@ -1861,6 +1861,7 @@ state_t states[NUMSTATES] =
{SPR_SIGN, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SIGNSTOP
{SPR_SIGN, FF_PAPERSPRITE| 2, -1, {NULL}, 0, 0, S_NULL}, // S_SIGNBOARD
{SPR_SIGN, FF_PAPERSPRITE| 1, -1, {NULL}, 0, 29, S_NULL}, // S_EGGMANSIGN
{SPR_SIGN, FF_PAPERSPRITE|18, -1, {NULL}, 0, 29, S_NULL}, // S_CLEARSIGN
// Spike Ball
{SPR_SPIK, 0, 1, {NULL}, 0, 0, S_SPIKEBALL2}, // S_SPIKEBALL1
@ -7850,7 +7851,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MT_SPARK, // painchance
sfx_s3kb8, // painsound
S_EGGMANSIGN, // meleestate
S_NULL, // missilestate
S_CLEARSIGN, // missilestate
S_SIGNSTOP, // deathstate
S_NULL, // xdeathstate
sfx_s3k64, // deathsound

View file

@ -2021,6 +2021,7 @@ typedef enum state
S_SIGNSTOP,
S_SIGNBOARD,
S_EGGMANSIGN,
S_CLEARSIGN,
// Spike Ball
S_SPIKEBALL1,

View file

@ -5177,6 +5177,8 @@ void A_SignPlayer(mobj_t *actor)
if (signcolor)
;
else if (!skin->sprites[SPR2_SIGN].numframes)
signcolor = facecolor;
else if ((actor->target->player->skincolor == skin->prefcolor) && (skin->prefoppositecolor)) // Set it as the skin's preferred oppositecolor?
signcolor = skin->prefoppositecolor;
else if (actor->target->player->skincolor) // Set the sign to be an appropriate background color for this player's skincolor.
@ -5221,21 +5223,33 @@ void A_SignPlayer(mobj_t *actor)
facecolor = skin->prefcolor;
if (signcolor)
;
else if (!skin->sprites[SPR2_SIGN].numframes)
signcolor = facecolor;
else if (skin->prefoppositecolor)
signcolor = skin->prefoppositecolor;
else if (facecolor)
signcolor = Color_Opposite[facecolor - 1][0];
}
if (skin && skin->sprites[SPR2_SIGN].numframes) // player face
if (skin)
{
if (skin->sprites[SPR2_SIGN].numframes) // player face
{
ov->color = facecolor;
ov->skin = skin;
P_SetMobjState(ov, actor->info->seestate); // S_PLAY_SIGN
}
else // CLEAR! sign
{
ov->color = SKINCOLOR_NONE;
ov->skin = NULL; // needs to be NULL in the case of SF_HIRES characters
P_SetMobjState(ov, actor->info->missilestate); // S_CLEARSIGN
}
}
else // Eggman face
{
ov->color = SKINCOLOR_NONE;
ov->skin = NULL;
P_SetMobjState(ov, actor->info->meleestate); // S_EGGMANSIGN
if (!signcolor)
signcolor = SKINCOLOR_CARBON;