Super color code cleaning, speed 50%, nothing special

This commit is contained in:
Inuyasha 2016-02-28 18:19:46 -08:00
parent ffa9a4e056
commit fc35c8557e
2 changed files with 7 additions and 22 deletions

View file

@ -4326,10 +4326,8 @@ void G_GhostTicker(void)
switch(g->color) switch(g->color)
{ {
case GHC_SUPER: // Super Sonic (P_DoSuperStuff) case GHC_SUPER: // Super Sonic (P_DoSuperStuff)
if (leveltime % 9 < 5) g->mo->color = SKINCOLOR_SUPER1;
g->mo->color = SKINCOLOR_SUPER1 + leveltime % 9; g->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4);
else
g->mo->color = SKINCOLOR_SUPER1 + 9 - leveltime % 9;
break; break;
case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer)
g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS);

View file

@ -3442,27 +3442,14 @@ static void P_DoSuperStuff(player_t *player)
player->mo->health--; player->mo->health--;
} }
// future todo: a skin option for this, and possibly more colors
switch (player->skin) switch (player->skin)
{ {
case 1: // Golden orange supertails. case 1: /* Tails */ player->mo->color = SKINCOLOR_TSUPER1; break;
if (leveltime % 9 < 5) case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break;
player->mo->color = SKINCOLOR_TSUPER1 + leveltime % 9; default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break;
else
player->mo->color = SKINCOLOR_TSUPER1 + 9 - leveltime % 9;
break;
case 2: // Pink superknux.
if (leveltime % 9 < 5)
player->mo->color = SKINCOLOR_KSUPER1 + leveltime % 9;
else
player->mo->color = SKINCOLOR_KSUPER1 + 9 - leveltime % 9;
break;
default: // Yousa yellow now!
if (leveltime % 9 < 5)
player->mo->color = SKINCOLOR_SUPER1 + leveltime % 9;
else
player->mo->color = SKINCOLOR_SUPER1 + 9 - leveltime % 9;
break;
} }
player->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4);
if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN))
&& !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy))