diff --git a/_maps/map_files/debug/runtimestation.dmm b/_maps/map_files/debug/runtimestation.dmm index 7d949fb043d0c..1b1fdf387396f 100644 --- a/_maps/map_files/debug/runtimestation.dmm +++ b/_maps/map_files/debug/runtimestation.dmm @@ -924,7 +924,7 @@ /turf/open/floor/iron, /area/station/construction) "dN" = ( -/obj/structure/table, +/obj/machinery/vending/subtype_vendor, /turf/open/floor/iron, /area/station/commons/storage/primary) "dO" = ( @@ -932,6 +932,7 @@ /obj/machinery/light/directional/south, /obj/item/storage/medkit/regular, /obj/item/healthanalyzer/advanced, +/obj/item/debug/omnitool/item_spawner, /turf/open/floor/iron, /area/station/commons/storage/primary) "dP" = ( @@ -1775,6 +1776,7 @@ /area/station/construction) "is" = ( /obj/structure/sign/warning/vacuum/external/directional/east, +/obj/machinery/vending/subtype_vendor, /turf/open/floor/iron, /area/station/medical/medbay) "jb" = ( @@ -1862,6 +1864,7 @@ "ny" = ( /obj/structure/table, /obj/item/storage/toolbox/syndicate, +/obj/item/debug/omnitool, /turf/open/floor/iron, /area/station/commons/storage/primary) "nI" = ( @@ -2217,6 +2220,24 @@ /obj/effect/turf_decal/tile/blue/half/contrasted, /turf/open/floor/iron, /area/station/command/bridge) +"IB" = ( +/obj/structure/cable, +/obj/effect/turf_decal/tile/blue{ + dir = 8 + }, +/obj/structure/table, +/obj/item/debug/omnitool{ + pixel_x = -4; + pixel_y = 6 + }, +/obj/item/debug/omnitool/item_spawner{ + pixel_x = 4; + pixel_y = -6 + }, +/turf/open/floor/iron/white/corner{ + dir = 1 + }, +/area/station/medical/medbay) "IF" = ( /obj/machinery/power/apc/auto_name/directional/north, /obj/structure/cable, @@ -7989,7 +8010,7 @@ av by Ot cl -cl +IB cl cH cu diff --git a/code/game/objects/items/debug_items.dm b/code/game/objects/items/debug_items.dm index 0a944b300d423..071561d57a095 100644 --- a/code/game/objects/items/debug_items.dm +++ b/code/game/objects/items/debug_items.dm @@ -143,6 +143,10 @@ if("Wire Brush") tool_behaviour = TOOL_RUSTSCRAPER +/obj/item/debug/omnitool/item_spawner + name = "spawntool" + color = COLOR_ADMIN_PINK + /obj/item/debug/omnitool/item_spawner/attack_self(mob/user) if(!user || !user.client) return diff --git a/code/modules/vending/subtype.dm b/code/modules/vending/subtype.dm new file mode 100644 index 0000000000000..9b4f212224ea7 --- /dev/null +++ b/code/modules/vending/subtype.dm @@ -0,0 +1,51 @@ + +/obj/machinery/vending/subtype_vendor + name = "\improper subtype vendor" + desc = "A vending machine that vends all subtypes of a specific type." + color = COLOR_ADMIN_PINK + verb_say = "codes" + verb_ask = "queries" + verb_exclaim = "compiles" + armor_type = /datum/armor/machinery_vending + circuit = null + product_slogans = "Spawn \" too annoying? Too lazy to open game panel? This one's for you!;Subtype vendor, for all your debugging woes!" + default_price = 0 + /// Spawns coders by default + var/type_to_vend = /obj/item/food/grown/citrus + +/obj/machinery/vending/subtype_vendor/Initialize(mapload, type_to_vend) + . = ..() + if(type_to_vend) + src.type_to_vend = type_to_vend + load_subtypes() + +/obj/machinery/vending/subtype_vendor/proc/load_subtypes() + products = list() + product_records = list() + + for(var/type in typesof(type_to_vend)) + LAZYADDASSOC(products, type, 50) + + build_inventories() + +/obj/machinery/vending/subtype_vendor/attack_hand_secondary(mob/user, list/modifiers) + . = ..() + if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN) + return + + if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH)) + return + + if(!user.client?.holder?.check_for_rights(R_SERVER|R_DEBUG)) + speak("Hey! You can't use this! Get outta here!") + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + + var/type_to_vend_now = tgui_input_text(user, "What type to set it to?", "Set type to vend", "/obj/item/toy/plush") + type_to_vend_now = text2path(type_to_vend_now) + if(!ispath(type_to_vend_now)) + speak("That's not a real path, dumbass! Try again!") + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + + type_to_vend = type_to_vend_now + load_subtypes() + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN diff --git a/tgstation.dme b/tgstation.dme index 013c183acca36..aeb49eb9a49ce 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6147,6 +6147,7 @@ #include "code\modules\vending\security.dm" #include "code\modules\vending\snack.dm" #include "code\modules\vending\sovietsoda.dm" +#include "code\modules\vending\subtype.dm" #include "code\modules\vending\sustenance.dm" #include "code\modules\vending\toys.dm" #include "code\modules\vending\wardrobes.dm"