From ffba0fab068d32da7c6f074331bc2c5672a36c6d Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:44:53 +0300 Subject: [PATCH] Heart eater wizard perk no longer works activates on organs that haven't been used before (#85367) ## About The Pull Request Closes #85364 Organs now mark themselves after being removed from someone, which is that the perk checks for ## Changelog :cl: fix: Heart eater wizard perk no longer works activates on organs that haven't been used before /:cl: --- code/__DEFINES/traits/declarations.dm | 3 +++ code/_globalvars/traits/_traits.dm | 1 + code/datums/components/heart_eater.dm | 3 +++ code/modules/surgery/organs/organ_movement.dm | 1 + 4 files changed, 8 insertions(+) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 3a47fe1ca0a..2ecf51a89ad 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1125,6 +1125,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai ///Trait given to limb by /mob/living/basic/living_limb_flesh #define TRAIT_IGNORED_BY_LIVING_FLESH "livingflesh_ignored" +///Trait given to organs that have been inside a living being previously +#define TRAIT_USED_ORGAN "used_organ" + /// Trait given while using /datum/action/cooldown/mob_cooldown/wing_buffet #define TRAIT_WING_BUFFET "wing_buffet" /// Trait given while tired after using /datum/action/cooldown/mob_cooldown/wing_buffet diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 8d97c8fe84f..6896f11b78b 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -617,6 +617,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( ), /obj/item/organ = list( "TRAIT_LIVING_HEART" = TRAIT_LIVING_HEART, + "TRAIT_USED_ORGAN" = TRAIT_USED_ORGAN, ), /obj/item/organ/internal/liver = list( "TRAIT_BALLMER_SCIENTIST" = TRAIT_BALLMER_SCIENTIST, diff --git a/code/datums/components/heart_eater.dm b/code/datums/components/heart_eater.dm index 5b73c40c954..507090b9452 100644 --- a/code/datums/components/heart_eater.dm +++ b/code/datums/components/heart_eater.dm @@ -68,6 +68,9 @@ var/obj/item/organ/internal/heart/previous_heart = last_heart_we_ate?.resolve() if(we_ate_heart == previous_heart) return + if (!HAS_TRAIT(we_ate_heart, TRAIT_USED_ORGAN)) + to_chat(eater, span_warning("This heart is utterly lifeless, you won't receive any boons from consuming it!")) + return bites_taken = 0 last_heart_we_ate = WEAKREF(we_ate_heart) diff --git a/code/modules/surgery/organs/organ_movement.dm b/code/modules/surgery/organs/organ_movement.dm index 2889cbe0708..ff9f753ce18 100644 --- a/code/modules/surgery/organs/organ_movement.dm +++ b/code/modules/surgery/organs/organ_movement.dm @@ -161,6 +161,7 @@ UnregisterSignal(organ_owner, COMSIG_ATOM_EXAMINE) SEND_SIGNAL(src, COMSIG_ORGAN_REMOVED, organ_owner) SEND_SIGNAL(organ_owner, COMSIG_CARBON_LOSE_ORGAN, src, special) + ADD_TRAIT(src, TRAIT_USED_ORGAN, ORGAN_TRAIT) var/list/diseases = organ_owner.get_static_viruses() if(!LAZYLEN(diseases))