Skip to content

Commit

Permalink
Fixes defenders staying fortified while in crit, adds xeno crit comsig
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicacrov committed Feb 2, 2024
1 parent 55f0768 commit 07c0fbe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down

0 comments on commit 07c0fbe

Please sign in to comment.