From faadc2ec438cfdc746a046175f0aea34237e2387 Mon Sep 17 00:00:00 2001 From: Arturlang <24881678+Arturlang@users.noreply.github.com> Date: Sat, 18 Oct 2025 18:40:58 +0300 Subject: [PATCH] fix moon robes runtime + make adjustDamageType be handled by moon robes (#93470) ## About The Pull Request small followup to fix adjustBruteLoss and etc not being handled by moon robes, as i had refactored it heavily to make the code better, this was a thing i missed ## Why It's Good For The Game moon robes not blocking damage good, probably ## Changelog :cl: fix: moon robes now again will protect you from full body damage like low pressure or high pressure or fire /:cl: --- .../heretic/items/heretic_armor.dm | 23 ++++++++++++++++++- .../heretic/status_effects/heretic_passive.dm | 4 ++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/code/modules/antagonists/heretic/items/heretic_armor.dm b/code/modules/antagonists/heretic/items/heretic_armor.dm index 85e1dbf8ae2..e12066cb670 100644 --- a/code/modules/antagonists/heretic/items/heretic_armor.dm +++ b/code/modules/antagonists/heretic/items/heretic_armor.dm @@ -584,6 +584,18 @@ RegisterSignal(human_user, COMSIG_MOB_APPLY_DAMAGE_MODIFIERS, PROC_REF(on_apply_modifiers)) signal_registered += COMSIG_MOB_APPLY_DAMAGE_MODIFIERS + // adjust ignores damage modifiers so we listen to them separately + var/list/damage_adjust_signals = list( + COMSIG_LIVING_ADJUST_BRUTE_DAMAGE, + COMSIG_LIVING_ADJUST_BURN_DAMAGE, + COMSIG_LIVING_ADJUST_OXY_DAMAGE, + COMSIG_LIVING_ADJUST_TOX_DAMAGE, + COMSIG_LIVING_ADJUST_STAMINA_DAMAGE + ) + + RegisterSignals(human_user, damage_adjust_signals, PROC_REF(adjust_damage)) + signal_registered += damage_adjust_signals + RegisterSignal(human_user, COMSIG_LIVING_DEATH, PROC_REF(on_death)) signal_registered += COMSIG_LIVING_DEATH @@ -606,7 +618,8 @@ wearer.remove_movespeed_mod_immunities(REF(src), /datum/movespeed_modifier/equipment_speedmod) var/obj/item/organ/brain/our_brain = wearer.get_organ_slot(ORGAN_SLOT_BRAIN) - REMOVE_TRAIT(our_brain, TRAIT_BRAIN_DAMAGE_NODEATH, REF(src)) + if(our_brain) + REMOVE_TRAIT(our_brain, TRAIT_BRAIN_DAMAGE_NODEATH, REF(src)) braindead = FALSE if(health_hud in user.hud_used.infodisplay) on_hud_remove(user) @@ -616,6 +629,14 @@ if(braindead) return damage_mods += 0 + handle_damage(user, damage) + +/obj/item/clothing/suit/hooded/cultrobes/eldritch/moon/proc/adjust_damage(mob/living/user, type, amount, forced) + SIGNAL_HANDLER + handle_damage(user, amount) + return COMPONENT_IGNORE_CHANGE + +/obj/item/clothing/suit/hooded/cultrobes/eldritch/moon/proc/handle_damage(mob/living/user, damage) user.adjustOrganLoss(ORGAN_SLOT_BRAIN, damage * damage_modifier) check_braindeath(user) diff --git a/code/modules/antagonists/heretic/status_effects/heretic_passive.dm b/code/modules/antagonists/heretic/status_effects/heretic_passive.dm index 150f1384a7c..3fe6f5c89f7 100644 --- a/code/modules/antagonists/heretic/status_effects/heretic_passive.dm +++ b/code/modules/antagonists/heretic/status_effects/heretic_passive.dm @@ -415,6 +415,8 @@ /datum/status_effect/heretic_passive/moon/on_apply() . = ..() var/obj/item/organ/brain/our_brain = owner.get_organ_slot(ORGAN_SLOT_BRAIN) + if(!our_brain) + return ADD_TRAIT(our_brain, TRAIT_BRAIN_TRAUMA_IMMUNITY, REF(src)) owner.AddElement(/datum/element/relay_attackers) RegisterSignal(owner, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(on_attacked)) @@ -450,6 +452,8 @@ /datum/status_effect/heretic_passive/moon/on_remove() var/obj/item/organ/brain/our_brain = owner.get_organ_slot(ORGAN_SLOT_BRAIN) + if(!our_brain) + return ..() REMOVE_TRAIT(our_brain, TRAIT_BRAIN_TRAUMA_IMMUNITY, REF(src)) REMOVE_TRAIT(owner, TRAIT_SLEEPIMMUNE, REF(src)) UnregisterSignal(owner, COMSIG_ATOM_WAS_ATTACKED)