From df7ffcc397631d26ecdb31b2c68699a8ae5d68f3 Mon Sep 17 00:00:00 2001 From: GreatBigFailure <64218965+GreatBigFailure@users.noreply.github.com> Date: Thu, 30 Sep 2021 00:42:55 -0400 Subject: [PATCH] The Eggcellent Update Part 2 (#30837) * I'm unreasonably excited about this change * Woopsy * That was not on copy paste and 30 characters Co-authored-by: Rubylips --- __DEFINES/setup.dm | 1 + code/game/machinery/ammolathe.dm | 3 +-- code/game/machinery/autolathe.dm | 2 +- code/game/machinery/cryo.dm | 9 +------ code/game/machinery/machinery.dm | 26 ++++++++++++++++--- code/game/machinery/medal_printer.dm | 4 +-- code/modules/hydroponics/eggincubator.dm | 21 ++++++++++----- code/modules/medical/cloning.dm | 12 +-------- code/modules/medical/patientprocessor.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 2 +- code/modules/research/circuitprinter.dm | 4 +-- code/modules/research/fabricators.dm | 2 +- .../research/mechanic/mechanic_fabs.dm | 2 +- code/modules/research/protolathe.dm | 2 +- code/modules/research/rdmachines.dm | 23 ++++------------ code/modules/spacepods/pod_fabricator.dm | 4 +-- 16 files changed, 59 insertions(+), 60 deletions(-) diff --git a/__DEFINES/setup.dm b/__DEFINES/setup.dm index 2840b4cee4f..218c15ef925 100644 --- a/__DEFINES/setup.dm +++ b/__DEFINES/setup.dm @@ -1147,6 +1147,7 @@ var/default_colour_matrix = list(1,0,0,0,\ #define WIREJACK 512 //can we wirejack it? if flagged, machine calls wirejack() #define SHUTTLEWRENCH 1024 //if this flag exists, the computer can be wrenched on shuttle floors #define SECUREDPANEL 2048 //it won't let you open the deconstruction panel if you don't have the linked account number. Originally used for custom vending machines +#define MULTIOUTPUT 4096 //Let's you set the output location with a multitool #define MAX_N_OF_ITEMS 999 // Used for certain storage machinery, BYOND infinite loop detector doesn't look things over 1000. diff --git a/code/game/machinery/ammolathe.dm b/code/game/machinery/ammolathe.dm index b9d67c89c18..d16451d0be9 100644 --- a/code/game/machinery/ammolathe.dm +++ b/code/game/machinery/ammolathe.dm @@ -14,7 +14,7 @@ allowed_materials = 0 //A 0 or FALSE Allows all materials. light_color = LIGHT_COLOR_RED - machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK //| EMAGGABLE + machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK | MULTIOUTPUT //| EMAGGABLE research_flags = NANOTOUCH | TAKESMATIN | HASOUTPUT | IGNORE_CHEMS | HASMAT_OVER | LOCKBOXES | FAB_RECYCLER one_part_set_only = 0 @@ -98,4 +98,3 @@ RefreshParts() - \ No newline at end of file diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 74ae33af794..d061ac47ef9 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -27,7 +27,7 @@ MAT_GLASS ) - machine_flags = SCREWTOGGLE | CROWDESTROY | EMAGGABLE | WRENCHMOVE | FIXED2WORK + machine_flags = SCREWTOGGLE | CROWDESTROY | EMAGGABLE | WRENCHMOVE | FIXED2WORK | MULTIOUTPUT research_flags = NANOTOUCH | TAKESMATIN | HASOUTPUT | IGNORE_CHEMS | HASMAT_OVER | FAB_RECYCLER diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 888a89843d8..fcc83106537 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -27,9 +27,7 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj var/current_heat_capacity = 50 var/running_bob_animation = 0 // This is used to prevent threads from building up if update_icons is called multiple times - var/output_dir //Which direction to try to place our patients onto, should they eject naturally. - - machine_flags = SCREWTOGGLE | CROWDESTROY + machine_flags = SCREWTOGGLE | CROWDESTROY | MULTIOUTPUT light_color = LIGHT_COLOR_HALOGEN light_range_on = 1 @@ -334,11 +332,6 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") investigation_log(I_CHEMS, "was loaded with \a [G] by [key_name(user)], containing [G.reagents.get_reagent_ids(1)]") update_icon() - - if(G.is_multitool(user) && Adjacent(user)) - output_dir = get_dir(src, user) - to_chat(user, "[bicon(src)]Output location set.") - return if(G.is_wrench(user))//FUCK YOU PARENT, YOU AREN'T MY REAL DAD return if(G.is_screwdriver(user)) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 49cc7819336..addd7aa81d1 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -136,6 +136,7 @@ Class Procs: var/custom_aghost_alerts=0 var/panel_open = 0 var/state = 0 //0 is unanchored, 1 is anchored and unwelded, 2 is anchored and welded for most things + var/output_dir = 0 //Direction used to output to (for things like fabs), set to 0 for loc. var/obj/item/weapon/cell/connected_cell = null //The battery connected to this machine var/battery_dependent = 0 //Requires a battery to run @@ -626,9 +627,14 @@ Class Procs: else return -1 - if(O.is_multitool(user) && machine_flags & MULTITOOL_MENU) - update_multitool_menu(user) - return 1 + if(O.is_multitool(user)) + if(!panel_open && machine_flags & MULTIOUTPUT) + setOutputLocation(user) + return 1 + if(machine_flags & MULTITOOL_MENU) + update_multitool_menu(user) + return 1 + if(!anchored && machine_flags & FIXED2WORK) return to_chat(user, "\The [src] must be anchored first!") @@ -774,3 +780,17 @@ Class Procs: /obj/machinery/proc/is_operational() return !(stat & (NOPOWER|BROKEN|MAINT)) + + +/obj/machinery/proc/setOutputLocation(user) + var/result = input("Set your location as output?") in list("Yes","No","Machine Location") + switch(result) + if("Yes") + if(!Adjacent(user)) + to_chat(user, "Cannot set this as the output location; You're not adjacent to it!") + return 1 + output_dir = get_dir(src, user) + to_chat(user, "Output set.") + if("Machine Location") + output_dir = 0 + to_chat(user, "Output set.") diff --git a/code/game/machinery/medal_printer.dm b/code/game/machinery/medal_printer.dm index 9143c540bd7..625e9e1a81c 100644 --- a/code/game/machinery/medal_printer.dm +++ b/code/game/machinery/medal_printer.dm @@ -5,7 +5,7 @@ icon_state = "medalprinter" icon_state_open = "medalprinter_t" nano_file = "medalprinter.tmpl" - machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK | EMAGGABLE + machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK | EMAGGABLE | MULTIOUTPUT research_flags = NANOTOUCH | TAKESMATIN | HASOUTPUT | IGNORE_CHEMS | HASMAT_OVER | ACCESS_EMAG req_access = list(access_hop) @@ -61,4 +61,4 @@ if((loc == user && user.isUnconscious())) O.name = "medal" add_fingerprint(user) - ..() \ No newline at end of file + ..() diff --git a/code/modules/hydroponics/eggincubator.dm b/code/modules/hydroponics/eggincubator.dm index bba04a83fe6..6acdf004b5c 100644 --- a/code/modules/hydroponics/eggincubator.dm +++ b/code/modules/hydroponics/eggincubator.dm @@ -7,7 +7,7 @@ use_power = 1 idle_power_usage = 10 active_power_usage = 500 - machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | EJECTNOTDEL + machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | EJECTNOTDEL | MULTIOUTPUT flags = OPENCONTAINER | NOREACT pass_flags = PASSTABLE var/input_path = /obj/item/weapon/reagent_containers/food/snacks/egg @@ -15,6 +15,7 @@ var/speed_bonus = 0 var/circuitpath = /obj/item/weapon/circuitboard/egg_incubator var/active_state = "incubator_old_on" + output_dir = 0 /obj/machinery/egg_incubator/New() . = ..() @@ -48,10 +49,10 @@ /obj/machinery/egg_incubator/attackby(var/obj/item/O as obj, var/mob/user as mob) if(..()) return 1 - if(contents.len >= limit) - to_chat(user, "\The [src] has no more space!") - return 1 - if (istype(O,input_path)) + if(istype(O,input_path)) + if(contents.len >= limit) + to_chat(user, "\The [src] has no more space!") + return 1 if(animal_count[/mob/living/simple_animal/chicken] >= ANIMAL_CHILD_CAP) to_chat(user, "You get the feeling there are enough of those already.") return 1 @@ -123,10 +124,16 @@ /obj/machinery/egg_incubator/proc/eject(var/obj/E) if(E.loc != src) return //You can't eject it if it's not here. - E.forceMove(get_turf(src)) + E.forceMove(get_step(get_turf(src), output_dir)) src.updateUsrDialog() visible_message("\The [E] is released from \the [src].") +/obj/machinery/egg_incubator/conveyor_act(var/atom/movable/AM, var/obj/machinery/conveyor/CB) + if(istype(AM, input_path)) + if(contents.len >= limit || animal_count[/mob/living/simple_animal/chicken] >= ANIMAL_CHILD_CAP) + return + AM.forceMove(src) + /obj/machinery/egg_incubator/box_cloner name = "box flesh cloner" desc = "The spasmodically squirming, braying, and snorting half-corpses were heaped each upon the other, until at least I was rid of them. The station had become a landfill of snout and hoof, gristle and bone - a mountainous, twitching mass of misshapen flesh, fusing itself together in the darkness." @@ -150,3 +157,5 @@ /obj/machinery/egg_incubator/box_cloner/getProgress(var/obj/item/weapon/reagent_containers/food/snacks/meat/box/B) if(istype(B)) return B.amount_cloned + + diff --git a/code/modules/medical/cloning.dm b/code/modules/medical/cloning.dm index b93bfa06bc0..e5eab1710a3 100644 --- a/code/modules/medical/cloning.dm +++ b/code/modules/medical/cloning.dm @@ -28,10 +28,9 @@ id_tag = "clone_pod" var/upgraded = 0 //if fully upgraded with T4 components, it will drastically improve and allow for some stuff var/obj/machinery/computer/cloning/cloning_computer = null - var/output_dir //Which direction to try to place our patients onto, should they eject naturally. - machine_flags = EMAGGABLE | SCREWTOGGLE | CROWDESTROY | MULTITOOL_MENU + machine_flags = EMAGGABLE | SCREWTOGGLE | CROWDESTROY | MULTITOOL_MENU | MULTIOUTPUT light_color = LIGHT_COLOR_CYAN use_auto_lights = 1 @@ -579,15 +578,6 @@ return loc return T -/obj/machinery/cloning/clonepod/Topic(href,href_list) - if(..()) - return - if(href_list["set_output_dir"]) - if(!Adjacent(usr)) - to_chat(usr, "Cannot set output location: Out of range.") - return 1 - output_dir = get_dir(src, usr) - to_chat(usr, "[bicon(src)]Output location set.") /* * Diskette Box diff --git a/code/modules/medical/patientprocessor.dm b/code/modules/medical/patientprocessor.dm index 7640620a069..0d9ae47dc05 100644 --- a/code/modules/medical/patientprocessor.dm +++ b/code/modules/medical/patientprocessor.dm @@ -6,7 +6,7 @@ density = 1 anchored = 1 var/input_dir = 1 - var/output_dir = 2 + output_dir = 2 /obj/machinery/patient_processor/proc/notify_ghost(var/mob/M) if(!M.client) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index c556dd9aabc..d6865442fb6 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -259,8 +259,8 @@ var/atom/movable/mover //Virtual atom used to check passing ability on the out turf. + output_dir = WEST var/input_dir = EAST - var/output_dir = WEST var/filter_dir = SOUTH var/max_items_moved = 100 diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index d92f7dc19ba..f4a1ada9d4f 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -17,7 +17,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). build_time = IMPRINTER_BUILD_TIME build_number = 1 - research_flags = HASOUTPUT | TAKESMATIN | CONSOLECONTROL | LOCKBOXES + research_flags = HASOUTPUT | TAKESMATIN | CONSOLECONTROL | LOCKBOXES | MULTIOUTPUT // Don't log reagent transfers. They're just spammy. log_reagents = 0 @@ -113,4 +113,4 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). /obj/machinery/r_n_d/fabricator/circuit_imprinter/suicide_act(var/mob/living/user) to_chat(viewers(user), "[user] is placing \his mouth underneath the imprinter nozzle and turning the machine on! It looks like \he's trying to commit suicide.") - return(SUICIDE_ACT_BRUTELOSS) \ No newline at end of file + return(SUICIDE_ACT_BRUTELOSS) diff --git a/code/modules/research/fabricators.dm b/code/modules/research/fabricators.dm index d9a5c0b02ba..2d244a08c47 100644 --- a/code/modules/research/fabricators.dm +++ b/code/modules/research/fabricators.dm @@ -35,7 +35,7 @@ var/min_cap_T = 0.1 //The minimum cap used to how much time coeff can be improved var/fabricator_cooldown = 2 //In deciseconds, the delay between each item starting to be built - machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK | EMAGGABLE + machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK | EMAGGABLE | MULTIOUTPUT research_flags = TAKESMATIN | HASOUTPUT | HASMAT_OVER | NANOTOUCH /obj/machinery/r_n_d/fabricator/New() diff --git a/code/modules/research/mechanic/mechanic_fabs.dm b/code/modules/research/mechanic/mechanic_fabs.dm index 3ae05f98ffb..d1bfcb1e7ec 100644 --- a/code/modules/research/mechanic/mechanic_fabs.dm +++ b/code/modules/research/mechanic/mechanic_fabs.dm @@ -13,7 +13,7 @@ icon_state = "genfab" max_material_storage = GEN_FAB_BASESTORAGE nano_file = "genfab.tmpl" - var/list/design_types = GENFAB | IMPRINTER | PROTOLATHE | AUTOLATHE | MECHFAB | PODFAB + var/list/design_types = GENFAB | IMPRINTER | PROTOLATHE | AUTOLATHE | MECHFAB | PODFAB | MULTIOUTPUT var/removable_designs = 1 var/plastic_added = 1 //if plastic costs are added for designs - the autolathe doesn't have this diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 01ed2520b63..000f6645329 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -20,7 +20,7 @@ it creates. All the menus and other manipulation commands are in the R&D console light_color = LIGHT_COLOR_CYAN - research_flags = CONSOLECONTROL | HASOUTPUT | TAKESMATIN | HASMAT_OVER | LOCKBOXES + research_flags = CONSOLECONTROL | HASOUTPUT | TAKESMATIN | HASMAT_OVER | LOCKBOXES | MULTIOUTPUT part_sets = list( "Stock Parts" = list(), diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 6cd73ad6e73..afcc64f1b33 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -14,7 +14,6 @@ var/global/list/rnd_machines = list() var/disabled = 0 var/shocked = 0 var/obj/machinery/computer/rdconsole/linked_console - var/output_dir = 0 // Direction used to output to (for things like fabs), set to 0 for loc. var/stopped = 0 var/base_state = "" var/build_time = 0 @@ -138,6 +137,10 @@ var/global/list/rnd_machines = list() return TRUE return FALSE +/obj/machinery/r_n_d/setOutputLocation(user) + if(research_flags &HASOUTPUT) + ..() + /obj/machinery/r_n_d/attackby(var/obj/item/O as obj, var/mob/user as mob) if (shocked) shock(user,50, O.siemens_coefficient) @@ -153,22 +156,6 @@ var/global/list/rnd_machines = list() return 1 if (disabled) return 1 - if (istype(O, /obj/item/device/multitool)) - if(!panel_open && research_flags &HASOUTPUT) - var/result = input("Set your location as output?") in list("Yes","No","Machine Location") - switch(result) - if("Yes") - if(!Adjacent(user)) - to_chat(user, "Cannot set this as the output location; You're not adjacent to it!") - return 1 - - output_dir = get_dir(src, user) - to_chat(user, "Output set.") - if("Machine Location") - output_dir = 0 - to_chat(user, "Output set.") - return 1 - return if (!linked_console && !(istype(src, /obj/machinery/r_n_d/fabricator))) //fabricators get a free pass because they aren't tied to a console to_chat(user, "\The [src] must be linked to an R&D console first!") return 1 @@ -257,4 +244,4 @@ var/global/list/rnd_machines = list() if(!.) return loc // Map edge I guess. -#undef ANIM_LENGTH \ No newline at end of file +#undef ANIM_LENGTH diff --git a/code/modules/spacepods/pod_fabricator.dm b/code/modules/spacepods/pod_fabricator.dm index 81f543ec3d9..12cd5ae95f1 100644 --- a/code/modules/spacepods/pod_fabricator.dm +++ b/code/modules/spacepods/pod_fabricator.dm @@ -10,7 +10,7 @@ build_number = PODFAB build_time = 1 nano_file = "podfab.tmpl" - research_flags = NANOTOUCH | HASOUTPUT | HASMAT_OVER | TAKESMATIN | ACCESS_EMAG | LOCKBOXES + research_flags = NANOTOUCH | HASOUTPUT | HASMAT_OVER | TAKESMATIN | ACCESS_EMAG | LOCKBOXES | MULTIOUTPUT part_sets = list( //set names must be unique "Pod_Frame" = list( @@ -48,4 +48,4 @@ /obj/item/weapon/stock_parts/micro_laser ) - RefreshParts() \ No newline at end of file + RefreshParts()