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 1/4] 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) . = ..() From 61d59500aa13e359d08d3e79e09a8f18a565605b Mon Sep 17 00:00:00 2001 From: Vicacrov <49321394+Vicacrov@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:33:03 +0100 Subject: [PATCH 2/4] Birdtalon suggestions --- .../xenomorph/abilities/defender/defender_powers.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 e96e5f697680..592d27fdee70 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,14 @@ playsound(get_turf(xeno), 'sound/effects/stonedoor_openclose.ogg', 30, 1) if(!xeno.fortify) - RegisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT, PROC_REF(crit_check)) + RegisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT, PROC_REF(unconscious_check)) + RegisterSignal(owner, COMSIG_MOB_DEATH, PROC_REF(unconscious_check)) fortify_switch(xeno, TRUE) if(xeno.selected_ability != src) button.icon_state = "template_active" else UnregisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT) + UnregisterSignal(owner, COMSIG_MOB_DEATH) fortify_switch(xeno, FALSE) if(xeno.selected_ability != src) button.icon_state = "template" @@ -249,10 +251,14 @@ else damagedata["armor"] += frontal_armor -/datum/action/xeno_action/activable/fortify/proc/crit_check() +/datum/action/xeno_action/activable/fortify/proc/unconscious_check() SIGNAL_HANDLER + if(QDELETED(owner)) + return + UnregisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT) + UnregisterSignal(owner, COMSIG_MOB_DEATH) fortify_switch(owner, FALSE) /datum/action/xeno_action/onclick/soak/use_ability(atom/A) From 2328f7c701ae1674a5cb1356b23dbc2311741a16 Mon Sep 17 00:00:00 2001 From: Vicacrov <49321394+Vicacrov@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:44:26 +0100 Subject: [PATCH 3/4] Contrabang suggestions --- code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm | 2 +- .../carbon/xenomorph/abilities/defender/defender_powers.dm | 6 +++--- code/modules/mob/living/carbon/xenomorph/life.dm | 2 +- 3 files changed, 5 insertions(+), 5 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 deda198c41e6..7144d26e5f33 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm @@ -73,4 +73,4 @@ #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" +#define COMSIG_ENTER_CRIT "xeno_entering_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 592d27fdee70..05f588351ce4 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,13 +174,13 @@ playsound(get_turf(xeno), 'sound/effects/stonedoor_openclose.ogg', 30, 1) if(!xeno.fortify) - RegisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT, PROC_REF(unconscious_check)) + RegisterSignal(owner, COMSIG_ENTER_CRIT, PROC_REF(unconscious_check)) RegisterSignal(owner, COMSIG_MOB_DEATH, PROC_REF(unconscious_check)) fortify_switch(xeno, TRUE) if(xeno.selected_ability != src) button.icon_state = "template_active" else - UnregisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT) + UnregisterSignal(owner, COMSIG_ENTER_CRIT) UnregisterSignal(owner, COMSIG_MOB_DEATH) fortify_switch(xeno, FALSE) if(xeno.selected_ability != src) @@ -257,7 +257,7 @@ if(QDELETED(owner)) return - UnregisterSignal(owner, COMSIG_XENO_GET_INTO_CRIT) + UnregisterSignal(owner, COMSIG_ENTER_CRIT) UnregisterSignal(owner, COMSIG_MOB_DEATH) fortify_switch(owner, FALSE) diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 8ec47f58253b..edf2c13d5ef0 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -506,7 +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) + SEND_SIGNAL(src, COMSIG_ENTER_CRIT) /mob/living/carbon/xenomorph/set_stat(new_stat) . = ..() From 113b828dc05981cda5dc51ad8777157a103f0e3f Mon Sep 17 00:00:00 2001 From: Vicacrov <49321394+Vicacrov@users.noreply.github.com> Date: Fri, 2 Feb 2024 20:15:29 +0100 Subject: [PATCH 4/4] Changes to a better comsig name --- code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm | 2 +- .../carbon/xenomorph/abilities/defender/defender_powers.dm | 6 +++--- code/modules/mob/living/carbon/xenomorph/life.dm | 2 +- 3 files changed, 5 insertions(+), 5 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 7144d26e5f33..73b10d700247 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm @@ -73,4 +73,4 @@ #define COMSIG_XENO_TAKE_HUGGER_FROM_MORPHER "xeno_take_hugger_from_morpher" /// From /mob/living/carbon/xenomorph/proc/handle_crit() -#define COMSIG_ENTER_CRIT "xeno_entering_critical" +#define COMSIG_XENO_ENTER_CRIT "xeno_entering_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 05f588351ce4..9326ae78bf9d 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,13 +174,13 @@ playsound(get_turf(xeno), 'sound/effects/stonedoor_openclose.ogg', 30, 1) if(!xeno.fortify) - RegisterSignal(owner, COMSIG_ENTER_CRIT, PROC_REF(unconscious_check)) + RegisterSignal(owner, COMSIG_XENO_ENTER_CRIT, PROC_REF(unconscious_check)) RegisterSignal(owner, COMSIG_MOB_DEATH, PROC_REF(unconscious_check)) fortify_switch(xeno, TRUE) if(xeno.selected_ability != src) button.icon_state = "template_active" else - UnregisterSignal(owner, COMSIG_ENTER_CRIT) + UnregisterSignal(owner, COMSIG_XENO_ENTER_CRIT) UnregisterSignal(owner, COMSIG_MOB_DEATH) fortify_switch(xeno, FALSE) if(xeno.selected_ability != src) @@ -257,7 +257,7 @@ if(QDELETED(owner)) return - UnregisterSignal(owner, COMSIG_ENTER_CRIT) + UnregisterSignal(owner, COMSIG_XENO_ENTER_CRIT) UnregisterSignal(owner, COMSIG_MOB_DEATH) fortify_switch(owner, FALSE) diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index edf2c13d5ef0..bbd59a74d8b5 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -506,7 +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_ENTER_CRIT) + SEND_SIGNAL(src, COMSIG_XENO_ENTER_CRIT) /mob/living/carbon/xenomorph/set_stat(new_stat) . = ..()