Excludes certain ghost roles from being affected by health events

This commit is contained in:
kevinz000
2019-12-30 00:26:19 -08:00
committed by Archie
parent 7e250ce9ee
commit 0d4b96fc76
8 changed files with 25 additions and 2 deletions
+2
View File
@@ -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"
@@ -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!"
+2
View File
@@ -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.
+1 -1
View File
@@ -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
+3 -1
View File
@@ -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)
if(HAS_TRAIT(C,TRAIT_EXEMPT_HEALTH_EVENTS))
continue
new picked_hallucination(C, TRUE)
@@ -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
@@ -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)
@@ -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, "<span class='boldannounce'>Your head aches for a second. You feel like this is how things should have been.</span>")
log_game("[key_name(H)] has loaded their default appearance for a ghost role.")