Skip to content

Commit

Permalink
Synths can now charge from cyborg chargers (Bubberstation#716)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## 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.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

<!-- Please make sure to actually test your PRs. If you have not tested
your PR mention it. -->

## Why It's Good For The Game

Robot charge in robot charger, good, yes?
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
add: Synths can now charge in cyborg chargers
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

<!-- By opening a pull request. You have read and understood the
repository rules located on the main README.md on this project. -->

---------

Co-authored-by: The Sharkening <[email protected]>
  • Loading branch information
Majkl-J and StrangeWeirdKitten authored Nov 15, 2023
1 parent 8d6944d commit 71a8cea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modular_zubbers/code/modules/synths/code/bodyparts/stomach.dm
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 71a8cea

Please sign in to comment.