From 71a8cea11ca04377b163dc737e7f02bcaef9b1bb Mon Sep 17 00:00:00 2001 From: Waterpig <49160555+Majkl-J@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:45:17 +0100 Subject: [PATCH] Synths can now charge from cyborg chargers (#716) ## About The Pull Request Part 3 of my synthcentric update series (Yes we are far from done) My insanity grows. You can probably deduce what this does, it is literally the title. ## Why It's Good For The Game Robot charge in robot charger, good, yes? ## Changelog :cl: add: Synths can now charge in cyborg chargers /:cl: --------- Co-authored-by: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com> --- .../modules/synths/code/bodyparts/stomach.dm | 25 +++++++++++++++++++ tgstation.dme | 1 + 2 files changed, 26 insertions(+) create mode 100644 modular_zubbers/code/modules/synths/code/bodyparts/stomach.dm diff --git a/modular_zubbers/code/modules/synths/code/bodyparts/stomach.dm b/modular_zubbers/code/modules/synths/code/bodyparts/stomach.dm new file mode 100644 index 0000000000000..af86b7379c20d --- /dev/null +++ b/modular_zubbers/code/modules/synths/code/bodyparts/stomach.dm @@ -0,0 +1,25 @@ +/obj/item/organ/internal/stomach/synth/Insert(mob/living/carbon/receiver, special, drop_if_replaced) + . = ..() + add_synth_signals(receiver) + +/obj/item/organ/internal/stomach/synth/Remove(mob/living/carbon/stomach_owner, special) + . = ..() + remove_synth_signals(stomach_owner) + +/obj/item/organ/internal/stomach/synth/proc/add_synth_signals(mob/living/carbon/stomach_owner) + SIGNAL_HANDLER + RegisterSignal(stomach_owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, PROC_REF(on_borg_charge)) + +/obj/item/organ/internal/stomach/synth/proc/remove_synth_signals(mob/living/carbon/stomach_owner) + SIGNAL_HANDLER + UnregisterSignal(stomach_owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT) + +/obj/item/organ/internal/stomach/synth/proc/on_borg_charge(datum/source, amount) + SIGNAL_HANDLER + + // This is so it isn't completely instant + amount /= 200 + if(owner.nutrition < NUTRITION_LEVEL_WELL_FED) + owner.nutrition += amount + if(owner.nutrition > NUTRITION_LEVEL_FULL) + owner.nutrition = NUTRITION_LEVEL_ALMOST_FULL diff --git a/tgstation.dme b/tgstation.dme index 94f818043c886..078ce3602a0f1 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -8058,6 +8058,7 @@ #include "modular_zubbers\code\modules\surgery\bodyparts\species_parts\misc_bodyparts.dm" #include "modular_zubbers\code\modules\surgery\organs\internal\lungs\_lungs.dm" #include "modular_zubbers\code\modules\synths\code\bodyparts\brain.dm" +#include "modular_zubbers\code\modules\synths\code\bodyparts\stomach.dm" #include "modular_zubbers\code\modules\synths\code\bodyparts\internal_computer\internal_computer.dm" #include "modular_zubbers\code\modules\traitor\goal_overrides.dm" #include "modular_zubbers\code\modules\vending\halloween_chocolate.dm"