From f1292c503c3d576d86f354dc96729c8a7287db6b Mon Sep 17 00:00:00 2001 From: Seris02 Date: Mon, 30 Dec 2019 11:33:15 +0800 Subject: [PATCH] makes it a trait --- 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 | 6 ++---- code/modules/events/spontaneous_appendicitis.dm | 2 +- code/modules/mob/living/carbon/human/human_defines.dm | 1 - 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 439b3d1493..e96805d891 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -134,6 +134,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 @@ -193,6 +194,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 8eef191d98..4304e275d1 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -31,7 +31,7 @@ return ..() /obj/effect/mob_spawn/human/seed_vault/special(mob/living/carbon/human/new_spawn) - new_spawn.exempt_from_health_events = TRUE + 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 @@ -254,7 +254,7 @@ return ..() /obj/effect/mob_spawn/human/hermit/special(mob/living/carbon/human/new_spawn) - new_spawn.exempt_from_health_events = TRUE + 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 @@ -359,7 +359,7 @@ ..() /obj/effect/mob_spawn/human/hotel_staff/special(mob/living/carbon/human/new_spawn) - new_spawn.exempt_from_health_events = TRUE + ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT) /obj/effect/mob_spawn/human/demonic_friend name = "Essence of friendship" @@ -626,7 +626,7 @@ O.equip(new_spawn, FALSE, new_spawn.client) SSjob.equip_loadout(null, new_spawn, FALSE) SSquirks.AssignQuirks(new_spawn, new_spawn.client, TRUE, TRUE, null, FALSE, new_spawn) - new_spawn.exempt_from_health_events = TRUE + ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT) /datum/outfit/ghostcafe name = "ID, jumpsuit and shoes" diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index 40674518ff..00e3698e1e 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -37,7 +37,7 @@ continue if(!H.client) continue - if(H.exempt_from_health_events) + if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS)) continue if(H.stat == DEAD) continue diff --git a/code/modules/events/heart_attack.dm b/code/modules/events/heart_attack.dm index 23b664d4d7..a47a8b81b4 100644 --- a/code/modules/events/heart_attack.dm +++ b/code/modules/events/heart_attack.dm @@ -9,7 +9,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.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() || H.exempt_from_health_events) + if(!H.client || 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 1c5393059e..0553f69b5b 100644 --- a/code/modules/events/mass_hallucination.dm +++ b/code/modules/events/mass_hallucination.dm @@ -35,8 +35,6 @@ /datum/hallucination/delusion, /datum/hallucination/oh_yeah) for(var/mob/living/carbon/C in GLOB.alive_mob_list) - var/mob/living/carbon/human/H = C - if (istype(H)) - if (H.exempt_from_health_events) - continue + if (HAS_TRAIT(C,TRAIT_EXEMPT_HEALTH_EVENTS)) + continue new picked_hallucination(C, TRUE) \ No newline at end of file diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm index cbef43ee8f..8ee943beb9 100644 --- a/code/modules/events/spontaneous_appendicitis.dm +++ b/code/modules/events/spontaneous_appendicitis.dm @@ -15,7 +15,7 @@ continue if(H.stat == DEAD) continue - if (H.exempt_from_health_events) + if (HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS)) 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 diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 3ae268a455..9ffa994066 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -68,4 +68,3 @@ var/static/list/can_ride_typecache = typecacheof(list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot)) var/lastpuke = 0 var/last_fire_update - var/exempt_from_health_events = FALSE