Skip to content

Commit

Permalink
Added the subtype vendor and it and omnitools to runtime station (tgs…
Browse files Browse the repository at this point in the history
…tation#84540)

## About The Pull Request

Added the subtype vendor which lets admins and coders vend subtypes of a
path

Added the vendor and both varieties of omnitool to runtime station

## Why It's Good For The Game

Better and faster testing environment. Runtimestation is horribly
inefficient rn but this will help a bit

## Changelog

:cl:
code: Added the subtype vendor which lets admins and coders vend
subtypes of a path
code: Added the vendor and both varieties of omnitool to runtime station
/:cl:
  • Loading branch information
carlarctg authored Jul 8, 2024
1 parent a9593b1 commit 663f17c
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 2 deletions.
25 changes: 23 additions & 2 deletions _maps/map_files/debug/runtimestation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -924,14 +924,15 @@
/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" = (
/obj/structure/table,
/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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -7989,7 +8010,7 @@ av
by
Ot
cl
cl
IB
cl
cH
cu
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/debug_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 51 additions & 0 deletions code/modules/vending/subtype.dm
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 663f17c

Please sign in to comment.