From 0d4b96fc76cf4aef38807e77dbf128790002d79d Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Mon, 30 Dec 2019 00:26:19 -0800
Subject: [PATCH 1/4] Excludes certain ghost roles from being affected by
health events
---
code/__DEFINES/traits.dm | 2 ++
code/game/objects/structures/ghost_role_spawners.dm | 8 ++++++++
code/modules/events/disease_outbreak.dm | 2 ++
code/modules/events/heart_attack.dm | 2 +-
code/modules/events/mass_hallucination.dm | 4 +++-
code/modules/events/spontaneous_appendicitis.dm | 2 ++
.../code/game/objects/structures/ghost_role_spawners.dm | 6 ++++++
hyperstation/code/modules/mob/mob_helpers.dm | 1 +
8 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index ed5e5dea..1dd7ce26 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -142,6 +142,7 @@
#define TRAIT_NORUNNING "norunning" // You walk!
#define TRAIT_NOMARROW "nomarrow" // You don't make blood, with chemicals or nanites.
#define TRAIT_NOPULSE "nopulse" // Your heart doesn't beat.
+#define TRAIT_EXEMPT_HEALTH_EVENTS "exempt-health-events"
//non-mob traits
#define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it
@@ -220,6 +221,7 @@
#define ABSTRACT_ITEM_TRAIT "abstract-item"
#define STATUS_EFFECT_TRAIT "status-effect"
#define ROUNDSTART_TRAIT "roundstart" //cannot be removed without admin intervention
+#define GHOSTROLE_TRAIT "ghostrole"
// unique trait sources, still defines
#define STATUE_MUTE "statue"
diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm
index 23e2ef8f..54498c2f 100644
--- a/code/game/objects/structures/ghost_role_spawners.dm
+++ b/code/game/objects/structures/ghost_role_spawners.dm
@@ -32,6 +32,8 @@
new/obj/structure/fluff/empty_terrarium(get_turf(src))
return ..()
+/obj/effect/mob_spawn/human/seed_vault/special(mob/living/carbon/human/new_spawn)
+ ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
//Ash walker eggs: Spawns in ash walker dens in lavaland. Ghosts become unbreathing lizards that worship the Necropolis and are advised to retrieve corpses to create more ash walkers.
/obj/effect/mob_spawn/human/ash_walker
@@ -262,6 +264,9 @@
new/obj/structure/fluff/empty_cryostasis_sleeper(get_turf(src))
return ..()
+/obj/effect/mob_spawn/human/hermit/special(mob/living/carbon/human/new_spawn)
+ ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
+
//Broken rejuvenation pod: Spawns in animal hospitals in lavaland. Ghosts become disoriented interns and are advised to search for help.
/obj/effect/mob_spawn/human/doctor/alive/lavaland
name = "broken rejuvenation pod"
@@ -371,6 +376,9 @@
new/obj/structure/fluff/empty_sleeper/syndicate(get_turf(src))
..()
+/obj/effect/mob_spawn/human/hotel_staff/special(mob/living/carbon/human/new_spawn)
+ ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
+
/obj/effect/mob_spawn/human/demonic_friend
name = "Essence of friendship"
desc = "Oh boy! Oh boy! A friend!"
diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm
index 5883bdfb..2f220b17 100644
--- a/code/modules/events/disease_outbreak.dm
+++ b/code/modules/events/disease_outbreak.dm
@@ -37,6 +37,8 @@
continue
if(!H.client)
continue
+ if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS))
+ continue
if(H.stat == DEAD)
continue
if(HAS_TRAIT(H, TRAIT_VIRUSIMMUNE)) //Don't pick someone who's virus immune, only for it to not do anything.
diff --git a/code/modules/events/heart_attack.dm b/code/modules/events/heart_attack.dm
index 7b7c2aa0..6042550d 100644
--- a/code/modules/events/heart_attack.dm
+++ b/code/modules/events/heart_attack.dm
@@ -8,7 +8,7 @@
/datum/round_event/heart_attack/start()
var/list/heart_attack_contestants = list()
for(var/mob/living/carbon/human/H in shuffle(GLOB.player_list))
- if(!H.client || H.z != SSmapping.station_start || H.stat == DEAD || H.InCritical() || !H.can_heartattack() || H.has_status_effect(STATUS_EFFECT_EXERCISED) || (/datum/disease/heart_failure in H.diseases) || H.undergoing_cardiac_arrest())
+ if(!H.client || H.z != SSmapping.station_start || H.stat == DEAD || H.InCritical() || !H.can_heartattack() || H.has_status_effect(STATUS_EFFECT_EXERCISED) || (/datum/disease/heart_failure in H.diseases) || H.undergoing_cardiac_arrest() || HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS))
continue
if(H.satiety <= -60) //Multiple junk food items recently
heart_attack_contestants[H] = 3
diff --git a/code/modules/events/mass_hallucination.dm b/code/modules/events/mass_hallucination.dm
index b38f34d4..627fd1b2 100644
--- a/code/modules/events/mass_hallucination.dm
+++ b/code/modules/events/mass_hallucination.dm
@@ -35,4 +35,6 @@
/datum/hallucination/delusion,
/datum/hallucination/oh_yeah)
for(var/mob/living/carbon/C in GLOB.alive_mob_list)
- new picked_hallucination(C, TRUE)
\ No newline at end of file
+ if(HAS_TRAIT(C,TRAIT_EXEMPT_HEALTH_EVENTS))
+ continue
+ new picked_hallucination(C, TRUE)
diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm
index 6bb3027b..64828123 100644
--- a/code/modules/events/spontaneous_appendicitis.dm
+++ b/code/modules/events/spontaneous_appendicitis.dm
@@ -17,6 +17,8 @@
continue
if(H.z != SSmapping.station_start) //Let's not fucking give Appendicitis to ghost roles or people not on station, shall we?
continue
+ if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS)) //Do they have the trait that makes them exempt from health conditions?
+ continue
if(!H.getorgan(/obj/item/organ/appendix)) //Don't give the disease to some who lacks it, only for it to be auto-cured
continue
if(!(MOB_ORGANIC & H.mob_biotypes)) //biotype sleeper bugs strike again, once again making appendicitis pick a target that can't take it
diff --git a/hyperstation/code/game/objects/structures/ghost_role_spawners.dm b/hyperstation/code/game/objects/structures/ghost_role_spawners.dm
index c43c19de..d70714d4 100644
--- a/hyperstation/code/game/objects/structures/ghost_role_spawners.dm
+++ b/hyperstation/code/game/objects/structures/ghost_role_spawners.dm
@@ -47,6 +47,9 @@
new/obj/structure/fluff/empty_cryostasis_sleeper(get_turf(src))
return ..()
+/obj/effect/mob_spawn/human/duohermit/special(mob/living/carbon/human/new_spawn)
+ ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
+
//Exiles: Stranded exiles that have been left in Snowdin. Can be easily adapted for other roles as well.
/obj/effect/mob_spawn/human/exiled
name = "used bed"
@@ -105,3 +108,6 @@
/obj/effect/mob_spawn/human/exiled/Destroy()
new/obj/structure/bed(get_turf(src))
return ..()
+
+/obj/effect/mob_spawn/human/exiled/special(mob/living/carbon/human/new_spawn)
+ ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
diff --git a/hyperstation/code/modules/mob/mob_helpers.dm b/hyperstation/code/modules/mob/mob_helpers.dm
index a02975fc..f0d9d6fc 100644
--- a/hyperstation/code/modules/mob/mob_helpers.dm
+++ b/hyperstation/code/modules/mob/mob_helpers.dm
@@ -18,6 +18,7 @@ mob/proc/checkloadappearance()
idCard.update_label(H.real_name, idCard.assignment)
idCard.registered_name = H.real_name
H.mirrorcanloadappearance = FALSE //Prevents them from using the mirror again.
+ ADD_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT) //Makes them exempt from health events and adds gives them the ghostrole trait. This is a special tool we'll use later.
SEND_SOUND(H, 'sound/magic/charge.ogg') //Fluff
to_chat(H, "Your head aches for a second. You feel like this is how things should have been.")
log_game("[key_name(H)] has loaded their default appearance for a ghost role.")
From b432248f46370ef3447e49c67b4335c9e0136bfe Mon Sep 17 00:00:00 2001
From: Archie
Date: Sun, 30 May 2021 20:20:14 -0300
Subject: [PATCH 2/4] Autotraitor piggyback
---
code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
index 06b6e80e..240ef54d 100644
--- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
+++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
@@ -259,11 +259,13 @@
if(is_centcom_level(player.z))
living_players -= player // We don't autotator people in CentCom
continue
- if(is_away_level(player.z))
- living_players -= player //We also don't autotator people in exiled roles / VR
- continue
if(player.mind && (player.mind.special_role || player.mind.antag_datums?.len > 0))
living_players -= player // We don't autotator people with roles already
+ continue
+ if(ishuman(player))
+ var/mob/living/carbon/human/H = player
+ if(HAS_TRAIT(H,GHOSTROLE_TRAIT))
+ living_players -= player //We also don't fucking give ghost roles traitor
/datum/dynamic_ruleset/midround/autotraitor/ready(forced = FALSE)
if (required_candidates > living_players.len)
From 8c9ed329d8aee6c7fb5e583d5202fd28cbdd1e1b Mon Sep 17 00:00:00 2001
From: Archie
Date: Sun, 30 May 2021 20:29:36 -0300
Subject: [PATCH 3/4] Fix
---
code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
index 240ef54d..0a9e3d5a 100644
--- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
+++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
@@ -264,8 +264,8 @@
continue
if(ishuman(player))
var/mob/living/carbon/human/H = player
- if(HAS_TRAIT(H,GHOSTROLE_TRAIT))
- living_players -= player //We also don't fucking give ghost roles traitor
+ if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS))
+ living_players -= player //We also don't fucking give ghost roles traitor. Yes I'm using the exempt health events trait given to ghost roles to do this, because piggyback ftw.
/datum/dynamic_ruleset/midround/autotraitor/ready(forced = FALSE)
if (required_candidates > living_players.len)
From 99045c14d8ecb288c3dfea1e1979845df07c8446 Mon Sep 17 00:00:00 2001
From: Archie
Date: Sun, 30 May 2021 20:31:45 -0300
Subject: [PATCH 4/4] Text
---
hyperstation/code/modules/mob/mob_helpers.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hyperstation/code/modules/mob/mob_helpers.dm b/hyperstation/code/modules/mob/mob_helpers.dm
index f0d9d6fc..00f9c863 100644
--- a/hyperstation/code/modules/mob/mob_helpers.dm
+++ b/hyperstation/code/modules/mob/mob_helpers.dm
@@ -18,7 +18,7 @@ mob/proc/checkloadappearance()
idCard.update_label(H.real_name, idCard.assignment)
idCard.registered_name = H.real_name
H.mirrorcanloadappearance = FALSE //Prevents them from using the mirror again.
- ADD_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT) //Makes them exempt from health events and adds gives them the ghostrole trait. This is a special tool we'll use later.
+ ADD_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT) //Makes sure they are exempt from health events.
SEND_SOUND(H, 'sound/magic/charge.ogg') //Fluff
to_chat(H, "Your head aches for a second. You feel like this is how things should have been.")
log_game("[key_name(H)] has loaded their default appearance for a ghost role.")