[MIRROR] Clears up issues moods and alerts on gain of NOBREATH (#968)

* Clears up issues moods and alerts on gain of NOBREATH (#53908)

Fixes up the gain of the NOBREATH trait to clear breath related moods and alerts.
Added a godmode fix up for humans also.

* Clears up issues moods and alerts on gain of NOBREATH

Co-authored-by: NightRed <nightred@gmail.com>
This commit is contained in:
SkyratBot
2020-09-24 20:34:00 +02:00
committed by GitHub
parent 77c53c4258
commit dcc063700f
4 changed files with 28 additions and 2 deletions
@@ -0,0 +1,25 @@
//Called on /mob/living/carbon/Initialize(), for the carbon mobs to register relevant signals.
/mob/living/carbon/register_init_signals()
. = ..()
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_NOBREATH), .proc/on_nobreath_trait_gain)
/**
* On gain of TRAIT_NOBREATH
*
* This will clear all alerts and moods related to breathing.
*/
/mob/living/carbon/proc/on_nobreath_trait_gain(datum/source)
failed_last_breath = FALSE
clear_alert("too_much_oxy")
clear_alert("not_enough_oxy")
clear_alert("too_much_tox")
clear_alert("not_enough_tox")
clear_alert("nitro")
clear_alert("too_much_nitro")
clear_alert("not_enough_nitro")
clear_alert("too_much_co2")
clear_alert("not_enough_co2")
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria")
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell")
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation")
-2
View File
@@ -140,8 +140,6 @@
clear_alert("not_enough_oxy")
return FALSE
if(HAS_TRAIT(src, TRAIT_NOBREATH))
failed_last_breath = FALSE
clear_alert("not_enough_oxy")
return FALSE
var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS)
+2
View File
@@ -76,6 +76,8 @@
/obj/item/organ/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
if(H.status_flags & GODMODE)
H.failed_last_breath = FALSE //clear oxy issues
H.clear_alert("not_enough_oxy")
return
if(HAS_TRAIT(H, TRAIT_NOBREATH))
return
+1
View File
@@ -2253,6 +2253,7 @@
#include "code\modules\mob\living\carbon\death.dm"
#include "code\modules\mob\living\carbon\emote.dm"
#include "code\modules\mob\living\carbon\examine.dm"
#include "code\modules\mob\living\carbon\init_signals.dm"
#include "code\modules\mob\living\carbon\inventory.dm"
#include "code\modules\mob\living\carbon\life.dm"
#include "code\modules\mob\living\carbon\skillchip.dm"