Renamed again, and this time I'm happy with it.

* "playstyle" to "coopstarposts"
* "lifedistribution" to "cooplives"
This commit is contained in:
toasterbabe 2017-06-03 17:55:03 +01:00
parent ae3441659e
commit 8d8ae2b538
9 changed files with 35 additions and 35 deletions

View File

@ -84,8 +84,8 @@ static void TeamScramble_OnChange(void);
static void NetTimeout_OnChange(void); static void NetTimeout_OnChange(void);
static void JoinTimeout_OnChange(void); static void JoinTimeout_OnChange(void);
static void PlayStyle_OnChange(void); static void CoopStarposts_OnChange(void);
static void LifeDistribution_OnChange(void); static void CoopLives_OnChange(void);
static void Ringslinger_OnChange(void); static void Ringslinger_OnChange(void);
static void Gravity_OnChange(void); static void Gravity_OnChange(void);
@ -352,11 +352,11 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}}; static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_inttime = {"inttime", "10", 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 playstyle_cons_t[] = {{0, "Individual"}, {1, "Sharing"}, {2, "Together"}, {0, NULL}}; static CV_PossibleValue_t coopstarposts_cons_t[] = {{0, "Individual"}, {1, "Sharing"}, {2, "Together"}, {0, NULL}};
consvar_t cv_playstyle = {"playstyle", "Together", CV_NETVAR|CV_CALL|CV_CHEAT, playstyle_cons_t, PlayStyle_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_coopstarposts = {"coopstarposts", "Together", CV_NETVAR|CV_CALL|CV_CHEAT, coopstarposts_cons_t, CoopStarposts_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t lifedistribution_cons_t[] = {{0, "Individual"}, {1, "Stealing"}, {2, "Sharing"}, {0, NULL}}; static CV_PossibleValue_t cooplives_cons_t[] = {{0, "Individual"}, {1, "Stealing"}, {2, "Sharing"}, {0, NULL}};
consvar_t cv_lifedistribution = {"lifedistribution", "Stealing", CV_NETVAR|CV_CALL, lifedistribution_cons_t, LifeDistribution_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cooplives = {"cooplives", "Stealing", CV_NETVAR|CV_CALL, 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}}; 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}; consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -516,8 +516,8 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_forceskin); CV_RegisterVar(&cv_forceskin);
CV_RegisterVar(&cv_downloading); CV_RegisterVar(&cv_downloading);
CV_RegisterVar(&cv_playstyle); CV_RegisterVar(&cv_coopstarposts);
CV_RegisterVar(&cv_lifedistribution); CV_RegisterVar(&cv_cooplives);
CV_RegisterVar(&cv_specialrings); CV_RegisterVar(&cv_specialrings);
CV_RegisterVar(&cv_powerstones); CV_RegisterVar(&cv_powerstones);
@ -3406,11 +3406,11 @@ static void JoinTimeout_OnChange(void)
jointimeout = (tic_t)cv_jointimeout.value; jointimeout = (tic_t)cv_jointimeout.value;
} }
static void PlayStyle_OnChange(void) static void CoopStarposts_OnChange(void)
{ {
INT32 i; INT32 i;
if (!(netgame || multiplayer) || gametype != GT_COOP || cv_playstyle.value == 2 || G_IsSpecialStage(gamemap)) if (!(netgame || multiplayer) || gametype != GT_COOP || cv_coopstarposts.value == 2 || G_IsSpecialStage(gamemap))
return; return;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -3421,18 +3421,18 @@ static void PlayStyle_OnChange(void)
if (!players[i].spectator) if (!players[i].spectator)
continue; continue;
if (players[i].lives <= 0 && !cv_lifedistribution.value) if (players[i].lives <= 0 && !cv_cooplives.value)
continue; continue;
P_SpectatorJoinGame(&players[i]); P_SpectatorJoinGame(&players[i]);
} }
} }
static void LifeDistribution_OnChange(void) static void CoopLives_OnChange(void)
{ {
if (!(netgame || multiplayer) || gametype != GT_COOP || cv_playstyle.value == 2) if (!(netgame || multiplayer) || gametype != GT_COOP || cv_coopstarposts.value == 2)
return; return;
if (cv_lifedistribution.value) if (cv_cooplives.value)
{ {
INT32 i; INT32 i;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)

View File

@ -89,7 +89,7 @@ extern consvar_t cv_recycler;
extern consvar_t cv_itemfinder; extern consvar_t cv_itemfinder;
extern consvar_t cv_inttime, cv_playstyle, cv_lifedistribution, 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_overtime;
extern consvar_t cv_startinglives; extern consvar_t cv_startinglives;

View File

@ -2628,7 +2628,7 @@ void G_DoReborn(INT32 playernum)
token = 0; token = 0;
} }
} }
if (cv_playstyle.value == 2) if (cv_coopstarposts.value == 2)
{ {
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
@ -2696,7 +2696,7 @@ void G_DoReborn(INT32 playernum)
// Not resetting map, so return to level music // Not resetting map, so return to level music
if (!countdown2 if (!countdown2
&& player->lives <= 0 && player->lives <= 0
&& !cv_lifedistribution.value) // not allowed for life steal because no way to come back from zero group lives without addons, which should call this anyways && !cv_cooplives.value) // 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); P_RestoreMultiMusic(player);
if (player->starposttime) if (player->starposttime)
@ -2739,7 +2739,7 @@ void G_AddPlayer(INT32 playernum)
if (!players->exiting) if (!players->exiting)
notexiting++; notexiting++;
if (!(cv_playstyle.value && (gametype == GT_COOP) && (p->starpostnum < players[i].starpostnum))) if (!(cv_coopstarposts.value && (gametype == GT_COOP) && (p->starpostnum < players[i].starpostnum)))
continue; continue;
p->starposttime = players[i].starposttime; p->starposttime = players[i].starposttime;

View File

@ -1390,8 +1390,8 @@ static menuitem_t OP_ServerOptionsMenu[] =
{IT_HEADER, NULL, "Cooperative", NULL, 90}, {IT_HEADER, NULL, "Cooperative", NULL, 90},
{IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 96}, {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 96},
{IT_STRING | IT_CVAR, NULL, "Play style", &cv_playstyle, 101}, {IT_STRING | IT_CVAR, NULL, "Starposts", &cv_coopstarposts, 101},
{IT_STRING | IT_CVAR, NULL, "Life distribution", &cv_lifedistribution, 106}, {IT_STRING | IT_CVAR, NULL, "Life distribution", &cv_cooplives, 106},
{IT_HEADER, NULL, "Race, Competition", NULL, 115}, {IT_HEADER, NULL, "Race, Competition", NULL, 115},
{IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 121}, {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 121},

View File

@ -1293,7 +1293,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->starpostnum >= special->health) if (player->starpostnum >= special->health)
return; // Already hit this post return; // Already hit this post
if (cv_playstyle.value && gametype == GT_COOP && (netgame || multiplayer)) if (cv_coopstarposts.value && gametype == GT_COOP && (netgame || multiplayer))
{ {
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
@ -1309,7 +1309,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
players[i].starpostangle = special->angle; players[i].starpostangle = special->angle;
players[i].starpostnum = special->health; players[i].starpostnum = special->health;
if (cv_playstyle.value == 2 && (players[i].playerstate == PST_DEAD || players[i].spectator) && P_GetLives(&players[i])) 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; P_SpectatorJoinGame(&players[i]); //players[i].playerstate = PST_REBORN;
} }
} }
@ -2254,7 +2254,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
if (target->player->lives <= 0) // Tails 03-14-2000 if (target->player->lives <= 0) // Tails 03-14-2000
{ {
boolean gameovermus = false; boolean gameovermus = false;
if ((netgame || multiplayer) && (gametype == GT_COOP) && cv_lifedistribution.value) if ((netgame || multiplayer) && (gametype == GT_COOP) && cv_cooplives.value)
{ {
INT32 i; INT32 i;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)

View File

@ -9086,8 +9086,8 @@ void P_SpawnPlayer(INT32 playernum)
{ {
if ( ( (multiplayer || netgame) && gametype == GT_COOP && leveltime > 0) // only question status in coop if ( ( (multiplayer || netgame) && gametype == GT_COOP && leveltime > 0) // only question status in coop
&& ( (G_IsSpecialStage(gamemap) && useNightsSS) // late join special stage && ( (G_IsSpecialStage(gamemap) && useNightsSS) // late join special stage
|| (cv_playstyle.value == 2 && (p->jointime < 1 || p->spectator) ) // late join or die in new coop || (cv_coopstarposts.value == 2 && (p->jointime < 1 || p->spectator) ) // late join or die in new coop
|| ((!cv_lifedistribution.value || !P_GetLives(p)) && p->lives <= 0))) // game over and can't redistribute lives || ((!cv_cooplives.value || !P_GetLives(p)) && p->lives <= 0))) // game over and can't redistribute lives
p->spectator = true; p->spectator = true;
else else
p->spectator = false; p->spectator = false;

View File

@ -2221,7 +2221,7 @@ static void P_LevelInitStuff(void)
// earthquake camera // earthquake camera
memset(&quake,0,sizeof(struct quake)); memset(&quake,0,sizeof(struct quake));
if ((netgame || multiplayer) && gametype == GT_COOP && cv_playstyle.value == 2) if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2)
{ {
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {

View File

@ -8110,12 +8110,12 @@ void P_FindEmerald(void)
boolean P_GetLives(player_t *player) boolean P_GetLives(player_t *player)
{ {
INT32 i, maxlivesplayer = -1, livescheck = 1; INT32 i, maxlivesplayer = -1, livescheck = 1;
if (!(cv_lifedistribution.value if (!(cv_cooplives.value
&& (gametype == GT_COOP) && (gametype == GT_COOP)
&& (netgame || multiplayer))) && (netgame || multiplayer)))
return true; return true;
if (cv_lifedistribution.value == 1 && player->lives > 0) if (cv_cooplives.value == 1 && player->lives > 0)
return true; return true;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -8131,7 +8131,7 @@ boolean P_GetLives(player_t *player)
} }
if (maxlivesplayer != -1 && &players[maxlivesplayer] != player) if (maxlivesplayer != -1 && &players[maxlivesplayer] != player)
{ {
if (cv_lifedistribution.value == 1 && P_IsLocalPlayer(&players[maxlivesplayer])) if (cv_cooplives.value == 1 && P_IsLocalPlayer(&players[maxlivesplayer]))
S_StartSound(NULL, sfx_jshard); // placeholder S_StartSound(NULL, sfx_jshard); // placeholder
players[maxlivesplayer].lives--; players[maxlivesplayer].lives--;
player->lives++; player->lives++;
@ -8220,7 +8220,7 @@ static void P_DeathThink(player_t *player)
G_UseContinue(); // Even if we don't have one this handles ending the game G_UseContinue(); // Even if we don't have one this handles ending the game
} }
if (cv_lifedistribution.value if (cv_cooplives.value
&& (gametype == GT_COOP) && (gametype == GT_COOP)
&& (netgame || multiplayer) && (netgame || multiplayer)
&& (player->lives <= 0)) && (player->lives <= 0))
@ -8240,7 +8240,7 @@ static void P_DeathThink(player_t *player)
player->playerstate = PST_REBORN; player->playerstate = PST_REBORN;
else if ((player->lives > 0 || j != MAXPLAYERS) && !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!
{ {
if (gametype == GT_COOP && (netgame || multiplayer) && cv_playstyle.value == 2) if (gametype == GT_COOP && (netgame || multiplayer) && cv_coopstarposts.value == 2)
{ {
P_ConsiderAllGone(); P_ConsiderAllGone();
if ((player->deadtimer > 5*TICRATE) || ((cmd->buttons & BT_JUMP) && (player->deadtimer > TICRATE))) if ((player->deadtimer > 5*TICRATE) || ((cmd->buttons & BT_JUMP) && (player->deadtimer > TICRATE)))
@ -9390,7 +9390,7 @@ void P_PlayerThink(player_t *player)
if (!player->spectator) if (!player->spectator)
P_PlayerInSpecialSector(player); P_PlayerInSpecialSector(player);
else if (gametype == GT_COOP && (netgame || multiplayer) && cv_playstyle.value == 2) else if (gametype == GT_COOP && (netgame || multiplayer) && cv_coopstarposts.value == 2)
P_ConsiderAllGone(); P_ConsiderAllGone();
if (player->playerstate == PST_DEAD) if (player->playerstate == PST_DEAD)

View File

@ -732,7 +732,7 @@ static void ST_drawLives(void)
// lives number // lives number
if ((netgame || multiplayer) && gametype == GT_COOP) if ((netgame || multiplayer) && gametype == GT_COOP)
{ {
switch (cv_lifedistribution.value) switch (cv_cooplives.value)
{ {
case 2: case 2:
{ {
@ -1875,7 +1875,7 @@ static void ST_overlayDrawer(void)
else else
p = sboover; p = sboover;
if (cv_lifedistribution.value if (cv_cooplives.value
&& gametype == GT_COOP) && gametype == GT_COOP)
{ {
INT32 i; INT32 i;
@ -2013,7 +2013,7 @@ static void ST_overlayDrawer(void)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot join the game until the stage has ended.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot join the game until the stage has ended."));
else if (gametype == GT_COOP) else if (gametype == GT_COOP)
{ {
if (cv_lifedistribution.value == 1 if (cv_cooplives.value == 1
&& (netgame || multiplayer)) && (netgame || multiplayer))
{ {
INT32 i; INT32 i;