Merge branch 'invinc-color-fix' into 'master'

Invinc color fix

See merge request KartKrew/Kart!553
This commit is contained in:
James R 2022-02-17 07:59:29 +00:00
commit 82377fb001
5 changed files with 10 additions and 5 deletions

View file

@ -244,7 +244,10 @@ typedef enum
SKINCOLOR_PEACH,
SKINCOLOR_BROWN,
SKINCOLOR_LEATHER,
SKINCOLOR_PINK,
FIRSTRAINBOWCOLOR,
SKINCOLOR_PINK = FIRSTRAINBOWCOLOR,
SKINCOLOR_ROSE,
SKINCOLOR_CINNAMON,
SKINCOLOR_RUBY,

View file

@ -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;

View file

@ -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)));
}
/*--------------------------------------------------

View file

@ -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;

View file

@ -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)