Some Color code, Kart powers

This commit is contained in:
ZTsukei 2016-08-11 21:42:11 -04:00
parent e4a970f894
commit 4112d44529
15 changed files with 669 additions and 60 deletions

View file

@ -409,6 +409,7 @@ DBGNAME?=$(EXENAME).debug
# $(OBJDIR)/dstrings.o \
# not too sophisticated dependency
# SRB2kart kart.o on line 433 below
OBJS:=$(i_main_o) \
$(OBJDIR)/comptime.o \
$(OBJDIR)/string.o \
@ -429,6 +430,7 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/hu_stuff.o \
$(OBJDIR)/y_inter.o \
$(OBJDIR)/st_stuff.o \
$(OBJDIR)/k_kart.o \
$(OBJDIR)/m_anigif.o \
$(OBJDIR)/m_argv.o \
$(OBJDIR)/m_bbox.o \

View file

@ -154,6 +154,8 @@ typedef struct
INT32 ringweapons;
UINT16 powers[NUMPOWERS];
INT32 kartstuff[NUMKARTSTUFF]; // SRB2kart
// Score is resynched in the confirm resync packet
INT32 health;
SINT8 lives;

View file

@ -44,6 +44,7 @@
#include "lua_hook.h"
#include "m_cond.h"
#include "m_anigif.h"
#include "k_kart.h" // SRB2kart
#ifdef NETGAME_DEVMODE
#define CV_RESTRICT CV_NETVAR
@ -551,7 +552,7 @@ void D_RegisterClientCommands(void)
for (i = 0; i < MAXSKINCOLORS; i++)
{
Color_cons_t[i].value = i;
Color_cons_t[i].strvalue = Color_Names[i];
Color_cons_t[i].strvalue = KartColor_Names[i]; // SRB2kart
}
Color_cons_t[MAXSKINCOLORS].value = 0;
Color_cons_t[MAXSKINCOLORS].strvalue = NULL;
@ -1107,7 +1108,7 @@ static void SendNameAndColor(void)
{
CV_StealthSetValue(&cv_playercolor, skins[cv_skin.value].prefcolor);
players[consoleplayer].skincolor = (cv_playercolor.value&0x1F) % MAXSKINCOLORS;
players[consoleplayer].skincolor = (cv_playercolor.value&0x3F) % MAXSKINCOLORS;
if (players[consoleplayer].mo)
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
@ -1231,7 +1232,7 @@ static void SendNameAndColor2(void)
{
CV_StealthSetValue(&cv_playercolor2, skins[players[secondplaya].skin].prefcolor);
players[secondplaya].skincolor = (cv_playercolor2.value&0x1F) % MAXSKINCOLORS;
players[secondplaya].skincolor = (cv_playercolor2.value&0x3F) % MAXSKINCOLORS;
if (players[secondplaya].mo)
players[secondplaya].mo->color = players[secondplaya].skincolor;

View file

@ -29,6 +29,9 @@
// as commands per game tick.
#include "d_ticcmd.h"
// SRB2kart stuff
#include "k_kart.h"
// Extra abilities/settings for skins (combinable stuff)
typedef enum
{
@ -286,6 +289,9 @@ typedef struct player_s
// Power ups. invinc and invis are tic counters.
UINT16 powers[NUMPOWERS];
// SRB2kart stuff
INT32 kartstuff[NUMKARTSTUFF];
// Bit flags.
// See pflags_t, above.
pflags_t pflags;
@ -365,6 +371,7 @@ typedef struct player_s
INT16 totalring; // Total number of rings obtained for Race Mode
tic_t realtime; // integer replacement for leveltime
UINT8 laps; // Number of laps (optional)
tic_t checkpointtimes[256]; // Individual checkpoint times // SRB2kart
////////////////////
// CTF Mode Stuff //

View file

@ -6817,33 +6817,72 @@ static const char *const ML_LIST[16] = {
// This DOES differ from r_draw's Color_Names, unfortunately.
// Also includes Super colors
static const char *COLOR_ENUMS[] = {
"NONE", // SKINCOLOR_NONE
"WHITE", // SKINCOLOR_WHITE
"SILVER", // SKINCOLOR_SILVER
"GREY", // SKINCOLOR_GREY
"BLACK", // SKINCOLOR_BLACK
"CYAN", // SKINCOLOR_CYAN
"TEAL", // SKINCOLOR_TEAL
"STEELBLUE", // SKINCOLOR_STEELBLUE
"BLUE", // SKINCOLOR_BLUE
"PEACH", // SKINCOLOR_PEACH
"TAN", // SKINCOLOR_TAN
"PINK", // SKINCOLOR_PINK
"LAVENDER", // SKINCOLOR_LAVENDER
"PURPLE", // SKINCOLOR_PURPLE
"ORANGE", // SKINCOLOR_ORANGE
"ROSEWOOD", // SKINCOLOR_ROSEWOOD
"BEIGE", // SKINCOLOR_BEIGE
"BROWN", // SKINCOLOR_BROWN
"RED", // SKINCOLOR_RED
"DARKRED", // SKINCOLOR_DARKRED
"NEONGREEN", // SKINCOLOR_NEONGREEN
"GREEN", // SKINCOLOR_GREEN
"ZIM", // SKINCOLOR_ZIM
"OLIVE", // SKINCOLOR_OLIVE
"YELLOW", // SKINCOLOR_YELLOW
"GOLD", // SKINCOLOR_GOLD
static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"NONE", // 00 // SKINCOLOR_NONE
"IVORY", // 01 // SKINCOLOR_IVORY
"WHITE", // 02 // SKINCOLOR_WHITE
"SILVER", // 03 // SKINCOLOR_SILVER
"CLOUDY", // 04 // SKINCOLOR_CLOUDY
"GREY", // 05 // SKINCOLOR_GREY
"DARKGREY", // 06 // SKINCOLOR_DARKGREY
"BLACK", // 07 // SKINCOLOR_BLACK
"SALMON", // 08 // SKINCOLOR_SALMON
"PINK", // 09 // SKINCOLOR_PINK
"LIGHTRED", // 10 // SKINCOLOR_LIGHTRED
"FULLRANGERED", // 11 // SKINCOLOR_FULLRANGERED
"RED", // 12 // SKINCOLOR_RED
"DARKPINK", // 13 // SKINCOLOR_DARKPINK
"DARKRED", // 14 // SKINCOLOR_DARKRED
"DAWN", // 15 // SKINCOLOR_DAWN
"ORANGE", // 16 // SKINCOLOR_ORANGE
"FULLRANGEORANGE", // 17 // SKINCOLOR_FULLRANGEORANGE
"DARKORANGE", // 18 // SKINCOLOR_DARKORANGE
"GOLDENBROWN", // 19 // SKINCOLOR_GOLDENBROWN
"ROSEWOOD", // 20 // SKINCOLOR_ROSEWOOD
"DARKROSEWOOD", // 21 // SKINCOLOR_DARKROSEWOOD
"SEPIA", // 22 // SKINCOLOR_SEPIA
"BEIGE", // 23 // SKINCOLOR_BEIGE
"BROWN", // 24 // SKINCOLOR_BROWN
"LEATHER", // 25 // SKINCOLOR_LEATHER
"YELLOW", // 26 // SKINCOLOR_YELLOW
"PEACH", // 27 // SKINCOLOR_PEACH
"LIGHTORANGE", // 28 // SKINCOLOR_LIGHTORANGE
"PEACHBROWN", // 29 // SKINCOLOR_PEACHBROWN
"GOLD", // 30 // SKINCOLOR_GOLD
"FULLRANGEPEACHBROWN", // 31 // SKINCOLOR_FULLRANGEPEACHBROWN
"GYPSYVOMIT", // 32 // SKINCOLOR_GYPSYVOMIT
"GARDEN", // 33 // SKINCOLOR_GARDEN
"LIGHTARMY", // 34 // SKINCOLOR_LIGHTARMY
"ARMY", // 35 // SKINCOLOR_ARMY
"PISTACHIO", // 36 // SKINCOLOR_PISTACHIO
"ROBOHOODGREEN", // 37 // SKINCOLOR_ROBOHOODGREEN
"OLIVE", // 38 // SKINCOLOR_OLIVE
"DARKARMY", // 39 // SKINCOLOR_DARKARMY
"LIGHTGREEN", // 40 // SKINCOLOR_LIGHTGREEN
"UGLYGREEN", // 41 // SKINCOLOR_UGLYGREEN
"NEONGREEN", // 42 // SKINCOLOR_NEONGREEN
"GREEN", // 43 // SKINCOLOR_GREEN
"DARKGREEN", // 44 // SKINCOLOR_DARKGREEN
"DARKNEONGREEN", // 45 // SKINCOLOR_DARKNEONGREEN
"FROST", // 46 // SKINCOLOR_FROST
"LIGHTSTEELBLUE", // 47 // SKINCOLOR_LIGHTSTEELBLUE
"LIGHTBLUE", // 48 // SKINCOLOR_LIGHTBLUE
"CYAN", // 49 // SKINCOLOR_CYAN
"CERULEAN", // 50 // SKINCOLOR_CERULEAN
"TURQUOISE", // 51 // SKINCOLOR_TURQUOISE
"TEAL", // 52 // SKINCOLOR_TEAL
"STEELBLUE", // 53 // SKINCOLOR_STEELBLUE
"BLUE", // 54 // SKINCOLOR_BLUE
"FULLRANGEBLUE", // 55 // SKINCOLOR_FULLRANGEBLUE
"DARKSTEELBLUE", // 56 // SKINCOLOR_DARKSTEELBLUE
"DARKBLUE", // 57 // SKINCOLOR_DARKBLUE
"JETBLACK", // 58 // SKINCOLOR_JETBLACK
"LILAC", // 59 // SKINCOLOR_LILAC
"PURPLE", // 60 // SKINCOLOR_PURPLE
"LAVENDER", // 61 // SKINCOLOR_LAVENDER
"BYZANTIUM", // 62 // SKINCOLOR_BYZANTIUM
"INDIGO", // 63 // SKINCOLOR_INDIGO
// Super special awesome Super flashing colors!
"SUPER1", // SKINCOLOR_SUPER1
"SUPER2", // SKINCOLOR_SUPER2,
@ -7718,7 +7757,7 @@ static fixed_t find_const(const char **rword)
free(word);
return r;
}
else if (fastncmp("SKINCOLOR_",word,10)) {
else if (fastncmp("SKINCOLOR_",word,20)) {
char *p = word+10;
for (i = 0; i < MAXTRANSLATIONS; i++)
if (fastcmp(p, COLOR_ENUMS[i])) {
@ -8128,7 +8167,7 @@ static inline int lib_getenum(lua_State *L)
if (mathlib) return luaL_error(L, "huditem '%s' could not be found.\n", word);
return 0;
}
else if (fastncmp("SKINCOLOR_",word,10)) {
else if (fastncmp("SKINCOLOR_",word,20)) {
p = word+10;
for (i = 0; i < MAXTRANSLATIONS; i++)
if (fastcmp(p, COLOR_ENUMS[i])) {

View file

@ -228,33 +228,71 @@ extern FILE *logstream;
typedef enum
{
SKINCOLOR_NONE = 0,
SKINCOLOR_IVORY,
SKINCOLOR_WHITE,
SKINCOLOR_SILVER,
SKINCOLOR_CLOUDY,
SKINCOLOR_GREY,
SKINCOLOR_DARKGREY,
SKINCOLOR_BLACK,
SKINCOLOR_SALMON,
SKINCOLOR_PINK,
SKINCOLOR_LIGHTRED,
SKINCOLOR_FULLRANGERED,
SKINCOLOR_RED,
SKINCOLOR_DARKPINK,
SKINCOLOR_DARKRED,
SKINCOLOR_DAWN,
SKINCOLOR_ORANGE,
SKINCOLOR_FULLRANGEORANGE,
SKINCOLOR_DARKORANGE,
SKINCOLOR_GOLDENBROWN,
SKINCOLOR_ROSEWOOD,
SKINCOLOR_DARKROSEWOOD,
SKINCOLOR_SEPIA,
SKINCOLOR_BEIGE,
SKINCOLOR_BROWN,
SKINCOLOR_LEATHER,
SKINCOLOR_YELLOW,
SKINCOLOR_PEACH,
SKINCOLOR_LIGHTORANGE,
SKINCOLOR_PEACHBROWN,
SKINCOLOR_GOLD,
SKINCOLOR_FULLRANGEPEACHBROWN,
SKINCOLOR_GYPSYVOMIT,
SKINCOLOR_GARDEN,
SKINCOLOR_LIGHTARMY,
SKINCOLOR_ARMY,
SKINCOLOR_PISTACHIO,
SKINCOLOR_ROBOHOODGREEN,
SKINCOLOR_OLIVE,
SKINCOLOR_DARKARMY,
SKINCOLOR_LIGHTGREEN,
SKINCOLOR_UGLYGREEN,
SKINCOLOR_NEONGREEN,
SKINCOLOR_GREEN,
SKINCOLOR_DARKGREEN,
SKINCOLOR_DARKNEONGREEN,
SKINCOLOR_FROST,
SKINCOLOR_LIGHTSTEELBLUE,
SKINCOLOR_LIGHTBLUE,
SKINCOLOR_CYAN,
SKINCOLOR_CERULEAN,
SKINCOLOR_TURQUOISE,
SKINCOLOR_TEAL,
SKINCOLOR_STEELBLUE,
SKINCOLOR_BLUE,
SKINCOLOR_PEACH,
SKINCOLOR_TAN,
SKINCOLOR_PINK,
SKINCOLOR_LAVENDER,
SKINCOLOR_FULLRANGEBLUE,
SKINCOLOR_DARKSTEELBLUE,
SKINCOLOR_DARKBLUE,
SKINCOLOR_JETBLACK,
SKINCOLOR_LILAC,
SKINCOLOR_PURPLE,
SKINCOLOR_ORANGE,
SKINCOLOR_ROSEWOOD,
SKINCOLOR_BEIGE,
SKINCOLOR_BROWN,
SKINCOLOR_RED,
SKINCOLOR_DARKRED,
SKINCOLOR_NEONGREEN,
SKINCOLOR_GREEN,
SKINCOLOR_ZIM,
SKINCOLOR_OLIVE,
SKINCOLOR_YELLOW,
SKINCOLOR_GOLD,
SKINCOLOR_LAVENDER,
SKINCOLOR_BYZANTIUM,
SKINCOLOR_INDIGO,
// Careful! MAXSKINCOLORS cannot be greater than 0x20!
// Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now.
MAXSKINCOLORS,
// Super special awesome Super flashing colors!

View file

@ -45,6 +45,7 @@
#include "b_bot.h"
#include "m_cond.h" // condition sets
#include "md5.h" // demo checksums
#include "k_kart.h" // SRB2kart
gameaction_t gameaction;
gamestate_t gamestate = GS_NULL;
@ -2078,6 +2079,14 @@ void G_PlayerReborn(INT32 player)
INT16 bot;
SINT8 pity;
// SRB2kart
INT32 x;
tic_t checkpointtimes[256];
INT32 playerahead;
INT32 starpostwp;
INT32 lakitu;
score = players[player].score;
lives = players[player].lives;
continues = players[player].continues;
@ -2124,6 +2133,12 @@ void G_PlayerReborn(INT32 player)
bot = players[player].bot;
pity = players[player].pity;
// SRB2kart
for (x = 0; x < (256); x++) checkpointtimes[x] = players[player].checkpointtimes[x];
playerahead = players[player].kartstuff[k_playerahead];
starpostwp = players[player].kartstuff[k_starpostwp];
lakitu = players[player].kartstuff[k_lakitu];
p = &players[player];
memset(p, 0, sizeof (*p));
@ -2171,6 +2186,12 @@ void G_PlayerReborn(INT32 player)
p->bot = 1; // reset to AI-controlled
p->pity = pity;
// SRB2kart
for (x = 0; x < 256; x++) p->checkpointtimes[x] = checkpointtimes[x];
p->kartstuff[k_playerahead] = playerahead;
p->kartstuff[k_starpostwp] = starpostwp;
p->kartstuff[k_lakitu] = lakitu;
// Don't do anything immediately
p->pflags |= PF_USEDOWN;
p->pflags |= PF_ATTACKDOWN;
@ -2191,7 +2212,13 @@ void G_PlayerReborn(INT32 player)
mapmusname[6] = 0;
mapmusflags = mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK;
}
//SRB2kart - leveltime stuff
if (leveltime > 157)
{
S_ChangeMusic(mapmusname, mapmusflags, true);
if (p->laps == (unsigned)(cv_numlaps.value - 1))
S_SpeedMusic(1.2f);
}
}
if (gametype == GT_COOP)
@ -5106,7 +5133,7 @@ void G_DoPlayDemo(char *defdemoname)
// Set color
for (i = 0; i < MAXSKINCOLORS; i++)
if (!stricmp(Color_Names[i],color))
if (!stricmp(KartColor_Names[i],color)) // SRB2kart
{
players[0].skincolor = i;
break;
@ -5352,7 +5379,7 @@ void G_AddGhost(char *defdemoname)
// Set color
gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor;
for (i = 0; i < MAXSKINCOLORS; i++)
if (!stricmp(Color_Names[i],color))
if (!stricmp(KartColor_Names[i],color)) // SRB2kart
{
gh->mo->color = (UINT8)i;
break;

View file

@ -975,9 +975,11 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
case SKINCOLOR_PEACH:
blendcolor = V_GetColor(71);
break;
/*
case SKINCOLOR_TAN:
blendcolor = V_GetColor(79);
break;
*/
case SKINCOLOR_PINK:
blendcolor = V_GetColor(147);
break;
@ -1011,9 +1013,11 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
case SKINCOLOR_GREEN:
blendcolor = V_GetColor(166);
break;
/*
case SKINCOLOR_ZIM:
blendcolor = V_GetColor(180);
break;
*/
case SKINCOLOR_OLIVE:
blendcolor = V_GetColor(108);
break;

390
src/k_kart.c Normal file
View file

@ -0,0 +1,390 @@
// SONIC ROBO BLAST 2 KART ~ ZarroTsu
//-----------------------------------------------------------------------------
/// \file k_kart.c
/// \brief SRB2kart general.
/// All of the SRB2kart-unique stuff.
#include "doomdef.h"
#include "r_draw.h"
#include "r_local.h"
//{ SRB2kart Color Code
#define SKIN_RAMP_LENGTH 16
#define DEFAULT_STARTTRANSCOLOR 160
#define NUM_PALETTE_ENTRIES 256
const char *KartColor_Names[MAXSKINCOLORS] =
{
"None", // 00 // SKINCOLOR_NONE
"Ivory", // 01 // SKINCOLOR_IVORY
"White", // 02 // SKINCOLOR_WHITE
"Silver", // 03 // SKINCOLOR_SILVER
"Cloudy", // 04 // SKINCOLOR_CLOUDY
"Grey", // 05 // SKINCOLOR_GREY
"Dark Grey", // 06 // SKINCOLOR_DARKGREY
"Black", // 07 // SKINCOLOR_BLACK
"Salmon", // 08 // SKINCOLOR_SALMON
"Pink", // 09 // SKINCOLOR_PINK
"Light Red", // 10 // SKINCOLOR_LIGHTRED
"Full-Range Red", // 11 // SKINCOLOR_FULLRANGERED
"Red", // 12 // SKINCOLOR_RED
"Dark Pink", // 13 // SKINCOLOR_DARKPINK
"Dark Red", // 14 // SKINCOLOR_DARKRED
"Dawn", // 15 // SKINCOLOR_DAWN
"Orange", // 16 // SKINCOLOR_ORANGE
"Full-Range Orange", // 17 // SKINCOLOR_FULLRANGEORANGE
"Dark Orange", // 18 // SKINCOLOR_DARKORANGE
"Golden Brown", // 19 // SKINCOLOR_GOLDENBROWN
"Rosewood", // 20 // SKINCOLOR_ROSEWOOD
"Dark Rosewood", // 21 // SKINCOLOR_DARKROSEWOOD
"Sepia", // 22 // SKINCOLOR_SEPIA
"Beige", // 23 // SKINCOLOR_BEIGE
"Brown", // 24 // SKINCOLOR_BROWN
"Leather", // 25 // SKINCOLOR_LEATHER
"Yellow", // 26 // SKINCOLOR_YELLOW
"Peach", // 27 // SKINCOLOR_PEACH
"Light Orange", // 28 // SKINCOLOR_LIGHTORANGE
"Peach-Brown", // 29 // SKINCOLOR_PEACHBROWN
"Gold", // 30 // SKINCOLOR_GOLD
"Full-Range Peach-Brown", // 31 // SKINCOLOR_FULLRANGEPEACHBROWN
"Gypsy Vomit", // 32 // SKINCOLOR_GYPSYVOMIT
"Garden", // 33 // SKINCOLOR_GARDEN
"Light Army", // 34 // SKINCOLOR_LIGHTARMY
"Army", // 35 // SKINCOLOR_ARMY
"Pistachio", // 36 // SKINCOLOR_PISTACHIO
"Robo-Hood Green", // 37 // SKINCOLOR_ROBOHOODGREEN
"Olive", // 38 // SKINCOLOR_OLIVE
"Dark Army", // 39 // SKINCOLOR_DARKARMY
"Light Green", // 40 // SKINCOLOR_LIGHTGREEN
"Ugly Green", // 41 // SKINCOLOR_UGLYGREEN
"Neon Green", // 42 // SKINCOLOR_NEONGREEN
"Green", // 43 // SKINCOLOR_GREEN
"Dark Green", // 44 // SKINCOLOR_DARKGREEN
"Dark Neon Green", // 45 // SKINCOLOR_DARKNEONGREEN
"Frost", // 46 // SKINCOLOR_FROST
"Light Steel Blue", // 47 // SKINCOLOR_LIGHTSTEELBLUE
"Light Blue", // 48 // SKINCOLOR_LIGHTBLUE
"Cyan", // 49 // SKINCOLOR_CYAN
"Cerulean", // 50 // SKINCOLOR_CERULEAN
"Turquoise", // 51 // SKINCOLOR_TURQUOISE
"Teal", // 52 // SKINCOLOR_TEAL
"Steel Blue", // 53 // SKINCOLOR_STEELBLUE
"Blue", // 54 // SKINCOLOR_BLUE
"Full-Range Blue", // 55 // SKINCOLOR_FULLRANGEBLUE
"Dark Steel Blue", // 56 // SKINCOLOR_DARKSTEELBLUE
"Dark Blue", // 57 // SKINCOLOR_DARKBLUE
"Jet Black", // 58 // SKINCOLOR_JETBLACK
"Lilac", // 59 // SKINCOLOR_LILAC
"Purple", // 60 // SKINCOLOR_PURPLE
"Lavender", // 61 // SKINCOLOR_LAVENDER
"Byzantium", // 62 // SKINCOLOR_BYZANTIUM
"Indigo" // 63 // SKINCOLOR_INDIGO
};
/** \brief Generates a simple case table for given values. Not very optimal, but makes it easy to read in K_GenerateKartColormap.
\param i loop iteration
\param cNumber Numeric color value, from Zero to Fifteen
\return INT32 Returns the pulled value of the sixteen fed to it
*/
static INT32 R_KartColorSetter(UINT8 i,
INT32 cZero, INT32 cOne, INT32 cTwo, INT32 cThree,
INT32 cFour, INT32 cFive, INT32 cSix, INT32 cSeven,
INT32 cEight, INT32 cNine, INT32 cTen, INT32 cEleven,
INT32 cTwelve, INT32 cThirteen, INT32 cFourteen, INT32 cFifteen)
{
INT32 ThisColorIs = 0;
switch (i)
{
case 0: ThisColorIs = cZero; break;
case 1: ThisColorIs = cOne; break;
case 2: ThisColorIs = cTwo; break;
case 3: ThisColorIs = cThree; break;
case 4: ThisColorIs = cFour; break;
case 5: ThisColorIs = cFive; break;
case 6: ThisColorIs = cSix; break;
case 7: ThisColorIs = cSeven; break;
case 8: ThisColorIs = cEight; break;
case 9: ThisColorIs = cNine; break;
case 10: ThisColorIs = cTen; break;
case 11: ThisColorIs = cEleven; break;
case 12: ThisColorIs = cTwelve; break;
case 13: ThisColorIs = cThirteen; break;
case 14: ThisColorIs = cFourteen; break;
case 15: ThisColorIs = cFifteen; break;
}
return ThisColorIs;
}
/** \brief Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c
\param dest_colormap colormap to populate
\param skinnum number of skin, TC_DEFAULT or TC_BOSS
\param color translation color
\return void
*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
{
INT32 i;
INT32 starttranscolor;
// Handle a couple of simple special cases
if (skinnum == TC_BOSS || skinnum == TC_ALLWHITE || skinnum == TC_METALSONIC || color == SKINCOLOR_NONE)
{
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
{
if (skinnum == TC_ALLWHITE) dest_colormap[i] = 0;
else dest_colormap[i] = (UINT8)i;
}
// White!
if (skinnum == TC_BOSS)
dest_colormap[31] = 0;
else if (skinnum == TC_METALSONIC)
dest_colormap[239] = 0;
return;
}
starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
// Fill in the entries of the palette that are fixed
for (i = 0; i < starttranscolor; i++)
dest_colormap[i] = (UINT8)i;
for (i = (UINT8)(starttranscolor + 16); i < NUM_PALETTE_ENTRIES; i++)
dest_colormap[i] = (UINT8)i;
// Build the translated ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
switch (color)
{
case SKINCOLOR_IVORY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 120, 120, 120, 0, 0, 0, 0, 1, 1, 2, 2, 4, 6, 8, 10); break;
case SKINCOLOR_WHITE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7); break;
case SKINCOLOR_SILVER: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); break;
case SKINCOLOR_CLOUDY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31); break;
case SKINCOLOR_GREY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); break;
case SKINCOLOR_DARKGREY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); break;
case SKINCOLOR_BLACK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31); break;
case SKINCOLOR_SALMON: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127); break;
case SKINCOLOR_PINK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151); break;
case SKINCOLOR_LIGHTRED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135); break;
case SKINCOLOR_FULLRANGERED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143); break;
case SKINCOLOR_RED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140); break;
case SKINCOLOR_DARKPINK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141); break;
case SKINCOLOR_DARKRED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143); break;
case SKINCOLOR_DAWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 121, 122, 123, 124, 147, 88, 89, 149, 91, 92, 151, 94, 95, 152, 153); break;
case SKINCOLOR_ORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95); break;
case SKINCOLOR_FULLRANGEORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 80, 81, 83, 85, 86, 88, 90, 91, 93, 95, 152, 153, 154, 156, 157, 159); break;
case SKINCOLOR_DARKORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 88, 89, 90, 91, 92, 93, 94, 95, 152, 153, 154, 155, 156, 157, 158, 159); break;
case SKINCOLOR_GOLDENBROWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 112, 113, 114, 115, 116, 117, 118, 119, 156, 156, 157, 157, 158, 158, 159, 159); break;
case SKINCOLOR_ROSEWOOD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159); break;
case SKINCOLOR_DARKROSEWOOD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 152, 153, 154, 155, 156, 157, 158, 159, 139, 140, 141, 142, 143, 31, 31, 31); break;
case SKINCOLOR_SEPIA: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 3, 5, 7, 32, 9, 34, 36, 37, 39, 42, 45, 59, 60, 61, 62, 63); break;
case SKINCOLOR_BEIGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47); break;
case SKINCOLOR_BROWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63); break;
case SKINCOLOR_LEATHER: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 57, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 28, 29, 30, 31); break;
case SKINCOLOR_YELLOW: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 97, 98, 99, 100, 101, 102, 103, 104, 113, 113, 114, 115, 115, 115, 116, 117); break;
case SKINCOLOR_PEACH: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79); break;
case SKINCOLOR_LIGHTORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87); break;
case SKINCOLOR_PEACHBROWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55); break;
case SKINCOLOR_GOLD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119); break;
case SKINCOLOR_FULLRANGEPEACHBROWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62); break;
case SKINCOLOR_GYPSYVOMIT: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246); break;
case SKINCOLOR_GARDEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 98, 99, 112, 101, 113, 114, 106, 179, 180, 181, 182, 172, 183, 173, 174, 175); break;
case SKINCOLOR_LIGHTARMY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 176, 176, 176, 177, 177, 177, 177, 178, 178, 178, 178, 179, 179, 179, 179); break;
case SKINCOLOR_ARMY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, 182, 182, 183, 183); break;
case SKINCOLOR_PISTACHIO: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 176, 177, 177, 178, 178, 179, 179, 166, 167, 168, 169, 170, 171, 172, 173); break;
case SKINCOLOR_ROBOHOODGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 177, 177, 178, 178, 165, 165, 167, 167, 182, 182, 171, 171, 183, 183, 173, 173); break;
case SKINCOLOR_OLIVE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 31, 31); break;
case SKINCOLOR_DARKARMY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 177, 178, 179, 170, 181, 182, 183, 173, 173, 174, 174, 175, 175, 31, 31); break;
case SKINCOLOR_LIGHTGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167); break;
case SKINCOLOR_UGLYGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 184, 184, 184, 184, 185, 185, 185, 185, 186, 186, 186, 186, 187, 187, 187, 187); break;
case SKINCOLOR_NEONGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191); break;
case SKINCOLOR_GREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175); break;
case SKINCOLOR_DARKGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 168, 168, 169, 169, 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, 175, 175); break;
case SKINCOLOR_DARKNEONGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191, 175, 175, 30, 30, 31, 31); break;
case SKINCOLOR_FROST: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 225, 226, 212, 213, 213, 214, 215, 220, 221, 172, 222, 173, 223, 174, 175); break;
case SKINCOLOR_LIGHTSTEELBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 200, 200, 200, 201, 201, 201, 201, 202, 202, 202, 202, 203, 203, 203, 203); break;
case SKINCOLOR_LIGHTBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 224, 225, 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231); break;
case SKINCOLOR_CYAN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 208, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 216, 216, 217, 218, 219); break;
case SKINCOLOR_CERULEAN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 216, 216, 216, 216, 217, 217, 217, 217, 218, 218, 218, 218, 219, 219, 219, 219); break;
case SKINCOLOR_TURQUOISE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 208, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 220, 220, 221, 222, 223); break;
case SKINCOLOR_TEAL: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 220, 220, 220, 220, 221, 221, 221, 221, 222, 222, 222, 222, 223, 223, 223, 223); break;
case SKINCOLOR_STEELBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207); break;
case SKINCOLOR_BLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239); break;
case SKINCOLOR_FULLRANGEBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246); break;
case SKINCOLOR_DARKSTEELBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 201, 202, 203, 204, 205, 206, 238, 239, 240, 241, 242, 243, 244, 245, 246); break;
case SKINCOLOR_DARKBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246); break;
case SKINCOLOR_JETBLACK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31); break;
case SKINCOLOR_LILAC: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 120, 121, 121, 122, 122, 123, 123, 192, 192, 248, 248, 249, 249, 250, 250); break;
case SKINCOLOR_PURPLE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199, 199); break;
case SKINCOLOR_LAVENDER: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255); break;
case SKINCOLOR_BYZANTIUM: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31); break;
case SKINCOLOR_INDIGO: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31); break;
/*
* Removed Colors:
* case SKINCOLOR_DUSK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 192, 248, 249, 250, 251, 229, 204, 230, 205, 206, 239, 240, 241, 242, 243); break;
* case SKINCOLOR_RAINBOW: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 1, 145, 125, 73, 83, 114, 106, 180, 187, 168, 219, 205, 236, 206, 199, 255); break;
*/
default:
I_Error("Invalid skin color #%hu.", (UINT16)color);
return;
}
}
/** \brief Pulls kart color by name, to replace R_GetColorByName in r_draw.c
\param name color name
\return 0
*/
UINT8 K_GetKartColorByName(const char *name)
{
UINT8 color = (UINT8)atoi(name);
if (color > 0 && color < MAXSKINCOLORS)
return color;
for (color = 1; color < MAXSKINCOLORS; color++)
if (!stricmp(KartColor_Names[color], name))
return color;
return 0;
}
//}
//{ P_KartPlayerThink - for p_user.c
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
\param player player object passed from P_PlayerThink
\param cmd control input from player
\return void
*/
void P_KartPlayerThink(player_t *player, ticcmd_t *cmd)
{
// This spawns the drift sparks when k_driftcharge hits 30. Its own AI handles life/death and color
//if ((player->kartstuff[k_drift] == 1 || player->kartstuff[k_drift] == -1)
// && player->kartstuff[k_driftcharge] == 30)
// P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_DRIFT)->target = player->mo;
if (player->kartstuff[k_itemclose])
player->kartstuff[k_itemclose]--;
if (player->kartstuff[k_spinout])
player->kartstuff[k_spinout]--;
if (player->kartstuff[k_spinouttimer])
player->kartstuff[k_spinouttimer]--;
if (player->kartstuff[k_magnettimer])
player->kartstuff[k_magnettimer]--;
if (player->kartstuff[k_mushroomtimer])
player->kartstuff[k_mushroomtimer]--;
if (player->kartstuff[k_startimer])
player->kartstuff[k_startimer]--;
if (player->kartstuff[k_growshrinktimer] > 0)
player->kartstuff[k_growshrinktimer]--;
if (player->kartstuff[k_growshrinktimer] < 0)
player->kartstuff[k_growshrinktimer]++;
if (player->kartstuff[k_growshrinktimer] == 1 || player->kartstuff[k_growshrinktimer] == -1)
{
player->mo->destscale = 100;
P_RestoreMusic(player);
}
if (player->kartstuff[k_bootaketimer] == 0 && player->kartstuff[k_boostolentimer] == 0
&& player->kartstuff[k_goldshroomtimer])
player->kartstuff[k_goldshroomtimer]--;
if (player->kartstuff[k_bootaketimer] == 0 && player->kartstuff[k_boostolentimer] == 0
&& player->kartstuff[k_fireflowertimer])
player->kartstuff[k_fireflowertimer]--;
if (player->kartstuff[k_bootaketimer])
player->kartstuff[k_bootaketimer]--;
if (player->kartstuff[k_boostolentimer])
player->kartstuff[k_boostolentimer]--;
if (player->kartstuff[k_squishedtimer])
player->kartstuff[k_squishedtimer]--;
if (player->kartstuff[k_laserwisptimer])
player->kartstuff[k_laserwisptimer]--;
// Restores music if too many sounds are playing (?)
if (player->kartstuff[k_sounds] >= 1 && player->kartstuff[k_sounds] < 120)
player->kartstuff[k_sounds] += 1;
if ((player->kartstuff[k_sounds] < 120 && player->kartstuff[k_sounds] > 116)
&& P_IsLocalPlayer(player))
P_RestoreMusic(player);
// ???
/*
if (player->kartstuff[k_jmp] > 1 && onground)
{
S_StartSound(player->mo, sfx_spring);
P_DoJump(player, false);
player->mo->momz *= player->kartstuff[k_jmp];
player->kartstuff[k_jmp] = 0;
}
*/
if (cmd->buttons & BT_JUMP)
player->kartstuff[k_jmp] = 1;
else
player->kartstuff[k_jmp] = 0;
P_KartItemRoulette(player); // Roulette Code
// Looping and stopping of the horrible horrible star SFX ~Sryder
if (player->mo->health > 0 && player->mo->player->kartstuff[k_startimer])// If you have invincibility
{
if (!P_IsLocalPlayer(player)) // If it isn't the current player
{
if (!S_SoundPlaying(NULL, sfx_star)) // and it isn't still playing
S_StartSound(player->mo, sfx_star); // play it again
}
}
else if (player->mo->health <= 0 || player->mo->player->kartstuff[k_startimer] <= 0 || player->mo->player->kartstuff[k_growshrinktimer] > 0) // If you don't have invincibility (or mega is active too)
{
if (S_SoundPlaying(player->mo, sfx_star)) // But the sound is playing
S_StopSoundByID(player->mo, sfx_star); // Stop it
}
// And now the same for the mega mushroom SFX ~Sryder
if (player->mo->health > 0 && player->mo->player->kartstuff[k_growshrinktimer] > 0) // If you are big
{
if (!P_IsLocalPlayer(player)) // If it isn't the current player
{
if (!S_SoundPlaying(NULL, sfx_mega)) // and it isn't still playing
S_StartSound(player->mo, sfx_mega); // play it again
}
}
else // If you aren't big
{
if (S_SoundPlaying(player->mo, sfx_mega)) // But the sound is playing
S_StopSoundByID(player->mo, sfx_mega); // Stop it
}
}
//}

88
src/k_kart.h Normal file
View file

@ -0,0 +1,88 @@
// SONIC ROBO BLAST 2 KART ~ ZarroTsu
//-----------------------------------------------------------------------------
/// \file k_kart.h
/// \brief SRB2kart stuff.
#ifndef __K_KART__
#define __K_KART__
extern const char *KartColor_Names[MAXSKINCOLORS];
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
UINT8 K_GetKartColorByName(const char *name);
//{ SRB2kart Player structure - kartstuff
typedef enum
{
// Basic gameplay things
k_position, // Used for Kart positions, mostly for deterministic stuff
k_playerahead, // Is someone ahead of me or not?
k_oldposition, // Used for taunting when you pass someone
k_prevcheck, // Previous checkpoint distance; for p_user.c (was "pw_pcd")
k_nextcheck, // Next checkpoint distance; for p_user.c (was "pw_ncd")
k_waypoint, // Waypoints.
k_starpostwp, // Temporarily stores player waypoint for... some reason. Used when respawning and finishing.
k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
k_turndir, // Turn direction for drifting; -1 = Left, 1 = Right, 0 = none
k_sounds, // Used this to avoid sounds being played every tic
k_boosting, // Determines if you're currently shroom-boosting to change how drifting works
k_spinout, // Separate confirmation to prevent endless wipeout loops
k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still
k_drift, // Drifting Left or Right, plus a bigger counter = sharper turn
k_driftcharge, // Charge your drift so you can release a burst of speed
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
k_lakitu, // > 0 = Lakitu fishing, < 0 = Lakitu lap counter (was "player->airtime") // NOTE: Check for ->lakitu, replace with this
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
k_itemslot, // If you have X item, and kartitem chose X too, save it
k_itemclose, // Used to animate the item window closing (was "pw_psychic")
// Some items use timers for their duration or effects
k_magnettimer, // Duration of Magnet's item-break and item box pull
k_bootaketimer, // You are stealing an item, this is your timer
k_boostolentimer, // You are being stolen from, this is your timer
k_mushroomtimer, // Duration of the Mushroom Boost itself
k_growshrinktimer, // > 0 = Big, < 0 = small
k_squishedtimer, // Squished frame timer
k_goldshroomtimer, // Gold Mushroom duration timer
k_startimer, // Invincibility timer
k_spinouttimer, // Wipe-out from a banana peel or oil slick (was "pw_bananacam")
k_laserwisptimer, // The duration and relative angle of the laser
k_fireflowertimer, // Duration of Fire Flower
// Each item needs its own power slot, for the HUD and held use
k_magnet, // 0x1 = Magnet in inventory
k_boo, // 0x1 = Boo in inventory
k_mushroom, // 0x1 = 1 Mushroom in inventory, 0x2 = 2 Mushrooms in inventory
// 0x4 = 3 Mushrooms in inventory
k_megashroom, // 0x1 = Mega Mushroom in inventory
k_goldshroom, // 0x1 = Gold Mushroom in inventory
k_star, // 0x1 = Star in inventory
k_triplebanana, // 0x1 = 1 Banana following, 0x2 = 2 Bananas following
// 0x4 = 3 Bananas following, 0x8 = Triple Banana in inventory
k_fakeitem, // 0x1 = Fake Item being held, 0x2 = Fake Item in inventory
k_banana, // 0x1 = Banana being held, 0x2 = Banana in inventory
k_greenshell, // 0x1 = Green Shell being held, 0x2 = Green Shell in inventory
k_redshell, // 0x1 = Red Shell being held, 0x2 = Red Shell in inventory
k_laserwisp, // 0x1 = Laser Wisp in inventory
k_triplegreenshell, // 0x1 = 1 Green Shell orbiting, 0x2 = 2 Green Shells orbiting
// 0x4 = 3 Green Shells orbiting, 0x8 = Triple Green Shell in inventory
k_bobomb, // 0x1 = Bob-omb being held, 0x2 = Bob-omb in inventory
k_blueshell, // 0x1 = Blue Shell in inventory
k_jaws, // 0x1 = 1 Jaws orbiting, 0x2 = 2 Jaws orbiting,
// 0x4 = 2x Jaws in inventory
k_fireflower, // 0x1 = Fire Flower in inventory
k_tripleredshell, // 0x1 = 1 Red Shell orbiting, 0x2 = 2 Red Shells orbiting
// 0x4 = 3 Red Shells orbiting, 0x8 = Triple Red Shell in inventory
k_lightning, // 0x1 = Lightning in inventory
NUMKARTSTUFF
} kartstufftype_t;
//}
// =========================================================================
#endif // __K_KART__

View file

@ -19,7 +19,8 @@
#include "g_game.h" // record info
#include "r_things.h" // numskins
#include "r_draw.h" // R_GetColorByName
//#include "r_draw.h" // R_GetColorByName
#include "k_kart.h" // K_GetKartColorByName
// Map triggers for linedef executors
// 32 triggers, one bit each

View file

@ -53,6 +53,7 @@
#include "byteptr.h"
#include "st_stuff.h"
#include "i_sound.h"
#include "k_kart.h" // SRB2kart
// Condition Sets
#include "m_cond.h"
@ -6403,7 +6404,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
// draw the name of the color you have chosen
// Just so people don't go thinking that "Default" is Green.
V_DrawString(208, 72, V_YELLOWMAP|V_ALLOWLOWERCASE, Color_Names[setupm_fakecolor]);
V_DrawString(208, 72, V_YELLOWMAP|V_ALLOWLOWERCASE, KartColor_Names[setupm_fakecolor]); // SRB2kart
// draw text cursor for name
if (!itemOn && skullAnimCounter < 4) // blink cursor

View file

@ -7794,13 +7794,13 @@ static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {45, "MAX"}, {0, NULL
static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}};
consvar_t cv_cam_dist = {"cam_dist", "128", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam_height = {"cam_height", "20", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam_height = {"cam_height", "40", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam_speed = {"cam_speed", "0.25", CV_FLOAT, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", 0, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam2_dist = {"cam2_dist", "128", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam2_height = {"cam2_height", "20", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam2_height = {"cam2_height", "40", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam2_speed = {"cam2_speed", "0.25", CV_FLOAT, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL};
@ -9125,6 +9125,8 @@ void P_PlayerThink(player_t *player)
player->pflags &= ~PF_SLIDING;
P_KartPlayerThink(player); // SRB2kart
/*
// Colormap verification
{

View file

@ -25,6 +25,7 @@
#include "w_wad.h"
#include "z_zone.h"
#include "console.h" // Until buffering gets finished
#include "k_kart.h" // SRB2kart
#ifdef HWRENDER
#include "hardware/hw_main.h"
@ -135,6 +136,7 @@ static UINT8** translationtablecache[MAXSKINS + 4] = {NULL};
// See also the enum skincolors_t
// TODO Callum: Can this be translated?
/*
const char *Color_Names[MAXSKINCOLORS] =
{
"None", // SKINCOLOR_NONE
@ -164,6 +166,7 @@ const char *Color_Names[MAXSKINCOLORS] =
"Yellow", // SKINCOLOR_YELLOW
"Gold" // SKINCOLOR_GOLD
};
*/
const UINT8 Color_Opposite[MAXSKINCOLORS*2] =
{
@ -234,6 +237,7 @@ void R_InitTranslationTables(void)
\return void
*/
/*
static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
{
// Table of indices into the palette of the first entries of each translated ramp
@ -496,7 +500,7 @@ static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, U
break;
}
}
*/
/** \brief Retrieves a translation colormap from the cache.
@ -534,7 +538,7 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags)
if (!ret)
{
ret = Z_MallocAlign(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL, 8);
R_GenerateTranslationColormap(ret, skinnum, color);
K_GenerateKartColormap(ret, skinnum, color); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart
// Cache the colormap if desired
if (flags & GTC_CACHE)
@ -561,6 +565,7 @@ void R_FlushTranslationColormapCache(void)
memset(translationtablecache[i], 0, MAXTRANSLATIONS * sizeof(UINT8**));
}
/*
UINT8 R_GetColorByName(const char *name)
{
UINT8 color = (UINT8)atoi(name);
@ -571,6 +576,7 @@ UINT8 R_GetColorByName(const char *name)
return color;
return 0;
}
*/
// ==========================================================================
// COMMON DRAWER FOR 8 AND 16 BIT COLOR MODES

View file

@ -28,6 +28,7 @@
#include "dehacked.h" // get_number (for thok)
#include "d_netfil.h" // blargh. for nameonly().
#include "m_cheat.h" // objectplace
#include "k_kart.h" // SRB2kart
#ifdef HWRENDER
#include "hardware/hw_md2.h"
#endif
@ -2653,7 +2654,7 @@ void R_AddSkins(UINT16 wadnum)
skin->starttranscolor = atoi(value);
else if (!stricmp(stoken, "prefcolor"))
skin->prefcolor = R_GetColorByName(value);
skin->prefcolor = K_GetKartColorByName(value);
else if (!stricmp(stoken, "jumpfactor"))
skin->jumpfactor = FLOAT_TO_FIXED(atof(value));
else if (!stricmp(stoken, "highresscale"))