Respawn delay gametype rule
This commit is contained in:
parent
1dac3d174e
commit
51404130af
|
@ -8928,6 +8928,7 @@ static const char *const GAMETYPERULE_LIST[] = {
|
||||||
"OVERTIME",
|
"OVERTIME",
|
||||||
"HURTMESSAGES",
|
"HURTMESSAGES",
|
||||||
"SPAWNINVUL",
|
"SPAWNINVUL",
|
||||||
|
"RESPAWNDELAY",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -423,6 +423,7 @@ enum GameTypeRules
|
||||||
GTR_OVERTIME = 1<<26, // Allow overtime
|
GTR_OVERTIME = 1<<26, // Allow overtime
|
||||||
GTR_HURTMESSAGES = 1<<27, // Hit and death messages
|
GTR_HURTMESSAGES = 1<<27, // Hit and death messages
|
||||||
GTR_SPAWNINVUL = 1<<28, // Babysitting deterrent
|
GTR_SPAWNINVUL = 1<<28, // Babysitting deterrent
|
||||||
|
GTR_RESPAWNDELAY = 1<<29, // Respawn delay
|
||||||
};
|
};
|
||||||
|
|
||||||
// String names for gametypes
|
// String names for gametypes
|
||||||
|
|
10
src/g_game.c
10
src/g_game.c
|
@ -3201,17 +3201,17 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
|
||||||
GTR_RACE|GTR_SPAWNENEMIES|GTR_SPAWNINVUL|GTR_ALLOWEXIT,
|
GTR_RACE|GTR_SPAWNENEMIES|GTR_SPAWNINVUL|GTR_ALLOWEXIT,
|
||||||
|
|
||||||
// Match
|
// Match
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_MATCHEMERALDS|GTR_SPAWNINVUL|GTR_PITYSHIELD|GTR_DEATHPENALTY,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_MATCHEMERALDS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY,
|
||||||
// Team Match
|
// Team Match
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_SPAWNINVUL|GTR_PITYSHIELD,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||||
|
|
||||||
// Tag
|
// Tag
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_SPAWNINVUL,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||||
// Hide and Seek
|
// Hide and Seek
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_SPAWNINVUL,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||||
|
|
||||||
// CTF
|
// CTF
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_MATCHEMERALDS|GTR_SPAWNINVUL|GTR_PITYSHIELD,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_MATCHEMERALDS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
23
src/p_user.c
23
src/p_user.c
|
@ -9462,19 +9462,22 @@ static void P_DeathThink(player_t *player)
|
||||||
// Respawn with jump button, force respawn time (3 second default, cheat protected) in shooter modes.
|
// Respawn with jump button, force respawn time (3 second default, cheat protected) in shooter modes.
|
||||||
if (cmd->buttons & BT_JUMP)
|
if (cmd->buttons & BT_JUMP)
|
||||||
{
|
{
|
||||||
|
// You're a spectator, so respawn right away.
|
||||||
if (gametype != GT_COOP && player->spectator)
|
if (gametype != GT_COOP && player->spectator)
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
else switch(gametype) {
|
else
|
||||||
case GT_COOP:
|
{
|
||||||
case GT_COMPETITION:
|
// Give me one second.
|
||||||
case GT_RACE:
|
INT32 respawndelay = TICRATE;
|
||||||
if (player->deadtimer > TICRATE)
|
|
||||||
|
// Non-platform gametypes
|
||||||
|
if (gametyperules & GTR_RESPAWNDELAY)
|
||||||
|
respawndelay = (cv_respawntime.value*TICRATE);
|
||||||
|
|
||||||
|
// You've been dead for enough time.
|
||||||
|
// You may now respawn.
|
||||||
|
if (player->deadtimer > respawndelay)
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (player->deadtimer > cv_respawntime.value*TICRATE)
|
|
||||||
player->playerstate = PST_REBORN;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2202,7 +2202,7 @@ static void ST_drawTextHUD(void)
|
||||||
donef12 = true;
|
donef12 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) // Death overrides spectator text.
|
else if ((gametyperules & GTR_RESPAWNDELAY) && stplyr->playerstate == PST_DEAD && stplyr->lives) // Death overrides spectator text.
|
||||||
{
|
{
|
||||||
INT32 respawntime = cv_respawntime.value - stplyr->deadtimer/TICRATE;
|
INT32 respawntime = cv_respawntime.value - stplyr->deadtimer/TICRATE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue