From 3bcfba777591ce850e614af03ee1e0a313c6a8c0 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Tue, 21 Jan 2025 01:24:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D0=B0=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/game_options.txt | 2 +- modular_bandastation/medical/_medical.dme | 1 + .../medical/code/organs/_brain.dm | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 modular_bandastation/medical/code/organs/_brain.dm diff --git a/config/game_options.txt b/config/game_options.txt index 689c0328a2ee4..e60d1b4be030b 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -9,7 +9,7 @@ DAMAGE_MULTIPLIER 1 REVIVAL_POD_PLANTS ## amount of time (in hundredths of seconds) for which a brain retains the "spark of life" after the person's death (set to -1 for infinite) -REVIVAL_BRAIN_LIFE -1 +REVIVAL_BRAIN_LIFE 420 ## OOC DURING ROUND ### ## Comment this out if you want OOC to be automatically disabled during the round, it will be enabled during the lobby and after the round end results. diff --git a/modular_bandastation/medical/_medical.dme b/modular_bandastation/medical/_medical.dme index 3783e0393c8c7..c7fda6cf486ca 100644 --- a/modular_bandastation/medical/_medical.dme +++ b/modular_bandastation/medical/_medical.dme @@ -1,3 +1,4 @@ #include "_medical.dm" +#include "code/organs/_brain.dm" #include "code/surgery/vocal_cords.dm" diff --git a/modular_bandastation/medical/code/organs/_brain.dm b/modular_bandastation/medical/code/organs/_brain.dm new file mode 100644 index 0000000000000..a8b313b29c315 --- /dev/null +++ b/modular_bandastation/medical/code/organs/_brain.dm @@ -0,0 +1,39 @@ +/obj/item/organ/brain + var/perma_death = FALSE + +/obj/item/organ/brain/Initialize(mapload) + . = ..() + var/config_value = CONFIG_GET(number/revival_brain_life) + if(config_value > 0) + perma_death = TRUE + if(perma_death) + decay_factor = STANDARD_ORGAN_DECAY * config_value + +//Убивает игрока при смерти органа +/obj/item/organ/brain/on_death(seconds_per_tick, times_fired) + . = ..() + //Если орган мертв и включена пермасмерть + if(organ_flags & ORGAN_FAILING && perma_death && damage >= maxHealth && !suicided) + //Сделать ДНР + var/mob/living/carbon/brain_owner = owner + if(brainmob) + // If it's a ling decoy brain, nothing to transfer, just throw it out + if(decoy_override) + if(brainmob?.key) + stack_trace("Decoy override brain with a key assigned - This should never happen.") + + // Not a ling - assume direct control + else + if(brain_owner.key) + brain_owner.ghostize() + + if(brainmob.mind) + brainmob.mind.transfer_to(brain_owner) + else + brain_owner.key = brainmob.key + + brain_owner.set_suicide(HAS_TRAIT(brainmob, TRAIT_SUICIDED)) + + QDEL_NULL(brainmob) + else if(brain_owner) + brain_owner.set_suicide(TRUE)