Merge branch 'new_coop' into 'master'

New Co-op

See merge request !104
This commit is contained in:
Monster Iestyn 2017-08-16 15:01:39 -04:00
commit 9f726bc66d
30 changed files with 2293 additions and 1846 deletions

View File

@ -768,8 +768,16 @@ static void resynch_read_player(resynch_pak *rsp)
players[i].mo->scalespeed = LONG(rsp->scalespeed);
// And finally, SET THE MOBJ SKIN damn it.
players[i].mo->skin = &skins[players[i].skin];
players[i].mo->color = players[i].skincolor;
if ((players[i].powers[pw_carry] == CR_NIGHTSMODE) && (skins[players[i].skin].sprites[SPR2_NGT0].numframes == 0))
{
players[i].mo->skin = &skins[DEFAULTNIGHTSSKIN];
players[i].mo->color = skins[DEFAULTNIGHTSSKIN].prefcolor; // this will be corrected by thinker to super flash
}
else
{
players[i].mo->skin = &skins[players[i].skin];
players[i].mo->color = players[i].skincolor; // this will be corrected by thinker to super flash/mario star
}
P_SetThingPosition(players[i].mo);
}
@ -883,6 +891,7 @@ static inline void resynch_write_others(resynchend_pak *rst)
UINT8 i;
rst->ingame = 0;
rst->outofcoop = 0;
for (i = 0; i < MAXPLAYERS; ++i)
{
@ -899,6 +908,8 @@ static inline void resynch_write_others(resynchend_pak *rst)
if (!players[i].spectator)
rst->ingame |= (1<<i);
if (players[i].outofcoop)
rst->outofcoop |= (1<<i);
rst->ctfteam[i] = (INT32)LONG(players[i].ctfteam);
rst->score[i] = (UINT32)LONG(players[i].score);
rst->numboxes[i] = SHORT(players[i].numboxes);
@ -915,11 +926,13 @@ static inline void resynch_read_others(resynchend_pak *p)
{
UINT8 i;
UINT32 loc_ingame = (UINT32)LONG(p->ingame);
UINT32 loc_outofcoop = (UINT32)LONG(p->outofcoop);
for (i = 0; i < MAXPLAYERS; ++i)
{
// We don't care if they're in the game or not, just write all the data.
players[i].spectator = !(loc_ingame & (1<<i));
players[i].outofcoop = (loc_outofcoop & (1<<i));
players[i].ctfteam = (INT32)LONG(p->ctfteam[i]); // no, 0 does not mean spectator, at least not in Match
players[i].score = (UINT32)LONG(p->score[i]);
players[i].numboxes = SHORT(p->numboxes[i]);
@ -1319,7 +1332,7 @@ static void SV_SendPlayerInfo(INT32 node)
netbuffer->u.playerinfo[i].skin = (UINT8)players[i].skin;
// Extra data
netbuffer->u.playerinfo[i].data = players[i].skincolor;
netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor;
if (players[i].pflags & PF_TAGIT)
netbuffer->u.playerinfo[i].data |= 0x20;

View File

@ -136,6 +136,7 @@ typedef struct
fixed_t flagz[2];
UINT32 ingame; // Spectator bit for each player
UINT32 outofcoop; // outofcoop bit for each player
INT32 ctfteam[MAXPLAYERS]; // Which team? (can't be 1 bit, since in regular Match there are no teams)
// Resynch game scores and the like all at once

View File

@ -724,6 +724,14 @@ void D_StartTitle(void)
// empty maptol so mario/etc sounds don't play in sound test when they shouldn't
maptol = 0;
// reset to default player stuff
COM_BufAddText (va("%s \"%s\"\n",cv_playername.name,cv_defaultplayername.string));
COM_BufAddText (va("%s \"%s\"\n",cv_skin.name,cv_defaultskin.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor.name,cv_defaultplayercolor.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playername2.name,cv_defaultplayername2.string));
COM_BufAddText (va("%s \"%s\"\n",cv_skin2.name,cv_defaultskin2.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor2.name,cv_defaultplayercolor2.string));
gameaction = ga_nothing;
displayplayer = consoleplayer = 0;
gametype = GT_COOP;

View File

@ -82,6 +82,9 @@ static void TeamScramble_OnChange(void);
static void NetTimeout_OnChange(void);
static void JoinTimeout_OnChange(void);
static void CoopStarposts_OnChange(void);
static void CoopLives_OnChange(void);
static void Ringslinger_OnChange(void);
static void Gravity_OnChange(void);
static void ForceSkin_OnChange(void);
@ -179,15 +182,14 @@ static CV_PossibleValue_t joyport_cons_t[] = {{1, "/dev/js0"}, {2, "/dev/js1"},
#define usejoystick_cons_t NULL
#endif
static CV_PossibleValue_t autobalance_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}};
static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2, "Points"}, {0, NULL}};
static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}};
static CV_PossibleValue_t sleeping_cons_t[] = {{-1, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}};
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, //{2, "Teleports"},
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"}, //{2, "Teleport"},
{3, "None"}, {0, NULL}};
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"}, {2, "Unchanging"},
{3, "None"}, {0, NULL}};
static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
@ -209,7 +211,7 @@ consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT, starting
static CV_PossibleValue_t respawntime_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
consvar_t cv_respawntime = {"respawndelay", "3", CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_competitionboxes = {"competitionboxes", "Mystery", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifdef SEENAMES
static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
@ -217,9 +219,9 @@ consvar_t cv_seenames = {"seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0, 0,
consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
// these are just meant to be saved to the config
consvar_t cv_playername = {"name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playername2 = {"name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
// names
consvar_t cv_playername = {"name", "Sonic", CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playername2 = {"name2", "Tails", CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
// player colors
consvar_t cv_playercolor = {"color", "Blue", CV_CALL|CV_NOINIT, Color_cons_t, Color_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playercolor2 = {"color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t, Color2_OnChange, 0, NULL, NULL, 0, 0, NULL};
@ -227,6 +229,14 @@ consvar_t cv_playercolor2 = {"color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t
consvar_t cv_skin = {"skin", DEFAULTSKIN, CV_CALL|CV_NOINIT, NULL, Skin_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_skin2 = {"skin2", DEFAULTSKIN2, CV_CALL|CV_NOINIT, NULL, Skin2_OnChange, 0, NULL, NULL, 0, 0, NULL};
// saved versions of the above six
consvar_t cv_defaultplayername = {"defaultname", "Sonic", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_defaultplayername2 = {"defaultname2", "Tails", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_defaultplayercolor = {"defaultcolor", "Blue", CV_SAVE, Color_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_defaultplayercolor2 = {"defaultcolor2", "Orange", CV_SAVE, Color_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_defaultskin = {"defaultskin", DEFAULTSKIN, CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_defaultskin2 = {"defaultskin2", DEFAULTSKIN2, CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
INT32 cv_debug;
@ -297,7 +307,7 @@ consvar_t cv_countdowntime = {"countdowntime", "60", CV_NETVAR|CV_CHEAT, minitim
consvar_t cv_touchtag = {"touchtag", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_hidetime = {"hidetime", "30", CV_NETVAR|CV_CALL, minitimelimit_cons_t, Hidetime_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_autobalance = {"autobalance", "0", CV_NETVAR|CV_CALL, autobalance_cons_t, AutoBalance_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_autobalance = {"autobalance", "Off", CV_NETVAR|CV_CALL, CV_OnOff, AutoBalance_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_teamscramble = {"teamscramble", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_scrambleonchange = {"scrambleonchange", "Off", CV_NETVAR, teamscramble_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -342,12 +352,18 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
#endif
// Intermission time Tails 04-19-2002
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_inttime = {"inttime", "10", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t coopstarposts_cons_t[] = {{0, "Per-player"}, {1, "Shared"}, {2, "Teamwork"}, {0, NULL}};
consvar_t cv_coopstarposts = {"coopstarposts", "Teamwork", CV_NETVAR|CV_CALL|CV_CHEAT, coopstarposts_cons_t, CoopStarposts_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t cooplives_cons_t[] = {{0, "Infinite"}, {1, "Per-player"}, {2, "Avoid Game Over"}, {3, "Single pool"}, {0, NULL}};
consvar_t cv_cooplives = {"cooplives", "Avoid Game Over", CV_NETVAR|CV_CALL|CV_CHEAT, cooplives_cons_t, CoopLives_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}};
consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "All"}, {0, NULL}};
consvar_t cv_playersforexit = {"playersforexit", "One", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}};
consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -496,6 +512,9 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_forceskin);
CV_RegisterVar(&cv_downloading);
CV_RegisterVar(&cv_coopstarposts);
CV_RegisterVar(&cv_cooplives);
CV_RegisterVar(&cv_specialrings);
CV_RegisterVar(&cv_powerstones);
CV_RegisterVar(&cv_competitionboxes);
@ -624,7 +643,7 @@ void D_RegisterClientCommands(void)
// register these so it is saved to config
if ((username = I_GetUserName()))
cv_playername.defaultvalue = username;
cv_playername.defaultvalue = cv_defaultplayername.defaultvalue = username;
CV_RegisterVar(&cv_playername);
CV_RegisterVar(&cv_playercolor);
CV_RegisterVar(&cv_skin); // r_things.c (skin NAME)
@ -632,6 +651,13 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_playername2);
CV_RegisterVar(&cv_playercolor2);
CV_RegisterVar(&cv_skin2);
// saved versions of the above six
CV_RegisterVar(&cv_defaultplayername);
CV_RegisterVar(&cv_defaultplayercolor);
CV_RegisterVar(&cv_defaultskin);
CV_RegisterVar(&cv_defaultplayername2);
CV_RegisterVar(&cv_defaultplayercolor2);
CV_RegisterVar(&cv_defaultskin2);
#ifdef SEENAMES
CV_RegisterVar(&cv_seenames);
@ -1161,7 +1187,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 % MAXSKINCOLORS;
if (players[consoleplayer].mo)
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
@ -1288,7 +1314,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 % MAXSKINCOLORS;
if (players[secondplaya].mo)
players[secondplaya].mo->color = players[secondplaya].skincolor;
@ -3355,6 +3381,102 @@ static void JoinTimeout_OnChange(void)
jointimeout = (tic_t)cv_jointimeout.value;
}
static void CoopStarposts_OnChange(void)
{
INT32 i;
if (!(netgame || multiplayer) || gametype != GT_COOP)
return;
switch (cv_coopstarposts.value)
{
case 0:
CONS_Printf(M_GetText("Starposts are now per-player.\n"));
break;
case 1:
CONS_Printf(M_GetText("Starposts are now shared between players.\n"));
break;
case 2:
CONS_Printf(M_GetText("Players now only spawn when starposts are hit.\n"));
return;
}
if (G_IsSpecialStage(gamemap))
return;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (!players[i].spectator)
continue;
if (players[i].lives <= 0)
continue;
break;
}
if (i == MAXPLAYERS)
return;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (!players[i].spectator)
continue;
if (players[i].lives <= 0 && (cv_cooplives.value == 1))
continue;
P_SpectatorJoinGame(&players[i]);
}
}
static void CoopLives_OnChange(void)
{
INT32 i;
if (!(netgame || multiplayer) || gametype != GT_COOP)
return;
switch (cv_cooplives.value)
{
case 0:
CONS_Printf(M_GetText("Players can now respawn indefinitely.\n"));
return;
case 1:
CONS_Printf(M_GetText("Lives are now per-player.\n"));
return;
case 2:
CONS_Printf(M_GetText("Players can now steal lives to avoid game over.\n"));
break;
case 3:
CONS_Printf(M_GetText("Lives are now shared between players.\n"));
break;
}
if (cv_coopstarposts.value == 2)
return;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (!players[i].spectator)
continue;
if (players[i].lives > 0)
continue;
P_SpectatorJoinGame(&players[i]);
}
}
UINT32 timelimitintics = 0;
/** Deals with a timelimit change by printing the change to the console.
@ -3645,7 +3767,7 @@ retryscramble:
{
if (red == maxcomposition)
newteam = 2;
else if (blue == maxcomposition)
else //if (blue == maxcomposition)
newteam = 1;
repick = false;
@ -3686,14 +3808,11 @@ retryscramble:
newteam = (INT16)((M_RandomByte() % 2) + 1);
repick = false;
}
else
else if (i != 2) // Mystic's secret sauce - ABBA is better than ABAB, so team B doesn't get worse players all around
{
// We will only randomly pick the team for the first guy.
// Otherwise, just alternate back and forth, distributing players.
if (newteam == 1)
newteam = 2;
else
newteam = 1;
newteam = 3 - newteam;
}
scrambleteams[i] = newteam;

View File

@ -25,6 +25,13 @@ extern consvar_t cv_skin;
extern consvar_t cv_playername2;
extern consvar_t cv_playercolor2;
extern consvar_t cv_skin2;
// saved versions of the above six
extern consvar_t cv_defaultplayername;
extern consvar_t cv_defaultplayercolor;
extern consvar_t cv_defaultskin;
extern consvar_t cv_defaultplayername2;
extern consvar_t cv_defaultplayercolor2;
extern consvar_t cv_defaultskin2;
#ifdef SEENAMES
extern consvar_t cv_seenames, cv_allowseenames;
@ -89,7 +96,7 @@ extern consvar_t cv_recycler;
extern consvar_t cv_itemfinder;
extern consvar_t cv_inttime, cv_advancemap, cv_playersforexit;
extern consvar_t cv_inttime, cv_coopstarposts, cv_cooplives, cv_advancemap, cv_playersforexit;
extern consvar_t cv_overtime;
extern consvar_t cv_startinglives;

View File

@ -481,6 +481,7 @@ typedef struct player_s
angle_t awayviewaiming; // Used for cut-away view
boolean spectator;
boolean outofcoop;
UINT8 bot;
tic_t jointime; // Timer when player joins game to change skin/color

View File

@ -6505,91 +6505,130 @@ 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
"BEIGE", // SKINCOLOR_BEIGE
"PEACH", // SKINCOLOR_PEACH
"BROWN", // SKINCOLOR_BROWN
"RED", // SKINCOLOR_RED
"CRIMSON", // SKINCOLOR_CRIMSON
"ORANGE", // SKINCOLOR_ORANGE
"RUST", // SKINCOLOR_RUST
"GOLD", // SKINCOLOR_GOLD
"YELLOW", // SKINCOLOR_YELLOW
"TAN", // SKINCOLOR_TAN
"MOSS", // SKINCOLOR_MOSS
"PERIDOT", // SKINCOLOR_PERIDOT
"GREEN", // SKINCOLOR_GREEN
"EMERALD", // SKINCOLOR_EMERALD
"AQUA", // SKINCOLOR_AQUA
"TEAL", // SKINCOLOR_TEAL
"CYAN", // SKINCOLOR_CYAN
"BLUE", // SKINCOLOR_BLUE
"AZURE", // SKINCOLOR_AZURE
"PASTEL", // SKINCOLOR_PASTEL
"PURPLE", // SKINCOLOR_PURPLE
"LAVENDER", // SKINCOLOR_LAVENDER
"MAGENTA", // SKINCOLOR_MAGENTA
"PINK", // SKINCOLOR_PINK
"ROSY", // SKINCOLOR_ROSY
"NONE", // SKINCOLOR_NONE,
// Greyscale ranges
"WHITE", // SKINCOLOR_WHITE,
"BONE", // SKINCOLOR_BONE,
"CLOUDY", // SKINCOLOR_CLOUDY,
"GREY", // SKINCOLOR_GREY,
"SILVER", // SKINCOLOR_SILVER,
"CARBON", // SKINCOLOR_CARBON,
"JET", // SKINCOLOR_JET,
"BLACK", // SKINCOLOR_BLACK,
// Desaturated
"AETHER", // SKINCOLOR_AETHER,
"SLATE", // SKINCOLOR_SLATE,
"PINK", // SKINCOLOR_PINK,
"YOGURT", // SKINCOLOR_YOGURT,
"BROWN", // SKINCOLOR_BROWN,
"TAN", // SKINCOLOR_TAN,
"BEIGE", // SKINCOLOR_BEIGE,
"MOSS", // SKINCOLOR_MOSS,
"AZURE", // SKINCOLOR_AZURE,
"LAVENDER", // SKINCOLOR_LAVENDER,
// Viv's vivid colours (toast 21/07/17)
"RUBY", // SKINCOLOR_RUBY,
"SALMON", // SKINCOLOR_SALMON,
"RED", // SKINCOLOR_RED,
"CRIMSON", // SKINCOLOR_CRIMSON,
"FLAME", // SKINCOLOR_FLAME,
"PEACHY", // SKINCOLOR_PEACHY,
"QUAIL", // SKINCOLOR_QUAIL,
"SUNSET", // SKINCOLOR_SUNSET,
"APRICOT", // SKINCOLOR_APRICOT,
"ORANGE", // SKINCOLOR_ORANGE,
"RUST", // SKINCOLOR_RUST,
"GOLD", // SKINCOLOR_GOLD,
"SANDY", // SKINCOLOR_SANDY,
"YELLOW", // SKINCOLOR_YELLOW,
"OLIVE", // SKINCOLOR_OLIVE,
"LIME", // SKINCOLOR_LIME,
"PERIDOT", // SKINCOLOR_PERIDOT,
"GREEN", // SKINCOLOR_GREEN,
"FOREST", // SKINCOLOR_FOREST,
"EMERALD", // SKINCOLOR_EMERALD,
"MINT", // SKINCOLOR_MINT,
"SEAFOAM", // SKINCOLOR_SEAFOAM,
"AQUA", // SKINCOLOR_AQUA,
"TEAL", // SKINCOLOR_TEAL,
"WAVE", // SKINCOLOR_WAVE,
"CYAN", // SKINCOLOR_CYAN,
"SKY", // SKINCOLOR_SKY,
"CERULEAN", // SKINCOLOR_CERULEAN,
"ICY", // SKINCOLOR_ICY,
"SAPPHIRE", // SKINCOLOR_SAPPHIRE,
"CORNFLOWER", // SKINCOLOR_CORNFLOWER,
"BLUE", // SKINCOLOR_BLUE,
"COBALT", // SKINCOLOR_COBALT,
"VAPOR", // SKINCOLOR_VAPOR,
"DUSK", // SKINCOLOR_DUSK,
"PASTEL", // SKINCOLOR_PASTEL,
"PURPLE", // SKINCOLOR_PURPLE,
"BUBBLEGUM", // SKINCOLOR_BUBBLEGUM,
"MAGENTA", // SKINCOLOR_MAGENTA,
"NEON", // SKINCOLOR_NEON,
"VIOLET", // SKINCOLOR_VIOLET,
"LILAC", // SKINCOLOR_LILAC,
"PLUM", // SKINCOLOR_PLUM,
"ROSY", // SKINCOLOR_ROSY,
// Super special awesome Super flashing colors!
"SUPERSILVER1", // SKINCOLOR_SUPERSILVER1
"SUPERSILVER2", // SKINCOLOR_SUPERSILVER2,
"SUPERSILVER3", // SKINCOLOR_SUPERSILVER3,
"SUPERSILVER4", // SKINCOLOR_SUPERSILVER4,
"SUPERSILVER5", // SKINCOLOR_SUPERSILVER5,
"SUPERSILVER1", // SKINCOLOR_SUPERSILVER1
"SUPERSILVER2", // SKINCOLOR_SUPERSILVER2,
"SUPERSILVER3", // SKINCOLOR_SUPERSILVER3,
"SUPERSILVER4", // SKINCOLOR_SUPERSILVER4,
"SUPERSILVER5", // SKINCOLOR_SUPERSILVER5,
"SUPERRED1", // SKINCOLOR_SUPERRED1
"SUPERRED2", // SKINCOLOR_SUPERRED2,
"SUPERRED3", // SKINCOLOR_SUPERRED3,
"SUPERRED4", // SKINCOLOR_SUPERRED4,
"SUPERRED5", // SKINCOLOR_SUPERRED5,
"SUPERRED1", // SKINCOLOR_SUPERRED1
"SUPERRED2", // SKINCOLOR_SUPERRED2,
"SUPERRED3", // SKINCOLOR_SUPERRED3,
"SUPERRED4", // SKINCOLOR_SUPERRED4,
"SUPERRED5", // SKINCOLOR_SUPERRED5,
"SUPERORANGE1", // SKINCOLOR_SUPERORANGE1
"SUPERORANGE2", // SKINCOLOR_SUPERORANGE2,
"SUPERORANGE3", // SKINCOLOR_SUPERORANGE3,
"SUPERORANGE4", // SKINCOLOR_SUPERORANGE4,
"SUPERORANGE5", // SKINCOLOR_SUPERORANGE5,
"SUPERORANGE1", // SKINCOLOR_SUPERORANGE1
"SUPERORANGE2", // SKINCOLOR_SUPERORANGE2,
"SUPERORANGE3", // SKINCOLOR_SUPERORANGE3,
"SUPERORANGE4", // SKINCOLOR_SUPERORANGE4,
"SUPERORANGE5", // SKINCOLOR_SUPERORANGE5,
"SUPERGOLD1", // SKINCOLOR_SUPERGOLD1
"SUPERGOLD2", // SKINCOLOR_SUPERGOLD2,
"SUPERGOLD3", // SKINCOLOR_SUPERGOLD3,
"SUPERGOLD4", // SKINCOLOR_SUPERGOLD4,
"SUPERGOLD5", // SKINCOLOR_SUPERGOLD5,
"SUPERGOLD1", // SKINCOLOR_SUPERGOLD1
"SUPERGOLD2", // SKINCOLOR_SUPERGOLD2,
"SUPERGOLD3", // SKINCOLOR_SUPERGOLD3,
"SUPERGOLD4", // SKINCOLOR_SUPERGOLD4,
"SUPERGOLD5", // SKINCOLOR_SUPERGOLD5,
"SUPERPERIDOT1", // SKINCOLOR_SUPERPERIDOT1
"SUPERPERIDOT2", // SKINCOLOR_SUPERPERIDOT2,
"SUPERPERIDOT3", // SKINCOLOR_SUPERPERIDOT3,
"SUPERPERIDOT4", // SKINCOLOR_SUPERPERIDOT4,
"SUPERPERIDOT5", // SKINCOLOR_SUPERPERIDOT5,
"SUPERPERIDOT1", // SKINCOLOR_SUPERPERIDOT1
"SUPERPERIDOT2", // SKINCOLOR_SUPERPERIDOT2,
"SUPERPERIDOT3", // SKINCOLOR_SUPERPERIDOT3,
"SUPERPERIDOT4", // SKINCOLOR_SUPERPERIDOT4,
"SUPERPERIDOT5", // SKINCOLOR_SUPERPERIDOT5,
"SUPERCYAN1", // SKINCOLOR_SUPERCYAN1
"SUPERCYAN2", // SKINCOLOR_SUPERCYAN2,
"SUPERCYAN3", // SKINCOLOR_SUPERCYAN3,
"SUPERCYAN4", // SKINCOLOR_SUPERCYAN4,
"SUPERCYAN5", // SKINCOLOR_SUPERCYAN5,
"SUPERSKY1", // SKINCOLOR_SUPERSKY1
"SUPERSKY2", // SKINCOLOR_SUPERSKY2,
"SUPERSKY3", // SKINCOLOR_SUPERSKY3,
"SUPERSKY4", // SKINCOLOR_SUPERSKY4,
"SUPERSKY5", // SKINCOLOR_SUPERSKY5,
"SUPERPURPLE1", // SKINCOLOR_SUPERPURPLE1,
"SUPERPURPLE2", // SKINCOLOR_SUPERPURPLE2,
"SUPERPURPLE3", // SKINCOLOR_SUPERPURPLE3,
"SUPERPURPLE4", // SKINCOLOR_SUPERPURPLE4,
"SUPERPURPLE5", // SKINCOLOR_SUPERPURPLE5,
"SUPERPURPLE1", // SKINCOLOR_SUPERPURPLE1,
"SUPERPURPLE2", // SKINCOLOR_SUPERPURPLE2,
"SUPERPURPLE3", // SKINCOLOR_SUPERPURPLE3,
"SUPERPURPLE4", // SKINCOLOR_SUPERPURPLE4,
"SUPERPURPLE5", // SKINCOLOR_SUPERPURPLE5,
"SUPERRUST1", // SKINCOLOR_SUPERRUST1
"SUPERRUST2", // SKINCOLOR_SUPERRUST2,
"SUPERRUST3", // SKINCOLOR_SUPERRUST3,
"SUPERRUST4", // SKINCOLOR_SUPERRUST4,
"SUPERRUST5", // SKINCOLOR_SUPERRUST5,
"SUPERRUST1", // SKINCOLOR_SUPERRUST1
"SUPERRUST2", // SKINCOLOR_SUPERRUST2,
"SUPERRUST3", // SKINCOLOR_SUPERRUST3,
"SUPERRUST4", // SKINCOLOR_SUPERRUST4,
"SUPERRUST5", // SKINCOLOR_SUPERRUST5,
"SUPERTAN1", // SKINCOLOR_SUPERTAN1
"SUPERTAN2", // SKINCOLOR_SUPERTAN2,
"SUPERTAN3", // SKINCOLOR_SUPERTAN3,
"SUPERTAN4", // SKINCOLOR_SUPERTAN4,
"SUPERTAN5" // SKINCOLOR_SUPERTAN5,
"SUPERTAN1", // SKINCOLOR_SUPERTAN1
"SUPERTAN2", // SKINCOLOR_SUPERTAN2,
"SUPERTAN3", // SKINCOLOR_SUPERTAN3,
"SUPERTAN4", // SKINCOLOR_SUPERTAN4,
"SUPERTAN5" // SKINCOLOR_SUPERTAN5,
};
static const char *const POWERS_LIST[] = {

View File

@ -207,8 +207,9 @@ typedef struct
#define ZSHIFT 4
extern const UINT8 Color_Index[MAXTRANSLATIONS-1][16];
extern const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS];
extern const UINT8 Color_Opposite[MAXSKINCOLORS*2];
extern const UINT8 Color_Opposite[(MAXSKINCOLORS - 1)*2];
#define NUMMAPS 1035

View File

@ -229,39 +229,77 @@ extern FILE *logstream;
typedef enum
{
SKINCOLOR_NONE = 0,
// Greyscale ranges
SKINCOLOR_WHITE,
SKINCOLOR_SILVER,
SKINCOLOR_BONE,
SKINCOLOR_CLOUDY,
SKINCOLOR_GREY,
SKINCOLOR_SILVER,
SKINCOLOR_CARBON,
SKINCOLOR_JET,
SKINCOLOR_BLACK,
SKINCOLOR_BEIGE,
SKINCOLOR_PEACH,
// Desaturated
SKINCOLOR_AETHER,
SKINCOLOR_SLATE,
SKINCOLOR_PINK,
SKINCOLOR_YOGURT,
SKINCOLOR_BROWN,
SKINCOLOR_TAN,
SKINCOLOR_BEIGE,
SKINCOLOR_MOSS,
SKINCOLOR_AZURE,
SKINCOLOR_LAVENDER,
// Viv's vivid colours (toast 21/07/17)
SKINCOLOR_RUBY,
SKINCOLOR_SALMON,
SKINCOLOR_RED,
SKINCOLOR_CRIMSON,
SKINCOLOR_FLAME,
SKINCOLOR_PEACHY,
SKINCOLOR_QUAIL,
SKINCOLOR_SUNSET,
SKINCOLOR_APRICOT,
SKINCOLOR_ORANGE,
SKINCOLOR_RUST,
SKINCOLOR_GOLD,
SKINCOLOR_SANDY,
SKINCOLOR_YELLOW,
SKINCOLOR_TAN,
SKINCOLOR_MOSS,
SKINCOLOR_OLIVE,
SKINCOLOR_LIME,
SKINCOLOR_PERIDOT,
SKINCOLOR_GREEN,
SKINCOLOR_FOREST,
SKINCOLOR_EMERALD,
SKINCOLOR_MINT,
SKINCOLOR_SEAFOAM,
SKINCOLOR_AQUA,
SKINCOLOR_TEAL,
SKINCOLOR_WAVE,
SKINCOLOR_CYAN,
SKINCOLOR_SKY,
SKINCOLOR_CERULEAN,
SKINCOLOR_ICY,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave slender aphrodite has overcome me with longing for a girl
SKINCOLOR_CORNFLOWER,
SKINCOLOR_BLUE,
SKINCOLOR_AZURE,
SKINCOLOR_COBALT,
SKINCOLOR_VAPOR,
SKINCOLOR_DUSK,
SKINCOLOR_PASTEL,
SKINCOLOR_PURPLE,
SKINCOLOR_LAVENDER,
SKINCOLOR_BUBBLEGUM,
SKINCOLOR_MAGENTA,
SKINCOLOR_PINK,
SKINCOLOR_NEON,
SKINCOLOR_VIOLET,
SKINCOLOR_LILAC,
SKINCOLOR_PLUM,
SKINCOLOR_ROSY,
//SKINCOLOR_?
//SKINCOLOR_?
// Careful! MAXSKINCOLORS cannot be greater than 0x20! Two slots left...
// SKINCOLOR_? - one left before we bump up against 0x39, which isn't a HARD limit anymore but would be excessive
MAXSKINCOLORS,
// Super special awesome Super flashing colors!
@ -295,11 +333,11 @@ typedef enum
SKINCOLOR_SUPERPERIDOT4,
SKINCOLOR_SUPERPERIDOT5,
SKINCOLOR_SUPERCYAN1,
SKINCOLOR_SUPERCYAN2,
SKINCOLOR_SUPERCYAN3,
SKINCOLOR_SUPERCYAN4,
SKINCOLOR_SUPERCYAN5,
SKINCOLOR_SUPERSKY1,
SKINCOLOR_SUPERSKY2,
SKINCOLOR_SUPERSKY3,
SKINCOLOR_SUPERSKY4,
SKINCOLOR_SUPERSKY5,
SKINCOLOR_SUPERPURPLE1,
SKINCOLOR_SUPERPURPLE2,

View File

@ -2091,6 +2091,7 @@ void G_PlayerReborn(INT32 player)
UINT32 availabilities;
tic_t jointime;
boolean spectator;
boolean outofcoop;
INT16 bot;
SINT8 pity;
@ -2101,6 +2102,7 @@ void G_PlayerReborn(INT32 player)
exiting = players[player].exiting;
jointime = players[player].jointime;
spectator = players[player].spectator;
outofcoop = players[player].outofcoop;
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE));
// As long as we're not in multiplayer, carry over cheatcodes from map to map
@ -2155,6 +2157,7 @@ void G_PlayerReborn(INT32 player)
p->ctfteam = ctfteam;
p->jointime = jointime;
p->spectator = spectator;
p->outofcoop = outofcoop;
// save player config truth reborn
p->skincolor = skincolor;
@ -2206,8 +2209,8 @@ void G_PlayerReborn(INT32 player)
p->rings = 0; // 0 rings
p->panim = PA_IDLE; // standing animation
if ((netgame || multiplayer) && !p->spectator)
p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
//if ((netgame || multiplayer) && !p->spectator) -- moved into P_SpawnPlayer to account for forced changes there
//p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
if (p-players == consoleplayer)
{
@ -2496,7 +2499,8 @@ void G_ChangePlayerReferences(mobj_t *oldmo, mobj_t *newmo)
void G_DoReborn(INT32 playernum)
{
player_t *player = &players[playernum];
boolean starpost = false;
boolean resetlevel = false;
INT32 i;
if (modeattacking)
{
@ -2522,35 +2526,98 @@ void G_DoReborn(INT32 playernum)
B_RespawnBot(playernum);
if (oldmo)
G_ChangePlayerReferences(oldmo, players[playernum].mo);
return;
}
else if (countdowntimeup || (!multiplayer && gametype == GT_COOP))
if (countdowntimeup || (!(netgame || multiplayer) && gametype == GT_COOP))
resetlevel = true;
else if (gametype == GT_COOP && (netgame || multiplayer))
{
boolean notgameover = true;
if (cv_cooplives.value != 0 && player->lives <= 0) // consider game over first
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].exiting || players[i].lives > 0)
break;
}
if (i == MAXPLAYERS)
{
notgameover = false;
if (!countdown2)
{
// They're dead, Jim.
//nextmapoverride = spstage_start;
nextmapoverride = gamemap;
countdown2 = TICRATE;
skipstats = true;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
players[i].score = 0;
}
//emeralds = 0;
tokenbits = 0;
tokenlist = 0;
token = 0;
}
}
}
if (notgameover && cv_coopstarposts.value == 2)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].playerstate != PST_DEAD && !players[i].spectator && players[i].mo && players[i].mo->health)
break;
}
if (i == MAXPLAYERS)
resetlevel = true;
}
}
if (resetlevel)
{
// reload the level from scratch
if (countdowntimeup)
{
player->starpostangle = 0;
player->starposttime = 0;
player->starpostx = 0;
player->starposty = 0;
player->starpostz = 0;
player->starpostnum = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
players[i].starpostangle = 0;
players[i].starposttime = 0;
players[i].starpostx = 0;
players[i].starposty = 0;
players[i].starpostz = 0;
players[i].starpostnum = 0;
}
}
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
{
INT32 i;
player->playerstate = PST_REBORN;
P_LoadThingsOnly();
P_ClearStarPost(player->starpostnum);
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
players[i].playerstate = PST_REBORN;
P_ClearStarPost(players[i].starpostnum);
}
// Do a wipe
wipegamestate = -1;
if (player->starposttime)
starpost = true;
if (camera.chase)
P_ResetCamera(&players[displayplayer], &camera);
if (camera2.chase && splitscreen)
@ -2558,7 +2625,7 @@ void G_DoReborn(INT32 playernum)
// clear cmd building stuff
memset(gamekeydown, 0, sizeof (gamekeydown));
for (i = 0;i < JOYAXISSET; i++)
for (i = 0; i < JOYAXISSET; i++)
{
joyxmove[i] = joyymove[i] = 0;
joy2xmove[i] = joy2ymove[i] = 0;
@ -2570,31 +2637,45 @@ void G_DoReborn(INT32 playernum)
CON_ClearHUD();
// Starpost support
G_SpawnPlayer(playernum, starpost);
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
G_SpawnPlayer(i, (players[i].starposttime));
}
if (botingame)
{ // Bots respawn next to their master.
players[secondarydisplayplayer].playerstate = PST_REBORN;
G_SpawnPlayer(secondarydisplayplayer, false);
// restore time in netgame (see also p_setup.c)
if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2)
{
// is this a hack? maybe
tic_t maxstarposttime = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].starposttime > maxstarposttime)
maxstarposttime = players[i].starposttime;
}
leveltime = maxstarposttime;
}
}
else
#ifdef HAVE_BLUA
{
#ifdef HAVE_BLUA
LUAh_MapChange();
#endif
G_DoLoadLevel(true);
#ifdef HAVE_BLUA
return;
}
#endif
}
else
{
// respawn at the start
mobj_t *oldmo = NULL;
if (player->starposttime)
starpost = true;
// Not resetting map, so return to level music
if (!countdown2
&& player->lives <= 0
&& cv_cooplives.value == 1) // not allowed for life steal because no way to come back from zero group lives without addons, which should call this anyways
P_RestoreMultiMusic(player);
// first dissasociate the corpse
if (player->mo)
@ -2604,7 +2685,7 @@ void G_DoReborn(INT32 playernum)
P_RemoveMobj(player->mo);
}
G_SpawnPlayer(playernum, starpost);
G_SpawnPlayer(playernum, (player->starposttime));
if (oldmo)
G_ChangePlayerReferences(oldmo, players[playernum].mo);
}
@ -2612,10 +2693,49 @@ void G_DoReborn(INT32 playernum)
void G_AddPlayer(INT32 playernum)
{
INT32 countplayers = 0, notexiting = 0;
player_t *p = &players[playernum];
// Go through the current players and make sure you have the latest starpost set
if (G_PlatformGametype() && (netgame || multiplayer))
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].bot) // ignore dumb, stupid tails
continue;
countplayers++;
if (!players->exiting)
notexiting++;
if (!(cv_coopstarposts.value && (gametype == GT_COOP) && (p->starpostnum < players[i].starpostnum)))
continue;
p->starposttime = players[i].starposttime;
p->starpostx = players[i].starpostx;
p->starposty = players[i].starposty;
p->starpostz = players[i].starpostz;
p->starpostangle = players[i].starpostangle;
p->starpostnum = players[i].starpostnum;
}
}
p->jointime = 0;
p->playerstate = PST_REBORN;
p->height = mobjinfo[MT_PLAYER].height;
if (G_GametypeUsesLives() || ((netgame || multiplayer) && gametype == GT_COOP))
p->lives = cv_startinglives.value;
if (countplayers && !notexiting)
P_DoPlayerExit(p);
}
void G_ExitLevel(void)
@ -3613,7 +3733,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
if (netgame || multiplayer)
{
if (!FLS || (players[i].lives < cv_startinglives.value))
if (!FLS || (players[i].lives < 1))
players[i].lives = cv_startinglives.value;
players[i].continues = 0;
}
@ -4415,7 +4535,7 @@ void G_GhostTicker(void)
g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4);
break;
case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer)
g->mo->color = (UINT8)(SKINCOLOR_RED + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RED))); // Passes through all saturated colours
g->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours
break;
default:
break;

View File

@ -945,7 +945,6 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
{
UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h;
UINT8 c = 255;
RGBA_t *image, *blendimage, *cur, blendcolor;
if (grmip->width == 0)
@ -969,59 +968,10 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
image = gpatch->mipmap.grInfo.data;
blendimage = blendgpatch->mipmap.grInfo.data;
#define SUPERCOLORBLEND(name, c1, c2, c3, c4, c5) \
case SKINCOLOR_SUPER ## name ## 1: c = c1; break; \
case SKINCOLOR_SUPER ## name ## 2: c = c2; break; \
case SKINCOLOR_SUPER ## name ## 3: c = c3; break; \
case SKINCOLOR_SUPER ## name ## 4: c = c4; break; \
case SKINCOLOR_SUPER ## name ## 5: c = c5; break;
switch (color)
{
case SKINCOLOR_WHITE: c = 3; break;
case SKINCOLOR_SILVER: c = 10; break;
case SKINCOLOR_GREY: c = 15; break;
case SKINCOLOR_BLACK: c = 27; break;
case SKINCOLOR_BEIGE: c = 247; break;
case SKINCOLOR_PEACH: c = 218; break;
case SKINCOLOR_BROWN: c = 234; break;
case SKINCOLOR_RED: c = 38; break;
case SKINCOLOR_CRIMSON: c = 45; break;
case SKINCOLOR_ORANGE: c = 54; break;
case SKINCOLOR_RUST: c = 60; break;
case SKINCOLOR_GOLD: c = 67; break;
case SKINCOLOR_YELLOW: c = 73; break;
case SKINCOLOR_TAN: c = 85; break;
case SKINCOLOR_MOSS: c = 92; break;
case SKINCOLOR_PERIDOT: c = 188; break;
case SKINCOLOR_GREEN: c = 101; break;
case SKINCOLOR_EMERALD: c = 112; break;
case SKINCOLOR_AQUA: c = 122; break;
case SKINCOLOR_TEAL: c = 141; break;
case SKINCOLOR_CYAN: c = 131; break;
case SKINCOLOR_BLUE: c = 152; break;
case SKINCOLOR_AZURE: c = 171; break;
case SKINCOLOR_PASTEL: c = 161; break;
case SKINCOLOR_PURPLE: c = 165; break;
case SKINCOLOR_LAVENDER: c = 195; break;
case SKINCOLOR_MAGENTA: c = 183; break;
case SKINCOLOR_PINK: c = 211; break;
case SKINCOLOR_ROSY: c = 202; break;
SUPERCOLORBLEND(SILVER, 0, 2, 4, 7, 10) // Super silver
SUPERCOLORBLEND(RED, 208, 210, 32, 33, 35) // Super red
SUPERCOLORBLEND(ORANGE, 208, 48, 50, 54, 58) // Super orange
SUPERCOLORBLEND(GOLD, 80, 83, 73, 64, 67) // Super gold
SUPERCOLORBLEND(PERIDOT, 88, 188, 189, 190, 191) // Super peridot
SUPERCOLORBLEND(CYAN, 128, 131, 133, 134, 136) // Super cyan
SUPERCOLORBLEND(PURPLE, 144, 162, 164, 166, 168) // Super purple
SUPERCOLORBLEND(RUST, 51, 54, 68, 70, 234) // Super rust
SUPERCOLORBLEND(TAN, 80, 82, 84, 87, 247) // Super tan
default: c = 255; break;
}
blendcolor = V_GetColor(c);
#undef SUPERCOLORBLEND
if (color == SKINCOLOR_NONE || color >= MAXTRANSLATIONS)
blendcolor = V_GetColor(0xff);
else
blendcolor = V_GetColor(Color_Index[color-1][4]);
while (size--)
{

View File

@ -92,6 +92,7 @@ patch_t *emeraldpics[7];
patch_t *tinyemeraldpics[7];
static patch_t *emblemicon;
patch_t *tokenicon;
static patch_t *exiticon;
//-------------------------------------------
// misc vars
@ -245,6 +246,7 @@ void HU_LoadGraphics(void)
emblemicon = W_CachePatchName("EMBLICON", PU_HUDGFX);
tokenicon = W_CachePatchName("TOKNICON", PU_HUDGFX);
exiticon = W_CachePatchName("EXITICON", PU_HUDGFX);
emeraldpics[0] = W_CachePatchName("CHAOS1", PU_HUDGFX);
emeraldpics[1] = W_CachePatchName("CHAOS2", PU_HUDGFX);
@ -1176,6 +1178,9 @@ void HU_Erase(void)
// IN-LEVEL MULTIPLAYER RANKINGS
//======================================================================
#define supercheckdef ((players[tab[i].num].powers[pw_super] && players[tab[i].num].mo && (players[tab[i].num].mo->state < &states[S_PLAY_SUPER_TRANS] || players[tab[i].num].mo->state > &states[S_PLAY_SUPER_TRANS9])) || (players[tab[i].num].powers[pw_carry] == CR_NIGHTSMODE && skins[players[tab[i].num].skin].flags & SF_SUPER))
#define greycheckdef ((players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) || players[tab[i].num].spectator)
//
// HU_DrawTabRankings
//
@ -1183,6 +1188,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
{
INT32 i;
const UINT8 *colormap;
boolean greycheck, supercheck;
//this function is designed for 9 or less score lines only
I_Assert(scorelines <= 9);
@ -1191,12 +1197,15 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
for (i = 0; i < scorelines; i++)
{
if (players[tab[i].num].spectator)
if (players[tab[i].num].spectator && gametype != GT_COOP)
continue; //ignore them.
greycheck = greycheckdef;
supercheck = supercheckdef;
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS)
| (greycheck ? V_60TRANS : 0)
| V_ALLOWLOWERCASE, tab[i].name);
// Draw emeralds
@ -1206,7 +1215,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
}
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
if (greycheck)
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, livesback);
else
V_DrawSmallScaledPatch (x, y-4, 0, livesback);
@ -1214,11 +1223,11 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if (tab[i].color == 0)
{
colormap = colormaps;
if (players[tab[i].num].powers[pw_super])
if (supercheck)
V_DrawSmallScaledPatch(x, y-4, 0, superprefix[players[tab[i].num].skin]);
else
{
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
if (greycheck)
V_DrawSmallTranslucentPatch(x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
else
V_DrawSmallScaledPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin]);
@ -1226,7 +1235,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
}
else
{
if (players[tab[i].num].powers[pw_super] && players[tab[i].num].mo && (players[tab[i].num].mo->state < &states[S_PLAY_SUPER_TRANS] || players[tab[i].num].mo->state > &states[S_PLAY_SUPER_TRANS9]))
if (supercheck)
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE);
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
@ -1234,23 +1243,26 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
else
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
if (greycheck)
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
else
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
}
}
if (G_GametypeUsesLives()) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives));
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3))) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
{
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
if (greycheck)
V_DrawSmallTranslucentPatch(x-32, y-4, V_60TRANS, tagico);
else
V_DrawSmallScaledPatch(x-32, y-4, 0, tagico);
}
if (players[tab[i].num].exiting)
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon);
if (gametype == GT_RACE)
{
if (circuitmap)
@ -1258,13 +1270,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if (players[tab[i].num].exiting)
V_DrawRightAlignedString(x+240, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
else
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
V_DrawRightAlignedString(x+240, y, (greycheck ? V_60TRANS : 0), va("%u", tab[i].count));
}
else
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
V_DrawRightAlignedString(x+240, y, (greycheck ? V_60TRANS : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
}
else
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
V_DrawRightAlignedString(x+240, y, (greycheck ? V_60TRANS : 0), va("%u", tab[i].count));
y += 16;
}
@ -1279,6 +1291,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
INT32 redplayers = 0, blueplayers = 0;
const UINT8 *colormap;
char name[MAXPLAYERNAME+1];
boolean greycheck, supercheck;
V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two teams.
V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
@ -1306,10 +1319,13 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
else //er? not on red or blue, so ignore them
continue;
greycheck = greycheckdef;
supercheck = supercheckdef;
strlcpy(name, tab[i].name, 9);
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT)
| (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name);
if (gametype == GT_CTF)
@ -1327,7 +1343,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
}
if (players[tab[i].num].powers[pw_super])
if (supercheck)
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
@ -1335,12 +1351,12 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
else
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
if (greycheck)
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
else
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
}
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
V_DrawRightAlignedThinString(x+120, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
}
}
@ -1352,6 +1368,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
INT32 i;
const UINT8 *colormap;
char name[MAXPLAYERNAME+1];
boolean greycheck, supercheck;
V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two sides.
V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
@ -1359,20 +1376,26 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
for (i = 0; i < scorelines; i++)
{
if (players[tab[i].num].spectator)
if (players[tab[i].num].spectator && gametype != GT_COOP)
continue; //ignore them.
greycheck = greycheckdef;
supercheck = supercheckdef;
strlcpy(name, tab[i].name, 9);
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT)
| (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name);
if (G_GametypeUsesLives()) //show lives
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3))) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
V_DrawSmallScaledPatch(x-28, y-4, 0, tagico);
if (players[tab[i].num].exiting)
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon);
// Draw emeralds
if (!players[tab[i].num].powers[pw_super]
|| ((leveltime/7) & 1))
@ -1384,19 +1407,19 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
if (tab[i].color == 0)
{
colormap = colormaps;
if (players[tab[i].num].powers[pw_super])
if (supercheck)
V_DrawSmallScaledPatch (x, y-4, 0, superprefix[players[tab[i].num].skin]);
else
{
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
V_DrawSmallTranslucentPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
if (greycheck)
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
else
V_DrawSmallScaledPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
}
}
else
{
if (players[tab[i].num].powers[pw_super])
if (supercheck)
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
@ -1404,8 +1427,8 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
else
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
if (greycheck)
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
else
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
}
@ -1419,13 +1442,13 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
if (players[tab[i].num].exiting)
V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
else
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
V_DrawRightAlignedThinString(x+156, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
}
else
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
V_DrawRightAlignedThinString(x+156, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
}
else
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
V_DrawRightAlignedThinString(x+120, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
y += 16;
if (y > 160)
@ -1622,61 +1645,67 @@ static void HU_DrawRankings(void)
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator)
if (!playeringame[j])
continue;
if (gametype != GT_COOP && players[j].spectator)
continue;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
if (!playeringame[i])
continue;
if (gametype != GT_COOP && players[i].spectator)
continue;
if (gametype == GT_RACE)
{
if (gametype == GT_RACE)
if (circuitmap)
{
if (circuitmap)
if ((unsigned)players[i].laps+1 >= tab[scorelines].count && completed[i] == false)
{
if ((unsigned)players[i].laps+1 >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].laps+1;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
}
}
else
{
if (players[i].realtime <= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].realtime;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
}
}
}
else if (gametype == GT_COMPETITION)
{
// todo put something more fitting for the gametype here, such as current
// number of categories led
if (players[i].score >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].score;
tab[scorelines].count = players[i].laps+1;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
tab[scorelines].emeralds = players[i].powers[pw_emeralds];
}
}
else
{
if (players[i].score >= tab[scorelines].count && completed[i] == false)
if (players[i].realtime <= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].score;
tab[scorelines].count = players[i].realtime;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
tab[scorelines].emeralds = players[i].powers[pw_emeralds];
}
}
}
else if (gametype == GT_COMPETITION)
{
// todo put something more fitting for the gametype here, such as current
// number of categories led
if (players[i].score >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].score;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
tab[scorelines].emeralds = players[i].powers[pw_emeralds];
}
}
else
{
if (players[i].score >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].score;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
tab[scorelines].emeralds = players[i].powers[pw_emeralds];
}
}
}
completed[tab[scorelines].num] = true;
scorelines++;

View File

@ -21,7 +21,7 @@
//------------------------------------
// heads up font
//------------------------------------
#define HU_FONTSTART '\x19' // the first font character
#define HU_FONTSTART '\x16' // the first font character
#define HU_FONTEND '~'
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)

View File

@ -978,6 +978,19 @@ static int lib_pGivePlayerLives(lua_State *L)
return 0;
}
static int lib_pGiveCoopLives(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
INT32 numlives = (INT32)luaL_checkinteger(L, 2);
boolean sound = (boolean)lua_opttrueboolean(L, 3);
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_GiveCoopLives(player, numlives, sound);
return 0;
}
static int lib_pResetScore(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2440,6 +2453,7 @@ static luaL_Reg lib[] = {
{"P_SpawnGhostMobj",lib_pSpawnGhostMobj},
{"P_GivePlayerRings",lib_pGivePlayerRings},
{"P_GivePlayerLives",lib_pGivePlayerLives},
{"P_GiveCoopLives",lib_pGiveCoopLives},
{"P_ResetScore",lib_pResetScore},
{"P_DoJumpShield",lib_pDoJumpShield},
{"P_DoBubbleBounce",lib_pDoBubbleBounce},

View File

@ -417,7 +417,7 @@ static int mobj_set(lua_State *L)
mo->frame = (UINT32)luaL_checkinteger(L, 3);
break;
case mobj_sprite2:
mo->sprite2 = P_GetMobjSprite2(mo, (UINT8)luaL_checkinteger(L, 3));
mo->sprite2 = P_GetSkinSprite2(((skin_t *)mo->skin), (UINT8)luaL_checkinteger(L, 3), mo->player);
break;
case mobj_anim_duration:
mo->anim_duration = (UINT16)luaL_checkinteger(L, 3);

View File

@ -320,6 +320,8 @@ static int player_get(lua_State *L)
lua_pushangle(L, plr->awayviewaiming);
else if (fastcmp(field,"spectator"))
lua_pushboolean(L, plr->spectator);
else if (fastcmp(field,"outofcoop"))
lua_pushboolean(L, plr->outofcoop);
else if (fastcmp(field,"bot"))
lua_pushinteger(L, plr->bot);
else if (fastcmp(field,"jointime"))
@ -597,6 +599,8 @@ static int player_set(lua_State *L)
plr->awayviewaiming = luaL_checkangle(L, 3);
else if (fastcmp(field,"spectator"))
plr->spectator = lua_toboolean(L, 3);
else if (fastcmp(field,"outofcoop"))
plr->outofcoop = lua_toboolean(L, 3);
else if (fastcmp(field,"bot"))
return NOSET;
else if (fastcmp(field,"jointime"))

View File

@ -499,63 +499,63 @@ emblem_t emblemlocations[MAXEMBLEMS] =
// FLORAL FIELD
// ---
{0, 5394, -996, 160, 50, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 50, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 50, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 50, 'T', SKINCOLOR_GREY, 40*TICRATE, "", 0},
// TOXIC PLATEAU
// ---
{0, 780, -1664, 32, 51, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 51, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 51, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 51, 'T', SKINCOLOR_GREY, 50*TICRATE, "", 0},
// FLOODED COVE
// ---
{0, 1824, -1888, 2448, 52, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 52, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 52, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 52, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0},
// CAVERN FORTRESS
// ---
{0, -3089, -431, 1328, 53, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 53, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 53, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 53, 'T', SKINCOLOR_GREY, 75*TICRATE, "", 0},
// DUSTY WASTELAND
// ---
{0, 957, 924, 2956, 54, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 54, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 54, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 54, 'T', SKINCOLOR_GREY, 65*TICRATE, "", 0},
// MAGMA CAVES
// ---
{0, -2752, 3104, 1800, 55, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 55, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 55, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 55, 'T', SKINCOLOR_GREY, 80*TICRATE, "", 0},
// EGG SATELLITE
// ---
{0, 5334, -609, 3426, 56, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 56, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 56, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 56, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0},
// BLACK HOLE
// ---
{0, 2108, 3776, 32, 57, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 57, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 57, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 57, 'T', SKINCOLOR_GREY, 150*TICRATE, "", 0},
// SPRING HILL
// ---
{0, -1840, -1024, 1644, 58, 'N', SKINCOLOR_RUST, 0, "", 0},
{ET_NGRADE, 0,0,0, 58, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
{ET_NGRADE, 0,0,0, 58, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
{ET_NTIME, 0,0,0, 58, 'T', SKINCOLOR_GREY, 60*TICRATE, "", 0},
};
@ -566,7 +566,7 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] =
{"All Emeralds", "Complete 1P Mode with all Emeralds", 11, 'V', SKINCOLOR_GREY, 0},
{"Perfect Bonus", "Perfect Bonus on a non-secret stage", 30, 'P', SKINCOLOR_GOLD, 0},
{"PLACEHOLDER", "PLACEHOLDER", 0, 'O', SKINCOLOR_RUST, 0},
{"NiGHTS Mastery", "Show your mastery of NiGHTS!", 22, 'W', SKINCOLOR_TEAL, 0},
{"NiGHTS Mastery", "Show your mastery of NiGHTS!", 22, 'W', SKINCOLOR_CYAN, 0},
};
// Default Unlockables

File diff suppressed because it is too large Load Diff

View File

@ -832,6 +832,34 @@ static mobjtype_t P_DoRandomBoxChances(void)
mobjtype_t spawnchance[256];
INT32 numchoices = 0, i = 0;
if (!(netgame || multiplayer))
{
switch (P_RandomKey(10))
{
case 0:
return MT_RING_ICON;
case 1:
return MT_SNEAKERS_ICON;
case 2:
return MT_INVULN_ICON;
case 3:
return MT_WHIRLWIND_ICON;
case 4:
return MT_ELEMENTAL_ICON;
case 5:
return MT_ATTRACT_ICON;
case 6:
return MT_FORCE_ICON;
case 7:
return MT_ARMAGEDDON_ICON;
case 8:
return MT_1UP_ICON;
case 9:
return MT_EGGMAN_ICON;
}
return MT_NULL;
}
#define QUESTIONBOXCHANCES(type, cvar) \
for (i = cvar.value; i; --i) spawnchance[numchoices++] = type
QUESTIONBOXCHANCES(MT_RING_ICON, cv_superring);
@ -2826,8 +2854,8 @@ void A_BossDeath(mobj_t *mo)
// make sure there is a player alive for victory
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && ((players[i].mo && players[i].mo->health > 0)
|| ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0))))
if (playeringame[i] && ((players[i].mo && players[i].mo->health)
|| ((netgame || multiplayer) && (players[i].lives || players[i].continues))))
break;
if (i == MAXPLAYERS)
@ -3215,10 +3243,12 @@ void A_ExtraLife(mobj_t *actor)
// In shooter gametypes, give the player 100 rings instead of an extra life.
if (gametype != GT_COOP && gametype != GT_COMPETITION)
{
P_GivePlayerRings(player, 100);
P_PlayLivesJingle(player);
}
else
P_GivePlayerLives(player, 1);
P_PlayLivesJingle(player);
P_GiveCoopLives(player, 1, true);
}
// Function: A_GiveShield
@ -3931,12 +3961,12 @@ void A_SignPlayer(mobj_t *actor)
of in the name. If you have a better idea, feel free
to let me know. ~toast 2016/07/20
*/
actor->frame += Color_Opposite[Color_Opposite[skin->prefoppositecolor*2]*2+1];
actor->frame += (15 - Color_Opposite[(Color_Opposite[(skin->prefoppositecolor - 1)*2] - 1)*2 + 1]);
}
else // Set the sign to be an appropriate background color for this player's skincolor.
else if (actor->target->player->skincolor) // Set the sign to be an appropriate background color for this player's skincolor.
{
actor->color = Color_Opposite[actor->target->player->skincolor*2];
actor->frame += Color_Opposite[actor->target->player->skincolor*2+1];
actor->color = Color_Opposite[(actor->target->player->skincolor - 1)*2];
actor->frame += (15 - Color_Opposite[(actor->target->player->skincolor - 1)*2 + 1]);
}
if (skin->sprites[SPR2_SIGN].numframes)
@ -5254,7 +5284,10 @@ void A_MixUp(mobj_t *actor)
}
if (numplayers <= 1) // Not enough players to mix up.
{
S_StartSound(actor, sfx_lose);
return;
}
else if (numplayers == 2) // Special case -- simple swap
{
fixed_t x, y, z;
@ -5500,7 +5533,10 @@ void A_RecyclePowers(mobj_t *actor)
#endif
if (!multiplayer)
{
S_StartSound(actor, sfx_lose);
return;
}
numplayers = 0;
@ -5536,7 +5572,10 @@ void A_RecyclePowers(mobj_t *actor)
}
if (numplayers <= 1)
{
S_StartSound(actor, sfx_lose);
return; //nobody to touch!
}
//shuffle the post scramble list, whee!
// hardcoded 0-1 to 1-0 for two players
@ -9016,8 +9055,8 @@ void A_ForceWin(mobj_t *actor)
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && ((players[i].mo && players[i].mo->health > 0)
|| ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0))))
if (playeringame[i] && ((players[i].mo && players[i].mo->health)
|| ((netgame || multiplayer) && (players[i].lives || players[i].continues))))
break;
}

View File

@ -1293,13 +1293,40 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->starpostnum >= special->health)
return; // Already hit this post
// Save the player's time and position.
player->starposttime = leveltime;
player->starpostx = toucher->x>>FRACBITS;
player->starposty = toucher->y>>FRACBITS;
player->starpostz = special->z>>FRACBITS;
player->starpostangle = special->angle;
player->starpostnum = special->health;
if (cv_coopstarposts.value && gametype == GT_COOP && (netgame || multiplayer))
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
{
if (players[i].bot) // ignore dumb, stupid tails
continue;
players[i].starposttime = leveltime;
players[i].starpostx = player->mo->x>>FRACBITS;
players[i].starposty = player->mo->y>>FRACBITS;
players[i].starpostz = special->z>>FRACBITS;
players[i].starpostangle = special->angle;
players[i].starpostnum = special->health;
if (cv_coopstarposts.value == 2 && (players[i].playerstate == PST_DEAD || players[i].spectator) && P_GetLives(&players[i]))
P_SpectatorJoinGame(&players[i]); //players[i].playerstate = PST_REBORN;
}
}
S_StartSound(NULL, special->info->painsound);
}
else
{
// Save the player's time and position.
player->starposttime = leveltime;
player->starpostx = toucher->x>>FRACBITS;
player->starposty = toucher->y>>FRACBITS;
player->starpostz = special->z>>FRACBITS;
player->starpostangle = special->angle;
player->starpostnum = special->health;
S_StartSound(toucher, special->info->painsound);
}
P_ClearStarPost(special->health);
// Find all starposts in the level with this value.
@ -2230,14 +2257,34 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
target->flags |= MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY;
P_SetThingPosition(target);
if (!target->player->bot && !G_IsSpecialStage(gamemap)
if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0))
;
else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap)
&& G_GametypeUsesLives())
{
target->player->lives -= 1; // Lose a life Tails 03-11-2000
if (target->player->lives <= 0) // Tails 03-14-2000
{
if (P_IsLocalPlayer(target->player)/* && target->player == &players[consoleplayer] */)
boolean gameovermus = false;
if ((netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value != 1))
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].lives > 0)
break;
}
if (i == MAXPLAYERS)
gameovermus = true;
}
else if (P_IsLocalPlayer(target->player))
gameovermus = true;
if (gameovermus)
{
S_StopMusic(); // Stop the Music! Tails 03-14-2000
S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000

View File

@ -148,6 +148,7 @@ void P_SwitchShield(player_t *player, UINT16 shieldtype);
mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
void P_GivePlayerRings(player_t *player, INT32 num_rings);
void P_GivePlayerLives(player_t *player, INT32 numlives);
void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound);
UINT8 P_GetNextEmerald(void);
void P_GiveEmerald(boolean spawnObj);
#if 0
@ -198,6 +199,9 @@ void P_PlayLivesJingle(player_t *player);
#define P_PlayDeathSound(s) S_StartSound(s, sfx_altdi1 + P_RandomKey(4));
#define P_PlayVictorySound(s) S_StartSound(s, sfx_victr1 + P_RandomKey(4));
boolean P_GetLives(player_t *player);
boolean P_SpectatorJoinGame(player_t *player);
void P_RestoreMultiMusic(player_t *player);
//
// P_MOBJ
@ -224,7 +228,6 @@ void P_PrecipitationEffects(void);
void P_RemoveMobj(mobj_t *th);
boolean P_MobjWasRemoved(mobj_t *th);
void P_RemoveSavegameMobj(mobj_t *th);
UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2);
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
void P_RunShields(void);

View File

@ -86,7 +86,7 @@ void P_AddCachedAction(mobj_t *mobj, INT32 statenum)
//
FUNCINLINE static ATTRINLINE void P_SetupStateAnimation(mobj_t *mobj, state_t *st)
{
INT32 animlength = (mobj->skin && mobj->sprite == SPR_PLAY)
INT32 animlength = (mobj->sprite == SPR_PLAY && mobj->skin)
? (INT32)(((skin_t *)mobj->skin)->sprites[mobj->sprite2].numframes) - 1
: st->var1;
@ -185,195 +185,6 @@ static void P_CyclePlayerMobjState(mobj_t *mobj)
}
}
//
// P_GetMobjSprite2
// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing.
// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version.
//
UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2)
{
player_t *player = mobj->player;
skin_t *skin = ((skin_t *)mobj->skin);
UINT8 super = (spr2 & FF_SPR2SUPER);
if (!skin)
return 0;
while (!(skin->sprites[spr2].numframes)
&& spr2 != SPR2_STND)
{
if (spr2 & FF_SPR2SUPER)
{
spr2 &= ~FF_SPR2SUPER;
continue;
}
switch(spr2)
{
case SPR2_RUN:
spr2 = SPR2_WALK;
break;
case SPR2_STUN:
spr2 = SPR2_PAIN;
break;
case SPR2_DRWN:
spr2 = SPR2_DEAD;
break;
case SPR2_SPIN:
spr2 = SPR2_ROLL;
break;
case SPR2_GASP:
spr2 = SPR2_SPNG;
break;
case SPR2_JUMP:
spr2 = ((player
? player->charflags
: skin->flags)
& SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL;
break;
case SPR2_SPNG: // spring
spr2 = SPR2_FALL;
break;
case SPR2_FALL:
spr2 = SPR2_WALK;
break;
case SPR2_RIDE:
spr2 = SPR2_FALL;
break;
case SPR2_FLY :
spr2 = SPR2_SPNG;
break;
case SPR2_SWIM:
spr2 = SPR2_FLY ;
break;
case SPR2_TIRE:
spr2 = (player && player->charability == CA_SWIM) ? SPR2_SWIM : SPR2_FLY;
break;
case SPR2_GLID:
spr2 = SPR2_FLY;
break;
case SPR2_CLMB:
spr2 = SPR2_ROLL;
break;
case SPR2_CLNG:
spr2 = SPR2_CLMB;
break;
case SPR2_FLT :
spr2 = SPR2_WALK;
break;
case SPR2_FRUN:
spr2 = SPR2_RUN ;
break;
case SPR2_DASH:
spr2 = SPR2_FRUN;
break;
case SPR2_BNCE:
spr2 = SPR2_FALL;
break;
case SPR2_BLND:
spr2 = SPR2_ROLL;
break;
case SPR2_TWIN:
spr2 = SPR2_ROLL;
break;
case SPR2_MLEE:
spr2 = SPR2_TWIN;
break;
// NiGHTS sprites.
case SPR2_NSTD:
spr2 = SPR2_STND;
super = FF_SPR2SUPER;
break;
case SPR2_NFLT:
spr2 = SPR2_FLT ;
super = FF_SPR2SUPER;
break;
case SPR2_NSTN:
spr2 = SPR2_STUN;
break;
case SPR2_NPUL:
spr2 = SPR2_NSTN;
break;
case SPR2_NATK:
spr2 = SPR2_ROLL;
super = FF_SPR2SUPER;
break;
/*case SPR2_NGT0:
spr2 = SPR2_NFLT;
break;*/
case SPR2_NGT1:
case SPR2_NGT7:
case SPR2_DRL0:
spr2 = SPR2_NGT0;
break;
case SPR2_NGT2:
case SPR2_DRL1:
spr2 = SPR2_NGT1;
break;
case SPR2_NGT3:
case SPR2_DRL2:
spr2 = SPR2_NGT2;
break;
case SPR2_NGT4:
case SPR2_DRL3:
spr2 = SPR2_NGT3;
break;
case SPR2_NGT5:
case SPR2_DRL4:
spr2 = SPR2_NGT4;
break;
case SPR2_NGT6:
case SPR2_DRL5:
spr2 = SPR2_NGT5;
break;
case SPR2_DRL6:
spr2 = SPR2_NGT6;
break;
case SPR2_NGT8:
case SPR2_DRL7:
spr2 = SPR2_NGT7;
break;
case SPR2_NGT9:
case SPR2_DRL8:
spr2 = SPR2_NGT8;
break;
case SPR2_NGTA:
case SPR2_DRL9:
spr2 = SPR2_NGT9;
break;
case SPR2_NGTB:
case SPR2_DRLA:
spr2 = SPR2_NGTA;
break;
case SPR2_NGTC:
case SPR2_DRLB:
spr2 = SPR2_NGTB;
break;
case SPR2_DRLC:
spr2 = SPR2_NGTC;
break;
// Dunno? Just go to standing then.
default:
spr2 = SPR2_STND;
break;
}
spr2 |= super;
}
return spr2;
}
//
// P_SetPlayerMobjState
// Returns true if the mobj is still present.
@ -574,14 +385,16 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
{
skin_t *skin = ((skin_t *)mobj->skin);
UINT16 frame = (mobj->frame & FF_FRAMEMASK)+1;
UINT8 numframes;
UINT8 spr2 = P_GetMobjSprite2(mobj, (((player->powers[pw_super]) ? FF_SPR2SUPER : 0)|st->frame) & FF_FRAMEMASK);
UINT8 numframes, spr2;
if (skin)
{
spr2 = P_GetSkinSprite2(skin, (((player->powers[pw_super]) ? FF_SPR2SUPER : 0)|st->frame) & FF_FRAMEMASK, mobj->player);
numframes = skin->sprites[spr2].numframes;
}
else
{
spr2 = 0;
frame = 0;
numframes = 0;
}
@ -700,14 +513,16 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
{
skin_t *skin = ((skin_t *)mobj->skin);
UINT16 frame = (mobj->frame & FF_FRAMEMASK)+1;
UINT8 numframes;
UINT8 spr2 = P_GetMobjSprite2(mobj, st->frame & FF_FRAMEMASK);
UINT8 numframes, spr2;
if (skin)
{
spr2 = P_GetSkinSprite2(skin, st->frame & FF_FRAMEMASK, mobj->player);
numframes = skin->sprites[spr2].numframes;
}
else
{
spr2 = 0;
frame = 0;
numframes = 0;
}
@ -3225,8 +3040,17 @@ static void P_PlayerZMovement(mobj_t *mo)
}
}
if (mo->health && !P_CheckDeathPitCollide(mo))
if (mo->health && !mo->player->spectator && !P_CheckDeathPitCollide(mo))
{
if ((mo->player->charability2 == CA2_SPINDASH) && !(mo->player->pflags & PF_THOKKED) && (mo->player->cmd.buttons & BT_USE) && (FixedHypot(mo->momx, mo->momy) > (5*mo->scale)))
{
mo->player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(mo, S_PLAY_ROLL);
S_StartSound(mo, sfx_spin);
}
else
mo->player->pflags &= ~PF_SPINNING;
if (mo->player->pflags & PF_GLIDING) // ground gliding
{
mo->player->skidtime = TICRATE;
@ -3239,7 +3063,7 @@ static void P_PlayerZMovement(mobj_t *mo)
S_StartSound(mo, sfx_s3k8b);
mo->player->pflags |= PF_FULLSTASIS;
}
else if (mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN)
else if (mo->player->pflags & PF_JUMPED || !(mo->player->pflags & PF_SPINNING)
|| mo->player->powers[pw_tailsfly] || mo->state-states == S_PLAY_FLY_TIRED)
{
if (mo->player->cmomx || mo->player->cmomy)
@ -3270,15 +3094,6 @@ static void P_PlayerZMovement(mobj_t *mo)
}
}
if ((mo->player->charability2 == CA2_SPINDASH) && !(mo->player->pflags & PF_THOKKED) && (mo->player->cmd.buttons & BT_USE) && (FixedHypot(mo->momx, mo->momy) > (5*mo->scale)))
{
mo->player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(mo, S_PLAY_ROLL);
S_StartSound(mo, sfx_spin);
}
else
mo->player->pflags &= ~PF_SPINNING;
if (!(mo->player->pflags & PF_GLIDING))
mo->player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE);
@ -9261,40 +9076,44 @@ void P_SpawnPlayer(INT32 playernum)
// spawn as spectator determination
if (!G_GametypeHasSpectators())
{
// Special case for (NiGHTS) special stages!
// if stage has already started, force players to become spectators until the next stage
if (multiplayer && netgame && G_IsSpecialStage(gamemap) && useNightsSS && leveltime > 0)
p->spectator = true;
else
p->spectator = false;
p->spectator = p->outofcoop =
(((multiplayer || netgame) && gametype == GT_COOP) // only question status in coop
&& ((leveltime > 0
&& ((G_IsSpecialStage(gamemap) && useNightsSS) // late join special stage
|| (cv_coopstarposts.value == 2 && (p->jointime < 1 || p->outofcoop)))) // late join or die in new coop
|| (((cv_cooplives.value == 1) || !P_GetLives(p)) && p->lives <= 0))); // game over and can't redistribute lives
}
else if (netgame && p->jointime < 1)
p->spectator = true;
else if (multiplayer && !netgame)
else
{
// If you're in a team game and you don't have a team assigned yet...
if (G_GametypeHasTeams() && p->ctfteam == 0)
{
changeteam_union NetPacket;
UINT16 usvalue;
NetPacket.value.l = NetPacket.value.b = 0;
// Spawn as a spectator,
// yes even in splitscreen mode
p->outofcoop = false;
if (netgame && p->jointime < 1)
p->spectator = true;
if (playernum&1) p->skincolor = skincolor_redteam;
else p->skincolor = skincolor_blueteam;
else if (multiplayer && !netgame)
{
// If you're in a team game and you don't have a team assigned yet...
if (G_GametypeHasTeams() && p->ctfteam == 0)
{
changeteam_union NetPacket;
UINT16 usvalue;
NetPacket.value.l = NetPacket.value.b = 0;
// but immediately send a team change packet.
NetPacket.packet.playernum = playernum;
NetPacket.packet.verification = true;
NetPacket.packet.newteam = !(playernum&1) + 1;
// Spawn as a spectator,
// yes even in splitscreen mode
p->spectator = true;
if (playernum&1) p->skincolor = skincolor_redteam;
else p->skincolor = skincolor_blueteam;
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
// but immediately send a team change packet.
NetPacket.packet.playernum = playernum;
NetPacket.packet.verification = true;
NetPacket.packet.newteam = !(playernum&1) + 1;
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
}
else // Otherwise, never spectator.
p->spectator = false;
}
else // Otherwise, never spectator.
p->spectator = false;
}
if (G_GametypeHasTeams())
@ -9311,6 +9130,9 @@ void P_SpawnPlayer(INT32 playernum)
p->skincolor = skincolor_blueteam;
}
if ((netgame || multiplayer) && (gametype != GT_COOP || leveltime) && !p->spectator && !(maptol & TOL_NIGHTS))
p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER);
(mobj->player = p)->mo = mobj;
@ -9701,9 +9523,9 @@ void P_SpawnMapThing(mapthing_t *mthing)
if (gametype == GT_COMPETITION || gametype == GT_RACE)
{
// Set powerup boxes to user settings for competition.
if (cv_competitionboxes.value == 1) // Random
if (cv_competitionboxes.value == 1) // Mystery
i = MT_MYSTERY_BOX;
else if (cv_competitionboxes.value == 2) // Teleports
else if (cv_competitionboxes.value == 2) // Teleport
i = MT_MIXUP_BOX;
else if (cv_competitionboxes.value == 3) // None
return; // Don't spawn!
@ -9712,12 +9534,12 @@ void P_SpawnMapThing(mapthing_t *mthing)
// Set powerup boxes to user settings for other netplay modes
else if (gametype != GT_COOP)
{
if (cv_matchboxes.value == 1) // Random
if (cv_matchboxes.value == 1) // Mystery
i = MT_MYSTERY_BOX;
else if (cv_matchboxes.value == 2) // Non-Random
else if (cv_matchboxes.value == 2) // Unchanging
{
if (i == MT_MYSTERY_BOX)
return; // don't spawn in Non-Random
return; // don't spawn
mthing->options &= ~(MTF_AMBUSH|MTF_OBJECTSPECIAL); // no random respawning!
}
else if (cv_matchboxes.value == 3) // Don't spawn

View File

@ -2166,6 +2166,7 @@ lumpnum_t lastloadedmaplumpnum; // for comparative savegame
static void P_LevelInitStuff(void)
{
INT32 i;
boolean canresetlives = true;
leveltime = 0;
@ -2183,7 +2184,18 @@ static void P_LevelInitStuff(void)
// map time limit
if (mapheaderinfo[gamemap-1]->countdown)
{
tic_t maxtime = 0;
countdowntimer = mapheaderinfo[gamemap-1]->countdown * TICRATE;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].starposttime > maxtime)
maxtime = players[i].starposttime;
}
countdowntimer -= maxtime;
}
else
countdowntimer = 0;
countdowntimeup = false;
@ -2205,9 +2217,21 @@ static void P_LevelInitStuff(void)
// earthquake camera
memset(&quake,0,sizeof(struct quake));
if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].lives > 0)
{
canresetlives = false;
break;
}
}
}
for (i = 0; i < MAXPLAYERS; i++)
{
if ((netgame || multiplayer) && (gametype == GT_COMPETITION || players[i].lives <= 0))
if (canresetlives && (netgame || multiplayer) && playeringame[i] && (gametype == GT_COMPETITION || players[i].lives <= 0))
{
// In Co-Op, replenish a user's lives if they are depleted.
players[i].lives = cv_startinglives.value;
@ -2821,6 +2845,19 @@ boolean P_SetupLevel(boolean skipprecip)
}
}
// restore time in netgame (see also g_game.c)
if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2)
{
// is this a hack? maybe
tic_t maxstarposttime = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].starposttime > maxstarposttime)
maxstarposttime = players[i].starposttime;
}
leveltime = maxstarposttime;
}
if (modeattacking == ATTACKING_RECORD && !demoplayback)
P_LoadRecordGhosts();
else if (modeattacking == ATTACKING_NIGHTS && !demoplayback)

View File

@ -359,7 +359,7 @@ static void P_DoAutobalanceTeams(void)
totalred = red + redflagcarrier;
totalblue = blue + blueflagcarrier;
if ((abs(totalred - totalblue) > cv_autobalance.value))
if ((abs(totalred - totalblue) > max(1, (totalred + totalblue) / 8)))
{
if (totalred > totalblue)
{
@ -372,8 +372,7 @@ static void P_DoAutobalanceTeams(void)
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
}
if (totalblue > totalred)
else //if (totalblue > totalred)
{
i = M_RandomKey(blue);
NetPacket.packet.newteam = 1;
@ -651,7 +650,7 @@ void P_Ticker(boolean run)
if (run)
{
if (countdowntimer && --countdowntimer <= 0)
if (countdowntimer && G_PlatformGametype() && (gametype == GT_COOP || leveltime >= 4*TICRATE) && --countdowntimer <= 0)
{
countdowntimer = 0;
countdowntimeup = true;
@ -663,6 +662,8 @@ void P_Ticker(boolean run)
if (!players[i].mo)
continue;
if (multiplayer || netgame)
players[i].exiting = 0;
P_DamageMobj(players[i].mo, NULL, NULL, 1, DMG_INSTAKILL);
}
}

View File

@ -666,7 +666,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
if (skins[player->skin].sprites[SPR2_NGT0].numframes == 0) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin.
{
player->mo->skin = &skins[DEFAULTNIGHTSSKIN];
player->mo->color = ((skin_t *)(player->mo->skin))->prefcolor;
player->mo->color = skins[DEFAULTNIGHTSSKIN].prefcolor;
}
player->nightstime = player->startedtime = nighttime*TICRATE;
@ -958,6 +958,29 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
player->lives = 1;
}
void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound)
{
if (!((netgame || multiplayer) && gametype == GT_COOP))
{
P_GivePlayerLives(player, numlives);
if (sound)
P_PlayLivesJingle(player);
}
else
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
P_GivePlayerLives(&players[i], numlives);
if (sound)
P_PlayLivesJingle(&players[i]);
}
}
}
//
// P_DoSuperTransformation
//
@ -1130,7 +1153,9 @@ void P_PlayLivesJingle(player_t *player)
if (player && !P_IsLocalPlayer(player))
return;
if (use1upSound)
if (gametype == GT_COOP && (netgame || multiplayer) && cv_cooplives.value == 0)
S_StartSound(NULL, sfx_lose);
else if (use1upSound)
S_StartSound(NULL, sfx_oneup);
else if (mariomode)
S_StartSound(NULL, sfx_marioa);
@ -2266,7 +2291,7 @@ static void P_CheckInvincibilityTimer(player_t *player)
return;
if (mariomode && !player->powers[pw_super])
player->mo->color = (UINT8)(SKINCOLOR_RED + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RED))); // Passes through all saturated colours
player->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours
else if (leveltime % (TICRATE/7) == 0)
{
mobj_t *sparkle = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_IVSP);
@ -2323,7 +2348,7 @@ static void P_DoBubbleBreath(player_t *player)
if (player->charflags & SF_MACHINE)
{
if (P_RandomChance((128-(player->powers[pw_underwater]/4))*FRACUNIT/256))
if (player->powers[pw_underwater] && P_RandomChance((128-(player->powers[pw_underwater]/4))*FRACUNIT/256))
{
fixed_t r = player->mo->radius>>FRACBITS;
x += (P_RandomRange(r, -r)<<FRACBITS);
@ -4340,11 +4365,6 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->mo->momy /= 3;
}
if (player->mo->info->attacksound && !player->spectator)
S_StartSound(player->mo, player->mo->info->attacksound); // Play the THOK sound
P_SpawnThokMobj(player);
if (player->charability == CA_HOMINGTHOK)
{
P_SetTarget(&player->mo->target, P_SetTarget(&player->mo->tracer, lockon));
@ -4357,10 +4377,16 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
{
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
player->pflags &= ~PF_JUMPED;
player->mo->height = P_GetPlayerHeight(player);
}
player->pflags &= ~PF_NOJUMPDAMAGE;
}
if (player->mo->info->attacksound && !player->spectator)
S_StartSound(player->mo, player->mo->info->attacksound); // Play the THOK sound
P_SpawnThokMobj(player);
player->pflags &= ~(PF_SPINNING|PF_STARTDASH);
player->pflags |= PF_THOKKED;
}
@ -4822,7 +4848,7 @@ static void P_3dMovement(player_t *player)
angle_t dangle; // replaces old quadrants bits
fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
boolean analogmove = false;
boolean spin = (player->pflags & PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH));
boolean spin = ((onground = P_IsObjectOnGround(player->mo)) && player->pflags & PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH));
fixed_t oldMagnitude, newMagnitude;
#ifdef ESLOPE
vector3_t totalthrust;
@ -4912,9 +4938,6 @@ static void P_3dMovement(player_t *player)
if (player->pflags & PF_SLIDING)
cmd->forwardmove = 0;
// Do not let the player control movement if not onground.
onground = P_IsObjectOnGround(player->mo);
player->aiming = cmd->aiming<<FRACBITS;
// Set the player speeds.
@ -4975,10 +4998,7 @@ static void P_3dMovement(player_t *player)
if (spin) // Prevent gaining speed whilst rolling!
{
const fixed_t ns = FixedDiv(549*ORIG_FRICTION,500*FRACUNIT); // P_XYFriction
if (onground)
topspeed = FixedMul(oldMagnitude, ns);
else
topspeed = oldMagnitude;
topspeed = FixedMul(oldMagnitude, ns);
}
// Better maneuverability while flying
@ -5019,19 +5039,20 @@ static void P_3dMovement(player_t *player)
{
movepushforward = cmd->forwardmove * (thrustfactor * acceleration);
// allow very small movement while in air for gameplay
if (!onground)
movepushforward >>= 2; // proper air movement
// Allow a bit of movement while spinning
if (player->pflags & PF_SPINNING)
{
if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0)
|| (player->pflags & PF_STARTDASH))
movepushforward = 0;
else if (onground)
movepushforward >>= 4;
else
movepushforward = FixedDiv(movepushforward, 16*FRACUNIT);
movepushforward >>= 3;
}
// allow very small movement while in air for gameplay
else if (!onground)
movepushforward >>= 2; // proper air movement
movepushforward = FixedMul(movepushforward, player->mo->scale);
@ -5059,21 +5080,20 @@ static void P_3dMovement(player_t *player)
movepushforward = max(abs(cmd->sidemove), abs(cmd->forwardmove)) * (thrustfactor * acceleration);
// allow very small movement while in air for gameplay
if (!onground)
movepushforward >>= 2; // proper air movement
// Allow a bit of movement while spinning
if (player->pflags & PF_SPINNING)
{
// Stupid little movement prohibitor hack
// that REALLY shouldn't belong in analog code.
if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0)
|| (player->pflags & PF_STARTDASH))
movepushforward = 0;
else if (onground)
movepushforward >>= 4;
else
movepushforward = FixedDiv(movepushforward, 16*FRACUNIT);
movepushforward >>= 3;
}
// allow very small movement while in air for gameplay
else if (!onground)
movepushforward >>= 2; // proper air movement
movepushsideangle = controldirection;
@ -5091,25 +5111,26 @@ static void P_3dMovement(player_t *player)
{
movepushside = cmd->sidemove * (thrustfactor * acceleration);
// allow very small movement while in air for gameplay
if (!onground)
{
movepushside >>= 2;
movepushside >>= 2; // proper air movement
// Reduce movepushslide even more if over "max" flight speed
if (player->powers[pw_tailsfly] && player->speed > topspeed)
if ((player->pflags & PF_SPINNING) || (player->powers[pw_tailsfly] && player->speed > topspeed))
movepushside >>= 2;
}
// Allow a bit of movement while spinning
if (player->pflags & PF_SPINNING)
else if (player->pflags & PF_SPINNING)
{
if ((player->pflags & PF_STARTDASH))
if (player->pflags & PF_STARTDASH)
movepushside = 0;
else if (onground)
movepushside >>= 4;
else
movepushside = FixedDiv(movepushside,16*FRACUNIT);
movepushside >>= 3;
}
// Finally move the player now that his speed/direction has been decided.
// Finally move the player now that their speed/direction has been decided.
movepushside = FixedMul(movepushside, player->mo->scale);
#ifdef ESLOPE
@ -5192,16 +5213,16 @@ static void P_SpectatorMovement(player_t *player)
if (!(cmd->angleturn & TICCMD_RECEIVED))
ticmiss++;
if (player->mo->z > player->mo->ceilingz - player->mo->height)
player->mo->z = player->mo->ceilingz - player->mo->height;
if (player->mo->z < player->mo->floorz)
player->mo->z = player->mo->floorz;
if (cmd->buttons & BT_JUMP)
player->mo->z += FRACUNIT*16;
else if (cmd->buttons & BT_USE)
player->mo->z -= FRACUNIT*16;
if (player->mo->z > player->mo->ceilingz - player->mo->height)
player->mo->z = player->mo->ceilingz - player->mo->height;
if (player->mo->z < player->mo->floorz)
player->mo->z = player->mo->floorz;
// Aiming needed for SEENAMES, etc.
// We may not need to fire as a spectator, but this is still handy!
player->aiming = cmd->aiming<<FRACBITS;
@ -6677,9 +6698,6 @@ static void P_MovePlayer(player_t *player)
fixed_t runspd;
if (countdowntimeup)
return;
if (player->mo->state >= &states[S_PLAY_SUPER_TRANS] && player->mo->state <= &states[S_PLAY_SUPER_TRANS9])
{
player->mo->momx = player->mo->momy = player->mo->momz = 0;
@ -6740,6 +6758,7 @@ static void P_MovePlayer(player_t *player)
if (player->spectator)
{
player->mo->eflags &= ~MFE_VERTICALFLIP; // deflip...
P_SpectatorMovement(player);
return;
}
@ -8131,6 +8150,111 @@ void P_FindEmerald(void)
return;
}
//
// P_GetLives
// Get extra lives in new co-op if you're allowed to.
//
boolean P_GetLives(player_t *player)
{
INT32 i, maxlivesplayer = -1, livescheck = 1;
if (!(netgame || multiplayer)
|| (gametype != GT_COOP)
|| (cv_cooplives.value == 1))
return true;
if ((cv_cooplives.value == 2 || cv_cooplives.value == 0) && player->lives > 0)
return true;
if (cv_cooplives.value == 0) // infinite lives
{
player->lives++;
return true;
}
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].lives > livescheck)
{
maxlivesplayer = i;
livescheck = players[i].lives;
}
}
if (maxlivesplayer != -1 && &players[maxlivesplayer] != player)
{
if (cv_cooplives.value == 2 && (P_IsLocalPlayer(player) || P_IsLocalPlayer(&players[maxlivesplayer])))
S_StartSound(NULL, sfx_jshard); // placeholder
players[maxlivesplayer].lives--;
player->lives++;
if (player->lives < 1)
player->lives = 1;
return true;
}
return (player->lives > 0);
}
//
// P_ConsiderAllGone
// Shamelessly lifted from TD. Thanks, Sryder!
//
static void P_ConsiderAllGone(void)
{
INT32 i, lastdeadplayer = -1, deadtimercheck = INT32_MAX;
if (countdown2)
return;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].playerstate != PST_DEAD && !players[i].spectator && players[i].mo && players[i].mo->health)
break;
if (players[i].spectator)
{
if (lastdeadplayer == -1)
lastdeadplayer = i;
}
else if (players[i].lives > 0)
{
lastdeadplayer = i;
if (players[i].deadtimer < deadtimercheck)
deadtimercheck = players[i].deadtimer;
}
}
if (i == MAXPLAYERS && lastdeadplayer != -1 && deadtimercheck > 2*TICRATE) // the last killed player will reset the level in G_DoReborn
{
//players[lastdeadplayer].spectator = true;
players[lastdeadplayer].outofcoop = true;
players[lastdeadplayer].playerstate = PST_REBORN;
}
}
void P_RestoreMultiMusic(player_t *player)
{
if (netgame)
{
if (P_IsLocalPlayer(player))
S_ChangeMusic(mapmusname, mapmusflags, true);
}
else if (multiplayer) // local multiplayer only
{
// Restore the other player's music once we're dead for long enough
// -- that is, as long as they aren't dead too
if (player == &players[displayplayer] && players[secondarydisplayplayer].lives > 0)
P_RestoreMusic(&players[secondarydisplayplayer]);
else if (player == &players[secondarydisplayplayer] && players[displayplayer].lives > 0)
P_RestoreMusic(&players[displayplayer]);
}
}
//
// P_DeathThink
// Fall on your face when dying.
@ -8139,6 +8263,8 @@ void P_FindEmerald(void)
static void P_DeathThink(player_t *player)
{
INT32 j = MAXPLAYERS;
ticcmd_t *cmd = &player->cmd;
player->deltaviewheight = 0;
@ -8154,76 +8280,100 @@ static void P_DeathThink(player_t *player)
G_UseContinue(); // Even if we don't have one this handles ending the game
}
if ((cv_cooplives.value != 1)
&& (gametype == GT_COOP)
&& (netgame || multiplayer)
&& (player->lives <= 0))
{
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j])
continue;
if (players[j].lives > 1)
break;
}
}
// Force respawn if idle for more than 30 seconds in shooter modes.
if (player->deadtimer > 30*TICRATE && !G_PlatformGametype())
player->playerstate = PST_REBORN;
else if (player->lives > 0 && !G_IsSpecialStage(gamemap)) // Don't allow "click to respawn" in special stages!
else if ((player->lives > 0 || j != MAXPLAYERS) && !G_IsSpecialStage(gamemap)) // Don't allow "click to respawn" in special stages!
{
// Respawn with jump button, force respawn time (3 second default, cheat protected) in shooter modes.
if ((cmd->buttons & BT_JUMP) && player->deadtimer > cv_respawntime.value*TICRATE
&& gametype != GT_RACE && gametype != GT_COOP)
player->playerstate = PST_REBORN;
if (gametype == GT_COOP && (netgame || multiplayer) && cv_coopstarposts.value == 2)
{
P_ConsiderAllGone();
if ((player->deadtimer > 5*TICRATE) || ((cmd->buttons & BT_JUMP) && (player->deadtimer > TICRATE)))
{
//player->spectator = true;
player->outofcoop = true;
player->playerstate = PST_REBORN;
}
}
else
{
// Respawn with jump button, force respawn time (3 second default, cheat protected) in shooter modes.
if (cmd->buttons & BT_JUMP)
{
if (gametype != GT_COOP && player->spectator)
player->playerstate = PST_REBORN;
else switch(gametype) {
case GT_COOP:
if (player->deadtimer > TICRATE)
player->playerstate = PST_REBORN;
break;
case GT_COMPETITION:
if (player->deadtimer > TICRATE)
player->playerstate = PST_REBORN;
break;
case GT_RACE:
player->playerstate = PST_REBORN;
break;
default:
if (player->deadtimer > cv_respawntime.value*TICRATE)
player->playerstate = PST_REBORN;
break;
}
}
// Instant respawn in race or if you're spectating.
if ((cmd->buttons & BT_JUMP) && (gametype == GT_RACE || player->spectator))
player->playerstate = PST_REBORN;
// One second respawn in coop.
if ((cmd->buttons & BT_JUMP) && player->deadtimer > TICRATE && (gametype == GT_COOP || gametype == GT_COMPETITION))
player->playerstate = PST_REBORN;
// Single player auto respawn
if (!(netgame || multiplayer) && player->deadtimer > 5*TICRATE)
player->playerstate = PST_REBORN;
// Single player auto respawn
if (!(netgame || multiplayer) && player->deadtimer > 5*TICRATE)
player->playerstate = PST_REBORN;
}
}
else if ((netgame || multiplayer) && player->deadtimer == 8*TICRATE)
else if ((netgame || multiplayer) && player->deadtimer >= 8*TICRATE)
{
INT32 i, deadtimercheck = INT32_MAX;
// In a net/multiplayer game, and out of lives
if (gametype == GT_COMPETITION)
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && !players[i].exiting && players[i].lives > 0)
{
if (!playeringame[i])
continue;
if (!players[i].exiting && players[i].lives)
break;
if (players[i].deadtimer < deadtimercheck)
deadtimercheck = players[i].deadtimer;
}
if (i == MAXPLAYERS)
if (i == MAXPLAYERS && deadtimercheck == 8*TICRATE)
{
// Everyone's either done with the race, or dead.
if (!countdown2 || countdown2 > 1*TICRATE)
countdown2 = 1*TICRATE;
}
}
//else if (gametype == GT_COOP) -- moved to G_DoReborn
}
// In a coop game, and out of lives
if (gametype == GT_COOP)
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && (players[i].exiting || players[i].lives > 0))
break;
if (i == MAXPLAYERS)
{
// They're dead, Jim.
//nextmapoverride = spstage_start;
nextmapoverride = gamemap;
countdown2 = 1*TICRATE;
skipstats = true;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
players[i].score = 0;
}
//emeralds = 0;
tokenbits = 0;
tokenlist = 0;
token = 0;
}
}
if (gametype == GT_COOP && (multiplayer || netgame) && (player->lives <= 0) && (player->deadtimer >= 8*TICRATE || ((cmd->buttons & BT_JUMP) && (player->deadtimer > TICRATE))))
{
//player->spectator = true;
player->outofcoop = true;
player->playerstate = PST_REBORN;
}
if (gametype == GT_RACE || gametype == GT_COMPETITION || (gametype == GT_COOP && (multiplayer || netgame)))
@ -8243,25 +8393,8 @@ static void P_DeathThink(player_t *player)
}
// Return to level music
if (player->lives <= 0)
{
if (netgame)
{
if (player->deadtimer == gameovertics && P_IsLocalPlayer(player))
S_ChangeMusic(mapmusname, mapmusflags, true);
}
else if (multiplayer) // local multiplayer only
{
if (player->deadtimer != gameovertics)
;
// Restore the other player's music once we're dead for long enough
// -- that is, as long as they aren't dead too
else if (player == &players[displayplayer] && players[secondarydisplayplayer].lives > 0)
P_RestoreMusic(&players[secondarydisplayplayer]);
else if (player == &players[secondarydisplayplayer] && players[displayplayer].lives > 0)
P_RestoreMusic(&players[displayplayer]);
}
}
if (gametype != GT_COOP && player->lives <= 0 && player->deadtimer == gameovertics)
P_RestoreMultiMusic(player);
}
if (!player->mo)
@ -8915,16 +9048,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
return (x == thiscam->x && y == thiscam->y && z == thiscam->z && angle == thiscam->aiming);
}
static boolean P_SpectatorJoinGame(player_t *player)
boolean P_SpectatorJoinGame(player_t *player)
{
if (!G_GametypeHasSpectators() && G_IsSpecialStage(gamemap) && useNightsSS) // Special Stage spectators should NEVER be allowed to rejoin the game
{
if (P_IsLocalPlayer(player))
CONS_Printf(M_GetText("You cannot enter the game while a special stage is in progress.\n"));
player->powers[pw_flashing] += 2*TICRATE; //to prevent message spam.
}
else if (!cv_allowteamchange.value)
if (gametype != GT_COOP && !cv_allowteamchange.value)
{
if (P_IsLocalPlayer(player))
CONS_Printf(M_GetText("Server does not allow team change.\n"));
@ -8993,7 +9119,7 @@ static boolean P_SpectatorJoinGame(player_t *player)
P_RemoveMobj(player->mo);
player->mo = NULL;
}
player->spectator = false;
player->spectator = player->outofcoop = false;
player->playerstate = PST_REBORN;
if (gametype == GT_TAG)
@ -9012,7 +9138,8 @@ static boolean P_SpectatorJoinGame(player_t *player)
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
displayplayer = consoleplayer;
CONS_Printf(M_GetText("%s entered the game.\n"), player_names[player-players]);
if (gametype != GT_COOP)
CONS_Printf(M_GetText("%s entered the game.\n"), player_names[player-players]);
return true; // no more player->mo, cannot continue.
}
else
@ -9306,7 +9433,7 @@ void P_PlayerThink(player_t *player)
{
if (cv_playersforexit.value) // Count to be sure everyone's exited
{
INT32 i;
INT32 i, total = 0, exiting = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
@ -9315,11 +9442,12 @@ void P_PlayerThink(player_t *player)
if (players[i].lives <= 0)
continue;
if (!players[i].exiting || players[i].exiting > 3)
break;
total++;
if (players[i].exiting && players[i].exiting < 4)
exiting++;
}
if (i == MAXPLAYERS)
if (!total || ((4*exiting)/total) >= cv_playersforexit.value)
{
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
@ -9346,7 +9474,12 @@ void P_PlayerThink(player_t *player)
if (!player->spectator)
P_PlayerInSpecialSector(player);
else if (
#else
if (player->spectator &&
#endif
gametype == GT_COOP && (netgame || multiplayer) && cv_coopstarposts.value == 2)
P_ConsiderAllGone();
if (player->playerstate == PST_DEAD)
{
@ -9359,14 +9492,14 @@ void P_PlayerThink(player_t *player)
// Make sure spectators always have a score and ring count of 0.
if (player->spectator)
{
player->score = 0;
if (gametype != GT_COOP)
player->score = 0;
player->mo->health = 1;
player->rings = 0;
}
if ((netgame || multiplayer) && player->lives <= 0)
else if ((netgame || multiplayer) && player->lives <= 0 && gametype != GT_COOP)
{
// In Co-Op, replenish a user's lives if they are depleted.
// Outside of Co-Op, replenish a user's lives if they are depleted.
// of course, this is just a cheap hack, meh...
player->lives = cv_startinglives.value;
}
@ -9392,7 +9525,7 @@ void P_PlayerThink(player_t *player)
player->realtime = leveltime;
}
if ((netgame || splitscreen) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing])
if (player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing] && G_GametypeHasSpectators())
{
if (P_SpectatorJoinGame(player))
return; // player->mo was removed.

File diff suppressed because it is too large Load Diff

View File

@ -2423,6 +2423,193 @@ skin_t skins[MAXSKINS+1];
CV_PossibleValue_t skin_cons_t[MAXSKINS+1];
#endif
//
// P_GetSkinSprite2
// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing.
// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version.
//
UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player)
{
UINT8 super = (spr2 & FF_SPR2SUPER);
if (!skin)
return 0;
while (!(skin->sprites[spr2].numframes)
&& spr2 != SPR2_STND)
{
if (spr2 & FF_SPR2SUPER)
{
spr2 &= ~FF_SPR2SUPER;
continue;
}
switch(spr2)
{
case SPR2_RUN:
spr2 = SPR2_WALK;
break;
case SPR2_STUN:
spr2 = SPR2_PAIN;
break;
case SPR2_DRWN:
spr2 = SPR2_DEAD;
break;
case SPR2_SPIN:
spr2 = SPR2_ROLL;
break;
case SPR2_GASP:
spr2 = SPR2_SPNG;
break;
case SPR2_JUMP:
spr2 = ((player
? player->charflags
: skin->flags)
& SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL;
break;
case SPR2_SPNG: // spring
spr2 = SPR2_FALL;
break;
case SPR2_FALL:
spr2 = SPR2_WALK;
break;
case SPR2_RIDE:
spr2 = SPR2_FALL;
break;
case SPR2_FLY :
spr2 = SPR2_SPNG;
break;
case SPR2_SWIM:
spr2 = SPR2_FLY ;
break;
case SPR2_TIRE:
spr2 = (player && player->charability == CA_SWIM) ? SPR2_SWIM : SPR2_FLY;
break;
case SPR2_GLID:
spr2 = SPR2_FLY;
break;
case SPR2_CLMB:
spr2 = SPR2_ROLL;
break;
case SPR2_CLNG:
spr2 = SPR2_CLMB;
break;
case SPR2_FLT :
spr2 = SPR2_WALK;
break;
case SPR2_FRUN:
spr2 = SPR2_RUN ;
break;
case SPR2_DASH:
spr2 = SPR2_FRUN;
break;
case SPR2_BNCE:
spr2 = SPR2_FALL;
break;
case SPR2_BLND:
spr2 = SPR2_ROLL;
break;
case SPR2_TWIN:
spr2 = SPR2_ROLL;
break;
case SPR2_MLEE:
spr2 = SPR2_TWIN;
break;
// NiGHTS sprites.
case SPR2_NSTD:
spr2 = SPR2_STND;
super = FF_SPR2SUPER;
break;
case SPR2_NFLT:
spr2 = SPR2_FLT ;
super = FF_SPR2SUPER;
break;
case SPR2_NSTN:
spr2 = SPR2_STUN;
break;
case SPR2_NPUL:
spr2 = SPR2_NSTN;
break;
case SPR2_NATK:
spr2 = SPR2_ROLL;
super = FF_SPR2SUPER;
break;
/*case SPR2_NGT0:
spr2 = SPR2_NFLT;
break;*/
case SPR2_NGT1:
case SPR2_NGT7:
case SPR2_DRL0:
spr2 = SPR2_NGT0;
break;
case SPR2_NGT2:
case SPR2_DRL1:
spr2 = SPR2_NGT1;
break;
case SPR2_NGT3:
case SPR2_DRL2:
spr2 = SPR2_NGT2;
break;
case SPR2_NGT4:
case SPR2_DRL3:
spr2 = SPR2_NGT3;
break;
case SPR2_NGT5:
case SPR2_DRL4:
spr2 = SPR2_NGT4;
break;
case SPR2_NGT6:
case SPR2_DRL5:
spr2 = SPR2_NGT5;
break;
case SPR2_DRL6:
spr2 = SPR2_NGT6;
break;
case SPR2_NGT8:
case SPR2_DRL7:
spr2 = SPR2_NGT7;
break;
case SPR2_NGT9:
case SPR2_DRL8:
spr2 = SPR2_NGT8;
break;
case SPR2_NGTA:
case SPR2_DRL9:
spr2 = SPR2_NGT9;
break;
case SPR2_NGTB:
case SPR2_DRLA:
spr2 = SPR2_NGTA;
break;
case SPR2_NGTC:
case SPR2_DRLB:
spr2 = SPR2_NGTB;
break;
case SPR2_DRLC:
spr2 = SPR2_NGTC;
break;
// Dunno? Just go to standing then.
default:
spr2 = SPR2_STND;
break;
}
spr2 |= super;
}
return spr2;
}
static void Sk_SetDefaultValue(skin_t *skin)
{
INT32 i;
@ -2476,7 +2663,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
skin->spinitem = -1;
skin->revitem = -1;
skin->highresscale = FRACUNIT>>1;
skin->highresscale = FRACUNIT;
skin->availability = 0;
@ -2615,16 +2802,17 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
if (player->mo)
{
fixed_t radius = FixedMul(skin->radius, player->mo->scale);
if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NGT0].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin.
{
skin = &skins[DEFAULTNIGHTSSKIN];
newcolor = ((skin->flags & SF_SUPER) ? skin->supercolor : skin->prefcolor);
newcolor = skin->prefcolor; // will be updated in thinker to flashing
}
player->mo->skin = skin;
if (newcolor)
player->mo->color = newcolor;
P_SetScale(player->mo, player->mo->scale);
player->mo->radius = FixedMul(skin->radius, player->mo->scale);
player->mo->radius = radius;
P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames
}

View File

@ -215,6 +215,8 @@ INT32 R_SkinAvailable(const char *name);
void R_PatchSkins(UINT16 wadnum);
void R_AddSkins(UINT16 wadnum);
UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player);
void R_InitDrawNodes(void);
char *GetPlayerFacePic(INT32 skinnum);

View File

@ -154,7 +154,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"gravch", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Recycler"},
{"itemup", true, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sparkle"},
{"jet", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Jet engine"},
{"jshard", true, 167, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got shard"},
{"jshard", true, 167, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Life transfer"}, // placeholder repurpose; original string was "Got Shard"
{"lose" , false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Failure"},
{"lvpass", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning signpost"},
{"mindig", false, 8, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Tunnelling"},
@ -346,7 +346,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k78", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"},
{"s3k79", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric charge"},
{"s3k7a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising from lava"},
{"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Organic bounce"},
{"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Soft bounce"},
{"s3k7c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"},
{"s3k7d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Eating dirt"},

View File

@ -68,6 +68,7 @@ static patch_t *sboover;
static patch_t *timeover;
static patch_t *stlivex;
static patch_t *sboredrings;
static patch_t *sboredtime;
static patch_t *getall; // Special Stage HUD
static patch_t *timeup; // Special Stage HUD
static patch_t *hunthoming[6];
@ -251,6 +252,7 @@ void ST_LoadGraphics(void)
sboredrings = W_CachePatchName("STTRRING", PU_HUDGFX);
sboscore = W_CachePatchName("STTSCORE", PU_HUDGFX);
sbotime = W_CachePatchName("STTTIME", PU_HUDGFX); // Time logo
sboredtime = W_CachePatchName("STTRTIME", PU_HUDGFX);
sbocolon = W_CachePatchName("STTCOLON", PU_HUDGFX); // Colon for time
sboperiod = W_CachePatchName("STTPERIO", PU_HUDGFX); // Period for time centiseconds
@ -492,12 +494,12 @@ static INT32 SCR(INT32 r)
#define ST_DrawPaddedOverlayNum(x,y,n,d) V_DrawPaddedTallNum(x, y, V_NOSCALESTART|V_HUDTRANS, n, d)
#define ST_DrawOverlayPatch(x,y,p) V_DrawScaledPatch(x, y, V_NOSCALESTART|V_HUDTRANS, p)
#define ST_DrawMappedOverlayPatch(x,y,p,c) V_DrawMappedScaledPatch(x, y, V_NOSCALESTART|V_HUDTRANS, p, c)
#define ST_DrawNumFromHud(h,n) V_DrawTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|V_HUDTRANS, n)
#define ST_DrawPadNumFromHud(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|V_HUDTRANS, n, q)
#define ST_DrawPatchFromHud(h,p) V_DrawScaledPatch(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|V_HUDTRANS, p)
#define ST_DrawNumFromHudWS(h,n) V_DrawTallNum(SCX(hudinfo[h+!!splitscreen].x), SCY(hudinfo[h+!!splitscreen].y), V_NOSCALESTART|V_HUDTRANS, n)
#define ST_DrawPadNumFromHudWS(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h+!!splitscreen].x), SCY(hudinfo[h+!!splitscreen].y), V_NOSCALESTART|V_HUDTRANS, n, q)
#define ST_DrawPatchFromHudWS(h,p) V_DrawScaledPatch(SCX(hudinfo[h+!!splitscreen].x), SCY(hudinfo[h+!!splitscreen].y), V_NOSCALESTART|V_HUDTRANS, p)
#define ST_DrawNumFromHud(h,n,f) V_DrawTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|f, n)
#define ST_DrawPadNumFromHud(h,n,q,f) V_DrawPaddedTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|f, n, q)
#define ST_DrawPatchFromHud(h,p,f) V_DrawScaledPatch(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART|f, p)
#define ST_DrawNumFromHudWS(h,n,f) V_DrawTallNum(SCX(hudinfo[h+!!splitscreen].x), SCY(hudinfo[h+!!splitscreen].y), V_NOSCALESTART|f, n)
#define ST_DrawPadNumFromHudWS(h,n,q,f) V_DrawPaddedTallNum(SCX(hudinfo[h+!!splitscreen].x), SCY(hudinfo[h+!!splitscreen].y), V_NOSCALESTART|f, n, q)
#define ST_DrawPatchFromHudWS(h,p,f) V_DrawScaledPatch(SCX(hudinfo[h+!!splitscreen].x), SCY(hudinfo[h+!!splitscreen].y), V_NOSCALESTART|f, p)
// Draw a number, scaled, over the view, maybe with set translucency
// Always draw the number completely since it's overlay
@ -609,16 +611,16 @@ static void ST_drawDebugInfo(void)
static void ST_drawScore(void)
{
// SCORE:
ST_DrawPatchFromHud(HUD_SCORE, sboscore);
ST_DrawPatchFromHud(HUD_SCORE, sboscore, V_HUDTRANS);
if (objectplacing)
{
if (op_displayflags > UINT16_MAX)
ST_DrawOverlayPatch(SCX(hudinfo[HUD_SCORENUM].x-tallminus->width), SCY(hudinfo[HUD_SCORENUM].y), tallminus);
else
ST_DrawNumFromHud(HUD_SCORENUM, op_displayflags);
ST_DrawNumFromHud(HUD_SCORENUM, op_displayflags, V_HUDTRANS);
}
else
ST_DrawNumFromHud(HUD_SCORENUM, stplyr->score);
ST_DrawNumFromHud(HUD_SCORENUM, stplyr->score,V_HUDTRANS);
}
static void ST_drawTime(void)
@ -626,7 +628,7 @@ static void ST_drawTime(void)
INT32 seconds, minutes, tictrn, tics;
// TIME:
ST_DrawPatchFromHudWS(HUD_TIME, sbotime);
ST_DrawPatchFromHudWS(HUD_TIME, ((mapheaderinfo[gamemap-1]->countdown && countdowntimer < 11*TICRATE && leveltime/5 & 1) ? sboredtime : sbotime), V_HUDTRANS);
if (objectplacing)
{
@ -637,24 +639,24 @@ static void ST_drawTime(void)
}
else
{
tics = stplyr->realtime;
tics = (mapheaderinfo[gamemap-1]->countdown ? countdowntimer : stplyr->realtime);
seconds = G_TicsToSeconds(tics);
minutes = G_TicsToMinutes(tics, true);
tictrn = G_TicsToCentiseconds(tics);
}
if (cv_timetic.value == 1) // Tics only -- how simple is this?
ST_DrawNumFromHudWS(HUD_SECONDS, tics);
ST_DrawNumFromHudWS(HUD_SECONDS, tics, V_HUDTRANS);
else
{
ST_DrawNumFromHudWS(HUD_MINUTES, minutes); // Minutes
ST_DrawPatchFromHudWS(HUD_TIMECOLON, sbocolon); // Colon
ST_DrawPadNumFromHudWS(HUD_SECONDS, seconds, 2); // Seconds
ST_DrawNumFromHudWS(HUD_MINUTES, minutes, V_HUDTRANS); // Minutes
ST_DrawPatchFromHudWS(HUD_TIMECOLON, sbocolon, V_HUDTRANS); // Colon
ST_DrawPadNumFromHudWS(HUD_SECONDS, seconds, 2, V_HUDTRANS); // Seconds
if (!splitscreen && (cv_timetic.value == 2 || modeattacking)) // there's not enough room for tics in splitscreen, don't even bother trying!
{
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod); // Period
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2); // Tics
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod, V_HUDTRANS); // Period
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2, V_HUDTRANS); // Tics
}
}
}
@ -663,7 +665,7 @@ static inline void ST_drawRings(void)
{
INT32 ringnum = max(stplyr->rings, 0);
ST_DrawPatchFromHudWS(HUD_RINGS, ((stplyr->rings <= 0 && leveltime/5 & 1) ? sboredrings : sborings));
ST_DrawPatchFromHudWS(HUD_RINGS, ((!stplyr->spectator && stplyr->rings <= 0 && leveltime/5 & 1) ? sboredrings : sborings), ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
if (objectplacing)
ringnum = op_currentdoomednum;
@ -676,7 +678,7 @@ static inline void ST_drawRings(void)
ringnum += players[i].rings;
}
ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum);
ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum, ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
}
static void ST_drawLives(void)
@ -719,9 +721,68 @@ static void ST_drawLives(void)
// x
V_DrawScaledPatch(hudinfo[HUD_LIVESX].x, hudinfo[HUD_LIVESX].y + (v_splitflag ? -4 : 0),
V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_HUDTRANS|v_splitflag, stlivex);
// lives
// lives number
if ((netgame || multiplayer) && gametype == GT_COOP)
{
switch (cv_cooplives.value)
{
case 0:
V_DrawCharacter(hudinfo[HUD_LIVESNUM].x - 8, hudinfo[HUD_LIVESNUM].y + (v_splitflag ? -4 : 0), '\x16' | 0x80 | V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_HUDTRANS|v_splitflag, false);
return;
case 3:
{
INT32 i, sum = 0;
boolean canrespawn = (stplyr->lives > 0);
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].lives < 1)
continue;
if (players[i].lives > 1)
canrespawn = true;
sum += (players[i].lives);
}
V_DrawRightAlignedString(hudinfo[HUD_LIVESNUM].x, hudinfo[HUD_LIVESNUM].y + (v_splitflag ? -4 : 0),
V_SNAPTOLEFT|V_SNAPTOBOTTOM|(canrespawn ? V_HUDTRANS : V_HUDTRANSHALF)|v_splitflag,
va("%d",sum));
return;
}
#if 0 // render the number of lives you COULD steal
case 2:
{
INT32 i, sum = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (&players[i] == stplyr)
continue;
if (players[i].lives < 2)
continue;
sum += (players[i].lives - 1);
}
V_DrawString(hudinfo[HUD_LIVESNUM].x, hudinfo[HUD_LIVESNUM].y + (v_splitflag ? -4 : 0),
V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_HUDTRANSHALF|v_splitflag, va("/%d",sum));
}
// intentional fallthrough
#endif
default:
// don't return so the SP one can be drawn below
break;
}
}
V_DrawRightAlignedString(hudinfo[HUD_LIVESNUM].x, hudinfo[HUD_LIVESNUM].y + (v_splitflag ? -4 : 0),
V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_HUDTRANS|v_splitflag, va("%d",stplyr->lives));
V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_HUDTRANS|v_splitflag,
va("%d",stplyr->lives));
}
static void ST_drawLevelTitle(void)
@ -899,15 +960,25 @@ static void ST_drawFirstPersonHUD(void)
/*#define NUMLINKCOLORS 14
static skincolors_t linkColor[NUMLINKCOLORS] =
{SKINCOLOR_BEIGE, SKINCOLOR_LAVENDER, SKINCOLOR_AZURE, SKINCOLOR_PEACH, SKINCOLOR_ORANGE,
SKINCOLOR_MAGENTA, SKINCOLOR_SILVER, SKINCOLOR_SUPERGOLD4, SKINCOLOR_PINK, SKINCOLOR_RED,
SKINCOLOR_BLUE, SKINCOLOR_GREEN, SKINCOLOR_CYAN, SKINCOLOR_GOLD};*/
SKINCOLOR_MAGENTA, SKINCOLOR_SILVER, SKINCOLOR_SUPERGOLD4, SKINCOLOR_PINK, SKINCOLOR_RED,
SKINCOLOR_BLUE, SKINCOLOR_GREEN, SKINCOLOR_CYAN, SKINCOLOR_GOLD};*/
// 2.2+: (unix time 1470866042) <Rob> Emerald, Aqua, Cyan, Blue, Pastel, Purple, Magenta, Rosy, Red, Orange, Gold, Yellow, Peridot
#define NUMLINKCOLORS 13
// 2.2 indev list: (unix time 1470866042) <Rob> Emerald, Aqua, Cyan, Blue, Pastel, Purple, Magenta, Rosy, Red, Orange, Gold, Yellow, Peridot
/*#define NUMLINKCOLORS 13
static skincolors_t linkColor[NUMLINKCOLORS] =
{SKINCOLOR_EMERALD, SKINCOLOR_AQUA, SKINCOLOR_CYAN, SKINCOLOR_BLUE, SKINCOLOR_PASTEL,
SKINCOLOR_PURPLE, SKINCOLOR_MAGENTA, SKINCOLOR_ROSY, SKINCOLOR_RED, SKINCOLOR_ORANGE,
SKINCOLOR_GOLD, SKINCOLOR_YELLOW, SKINCOLOR_PERIDOT};
{SKINCOLOR_EMERALD, SKINCOLOR_AQUA, SKINCOLOR_CYAN, SKINCOLOR_BLUE, SKINCOLOR_PASTEL,
SKINCOLOR_PURPLE, SKINCOLOR_MAGENTA, SKINCOLOR_ROSY, SKINCOLOR_RED, SKINCOLOR_ORANGE,
SKINCOLOR_GOLD, SKINCOLOR_YELLOW, SKINCOLOR_PERIDOT};*/
// 2.2+ list: [19:59:52] <baldobo> Ruby > Red > Flame > Sunset > Orange > Gold > Yellow > Lime > Green > Aqua > cyan > Sky > Blue > Pastel > Purple > Bubblegum > Magenta > Rosy > repeat
// [20:00:25] <baldobo> Also Icy for the link freeze text color
// [20:04:03] <baldobo> I would start it on lime
#define NUMLINKCOLORS 18
static skincolors_t linkColor[NUMLINKCOLORS] =
{SKINCOLOR_LIME, SKINCOLOR_EMERALD, SKINCOLOR_AQUA, SKINCOLOR_CYAN, SKINCOLOR_SKY,
SKINCOLOR_SAPPHIRE, SKINCOLOR_PASTEL, SKINCOLOR_PURPLE, SKINCOLOR_BUBBLEGUM, SKINCOLOR_MAGENTA,
SKINCOLOR_ROSY, SKINCOLOR_RUBY, SKINCOLOR_RED, SKINCOLOR_FLAME, SKINCOLOR_SUNSET,
SKINCOLOR_ORANGE, SKINCOLOR_GOLD, SKINCOLOR_YELLOW};
static void ST_drawNightsRecords(void)
{
@ -1008,8 +1079,8 @@ static void ST_drawNiGHTSHUD(void)
stplyr->linkcount > minlink)
{
skincolors_t colornum = linkColor[((stplyr->linkcount-1) / 5) % NUMLINKCOLORS];
if (stplyr->powers[pw_nights_linkfreeze])
colornum = SKINCOLOR_WHITE;
if (stplyr->powers[pw_nights_linkfreeze] && (!(stplyr->powers[pw_nights_linkfreeze] & 2) || (stplyr->powers[pw_nights_linkfreeze] > flashingtics)))
colornum = SKINCOLOR_ICY;
if (stplyr->linktimer < 2*TICRATE/3)
{
@ -1288,7 +1359,7 @@ static void ST_drawNiGHTSHUD(void)
realnightstime = lowest_time/TICRATE;
}
if (stplyr->powers[pw_flashing] > TICRATE ) // was hit
if (stplyr->powers[pw_flashing] > TICRATE) // was hit
{
UINT16 flashingLeft = stplyr->powers[pw_flashing]-(TICRATE);
if (flashingLeft < TICRATE/2) // Start fading out
@ -1630,21 +1701,21 @@ static inline void ST_drawTeamName(void)
static void ST_drawSpecialStageHUD(void)
{
if (totalrings > 0)
ST_DrawNumFromHudWS(HUD_SS_TOTALRINGS, totalrings);
ST_DrawNumFromHudWS(HUD_SS_TOTALRINGS, totalrings, V_HUDTRANS);
if (leveltime < 5*TICRATE && totalrings > 0)
{
ST_DrawPatchFromHud(HUD_GETRINGS, getall);
ST_DrawNumFromHud(HUD_GETRINGSNUM, totalrings);
ST_DrawPatchFromHud(HUD_GETRINGS, getall, V_HUDTRANS);
ST_DrawNumFromHud(HUD_GETRINGSNUM, totalrings, V_HUDTRANS);
}
if (sstimer)
{
V_DrawString(hudinfo[HUD_TIMELEFT].x, STRINGY(hudinfo[HUD_TIMELEFT].y), V_HUDTRANS, M_GetText("TIME LEFT"));
ST_DrawNumFromHud(HUD_TIMELEFTNUM, sstimer/TICRATE);
ST_DrawNumFromHud(HUD_TIMELEFTNUM, sstimer/TICRATE, V_HUDTRANS);
}
else
ST_DrawPatchFromHud(HUD_TIMEUP, timeup);
ST_DrawPatchFromHud(HUD_TIMEUP, timeup, V_HUDTRANS);
}
static INT32 ST_drawEmeraldHuntIcon(mobj_t *hunt, patch_t **patches, INT32 offset)
@ -1807,7 +1878,11 @@ static void ST_overlayDrawer(void)
}
// GAME OVER pic
if (G_GametypeUsesLives() && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
if ((gametype == GT_COOP)
&& (netgame || multiplayer)
&& (cv_cooplives.value == 0))
;
else if (G_GametypeUsesLives() && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
{
patch_t *p;
@ -1816,7 +1891,29 @@ static void ST_overlayDrawer(void)
else
p = sboover;
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, STRINGY(BASEVIDHEIGHT/2 - (SHORT(p->height)/2)), 0, p);
if ((gametype == GT_COOP)
&& (netgame || multiplayer)
&& (cv_cooplives.value != 1))
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (&players[i] == stplyr)
continue;
if (players[i].lives > 0)
{
p = NULL;
break;
}
}
}
if (p)
V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, STRINGY(BASEVIDHEIGHT/2 - (SHORT(p->height)/2)) - (splitscreen ? 4 : 0), (stplyr->spectator ? V_HUDTRANSHALF : V_HUDTRANS), p);
}
@ -1901,15 +1998,49 @@ static void ST_overlayDrawer(void)
)
ST_drawLevelTitle();
if (!hu_showscores && !splitscreen && netgame && displayplayer == consoleplayer)
if (!hu_showscores && (netgame || multiplayer) && displayplayer == consoleplayer)
{
if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player."));
if (!stplyr->spectator && stplyr->exiting && cv_playersforexit.value && gametype == GT_COOP)
{
INT32 i, total = 0, exiting = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].lives <= 0)
continue;
total++;
if (players[i].exiting)
exiting++;
}
if (cv_playersforexit.value != 4)
{
total *= cv_playersforexit.value;
if (total % 4) total += 4; // round up
total /= 4;
}
if (exiting >= total)
;
else
{
total -= exiting;
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(124), 0, va(M_GetText("%d more player%s required to exit."), total, ((total == 1) ? "" : "s")));
if (!splitscreen)
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
}
}
else if (!splitscreen && gametype != GT_COOP && (stplyr->exiting || (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)))
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
else if (gametype == GT_HIDEANDSEEK &&
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))
{
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(116), 0, M_GetText("You cannot move while hiding."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player."));
if (!splitscreen)
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
}
else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
{
@ -1919,7 +2050,7 @@ static void ST_overlayDrawer(void)
else
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Jump to respawn."));
}
else if (stplyr->spectator
else if (stplyr->spectator && (gametype != GT_COOP || stplyr->playerstate == PST_LIVE)
#ifdef HAVE_BLUA
&& LUA_HudEnabled(hud_textspectator)
#endif
@ -1929,11 +2060,38 @@ static void ST_overlayDrawer(void)
if (G_GametypeHasTeams())
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Fire to be assigned to a team."));
else if (G_IsSpecialStage(gamemap) && useNightsSS)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot join the game until the stage has ended."));
else
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot play until the stage has ended."));
else if (gametype == GT_COOP && stplyr->lives <= 0)
{
if (cv_cooplives.value == 1
&& (netgame || multiplayer))
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (&players[i] == stplyr)
continue;
if (players[i].lives > 1)
break;
}
if (i != MAXPLAYERS)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132)-(splitscreen ? 12 : 0), V_HUDTRANSHALF, M_GetText("You'll steal a life on respawn."));
}
}
else if (!gametype == GT_COOP)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Fire to enter the game."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(148), V_HUDTRANSHALF, M_GetText("Press F12 to watch another player."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(164), V_HUDTRANSHALF, M_GetText("Press Jump to float and Spin to sink."));
if (!splitscreen)
{
V_DrawCenteredString(BASEVIDWIDTH/2, 148, V_HUDTRANSHALF, M_GetText("Press F12 to watch another player."));
V_DrawCenteredString(BASEVIDWIDTH/2, 164, V_HUDTRANSHALF, M_GetText("Press Jump to float and Spin to sink."));
}
else
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(136), V_HUDTRANSHALF, M_GetText("Press Jump to float and Spin to sink."));
}
}