From e28c9ca69683cd2ba4a7ca77d34851483a57d7e8 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Thu, 31 Aug 2023 21:24:22 +0200
Subject: [PATCH] [MIRROR] Organ harvester output direction selection [MDB
IGNORE] (#23431)
* Organ harvester output direction selection (#78013)
## About The Pull Request
The organ harvester now defaults to dropping harvested limbs/organs to
the tile south of it. When the panel is open, you can alt click to cycle
the output between the cardinal directions.

~~I also killed some runtime that was happening in
`/obj/item/bodypart/head/update_limb(dropping_limb, is_creating)`
whenever the organ harvester removed a head. As far as I can tell, the
player facing side of this has not changed at all from this.~~
I think someone else did it first, and they probably did it better.
## Why It's Good For The Game
The organ harvester choosing where to output for you and giving no
indiciation of which way it is is very annoying. Whenever I set it up,
it always ends up dropping the organs on the same tile as a vending
machine or on the other side of a directional window. This gives a
little more control over where things get spat out.
## Changelog
:cl:
qol: The organ harvester's output is more predictable, and the direction
can be changed by alt-clicking with the panel screwed open.
/:cl:
* Organ harvester output direction selection
---------
Co-authored-by: Vladin Heir <44104681+VladinXXV@users.noreply.github.com>
---
code/game/machinery/harvester.dm | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm
index b5fd04a98f2..63a48dcd976 100644
--- a/code/game/machinery/harvester.dm
+++ b/code/game/machinery/harvester.dm
@@ -13,6 +13,7 @@
var/harvesting = FALSE
var/warming_up = FALSE
var/list/operation_order = list() //Order of wich we harvest limbs.
+ var/output_dir = SOUTH //Direction to drop the limbs in
var/allow_clothing = FALSE
var/allow_living = FALSE
@@ -58,6 +59,12 @@
/obj/machinery/harvester/AltClick(mob/user)
. = ..()
+ if(!user.can_perform_action(src))
+ return
+ if(panel_open)
+ output_dir = turn(output_dir, -90)
+ to_chat(user, span_notice("You change [src]'s output settings, setting the output to [dir2text(output_dir)]."))
+ return
if(!can_interact(user))
return
if(harvesting || !user || !isliving(user) || state_open)
@@ -121,17 +128,7 @@
if(!LAZYLEN(operation_order)) //The list is empty, so we're done here
end_harvesting(success = TRUE)
return
- var/turf/target
- for(var/adir in list(EAST,NORTH,SOUTH,WEST))
- var/turf/T = get_step(src,adir)
- if(!T)
- continue
- if(isclosedturf(T))
- continue
- target = T
- break
- if(!target)
- target = get_turf(src)
+ var/turf/target = get_step(src, output_dir)
for(var/obj/item/bodypart/BP in operation_order) //first we do non-essential limbs
BP.drop_limb()
C.emote("scream")
@@ -219,4 +216,4 @@
else if(!harvesting)
. += span_notice("Alt-click [src] to start harvesting.")
if(in_range(user, src) || isobserver(user))
- . += span_notice("The status display reads: Harvest speed at [interval*0.1] seconds per organ.")
+ . += span_notice("The status display reads: Harvest speed at [interval*0.1] seconds per organ. Outputting to the [dir2text(output_dir)].")