From 603c7412bc1273a0d01951b6dab5397b4e0909b0 Mon Sep 17 00:00:00 2001 From: coiax Date: Fri, 16 Jul 2021 01:37:17 +0100 Subject: [PATCH] Stop ethereals reviving during Mafia games (#60210) --- code/__DEFINES/traits.dm | 3 +++ code/_globalvars/traits.dm | 3 +-- code/modules/mafia/controller.dm | 1 + code/modules/surgery/organs/heart.dm | 25 +++++++++++++++++-------- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 95f48e0ab86..e0f0e2a6d4e 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -491,6 +491,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Minor trait used for beakers, or beaker-ishes. [/obj/item/reagent_containers], to show that they've been used in a reagent grinder. #define TRAIT_MAY_CONTAIN_BLENDED_DUST "may_contain_blended_dust" +/// Trait put on [/mob/living/carbon/human]. If that mob has a crystal core, also known as an ethereal heart, it will not try to revive them if the mob dies. +#define TRAIT_CANNOT_CRYSTALIZE "cannot_crystalize" + ///Trait applied to turfs when an atmos holosign is placed on them. It will stop firedoors from closing. #define TRAIT_FIREDOOR_STOP "firedoor_stop" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 57fb14ae2d7..0268ee35c9b 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -162,8 +162,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_NOBLEED" = TRAIT_NOBLEED, "TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH, "TRAIT_ANXIOUS" = TRAIT_ANXIOUS, - "TRAIT_WEAK_SOUL" = TRAIT_WEAK_SOUL - + "TRAIT_WEAK_SOUL" = TRAIT_WEAK_SOUL, ), /obj/item/bodypart = list( "TRAIT_PARALYSIS" = TRAIT_PARALYSIS, diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm index d21c8476812..7bb1b788975 100644 --- a/code/modules/mafia/controller.dm +++ b/code/modules/mafia/controller.dm @@ -572,6 +572,7 @@ var/mob/living/carbon/human/H = new(get_turf(role.assigned_landmark)) ADD_TRAIT(H, TRAIT_NOFIRE, MAFIA_TRAIT) ADD_TRAIT(H, TRAIT_NOBREATH, MAFIA_TRAIT) + ADD_TRAIT(H, TRAIT_CANNOT_CRYSTALIZE, MAFIA_TRAIT) H.equipOutfit(player_outfit) H.status_flags |= GODMODE RegisterSignal(H,COMSIG_ATOM_UPDATE_OVERLAYS,.proc/display_votes) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index f63d5d2a706..fbbdac069b1 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -259,7 +259,7 @@ /obj/item/organ/heart/ethereal - name = "Crystal core" + name = "crystal core" icon_state = "ethereal_heart" //Welp. At least it's more unique in functionaliy. desc = "A crystal-like organ that functions similarly to a heart for Ethereals. It can revive its owner." @@ -335,8 +335,13 @@ if(!COOLDOWN_FINISHED(src, crystalize_cooldown)) return //lol double rip - to_chat(victim, span_nicegreen("Crystals start forming around your dead body.")) - victim.visible_message(span_notice("Crystals start forming around [victim].")) + if(HAS_TRAIT(victim, TRAIT_CANNOT_CRYSTALIZE)) + return // no reviving during mafia, or other inconvenient times. + + victim.visible_message( + span_notice("Crystals start forming around [victim]."), + span_nicegreen("Crystals start forming around your dead body."), + ) ADD_TRAIT(victim, TRAIT_CORPSELOCKED, SPECIES_TRAIT) crystalize_timer_id = addtimer(CALLBACK(src, .proc/crystalize, victim), CRYSTALIZE_PRE_WAIT_TIME, TIMER_STOPPABLE) @@ -348,8 +353,10 @@ ///Ran when disarmed, prevents the ethereal from reviving /obj/item/organ/heart/ethereal/proc/reset_crystalizing(mob/living/defender, mob/living/attacker, zone) SIGNAL_HANDLER - to_chat(defender, span_notice("The crystals on your corpse are gently broken off, and will need some time to recover.")) - defender.visible_message(span_notice("The crystals on [defender] are gently broken off.")) + defender.visible_message( + span_notice("The crystals on [defender] are gently broken off."), + span_notice("The crystals on your corpse are gently broken off, and will need some time to recover."), + ) deltimer(crystalize_timer_id) crystalize_timer_id = addtimer(CALLBACK(src, .proc/crystalize, defender), CRYSTALIZE_DISARM_WAIT_TIME, TIMER_STOPPABLE) //Lets us restart the timer on disarm @@ -405,13 +412,15 @@ var/mob/living/carbon/human/ethereal = source - to_chat(ethereal, span_warning("The crystals on your body have completely broken")) - ethereal.visible_message(span_notice("The crystals on [ethereal] are completely shattered and stopped growing")) + ethereal.visible_message( + span_notice("The crystals on [ethereal] are completely shattered and stopped growing."), + span_warning("The crystals on your body have completely broken."), + ) stop_crystalization_process(ethereal) /obj/structure/ethereal_crystal - name = "Ethereal Resurrection Crystal" + name = "ethereal resurrection crystal" desc = "It seems to contain the corpse of an ethereal mending its wounds." icon = 'icons/obj/ethereal_crystal.dmi' icon_state = "ethereal_crystal"