From eed6aafb065fee3215fedc75d686d6b712c2a7de Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 14 Jul 2021 00:57:26 +0200 Subject: [PATCH] [MIRROR] Fixes lingering moodlet on ethereal stomach removal. (#6897) * Fixes lingering moodlet on ethereal stomach removal. (#60130) * Fixes lingering moodlet on ethereal stomach removal. Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- code/datums/components/mood.dm | 19 ------------------- .../organs/stomach/stomach_ethereal.dm | 9 +++++++++ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index ec21d87be64..8741e1c0fc3 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -394,8 +394,6 @@ /datum/component/mood/proc/HandleNutrition() var/mob/living/L = parent - if(istype(L.getorganslot(ORGAN_SLOT_STOMACH), /obj/item/organ/stomach/ethereal)) - HandleCharge(L) if(HAS_TRAIT(L, TRAIT_NOHUNGER)) return FALSE //no mood events for nutrition switch(L.nutrition) @@ -415,23 +413,6 @@ if(0 to NUTRITION_LEVEL_STARVING) add_event(null, "nutrition", /datum/mood_event/starving) -/datum/component/mood/proc/HandleCharge(mob/living/carbon/human/H) - var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH) - - switch(stomach.crystal_charge) - if(ETHEREAL_CHARGE_NONE to ETHEREAL_CHARGE_LOWPOWER) - add_event(null, "charge", /datum/mood_event/decharged) - if(ETHEREAL_CHARGE_LOWPOWER to ETHEREAL_CHARGE_NORMAL) - add_event(null, "charge", /datum/mood_event/lowpower) - if(ETHEREAL_CHARGE_NORMAL to ETHEREAL_CHARGE_ALMOSTFULL) - clear_event(null, "charge") - if(ETHEREAL_CHARGE_ALMOSTFULL to ETHEREAL_CHARGE_FULL) - add_event(null, "charge", /datum/mood_event/charged) - if(ETHEREAL_CHARGE_FULL to ETHEREAL_CHARGE_OVERLOAD) - add_event(null, "charge", /datum/mood_event/overcharged) - if(ETHEREAL_CHARGE_OVERLOAD to ETHEREAL_CHARGE_DANGEROUS) - add_event(null, "charge", /datum/mood_event/supercharged) - /datum/component/mood/proc/check_area_mood(datum/source, area/A) SIGNAL_HANDLER diff --git a/code/modules/surgery/organs/stomach/stomach_ethereal.dm b/code/modules/surgery/organs/stomach/stomach_ethereal.dm index 55ba169c16c..6ac151adc2f 100644 --- a/code/modules/surgery/organs/stomach/stomach_ethereal.dm +++ b/code/modules/surgery/organs/stomach/stomach_ethereal.dm @@ -23,6 +23,7 @@ UnregisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT) REMOVE_TRAIT(owner, TRAIT_NOHUNGER, src) + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "charge") carbon.clear_alert("ethereal_charge") carbon.clear_alert("ethereal_overcharge") @@ -48,24 +49,32 @@ /obj/item/organ/stomach/ethereal/proc/handle_charge(mob/living/carbon/carbon, delta_time, times_fired) switch(crystal_charge) if(-INFINITY to ETHEREAL_CHARGE_NONE) + SEND_SIGNAL(carbon, COMSIG_ADD_MOOD_EVENT, "charge", /datum/mood_event/decharged) carbon.throw_alert("ethereal_charge", /atom/movable/screen/alert/emptycell/ethereal) if(carbon.health > 10.5) carbon.apply_damage(0.65, TOX, null, null, carbon) if(ETHEREAL_CHARGE_NONE to ETHEREAL_CHARGE_LOWPOWER) + SEND_SIGNAL(carbon, COMSIG_ADD_MOOD_EVENT, "charge", /datum/mood_event/decharged) carbon.throw_alert("ethereal_charge", /atom/movable/screen/alert/lowcell/ethereal, 3) if(carbon.health > 10.5) carbon.apply_damage(0.325 * delta_time, TOX, null, null, carbon) if(ETHEREAL_CHARGE_LOWPOWER to ETHEREAL_CHARGE_NORMAL) + SEND_SIGNAL(carbon, COMSIG_ADD_MOOD_EVENT, "charge", /datum/mood_event/lowpower) carbon.throw_alert("ethereal_charge", /atom/movable/screen/alert/lowcell/ethereal, 2) + if(ETHEREAL_CHARGE_ALMOSTFULL to ETHEREAL_CHARGE_FULL) + SEND_SIGNAL(carbon, COMSIG_ADD_MOOD_EVENT, "charge", /datum/mood_event/charged) if(ETHEREAL_CHARGE_FULL to ETHEREAL_CHARGE_OVERLOAD) + SEND_SIGNAL(carbon, COMSIG_ADD_MOOD_EVENT, "charge", /datum/mood_event/overcharged) carbon.throw_alert("ethereal_overcharge", /atom/movable/screen/alert/ethereal_overcharge, 1) carbon.apply_damage(0.2, TOX, null, null, carbon) if(ETHEREAL_CHARGE_OVERLOAD to ETHEREAL_CHARGE_DANGEROUS) + SEND_SIGNAL(carbon, COMSIG_ADD_MOOD_EVENT, "charge", /datum/mood_event/supercharged) carbon.throw_alert("ethereal_overcharge", /atom/movable/screen/alert/ethereal_overcharge, 2) carbon.apply_damage(0.325 * delta_time, TOX, null, null, carbon) if(DT_PROB(5, delta_time)) // 5% each seacond for ethereals to explosively release excess energy if it reaches dangerous levels discharge_process(carbon) else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "charge") carbon.clear_alert("ethereal_charge") carbon.clear_alert("ethereal_overcharge")