[MIRROR] Adds craftable surgery trays. [MDB IGNORE] (#23790)

* Adds craftable surgery trays. (#78364)

## About The Pull Request

Surgery trays can now be crafted in the crafting menu for two rods and
one silver, while having a screwdriver. (Same cost as a table.)
Out of necessity, the preloaded variants of surgery trays have been
re-pathed to a full subtype, though maps have already been updated to
use the preloaded variant.

The morgue tray and the (new!) advanced trays have been re-pathed to
`.../full/morgue` and `.../full/advanced`, respectively

Additionally, surgery trays can now be deconstructed by secondary click
with a screwdriver. Woo!

## Why It's Good For The Game

If you want more surgery trays, build 'em!
If you want less surgery trays, unbuild 'em!

## Changelog
🆑
qol: Surgery trays can now be crafted via the crafting menu (two rods,
one silver), and deconstructed via secondary click with a screwdriver!
/🆑

---------

Co-authored-by: Jacquerel <hnevard@ gmail.com>

* Adds craftable surgery trays.

* UpdatePaths

---------

Co-authored-by: Shadow-Quill <44811257+Shadow-Quill@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@ gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-09-18 23:48:49 -07:00
committed by GitHub
co-authored by Jacquerel Shadow-Quill Giz
parent 8e0362f284
commit fb9d01d959
45 changed files with 606 additions and 574 deletions
+70 -54
View File
@@ -38,25 +38,10 @@
/// If true we're currently portable
var/is_portable = TRUE
/// List of things that we spawn containing
var/list/initial_contents = list(
/obj/item/blood_filter,
/obj/item/bonesetter,
/obj/item/cautery,
/obj/item/circular_saw,
/obj/item/clothing/mask/surgical,
/obj/item/hemostat,
/obj/item/razor/surgery,
/obj/item/retractor,
/obj/item/scalpel,
/obj/item/stack/medical/bone_gel,
/obj/item/stack/sticky_tape/surgical,
/obj/item/surgical_drapes,
/obj/item/surgicaldrill,
)
/obj/item/surgery_tray/deployed
is_portable = FALSE
/// Fills the tray with items it should contain on creation
/obj/item/surgery_tray/proc/populate_contents()
return
/obj/item/surgery_tray/Initialize(mapload)
. = ..()
@@ -89,6 +74,7 @@
. += is_portable \
? span_notice("You can click and drag it to yourself to pick it up, then use it in your hand to make it a cart!") \
: span_notice("You can click and drag it to yourself to turn it into a tray!")
. += span_notice("The top is <b>screwed</b> on.")
/obj/item/surgery_tray/update_overlays()
. = ..()
@@ -125,12 +111,6 @@
for(var/surgery_tool in surgery_overlays)
. |= surgery_overlays[surgery_tool]
///Spawn the things we contain on initialisation
/obj/item/surgery_tray/proc/populate_contents()
for (var/thing_path in initial_contents)
new thing_path(src)
update_appearance(UPDATE_OVERLAYS)
///Sets the surgery tray's deployment state. Silent if user is null.
/obj/item/surgery_tray/proc/set_tray_mode(new_mode, mob/user)
is_portable = new_mode
@@ -177,46 +157,82 @@
user.put_in_hands(grabbies)
return TRUE
/obj/item/surgery_tray/screwdriver_act_secondary(mob/living/user, obj/item/tool)
. = ..()
tool.play_tool_sound(src)
to_chat(user, span_notice("You begin taking apart [src]."))
if(!tool.use_tool(src, user, 1 SECONDS))
return
deconstruct(TRUE)
to_chat(user, span_notice("[src] has been taken apart."))
/obj/item/surgery_tray/dump_contents()
var/atom/drop_point = drop_location()
for(var/atom/movable/tool as anything in contents)
tool.forceMove(drop_point)
/obj/item/surgery_tray/deconstruct(disassembled = TRUE)
dump_contents()
if(!(flags_1 & NODECONSTRUCT_1))
dump_contents()
new /obj/item/stack/rods(drop_location(), 2)
new /obj/item/stack/sheet/mineral/silver(drop_location())
return ..()
/obj/item/surgery_tray/morgue
/obj/item/surgery_tray/deployed
is_portable = FALSE
/obj/item/surgery_tray/full
/obj/item/surgery_tray/full/deployed
is_portable = FALSE
/obj/item/surgery_tray/full/populate_contents()
new /obj/item/blood_filter(src)
new /obj/item/bonesetter(src)
new /obj/item/cautery(src)
new /obj/item/circular_saw(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/hemostat(src)
new /obj/item/razor/surgery(src)
new /obj/item/retractor(src)
new /obj/item/scalpel(src)
new /obj/item/stack/medical/bone_gel(src)
new /obj/item/stack/sticky_tape/surgical(src)
new /obj/item/surgical_drapes(src)
new /obj/item/surgicaldrill(src)
update_appearance(UPDATE_OVERLAYS)
/obj/item/surgery_tray/full/morgue
name = "autopsy tray"
desc = "A Deforest brand surgery tray, made for use in morgues. It is a folding model, \
meaning the wheels on the bottom can be extended outwards, making it a cart."
initial_contents = list(
/obj/item/blood_filter,
/obj/item/bonesetter,
/obj/item/cautery/cruel,
/obj/item/circular_saw,
/obj/item/clothing/mask/surgical,
/obj/item/hemostat/cruel,
/obj/item/razor/surgery,
/obj/item/retractor/cruel,
/obj/item/scalpel/cruel,
/obj/item/stack/medical/bone_gel,
/obj/item/stack/sticky_tape/surgical,
/obj/item/surgical_drapes,
/obj/item/surgicaldrill,
)
/obj/item/surgery_tray/full/morgue/populate_contents()
new /obj/item/blood_filter(src)
new /obj/item/bonesetter(src)
new /obj/item/cautery/cruel(src)
new /obj/item/circular_saw(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/hemostat/cruel(src)
new /obj/item/razor/surgery(src)
new /obj/item/retractor/cruel(src)
new /obj/item/scalpel/cruel(src)
new /obj/item/stack/medical/bone_gel(src)
new /obj/item/stack/sticky_tape/surgical(src)
new /obj/item/surgical_drapes(src)
new /obj/item/surgicaldrill(src)
/// Surgery tray with advanced tools for debug
/obj/item/surgery_tray/advanced
initial_contents = list(
/obj/item/scalpel/advanced,
/obj/item/retractor/advanced,
/obj/item/cautery/advanced,
/obj/item/surgical_drapes,
/obj/item/reagent_containers/medigel/sterilizine,
/obj/item/bonesetter,
/obj/item/blood_filter,
/obj/item/stack/medical/bone_gel,
/obj/item/stack/sticky_tape/surgical,
/obj/item/clothing/mask/surgical,
)
/obj/item/surgery_tray/full/advanced
/obj/item/surgery_tray/full/advanced/populate_contents()
new /obj/item/scalpel/advanced
new /obj/item/retractor/advanced
new /obj/item/cautery/advanced
new /obj/item/surgical_drapes
new /obj/item/reagent_containers/medigel/sterilizine
new /obj/item/bonesetter
new /obj/item/blood_filter
new /obj/item/stack/medical/bone_gel
new /obj/item/stack/sticky_tape/surgical
new /obj/item/clothing/mask/surgical