[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 16:45:23 -04:00
committed by GitHub
co-authored by san7890 MrMelbert
parent 32b980303e
commit c5c79aa929
9 changed files with 109 additions and 31 deletions
+35 -9
View File
@@ -185,16 +185,42 @@
set category = "Server"
set desc = "Respawn basically"
set name = "Toggle Respawn"
var/new_nores = !CONFIG_GET(flag/norespawn)
CONFIG_SET(flag/norespawn, new_nores)
if (!new_nores)
to_chat(world, "<B>You may now respawn.</B>", confidential = TRUE)
else
to_chat(world, "<B>You may no longer respawn :(</B>", confidential = TRUE)
message_admins(span_adminnotice("[key_name_admin(usr)] toggled respawn to [!new_nores ? "On" : "Off"]."))
log_admin("[key_name(usr)] toggled respawn to [!new_nores ? "On" : "Off"].")
var/respawn_state = CONFIG_GET(flag/allow_respawn)
var/new_state = -1
var/new_state_text = ""
switch(respawn_state)
if(RESPAWN_FLAG_DISABLED) // respawn currently disabled
new_state = RESPAWN_FLAG_FREE
new_state_text = "Enabled"
to_chat(world, span_bold("You may now respawn."), confidential = TRUE)
if(RESPAWN_FLAG_FREE) // respawn currently enabled
new_state = RESPAWN_FLAG_NEW_CHARACTER
new_state_text = "Enabled, Different Slot"
to_chat(world, span_bold("You may now respawn as a different character."), confidential = TRUE)
if(RESPAWN_FLAG_NEW_CHARACTER) // respawn currently enabled for different slot characters only
new_state = RESPAWN_FLAG_DISABLED
new_state_text = "Disabled"
to_chat(world, span_bold("You may no longer respawn :("), confidential = TRUE)
else
WARNING("Invalid respawn state in config: [respawn_state]")
if(new_state == -1)
to_chat(usr, span_warning("The config for respawn is set incorrectly, please complain to your nearest server host (or fix it yourself). \
In the meanwhile respawn has been set to \"Off\"."))
new_state = RESPAWN_FLAG_DISABLED
new_state_text = "Disabled"
CONFIG_SET(flag/allow_respawn, new_state)
message_admins(span_adminnotice("[key_name_admin(usr)] toggled respawn to \"[new_state_text]\"."))
log_admin("[key_name(usr)] toggled respawn to \"[new_state_text]\".")
world.update_status()
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Respawn", "[!new_nores ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Respawn", "[new_state_text]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
/datum/admins/proc/delay()
set category = "Server"