From 07c0fbed27a786f2362abf007507f656adc114b9 Mon Sep 17 00:00:00 2001 From: Vicacrov <49321394+Vicacrov@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:10:32 +0100 Subject: [PATCH] Fixes defenders staying fortified while in crit, adds xeno crit comsig --- .../__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm | 3 +++ .../xenomorph/abilities/defender/defender_powers.dm | 8 ++++---- code/modules/mob/living/carbon/xenomorph/life.dm | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm b/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm index 9846e974827e..deda198c41e6 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm @@ -71,3 +71,6 @@ /// From /obj/effect/alien/resin/special/eggmorph/attack_alien: (mob/living/carbon/xenomorph/M) #define COMSIG_XENO_TAKE_HUGGER_FROM_MORPHER "xeno_take_hugger_from_morpher" + +/// From /mob/living/carbon/xenomorph/proc/handle_crit() +#define COMSIG_XENO_GET_INTO_CRIT "xeno_getting_into_critical" diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm index bd01376c9f9d..e96e5f697680 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm @@ -174,12 +174,12 @@ playsound(get_turf(xeno), 'sound/effects/stonedoor_openclose.ogg', 30, 1) if(!xeno.fortify) - RegisterSignal(owner, COMSIG_MOB_DEATH, PROC_REF(death_check)) + RegisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT, PROC_REF(crit_check)) fortify_switch(xeno, TRUE) if(xeno.selected_ability != src) button.icon_state = "template_active" else - UnregisterSignal(owner, COMSIG_MOB_DEATH) + UnregisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT) fortify_switch(xeno, FALSE) if(xeno.selected_ability != src) button.icon_state = "template" @@ -249,10 +249,10 @@ else damagedata["armor"] += frontal_armor -/datum/action/xeno_action/activable/fortify/proc/death_check() +/datum/action/xeno_action/activable/fortify/proc/crit_check() SIGNAL_HANDLER - UnregisterSignal(owner, COMSIG_MOB_DEATH) + UnregisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT) fortify_switch(owner, FALSE) /datum/action/xeno_action/onclick/soak/use_ability(atom/A) diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index d5ca8a41fa39..8ec47f58253b 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -506,6 +506,7 @@ Make sure their actual health updates immediately.*/ /mob/living/carbon/xenomorph/proc/handle_crit() if(stat <= CONSCIOUS && !gibbing) set_stat(UNCONSCIOUS) + SEND_SIGNAL(src, COMSIG_XENO_GET_INTO_CRIT) /mob/living/carbon/xenomorph/set_stat(new_stat) . = ..()