Skip to content

Commit

Permalink
Stop ethereals reviving during Mafia games (tgstation#60210)
Browse files Browse the repository at this point in the history
  • Loading branch information
coiax authored Jul 16, 2021
1 parent 748cac4 commit 603c741
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 1 addition & 2 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions code/modules/mafia/controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 17 additions & 8 deletions code/modules/surgery/organs/heart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 603c741

Please sign in to comment.