diff --git a/src/doomdef.h b/src/doomdef.h index ee17fb689..8fb3a92b8 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -244,7 +244,10 @@ typedef enum SKINCOLOR_PEACH, SKINCOLOR_BROWN, SKINCOLOR_LEATHER, - SKINCOLOR_PINK, + + FIRSTRAINBOWCOLOR, + + SKINCOLOR_PINK = FIRSTRAINBOWCOLOR, SKINCOLOR_ROSE, SKINCOLOR_CINNAMON, SKINCOLOR_RUBY, diff --git a/src/g_demo.c b/src/g_demo.c index 023482ba8..786097362 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -49,6 +49,7 @@ #include "k_battle.h" #include "k_respawn.h" #include "k_bot.h" +#include "k_color.h" static CV_PossibleValue_t recordmultiplayerdemos_cons_t[] = {{0, "Disabled"}, {1, "Manual Save"}, {2, "Auto Save"}, {0, NULL}}; consvar_t cv_recordmultiplayerdemos = CVAR_INIT ("netdemo_record", "Manual Save", CV_SAVE, recordmultiplayerdemos_cons_t, NULL); @@ -1330,7 +1331,7 @@ skippedghosttic: g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) - g->mo->color = (UINT16)(SKINCOLOR_RUBY + (leveltime % (FIRSTSUPERCOLOR - SKINCOLOR_RUBY))); // Passes through all saturated colours + g->mo->color = K_RainbowColor(leveltime); // Passes through all saturated colours break; default: break; diff --git a/src/k_color.c b/src/k_color.c index 0821c4437..ac1a2e6c8 100644 --- a/src/k_color.c +++ b/src/k_color.c @@ -39,7 +39,7 @@ UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b) UINT16 K_RainbowColor(tic_t time) { - return (UINT16)(SKINCOLOR_PINK + (time % (SKINCOLOR_TAFFY - SKINCOLOR_PINK))); + return (UINT16)(FIRSTRAINBOWCOLOR + (time % (FIRSTSUPERCOLOR - FIRSTRAINBOWCOLOR))); } /*-------------------------------------------------- diff --git a/src/p_mobj.c b/src/p_mobj.c index 26ada90a9..2164038be 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9789,7 +9789,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) break; case MT_EGGROBO1: mobj->movecount = P_RandomKey(13); - mobj->color = SKINCOLOR_RUBY + P_RandomKey(numskincolors - SKINCOLOR_RUBY); + mobj->color = FIRSTRAINBOWCOLOR + P_RandomKey(FIRSTSUPERCOLOR - FIRSTRAINBOWCOLOR); break; case MT_HIVEELEMENTAL: mobj->extravalue1 = 5; diff --git a/src/p_user.c b/src/p_user.c index 3b7382392..b8837144e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -53,6 +53,7 @@ #include "k_bot.h" #include "k_grandprix.h" #include "k_terrain.h" // K_SpawnSplashForMobj +#include "k_color.h" #ifdef HW3SOUND #include "hardware/hw3sound.h" @@ -1629,7 +1630,7 @@ static void P_CheckInvincibilityTimer(player_t *player) if (!player->invincibilitytimer) return; - player->mo->color = (UINT16)(SKINCOLOR_PINK + (leveltime % (numskincolors - SKINCOLOR_PINK))); + player->mo->color = K_RainbowColor(leveltime); // Resume normal music stuff. if (player->invincibilitytimer == 1)