Skip to content

Commit

Permalink
Fixes Inconsistent Synth Maintenance Stations Icons (#8153)
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. -->

# About the pull request

This whole thing was a mess. Drathek and the coding community helped me
put this together.

I had not experienced the issue where the Synthetic Maintenance System's
icon state does not change properly when occupied and whether or not an
APC is present, but investigating #4546 led me down a rabbit hole that
resulted in me fixing several unrelated problems, mentioned in the
changelog.

Just to be safe, however, the Synthetic Maintenance System now
automatically spits somebody out if it has 0 charge under any
circumstance and it refuses entry until it has some charge again. It
needs a powered APC to charge, anyway, so...

# Explain why it's good for the game

Fixes #4546 

# Testing Photographs and Procedure

<!-- !! If you are modifying sprites, you **must** include one or more
in-game screenshots or videos of the new sprites. !! -->

<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/user-attachments/assets/369b0885-47af-41a7-9ac1-396cd2179d01)
This maintenance station has no APC powering it and it has 0 charge. It
flashes red to let you know it's completely fucked.


![image](https://github.com/user-attachments/assets/2f733171-c555-42d9-994b-b9c8fe48cc52)
This maintenance station has no APC powering it but it has a little bit
of charge left, so the light is still green.
</details>


# Changelog

:cl:
imageadd: Synthetic Maintenance Stations now blink red if they cannot be
operated under any circumstances.
imageadd: Synthetic Maintenance Stations flash green whether or not an
APC is powering it to indicate it can still operate with charge.
fix: Synthetic Maintenance Stations now properly display the correct
occupied icon state whether or not there is an APC powering the machine
whilst somebody is inside.
code: Fixed and added code that makes Synthetic Maintenance Stations
automatically eject patients if they run out of charge while operating.
code: Added code that disables patients from entering the Synthetic
Maintenance Station if it has no charge left.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
Ultimate-Fluff and hry-gh authored Jan 24, 2025
1 parent 842be9d commit 6540404
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions code/game/machinery/rechargestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
src.go_out()
return

/obj/structure/machinery/recharge_station/inoperable(additional_flags = 0)
. = ..(additional_flags)
return (. && !current_internal_charge)

/obj/structure/machinery/recharge_station/emp_act(severity)
. = ..()
if(inoperable())
Expand All @@ -127,13 +131,13 @@

/obj/structure/machinery/recharge_station/update_icon()
..()
if(!inoperable())
if(operable())
if(src.occupant)
icon_state = "borgcharger1"
else
icon_state = "borgcharger0"
else
icon_state = "borgcharger0"
icon_state = "borgcharger2"
overlays.Cut()
switch(floor(chargepercentage()))
if(1 to 20)
Expand Down Expand Up @@ -225,6 +229,9 @@
return move_mob_inside(target)

/obj/structure/machinery/recharge_station/verb/move_mob_inside(mob/living/M)
if(current_internal_charge <= 0)
to_chat(M, SPAN_NOTICE(SPAN_BOLD("[src] is currently out of power. Please come back later!")))
return
if (!issynth(M))
return FALSE
if (occupant)
Expand Down
Binary file modified icons/obj/objects.dmi
Binary file not shown.

0 comments on commit 6540404

Please sign in to comment.