[MIRROR] Adds respawn config option forcing respawn as another character slot [MDB IGNORE] (#23943)

* Adds respawn config option forcing respawn as another character slot (#78459)

## About The Pull Request

Adds an option to the respawn config which forces you to pick another
character (slot) before you respawn.

## Why It's Good For The Game

Just an idea i'm throwing out there, not necessarily pushing for it to
be enabled on any servers.

Respawning as an alternative character can be a good way to make people
less frustrated at dying, particularly if paired with the cooldown
config that already exists:

"Oh shucks, I died and got my head cut off and got absorbed and got
spaced by some changeling. I won't be able to finish my project or
whatever. At least in 15 minutes I may be able to join as my botanist
character to try something else rather than having to wait an hour and a
half for the round to tick over."

Also nice for downstream support.

(Obviously you can just, *ban* people who respawn as the same character,
use an honor system, but codifying it seems better than not.)

## Changelog

🆑 Melbert
config: Adds a config option for player respawning that enables
respawns, but forces you pick a new character.
config: "NORESPAWN" has been replaced with "ALLOW_RESPAWN 0". Unlimited
respawns is "ALLOW_RESPAWN 1" and character limited respawns is
"ALLOW_RESPAWN 2".
/🆑

---------

Co-authored-by: san7890 <the@ san7890.com>

* Adds respawn config option forcing respawn as another character slot

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
This commit is contained in:
SkyratBot
2023-10-07 22:45:23 +02:00
committed by GitHub
parent 32b980303e
commit c5c79aa929
9 changed files with 109 additions and 31 deletions

View File

@@ -262,10 +262,25 @@
/datum/config_entry/string/hostedby
/datum/config_entry/flag/norespawn
/// Determines if a player can respawn after dying.
/// 0 / RESPAWN_FLAG_DISABLED = Cannot respawn (default)
/// 1 / RESPAWN_FLAG_FREE = Can respawn
/// 2 / RESPAWN_FLAG_NEW_CHARACTER = Can respawn if choosing a different character
/datum/config_entry/flag/allow_respawn
default = RESPAWN_FLAG_DISABLED
/datum/config_entry/flag/allow_respawn/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
var/val_as_num = text2num(str_val)
if(val_as_num in list(RESPAWN_FLAG_DISABLED, RESPAWN_FLAG_FREE, RESPAWN_FLAG_NEW_CHARACTER))
config_entry_value = val_as_num
return TRUE
return FALSE
/// Determines how long (in deciseconds) before a player is allowed to respawn.
/datum/config_entry/number/respawn_delay
default = 0
default = 0 SECONDS
/datum/config_entry/flag/usewhitelist