From a750fdd810cf40e1104cd13d39919b36b1602f53 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 16 Feb 2022 23:01:07 -0500 Subject: [PATCH] Invincibility wasn't using K_RainbowColor anymore, what the function was designed for... --- src/doomdef.h | 5 ++++- src/g_demo.c | 3 ++- src/k_color.c | 2 +- src/p_mobj.c | 2 +- src/p_user.c | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) 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 b8dda4299..65a2d3500 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); @@ -1316,7 +1317,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 ab6b30655..17b7483f0 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 f96eb80ee..3e9c41b04 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" @@ -1631,7 +1632,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)