From 697c8fdc4071e7d060ce77bbe6323aac78a7bffb Mon Sep 17 00:00:00 2001
From: zxaber <37497534+zxaber@users.noreply.github.com>
Date: Sat, 15 Apr 2023 18:23:02 -0700
Subject: [PATCH] Adds a Material Stack manipulation apparatus for Engineer
Cyborgs, replaces the R-Glass tool (#74297)
## About The Pull Request
- Adds a new apparatus for Engineer Cyborgs that can pick up and
manipulate material sheet stacks. Once holding a stack, interactions are
passed to the stack.
- Sheets in the new apparatus will always show as single sheets while
held, regardless of the actual count.
- Removes the R-Glass tool from Engineer Cyborgs.
- Sabotage borgs have the same changes
## Why It's Good For The Game
Allows Engiborgs to repair or build with various materials, without
(further) destroying the concept of material economy.
The R-Glass tool, in my experience, is generally unused, as the RCD can
create R-Windows and that's the main use for the sheets. So the tool has
been removed to keep the Engineer Borg Toolkit from exploding. The new
tool can also pick up R-Glass, if a need for it arises.
## Changelog
:cl:
balance: Engineer Borgs now have a tool to manipulate material stacks
(and also tile stacks). This replaces the R-Glass tool.
/:cl:
Pictured: Apparatus carrying titanium.

---
.../game/objects/items/robot/items/storage.dm | 35 ++++++++++++++++++
.../game/objects/items/stacks/sheets/glass.dm | 23 ------------
.../mob/living/silicon/robot/inventory.dm | 2 +
.../mob/living/silicon/robot/robot_model.dm | 9 +----
icons/mob/silicon/robot_items.dmi | Bin 1981 -> 2139 bytes
5 files changed, 39 insertions(+), 30 deletions(-)
diff --git a/code/game/objects/items/robot/items/storage.dm b/code/game/objects/items/robot/items/storage.dm
index 93ef7562b2a..c67aa202089 100644
--- a/code/game/objects/items/robot/items/storage.dm
+++ b/code/game/objects/items/robot/items/storage.dm
@@ -230,6 +230,41 @@
to_chat(user, span_notice("[src] is empty."))
return
+///Apparatus to allow Engineering/Sabo borgs to manipulate any material sheets.
+/obj/item/borg/apparatus/sheet_manipulator
+ name = "material manipulation apparatus"
+ desc = "An apparatus for carrying, deploying, and manipulating sheets of material. The device can also carry custom floor tiles."
+ icon_state = "borg_stack_apparatus"
+ storable = list(/obj/item/stack/sheet,
+ /obj/item/stack/tile)
+
+/obj/item/borg/apparatus/sheet_manipulator/Initialize(mapload)
+ update_appearance()
+ return ..()
+
+/obj/item/borg/apparatus/sheet_manipulator/update_overlays()
+ . = ..()
+ var/mutable_appearance/arm = mutable_appearance(icon, "borg_stack_apparatus_arm1")
+ if(stored)
+ stored.pixel_x = 0
+ stored.pixel_y = 0
+ arm.icon_state = "borg_stack_apparatus_arm2"
+ var/mutable_appearance/stored_copy = new /mutable_appearance(stored)
+ var/underscore = findtext(stored_copy.icon_state, "_")
+ if(underscore)
+ stored_copy.icon_state = initial(stored.icon_state) //how we use the icon_state of single sheets, even with full stacks
+ stored_copy.layer = FLOAT_LAYER
+ stored_copy.plane = FLOAT_PLANE
+ . += stored_copy
+ . += arm
+
+/obj/item/borg/apparatus/sheet_manipulator/examine()
+ . = ..()
+ if(stored)
+ . += "The apparatus currently has [stored] secured."
+ . += span_notice(" Alt-click will drop the currently stored sheets. ")
+
+///Apparatus allowing Engineer/Sabo borgs to manipulate Machine and Computer circuit boards
/obj/item/borg/apparatus/circuit
name = "circuit manipulation apparatus"
desc = "A special apparatus for carrying and manipulating circuit boards."
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 41c6d790fcd..301021e33e5 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -167,29 +167,6 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
add_fingerprint(user)
..()
-/obj/item/stack/sheet/rglass/cyborg
- mats_per_unit = null
- cost = 250
- source = /datum/robot_energy_storage/iron
-
- /// What energy storage this draws glass from as a robot module.
- var/datum/robot_energy_storage/glasource = /datum/robot_energy_storage/glass
- /// The amount of energy this draws from the glass source per stack unit.
- var/glacost = 500
-
-/obj/item/stack/sheet/rglass/cyborg/get_amount()
- return min(round(source.energy / cost), round(glasource.energy / glacost))
-
-/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE, check = TRUE) // Requires special checks, because it uses two storages
- if(get_amount(used)) //ensure we still have enough energy if called in a do_after chain
- source.use_charge(used * cost)
- glasource.use_charge(used * glacost)
- return TRUE
-
-/obj/item/stack/sheet/rglass/cyborg/add(amount)
- source.add_charge(amount * cost)
- glasource.add_charge(amount * glacost)
-
/obj/item/stack/sheet/rglass/get_main_recipes()
. = ..()
. += GLOB.reinforced_glass_recipes
diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm
index e86ca257f12..1d55351b02f 100644
--- a/code/modules/mob/living/silicon/robot/inventory.dm
+++ b/code/modules/mob/living/silicon/robot/inventory.dm
@@ -282,6 +282,8 @@
/mob/living/silicon/robot/proc/activated(obj/item/item_module)
if(item_module in held_items)
return TRUE
+ if(item_module.loc in held_items) //Apparatus check
+ return TRUE
return FALSE
/**
diff --git a/code/modules/mob/living/silicon/robot/robot_model.dm b/code/modules/mob/living/silicon/robot/robot_model.dm
index 43cb65ab54a..ecaac0431de 100644
--- a/code/modules/mob/living/silicon/robot/robot_model.dm
+++ b/code/modules/mob/living/silicon/robot/robot_model.dm
@@ -89,11 +89,6 @@
if(ispath(sheet_module.source, /datum/robot_energy_storage))
sheet_module.source = get_or_create_estorage(sheet_module.source)
- if(istype(sheet_module, /obj/item/stack/sheet/rglass/cyborg))
- var/obj/item/stack/sheet/rglass/cyborg/rglass_module = sheet_module
- if(ispath(rglass_module.glasource, /datum/robot_energy_storage))
- rglass_module.glasource = get_or_create_estorage(rglass_module.glasource)
-
if(istype(sheet_module.source))
sheet_module.cost = max(sheet_module.cost, 1) // Must not cost 0 to prevent div/0 errors.
sheet_module.is_cyborg = TRUE
@@ -333,7 +328,7 @@
/obj/item/electroadaptive_pseudocircuit,
/obj/item/stack/sheet/iron,
/obj/item/stack/sheet/glass,
- /obj/item/stack/sheet/rglass/cyborg,
+ /obj/item/borg/apparatus/sheet_manipulator,
/obj/item/stack/rods/cyborg,
/obj/item/stack/tile/iron/base/cyborg,
/obj/item/stack/cable_coil,
@@ -862,7 +857,7 @@
/obj/item/multitool/cyborg,
/obj/item/stack/sheet/iron,
/obj/item/stack/sheet/glass,
- /obj/item/stack/sheet/rglass/cyborg,
+ /obj/item/borg/apparatus/sheet_manipulator,
/obj/item/stack/rods/cyborg,
/obj/item/stack/tile/iron/base/cyborg,
/obj/item/dest_tagger/borg,
diff --git a/icons/mob/silicon/robot_items.dmi b/icons/mob/silicon/robot_items.dmi
index 0806c74ad8c140c2431d0b5cb610462f82d97dad..f409a5c38b15c19ccbefd62a7bab0bfbf340f3df 100644
GIT binary patch
delta 1963
zcmV;c2UPgI58Dt;iBL{Q4GJ0x0000DNk~Le0002M0001>2m=5B0B!b@ZvX%RJ5Wqi
zMZmzo{{R30SIr
z`*pR;jpV@g>NJ8)T4&X(bS07*&@!UTWYS?sQ?w|7++*EasiK9$sr+0G;@vh6f>RoY;!X+qO0+y<(vEyAui
ze}|?4f|TRmsH*c7?#Z$#)dJzzi9fm1%=v%d#W1*JayQoQ9W=u01G3ZTRIE13^EYq=
zE($wTPfbB8000HDNklJCh|}q~|^deTJM+HG+`wM5l7t`#f*{!;m(V;jA@gT}
z*XQJfJSg$x=jA7|ln*&}7y)7P<-)w2jQ)@YpnQ2=l?zbPN7}*&ZG!mt{F>%h5H{aN
zRtqweGzM!1QQR}Xvgi{KHs3X%X@CJm|9GibEH3GKaY<21rIJ6sY#7F}t{cm&f4Jw|
zPn4C%0!aQUMb}qXh56d7FMnu&02!e2i@N?Pc`kicd_04qQ~8Fje@>oDx%}h!+KjH3
zXUcS5rSz0#VBOKbzP`Fa4Lr)hsB{q_1n9msbbfHgp?
zOmm({4JnKP1o5>p)nBb@RdT{2<0>M^->gvm^}1FE@*M-RJO>#F&qx}}e}6RjE9yM>
zIgkaKs-`x{NAXVDLMElD$%UL$$gqJGX{9OUGpk=}lAl~6-{#_itU%fl5ClOG1VIo4
zMAW;U_PD73KJ9T)|9#ry!v6cT$NByD48*z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