From 2a1b63630e126d9dba84e93cdd949eb044e92eea Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:39:34 +0100 Subject: [PATCH] Changes heretic monster check to rely on traits instead of antag datums (#89703) ## About The Pull Request Doesn't affect anything besides fixing the armsy issue and making mindless heretic summons also count as, well, summons. Closes #89696 ## Changelog :cl: fix: Armsy (aka Lord Of The Night (aka flesh snek (aka heretic ascention))) no longer affects itself with its own spells /:cl: --- code/__DEFINES/antagonists.dm | 4 +--- code/__DEFINES/traits/declarations.dm | 3 +++ code/_globalvars/traits/_traits.dm | 1 + code/modules/antagonists/heretic/heretic_knowledge.dm | 1 + code/modules/antagonists/heretic/magic/flesh_surgery.dm | 4 ++-- code/modules/antagonists/heretic/status_effects/ghoul.dm | 2 ++ code/modules/antagonists/heretic/structures/lock_final.dm | 1 + code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm | 2 +- code/modules/mob/living/basic/heretic/_heretic_summon.dm | 1 + 9 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index 6665aada05e..e3ab49a4feb 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -255,12 +255,10 @@ GLOBAL_LIST_INIT(ai_employers, list( /// Checks if the given mob is a heretic and is guaranteed to return the datum if possible - will cause issues with above trait #define GET_HERETIC(mob) (mob.mind?.has_antag_datum(/datum/antagonist/heretic)) -/// Check if the given mob is a heretic monster. -#define IS_HERETIC_MONSTER(mob) (mob.mind?.has_antag_datum(/datum/antagonist/heretic_monster)) /// Check if the given mob is a lunatic #define IS_LUNATIC(mob) (mob.mind?.has_antag_datum(/datum/antagonist/lunatic)) /// Checks if the given mob is either a heretic, heretic monster or a lunatic. -#define IS_HERETIC_OR_MONSTER(mob) (IS_HERETIC(mob) || IS_HERETIC_MONSTER(mob) || IS_LUNATIC(mob)) +#define IS_HERETIC_OR_MONSTER(mob) (IS_HERETIC(mob) || HAS_TRAIT(mob, TRAIT_HERETIC_SUMMON) || IS_LUNATIC(mob)) /// CHecks if the given mob is in the mansus realm #define IS_IN_MANSUS(mob) (istype(get_area(mob), /area/centcom/heretic_sacrifice)) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 62292c08ce7..f224d8cfb2e 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1456,4 +1456,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai ///A trait given to users as a mutex to prevent repeated unresolved attempts to christen a shuttle #define TRAIT_ATTEMPTING_CHRISTENING "attempting_christening" +///Trait given to heretic summons, making them immune to heretic spells +#define TRAIT_HERETIC_SUMMON "heretic_summon" + // END TRAIT DEFINES diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 7483d993b64..2250bc23740 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -314,6 +314,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_HEAR_THROUGH_DARKNESS" = TRAIT_HEAR_THROUGH_DARKNESS, "TRAIT_HEAVY_DRINKER" = TRAIT_HEAVY_DRINKER, "TRAIT_HEAVY_SLEEPER" = TRAIT_HEAVY_SLEEPER, + "TRAIT_HERETIC_SUMMON" = TRAIT_HERETIC_SUMMON, "TRAIT_HIDE_EXTERNAL_ORGANS" = TRAIT_HIDE_EXTERNAL_ORGANS, "TRAIT_HIGH_VALUE_RANSOM" = TRAIT_HIGH_VALUE_RANSOM, "TRAIT_HOLY" = TRAIT_HOLY, diff --git a/code/modules/antagonists/heretic/heretic_knowledge.dm b/code/modules/antagonists/heretic/heretic_knowledge.dm index a0acae67c35..bc9ca00779a 100644 --- a/code/modules/antagonists/heretic/heretic_knowledge.dm +++ b/code/modules/antagonists/heretic/heretic_knowledge.dm @@ -554,6 +554,7 @@ var/datum/antagonist/heretic_monster/heretic_monster = summoned.mind.add_antag_datum(/datum/antagonist/heretic_monster) heretic_monster.set_owner(user.mind) + ADD_TRAIT(heretic_monster, TRAIT_HERETIC_SUMMON, INNATE_TRAIT) var/datum/objective/heretic_summon/summon_objective = locate() in user.mind.get_all_objectives() summon_objective?.num_summoned++ diff --git a/code/modules/antagonists/heretic/magic/flesh_surgery.dm b/code/modules/antagonists/heretic/magic/flesh_surgery.dm index 87d1927cc97..806a51ccb4f 100644 --- a/code/modules/antagonists/heretic/magic/flesh_surgery.dm +++ b/code/modules/antagonists/heretic/magic/flesh_surgery.dm @@ -43,7 +43,7 @@ if(isliving(victim)) var/mob/living/mob_victim = victim - if(mob_victim.stat == DEAD || !IS_HERETIC_MONSTER(mob_victim)) + if(mob_victim.stat == DEAD || !HAS_TRAIT(mob_victim, TRAIT_HERETIC_SUMMON)) return SECONDARY_ATTACK_CALL_NORMAL if(heal_heretic_monster(hand, mob_victim, caster)) @@ -73,7 +73,7 @@ context[SCREENTIP_CONTEXT_LMB] = "Extract organ" . = CONTEXTUAL_SCREENTIP_SET - if(IS_HERETIC_MONSTER(mob_victim)) + if(HAS_TRAIT(mob_victim, TRAIT_HERETIC_SUMMON)) context[SCREENTIP_CONTEXT_RMB] = "Heal [ishuman(mob_victim) ? "minion" : "summon"]" . = CONTEXTUAL_SCREENTIP_SET diff --git a/code/modules/antagonists/heretic/status_effects/ghoul.dm b/code/modules/antagonists/heretic/status_effects/ghoul.dm index 0ab04955a03..598b43f60fd 100644 --- a/code/modules/antagonists/heretic/status_effects/ghoul.dm +++ b/code/modules/antagonists/heretic/status_effects/ghoul.dm @@ -61,6 +61,7 @@ on_made_callback?.Invoke(human_target) ADD_TRAIT(human_target, TRAIT_FAKEDEATH, TRAIT_STATUS_EFFECT(id)) + ADD_TRAIT(human_target, TRAIT_HERETIC_SUMMON, TRAIT_STATUS_EFFECT(id)) human_target.become_husk(TRAIT_STATUS_EFFECT(id)) human_target.faction |= FACTION_HERETIC @@ -90,6 +91,7 @@ on_lost_callback?.Invoke(human_target) REMOVE_TRAIT(human_target, TRAIT_FAKEDEATH, TRAIT_STATUS_EFFECT(id)) + REMOVE_TRAIT(human_target, TRAIT_HERETIC_SUMMON, TRAIT_STATUS_EFFECT(id)) human_target.cure_husk(TRAIT_STATUS_EFFECT(id)) human_target.faction -= FACTION_HERETIC human_target.mind?.remove_antag_datum(/datum/antagonist/heretic_monster) diff --git a/code/modules/antagonists/heretic/structures/lock_final.dm b/code/modules/antagonists/heretic/structures/lock_final.dm index 5a49c0a0790..4438e4d6f25 100644 --- a/code/modules/antagonists/heretic/structures/lock_final.dm +++ b/code/modules/antagonists/heretic/structures/lock_final.dm @@ -75,6 +75,7 @@ var/mob/living/monster = new monster_type(loc) monster.PossessByPlayer(user.key) monster.set_name() + ADD_TRAIT(monster, TRAIT_HERETIC_SUMMON, INNATE_TRAIT) var/datum/antagonist/heretic_monster/woohoo_free_antag = new(src) monster.mind.add_antag_datum(woohoo_free_antag) if(ascendee) diff --git a/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm b/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm index d1956f24fae..d907fd81a64 100644 --- a/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm +++ b/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm @@ -906,7 +906,7 @@ means that you'll be forced to move carefully while it's on. Fits in pockets, an successful_sneak_attack = FALSE sneak_attack_fail_message = TRUE - else if(IS_HERETIC_MONSTER(living_target) && prob(50)) // IT IS HARD TO SNEAK ATTACK SOMETHING WITH TOO MANY REDUNDANT EVERYTHINGS. + else if(HAS_TRAIT(living_target, TRAIT_HERETIC_SUMMON) && prob(50)) // IT IS HARD TO SNEAK ATTACK SOMETHING WITH TOO MANY REDUNDANT EVERYTHINGS. successful_sneak_attack = FALSE sneak_attack_fail_message = TRUE diff --git a/code/modules/mob/living/basic/heretic/_heretic_summon.dm b/code/modules/mob/living/basic/heretic/_heretic_summon.dm index b482ee2d211..8b8797133a2 100644 --- a/code/modules/mob/living/basic/heretic/_heretic_summon.dm +++ b/code/modules/mob/living/basic/heretic/_heretic_summon.dm @@ -34,3 +34,4 @@ /mob/living/basic/heretic_summon/Initialize(mapload) . = ..() AddElement(/datum/element/death_drops, string_list(list(/obj/effect/gibspawner/generic))) + ADD_TRAIT(src, TRAIT_HERETIC_SUMMON, INNATE_TRAIT)