From 884bff7e5775a68613ecfe217b5337e4c77a1cc5 Mon Sep 17 00:00:00 2001 From: MiraHell <42539014+MiraHell@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:47:57 +0300 Subject: [PATCH 1/2] fix runtime --- code/__HELPERS/trait_helpers.dm | 1 + code/_globalvars/traits.dm | 1 + code/datums/diseases/zombie_virus.dm | 2 ++ code/modules/surgery/organs/organ_external.dm | 4 ++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/trait_helpers.dm b/code/__HELPERS/trait_helpers.dm index 4b23a6c59af1..c96d44956627 100644 --- a/code/__HELPERS/trait_helpers.dm +++ b/code/__HELPERS/trait_helpers.dm @@ -234,6 +234,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_CAN_STRIP "can_strip" // This mob can strip other mobs. #define TRAIT_CLING_BURSTING "cling_bursting" // This changeling is about to burst into a headslug, block cremation / gibber to prevent nullspace issues #define TRAIT_I_WANT_BRAINS "mob_zombie" // A general trait for tracking if the mob is a zombie. +#define TRAIT_I_WANT_BRAINS_ORGAN "zombie_organ" // A general trait for tracking whether a zombie owned the organ or limb #define TRAIT_NON_INFECTIOUS_ZOMBIE "non_infectious_zombie" // A trait for checking if a zombie shouldn't be able to infect other people #define TRAIT_NPC_ZOMBIE "npc_zombie" // A trait for checking if a zombie should act like an NPC and attack #define TRAIT_ABSTRACT_HANDS "abstract_hands" // Mobs with this trait can only pick up abstract items. diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index afd12fa96120..81d7b372d776 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -100,6 +100,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_CAN_STRIP" = TRAIT_CAN_STRIP, "TRAIT_CLING_BURSTING" = TRAIT_CLING_BURSTING, "TRAIT_I_WANT_BRAINS" = TRAIT_I_WANT_BRAINS, + "TRAIT_I_WANT_BRAINS_ORGAN" = TRAIT_I_WANT_BRAINS_ORGAN, "TRAIT_ABSTRACT_HANDS" = TRAIT_ABSTRACT_HANDS, "TRAIT_LANGUAGE_LOCKED" = TRAIT_LANGUAGE_LOCKED, "TRAIT_NON_INFECTIOUS_ZOMBIE" = TRAIT_NON_INFECTIOUS_ZOMBIE, diff --git a/code/datums/diseases/zombie_virus.dm b/code/datums/diseases/zombie_virus.dm index 37b96d68420f..bfaa6cee738e 100644 --- a/code/datums/diseases/zombie_virus.dm +++ b/code/datums/diseases/zombie_virus.dm @@ -105,6 +105,8 @@ for(var/obj/item/organ/limb as anything in H.bodyparts) if(!(limb.status & ORGAN_DEAD) && !limb.vital && !limb.is_robotic()) limb.necrotize() + if(!HAS_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN)) + ADD_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN, ZOMBIE_TRAIT) return FALSE for(var/obj/item/organ/limb as anything in H.bodyparts) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 36c4b86aaf93..3e17ce220f3c 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -394,7 +394,7 @@ This function completely restores a damaged organ to perfect condition. surgeryize() if(is_robotic()) //Robotic organs stay robotic. status = ORGAN_ROBOT - else if(HAS_TRAIT(owner, TRAIT_I_WANT_BRAINS)) + else if(HAS_TRAIT(src, TRAIT_I_WANT_BRAINS_ORGAN)) status = ORGAN_DEAD else status = 0 @@ -402,7 +402,7 @@ This function completely restores a damaged organ to perfect condition. perma_injury = 0 brute_dam = 0 burn_dam = 0 - if(!HAS_TRAIT(owner, TRAIT_I_WANT_BRAINS)) // zombies's wounds don't close. Because thats cool. + if(!HAS_TRAIT(src, TRAIT_I_WANT_BRAINS_ORGAN)) // zombies's wounds don't close. Because thats cool. open = ORGAN_CLOSED //Closing all wounds. // handle internal organs From eb091b61b68ddf2508a1e44f92a838e8cffdf00a Mon Sep 17 00:00:00 2001 From: MiraHell <42539014+MiraHell@users.noreply.github.com> Date: Sat, 18 Jan 2025 19:46:09 +0300 Subject: [PATCH 2/2] handle all cases --- code/datums/diseases/zombie_virus.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/datums/diseases/zombie_virus.dm b/code/datums/diseases/zombie_virus.dm index bfaa6cee738e..4f41eb8483d6 100644 --- a/code/datums/diseases/zombie_virus.dm +++ b/code/datums/diseases/zombie_virus.dm @@ -29,6 +29,8 @@ for(var/obj/item/organ/limb as anything in H.bodyparts) if(!(limb.status & ORGAN_DEAD) && !limb.is_robotic()) limb.necrotize(TRUE, TRUE) + if(!HAS_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN)) + ADD_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN, ZOMBIE_TRAIT) if(!..()) return FALSE @@ -112,6 +114,8 @@ for(var/obj/item/organ/limb as anything in H.bodyparts) if(!(limb.status & ORGAN_DEAD) && !limb.is_robotic()) limb.necrotize(FALSE, TRUE) + if(!HAS_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN)) + ADD_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN, ZOMBIE_TRAIT) return FALSE if(!HAS_TRAIT(affected_mob, TRAIT_I_WANT_BRAINS)) @@ -150,6 +154,10 @@ /datum/disease/zombie/cure() affected_mob.mind?.remove_antag_datum(/datum/antagonist/zombie) REMOVE_TRAIT(affected_mob, TRAIT_I_WANT_BRAINS, ZOMBIE_TRAIT) + var/mob/living/carbon/human/H = affected_mob + for(var/obj/item/organ/limb as anything in H.bodyparts) + if(HAS_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN)) + REMOVE_TRAIT(limb, TRAIT_I_WANT_BRAINS_ORGAN, ZOMBIE_TRAIT) affected_mob.DeleteComponent(/datum/component/zombie_regen) affected_mob.med_hud_set_health() affected_mob.med_hud_set_status()