From 2db00c7dc5ce04d89457d2e608233ae4dbfb453d Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Mon, 4 Apr 2022 15:44:14 -0400 Subject: [PATCH] standardizes default unfasten wrench (#65425) I'll do more in the future but I'll limit myself to this because I'm tired, bored, and don't want to make so many PRs touching the same things that I have to deal with conflicts each time one is merged. Just as an example, screwdriver's gotta be done as well, does the exact same thing wrenches do, I believe. Standardizes (and touches) each time default_unfasten_wrench is used. Fixes tool logs, since it relies on tool acts to exist, I'm trying to move as many tool acts to its proper proc. Like a spiritual successor to the tool superpack PRs. Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/game/machinery/PDApainter.dm | 10 +-- code/game/machinery/accounting.dm | 11 +++- code/game/machinery/cell_charger.dm | 10 ++- code/game/machinery/dish_drive.dm | 7 +- code/game/machinery/hologram.dm | 8 ++- code/game/machinery/iv_drip.dm | 8 +-- code/game/machinery/medical_kiosk.dm | 6 +- code/game/machinery/medipen_refiller.dm | 8 +-- code/game/machinery/pipe/pipe_dispenser.dm | 30 ++++----- code/game/machinery/recycler.dm | 7 +- code/game/machinery/sheetifier.dm | 7 +- code/game/machinery/shieldgen.dm | 4 +- code/game/machinery/spaceheater.dm | 10 +-- code/game/machinery/washing_machine.dm | 10 ++- code/game/objects/structures/ai_core.dm | 7 +- code/game/objects/structures/bedsheet_bin.dm | 4 +- .../game/objects/structures/cannons/cannon.dm | 10 ++- code/game/objects/structures/guillotine.dm | 66 ++++++++++--------- code/game/objects/structures/loom.dm | 8 +-- code/game/objects/structures/mineral_doors.dm | 8 +-- code/game/objects/structures/showcase.dm | 6 +- .../game/objects/structures/tank_dispenser.dm | 8 ++- code/game/objects/structures/votingbox.dm | 6 +- code/game/objects/structures/watercloset.dm | 6 +- code/game/shuttle_engines.dm | 8 +-- code/modules/aquarium/aquarium.dm | 7 +- code/modules/art/statues.dm | 9 ++- .../components/electrolyzer/electrolyzer.dm | 7 +- .../atmospherics/machinery/components/tank.dm | 3 +- .../machinery/portable/scrubber.dm | 10 +-- code/modules/explorer_drone/scanner_array.dm | 8 +-- .../kitchen_machinery/deep_fryer.dm | 33 +++++----- .../kitchen_machinery/gibber.dm | 8 ++- .../kitchen_machinery/griddle.dm | 8 +-- .../kitchen_machinery/microwave.dm | 10 ++- .../kitchen_machinery/monkeyrecycler.dm | 10 +-- .../food_and_drinks/kitchen_machinery/oven.dm | 9 ++- .../kitchen_machinery/processor.dm | 8 ++- .../kitchen_machinery/smartfridge.dm | 10 +-- code/modules/hydroponics/beekeeping/beebox.dm | 8 +-- code/modules/hydroponics/hydroponics.dm | 8 ++- code/modules/hydroponics/seed_extractor.dm | 8 ++- code/modules/instruments/stationary.dm | 7 +- code/modules/library/lib_machines.dm | 7 +- code/modules/mining/machine_redemption.dm | 7 +- code/modules/paperwork/photocopier.dm | 10 +-- .../plumbing/plumbers/_plumb_machinery.dm | 8 +-- code/modules/power/floodlight.dm | 17 +++-- code/modules/power/singularity/emitter.dm | 6 +- .../power/singularity/field_generator.dm | 8 +-- .../supermatter/supermatter_hit_procs.dm | 6 +- code/modules/power/tesla/coil.dm | 16 +++-- .../chemistry/machinery/chem_dispenser.dm | 7 +- .../chemistry/machinery/chem_mass_spec.dm | 9 +-- .../chemistry/machinery/chem_master.dm | 7 +- .../chemistry/machinery/reagentgrinder.dm | 8 ++- .../chemistry/machinery/smoke_machine.dm | 10 ++- code/modules/reagents/reagent_dispenser.dm | 8 +-- .../research/anomaly/anomaly_refinery.dm | 12 ++-- .../research/ordnance/doppler_array.dm | 9 ++- code/modules/station_goals/bsa.dm | 8 +-- code/modules/vending/_vending.dm | 12 ++-- 62 files changed, 361 insertions(+), 258 deletions(-) diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index 694adfb9467..12fb35f4e56 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -103,6 +103,12 @@ stored_id_card = null update_appearance(UPDATE_ICON) +/obj/machinery/pdapainter/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(default_unfasten_wrench(user, tool)) + power_change() + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/pdapainter/attackby(obj/item/O, mob/living/user, params) if(machine_stat & BROKEN) if(O.tool_behaviour == TOOL_WELDER && !user.combat_mode) @@ -121,10 +127,6 @@ return return ..() - if(default_unfasten_wrench(user, O)) - power_change() - return - // Chameleon checks first so they can exit the logic early if they're detected. if(istype(O, /obj/item/card/id/advanced/chameleon)) to_chat(user, span_warning("The machine rejects your [O]. This ID card does not appear to be compatible with the PDA Painter.")) diff --git a/code/game/machinery/accounting.dm b/code/game/machinery/accounting.dm index ac8468723c8..55021f3338b 100644 --- a/code/game/machinery/accounting.dm +++ b/code/game/machinery/accounting.dm @@ -13,6 +13,14 @@ remove_card() return ..() +/obj/machinery/accounting/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(inserted_id) + return FALSE + if(default_unfasten_wrench(user, tool)) + update_appearance() + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/accounting/attackby(obj/item/I, mob/living/user, params) if(isidcard(I)) var/obj/item/card/id/new_id = I @@ -42,9 +50,6 @@ if(!inserted_id && default_deconstruction_screwdriver(user, icon_state, icon_state, I)) update_appearance() return - if(!inserted_id && default_unfasten_wrench(user, I)) - update_appearance() - return if(default_deconstruction_crowbar(I)) return diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 92ead3724eb..805e2aea792 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -36,6 +36,14 @@ if(in_range(user, src) || isobserver(user)) . += span_notice("The status display reads: Charging power: [charge_rate]W.") +/obj/machinery/cell_charger/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(charging) + return FALSE + if(default_unfasten_wrench(user, tool)) + update_appearance() + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/cell_charger/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stock_parts/cell) && !panel_open) if(machine_stat & BROKEN) @@ -65,8 +73,6 @@ return if(default_deconstruction_crowbar(W)) return - if(!charging && default_unfasten_wrench(user, W)) - return return ..() /obj/machinery/cell_charger/deconstruct() diff --git a/code/game/machinery/dish_drive.dm b/code/game/machinery/dish_drive.dm index a3daa5ac3ab..afa533d6be2 100644 --- a/code/game/machinery/dish_drive.dm +++ b/code/game/machinery/dish_drive.dm @@ -47,6 +47,11 @@ playsound(src, 'sound/items/pshoom.ogg', 50, TRUE) flick("synthesizer_beam", src) +/obj/machinery/dish_drive/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/dish_drive/attackby(obj/item/I, mob/living/user, params) if(is_type_in_list(I, collectable_items) && !user.combat_mode) if(!user.transferItemToLoc(I, src)) @@ -58,8 +63,6 @@ return else if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) return - else if(default_unfasten_wrench(user, I)) - return else if(default_deconstruction_crowbar(I, FALSE)) return ..() diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 2b6c797a87e..e763a9cd870 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -208,6 +208,11 @@ Possible to do for anyone motivated enough: else if(in_range(user, src) || isobserver(user)) . += span_notice("The status display reads: Current projection range: [holo_range] units.") +/obj/machinery/holopad/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/holopad/attackby(obj/item/P, mob/user, params) if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P)) return @@ -215,9 +220,6 @@ Possible to do for anyone motivated enough: if(default_pry_open(P)) return - if(default_unfasten_wrench(user, P)) - return - if(default_deconstruction_crowbar(P)) return diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 56649dd3efd..6c0dc124a74 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -343,10 +343,10 @@ AddComponent(/datum/component/plumbing/iv_drip, anchored) AddComponent(/datum/component/simple_rotation) -/obj/machinery/iv_drip/plumbing/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I) - return TRUE +/obj/machinery/iv_drip/plumbing/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS #undef IV_TAKING #undef IV_INJECTING diff --git a/code/game/machinery/medical_kiosk.dm b/code/game/machinery/medical_kiosk.dm index cd8c63175ad..b1db20259ca 100644 --- a/code/game/machinery/medical_kiosk.dm +++ b/code/game/machinery/medical_kiosk.dm @@ -85,10 +85,10 @@ icon_state = "[base_icon_state][scan_active ? "_active" : null]" return ..() -/obj/machinery/medical_kiosk/wrench_act(mob/living/user, obj/item/I) //Allows for wrenching/unwrenching the machine. +/obj/machinery/medical_kiosk/wrench_act(mob/living/user, obj/item/tool) //Allows for wrenching/unwrenching the machine. ..() - default_unfasten_wrench(user, I, time = 10) - return TRUE + default_unfasten_wrench(user, tool, time = 0.1 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/medical_kiosk/RefreshParts() var/obj/item/circuitboard/machine/medical_kiosk/board = circuit diff --git a/code/game/machinery/medipen_refiller.dm b/code/game/machinery/medipen_refiller.dm index c1fc9f1ebf9..ad319824297 100644 --- a/code/game/machinery/medipen_refiller.dm +++ b/code/game/machinery/medipen_refiller.dm @@ -72,10 +72,10 @@ reagents.expose(get_turf(src), TOUCH) reagents.clear_reagents() -/obj/machinery/medipen_refiller/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I) - return TRUE +/obj/machinery/medipen_refiller/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/medipen_refiller/crowbar_act(mob/user, obj/item/I) ..() diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index d0460ebadde..6d4a2c58b5f 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -66,7 +66,7 @@ switch(action) if("color") paint_color = params["paint_color"] - + if("pipe_type") switch(category) if(ATMOS_PIPEDISPENSER) @@ -74,17 +74,17 @@ var/datum/pipe_info/info = GLOB.atmos_pipe_recipes[params["category"]][params["pipe_type"]] var/recipe_type = info.type var/p_type = info.id - + // No spawning arbitrary paths (literally 1984) if(!verify_recipe(GLOB.atmos_pipe_recipes, p_type)) return - + // If this is a meter, make that. if(recipe_type == /datum/pipe_info/meter) new /obj/item/pipe_meter(loc) wait = world.time + 1 SECONDS return - + // Otherwise, make a pipe/device var/p_dir = params["pipe_dir"] var/obj/item/pipe/pipe_out = new (loc, p_type, p_dir) @@ -98,17 +98,17 @@ if(wait < world.time) var/datum/pipe_info/info = GLOB.disposal_pipe_recipes[params["category"]][params["pipe_type"]] var/p_type = info.id - + // No spawning arbitrary paths (literally 1984) if(!verify_recipe(GLOB.disposal_pipe_recipes, p_type)) return - + var/obj/structure/disposalconstruct/disposal_out = new (loc, p_type) if(!disposal_out.can_place()) to_chat(usr, span_warning("There's not enough room to build that here!")) qdel(disposal_out) return - + disposal_out.add_fingerprint(usr) disposal_out.update_appearance() disposal_out.setDir(params["pipe_dir"]) @@ -117,11 +117,11 @@ if(wait < world.time) var/datum/pipe_info/info = GLOB.transit_tube_recipes[params["category"]][params["pipe_type"]] var/p_type = info.id - + // No spawning arbitrary paths (literally 1984) if(!verify_recipe(GLOB.transit_tube_recipes, p_type)) return - + var/obj/structure/c_transit_tube/tube_out = new p_type(loc) tube_out.add_fingerprint(usr) tube_out.update_appearance() @@ -129,7 +129,7 @@ wait = world.time + 1 SECONDS if("piping_layer") piping_layer = text2num(params["piping_layer"]) - + if("init_dir_setting") var/target_dir = p_init_dir ^ text2dir(params["dir_flag"]) // Refuse to create a smart pipe that can only connect in one direction (it would act weirdly and lack an icon) @@ -137,10 +137,10 @@ p_init_dir = target_dir else to_chat(usr, span_warning("\The [src]'s screen flashes a warning: Can't configure a pipe to only connect in one direction.")) - + if("init_reset") p_init_dir = ALL_CARDINALS - + return TRUE /obj/machinery/pipedispenser/ui_interact(mob/user, datum/tgui/ui) @@ -167,9 +167,9 @@ return TRUE return FALSE -/obj/machinery/pipedispenser/wrench_act(mob/living/user, obj/item/I) - ..() - if(default_unfasten_wrench(user, I, 40)) +/obj/machinery/pipedispenser/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(default_unfasten_wrench(user, tool, time = 4 SECONDS)) user << browse(null, "window=pipedispenser") return TRUE diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 7a99ee46ca5..fd6da3c9c63 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -68,6 +68,10 @@ The safety-mode light is [safety_mode ? "on" : "off"]. The safety-sensors status light is [obj_flags & EMAGGED ? "off" : "on"]."} +/obj/machinery/recycler/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/recycler/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) @@ -76,9 +80,6 @@ if(default_pry_open(I)) return - if(default_unfasten_wrench(user, I)) - return - if(default_deconstruction_crowbar(I)) return return ..() diff --git a/code/game/machinery/sheetifier.dm b/code/game/machinery/sheetifier.dm index 3057643983d..f08fb476e6e 100644 --- a/code/game/machinery/sheetifier.dm +++ b/code/game/machinery/sheetifier.dm @@ -45,9 +45,12 @@ var/datum/component/material_container/materials = GetComponent(/datum/component/material_container) materials.retrieve_all() //Returns all as sheets +/obj/machinery/sheetifier/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/sheetifier/attackby(obj/item/I, mob/user, params) - if(default_unfasten_wrench(user, I)) - return if(default_deconstruction_screwdriver(user, initial(icon_state), initial(icon_state), I)) update_appearance() return diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index f49b0e25241..17fc788ca5e 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -393,9 +393,9 @@ return ..() -/obj/machinery/power/shieldwallgen/wrench_act(mob/living/user, obj/item/I) +/obj/machinery/power/shieldwallgen/wrench_act(mob/living/user, obj/item/tool) . = ..() - . |= default_unfasten_wrench(user, I, 0) + . |= default_unfasten_wrench(user, tool, time = 0) var/turf/T = get_turf(src) update_cable_icons_on_turf(T) if(. == SUCCESSFUL_UNFASTEN && anchored) diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index c49d8679cf8..7233be61c25 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -152,6 +152,11 @@ if(cell) cell.emp_act(severity) +/obj/machinery/space_heater/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/space_heater/attackby(obj/item/I, mob/user, params) add_fingerprint(user) @@ -160,9 +165,6 @@ update_appearance() return TRUE - if(default_unfasten_wrench(user, I)) - return TRUE - if(default_deconstruction_crowbar(I)) return TRUE @@ -337,8 +339,6 @@ ///Slightly modified to ignore the open_hatch - it's always open, we hacked it. /obj/machinery/space_heater/improvised_chem_heater/attackby(obj/item/item, mob/user, params) add_fingerprint(user) - if(default_unfasten_wrench(user, item)) - return if(default_deconstruction_crowbar(item)) return if(istype(item, /obj/item/stock_parts/cell)) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 1115da8f929..d8d65133335 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -329,10 +329,14 @@ GLOBAL_LIST_INIT(dye_registry, list( if(panel_open) . += "wm_panel" -/obj/machinery/washing_machine/attackby(obj/item/W, mob/living/user, params) - if(panel_open && !busy && default_unfasten_wrench(user, W)) - return +/obj/machinery/washing_machine/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(!panel_open || busy) + return FALSE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS +/obj/machinery/washing_machine/attackby(obj/item/W, mob/living/user, params) if(default_deconstruction_screwdriver(user, null, null, W)) update_appearance() return diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 324b5ed8e06..b647537c370 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -95,9 +95,12 @@ return return ..() +/obj/structure/ai_core/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/structure/ai_core/attackby(obj/item/P, mob/user, params) - if(P.tool_behaviour == TOOL_WRENCH) - return default_unfasten_wrench(user, P, 20) if(!anchored) if(P.tool_behaviour == TOOL_WELDER && can_deconstruct) if(state != EMPTY_CORE) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 2306325f3c9..df02c6811c8 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -552,7 +552,9 @@ LINEN BINS return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/bedsheetbin/wrench_act(mob/living/user, obj/item/tool) - return default_unfasten_wrench(user, tool, 5) + . = ..() + default_unfasten_wrench(user, tool, time = 0.5 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/bedsheet)) diff --git a/code/game/objects/structures/cannons/cannon.dm b/code/game/objects/structures/cannons/cannon.dm index 19a82ced61d..6b04ee50f88 100644 --- a/code/game/objects/structures/cannons/cannon.dm +++ b/code/game/objects/structures/cannons/cannon.dm @@ -46,6 +46,13 @@ reagents.remove_all() charge_ignited = FALSE +/obj/structure/cannon/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(!anchorable_cannon) + return FALSE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/structure/cannon/attackby(obj/item/used_item, mob/user, params) if(charge_ignited) balloon_alert(user, "it's gonna fire!") @@ -100,9 +107,6 @@ powder_keg.reagents.trans_id_to(src, /datum/reagent/fuel, amount = charge_size) balloon_alert(user, "[src] loaded with welding fuel") return - if(anchorable_cannon && used_item.tool_behaviour == TOOL_WRENCH) - if(default_unfasten_wrench(user, used_item, time = 2 SECONDS)) - return ..() /obj/structure/cannon/trash diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index 8b799fc4d22..08ab8a00cc8 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -1,16 +1,24 @@ -#define GUILLOTINE_BLADE_MAX_SHARP 10 // This is maxiumum sharpness and will decapitate without failure -#define GUILLOTINE_DECAP_MIN_SHARP 7 // Minimum amount of sharpness for decapitation. Any less and it will just do severe brute damage -#define GUILLOTINE_ANIMATION_LENGTH 9 // How many deciseconds the animation is -#define GUILLOTINE_BLADE_RAISED 1 -#define GUILLOTINE_BLADE_MOVING 2 -#define GUILLOTINE_BLADE_DROPPED 3 +#define GUILLOTINE_BLADE_IDLE 0 +#define GUILLOTINE_BLADE_RAISED 1 +#define GUILLOTINE_BLADE_MOVING 2 +#define GUILLOTINE_BLADE_DROPPED 3 #define GUILLOTINE_BLADE_SHARPENING 4 -#define GUILLOTINE_HEAD_OFFSET 16 // How much we need to move the player to center their head -#define GUILLOTINE_LAYER_DIFF 1.2 // How much to increase/decrease a head when it's buckled/unbuckled -#define GUILLOTINE_ACTIVATE_DELAY 30 // Delay for executing someone -#define GUILLOTINE_WRENCH_DELAY 10 -#define GUILLOTINE_ACTION_INUSE 5 -#define GUILLOTINE_ACTION_WRENCH 6 +#define GUILLOTINE_ACTION_INUSE 5 +#define GUILLOTINE_ACTION_WRENCH 6 + +/// This is maxiumum sharpness and will decapitate without failure +#define GUILLOTINE_BLADE_MAX_SHARP 10 +/// Minimum amount of sharpness for decapitation. Any less and it will just do severe brute damage +#define GUILLOTINE_DECAP_MIN_SHARP 7 +/// How long the guillotine animation lasts +#define GUILLOTINE_ANIMATION_LENGTH (0.9 SECONDS) +/// How much we need to move the player to center their head +#define GUILLOTINE_HEAD_OFFSET 16 +/// How much to increase/decrease a head when it's buckled/unbuckled +#define GUILLOTINE_LAYER_DIFF 1.2 +/// Delay for executing someone +#define GUILLOTINE_ACTIVATE_DELAY (3 SECONDS) +#define GUILLOTINE_WRENCH_DELAY (1 SECONDS) /obj/structure/guillotine name = "guillotine" @@ -28,7 +36,7 @@ var/blade_status = GUILLOTINE_BLADE_RAISED var/blade_sharpness = GUILLOTINE_BLADE_MAX_SHARP // How sharp the blade is var/kill_count = 0 - var/current_action = 0 // What's currently happening to the guillotine + var/current_action = GUILLOTINE_BLADE_IDLE // What's currently happening to the guillotine /obj/structure/guillotine/Initialize(mapload) LAZYINITLIST(buckled_mobs) @@ -90,12 +98,12 @@ current_action = GUILLOTINE_ACTION_INUSE if (do_after(user, GUILLOTINE_ACTIVATE_DELAY, target = src) && blade_status == GUILLOTINE_BLADE_RAISED) - current_action = 0 + current_action = GUILLOTINE_BLADE_IDLE blade_status = GUILLOTINE_BLADE_MOVING icon_state = "guillotine_drop" addtimer(CALLBACK(src, .proc/drop_blade, user), GUILLOTINE_ANIMATION_LENGTH - 2) // Minus two so we play the sound and decap faster else - current_action = 0 + current_action = GUILLOTINE_BLADE_IDLE else var/mob/living/carbon/human/H = buckled_mobs[1] @@ -246,33 +254,29 @@ if (current_action) return FAILED_UNFASTEN + current_action = GUILLOTINE_ACTION_WRENCH return ..() -/obj/structure/guillotine/wrench_act(mob/living/user, obj/item/I) +/obj/structure/guillotine/wrench_act(mob/living/user, obj/item/tool) . = ..() - if (current_action) - return - - current_action = GUILLOTINE_ACTION_WRENCH - - if (do_after(user, GUILLOTINE_WRENCH_DELAY, target = src)) - current_action = 0 - default_unfasten_wrench(user, I, 0) + if(default_unfasten_wrench(user, tool, time = GUILLOTINE_WRENCH_DELAY)) setDir(SOUTH) - return TRUE - else - current_action = 0 + current_action = GUILLOTINE_BLADE_IDLE + return TOOL_ACT_TOOLTYPE_SUCCESS + current_action = GUILLOTINE_BLADE_IDLE + return FALSE #undef GUILLOTINE_BLADE_MAX_SHARP #undef GUILLOTINE_DECAP_MIN_SHARP #undef GUILLOTINE_ANIMATION_LENGTH +#undef GUILLOTINE_HEAD_OFFSET +#undef GUILLOTINE_LAYER_DIFF +#undef GUILLOTINE_ACTIVATE_DELAY + +#undef GUILLOTINE_BLADE_IDLE #undef GUILLOTINE_BLADE_RAISED #undef GUILLOTINE_BLADE_MOVING #undef GUILLOTINE_BLADE_DROPPED #undef GUILLOTINE_BLADE_SHARPENING -#undef GUILLOTINE_HEAD_OFFSET -#undef GUILLOTINE_LAYER_DIFF -#undef GUILLOTINE_ACTIVATE_DELAY #undef GUILLOTINE_WRENCH_DELAY #undef GUILLOTINE_ACTION_INUSE -#undef GUILLOTINE_ACTION_WRENCH diff --git a/code/game/objects/structures/loom.dm b/code/game/objects/structures/loom.dm index 6c63f069401..f7ad19a0b88 100644 --- a/code/game/objects/structures/loom.dm +++ b/code/game/objects/structures/loom.dm @@ -26,10 +26,10 @@ return return ..() -/obj/structure/loom/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 5) - return TRUE +/obj/structure/loom/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 0.5 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS ///Handles the weaving. /obj/structure/loom/proc/weave(obj/item/stack/sheet/cotton/W, mob/user) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index ddfcd176b3f..0f709dcd547 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -146,10 +146,10 @@ set_opacity(anchored ? !door_opened : FALSE) air_update_turf(TRUE, anchorvalue) -/obj/structure/mineral_door/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 40) - return TRUE +/obj/structure/mineral_door/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 4 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /////////////////////// TOOL OVERRIDES /////////////////////// diff --git a/code/game/objects/structures/showcase.dm b/code/game/objects/structures/showcase.dm index 915b390e70d..b586695fc65 100644 --- a/code/game/objects/structures/showcase.dm +++ b/code/game/objects/structures/showcase.dm @@ -130,8 +130,10 @@ return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/showcase/wrench_act(mob/living/user, obj/item/tool) - if(deconstruction_state == SHOWCASE_CONSTRUCTED && default_unfasten_wrench(user, tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + if(deconstruction_state != SHOWCASE_CONSTRUCTED) + return FALSE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS //Feedback is given in examine because showcases can basically have any sprite assigned to them diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index ccc58bdf317..b0f322d3539 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -38,6 +38,11 @@ if(5 to TANK_DISPENSER_CAPACITY) . += "plasma-5" +/obj/structure/tank_dispenser/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/structure/tank_dispenser/attackby(obj/item/I, mob/living/user, params) var/full if(istype(I, /obj/item/tank/internals/plasma)) @@ -50,9 +55,6 @@ oxygentanks++ else full = TRUE - else if(I.tool_behaviour == TOOL_WRENCH) - default_unfasten_wrench(user, I, time = 20) - return else if(!user.combat_mode) to_chat(user, span_notice("[I] does not fit into [src].")) return diff --git a/code/game/objects/structures/votingbox.dm b/code/game/objects/structures/votingbox.dm index 18b07dfcf8e..b8cae390223 100644 --- a/code/game/objects/structures/votingbox.dm +++ b/code/game/objects/structures/votingbox.dm @@ -126,10 +126,10 @@ qdel(P) to_chat(user,span_notice("You shred the current votes.")) -/obj/structure/votebox/wrench_act(mob/living/user, obj/item/I) +/obj/structure/votebox/wrench_act(mob/living/user, obj/item/tool) . = ..() - default_unfasten_wrench(user, I, 40) - return TRUE + default_unfasten_wrench(user, tool, time = 4 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/votebox/crowbar_act(mob/living/user, obj/item/I) . = ..() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index e6902e03e73..a07d82d9ae2 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -677,9 +677,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/urinal, 32) else return ..() -/obj/structure/curtain/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 50) +/obj/structure/curtain/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 5 SECONDS) return TRUE /obj/structure/curtain/wirecutter_act(mob/living/user, obj/item/I) diff --git a/code/game/shuttle_engines.dm b/code/game/shuttle_engines.dm index 345a416850c..eba89bf0bc0 100644 --- a/code/game/shuttle_engines.dm +++ b/code/game/shuttle_engines.dm @@ -36,10 +36,10 @@ else state = ENGINE_UNWRENCHED -/obj/structure/shuttle/engine/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I) - return TRUE +/obj/structure/shuttle/engine/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/shuttle/engine/welder_act(mob/living/user, obj/item/I) . = ..() diff --git a/code/modules/aquarium/aquarium.dm b/code/modules/aquarium/aquarium.dm index 437e7fec9ea..a6fa8ef3ec3 100644 --- a/code/modules/aquarium/aquarium.dm +++ b/code/modules/aquarium/aquarium.dm @@ -106,9 +106,10 @@ panel_open = !panel_open update_appearance() -/obj/structure/aquarium/wrench_act(mob/living/user, obj/item/I) - if(default_unfasten_wrench(user,I)) - return TRUE +/obj/structure/aquarium/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/aquarium/attackby(obj/item/I, mob/living/user, params) if(broken) diff --git a/code/modules/art/statues.dm b/code/modules/art/statues.dm index 421234337f9..d6af8f94b05 100644 --- a/code/modules/art/statues.dm +++ b/code/modules/art/statues.dm @@ -23,11 +23,16 @@ AddElement(/datum/element/beauty, impressiveness * 75) AddComponent(/datum/component/simple_rotation) +/obj/structure/cannon/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(flags_1 & NODECONSTRUCT_1) + return FALSE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/structure/statue/attackby(obj/item/W, mob/living/user, params) add_fingerprint(user) if(!(flags_1 & NODECONSTRUCT_1)) - if(default_unfasten_wrench(user, W)) - return if(W.tool_behaviour == TOOL_WELDER) if(!W.tool_start_check(user, amount=0)) return FALSE diff --git a/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm b/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm index b976296855d..65af7ccd181 100644 --- a/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm +++ b/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm @@ -136,6 +136,11 @@ update_appearance() return TRUE +/obj/machinery/electrolyzer/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/electrolyzer/crowbar_act(mob/living/user, obj/item/tool) return default_deconstruction_crowbar(tool) @@ -148,8 +153,6 @@ /obj/machinery/electrolyzer/attackby(obj/item/I, mob/user, params) add_fingerprint(user) - if(default_unfasten_wrench(user, I)) - return if(istype(I, /obj/item/stock_parts/cell)) if(!panel_open) to_chat(user, span_warning("The hatch must be open to insert a power cell!")) diff --git a/code/modules/atmospherics/machinery/components/tank.dm b/code/modules/atmospherics/machinery/components/tank.dm index 0f99a977625..b133a3a964d 100644 --- a/code/modules/atmospherics/machinery/components/tank.dm +++ b/code/modules/atmospherics/machinery/components/tank.dm @@ -480,7 +480,8 @@ /obj/structure/tank_frame/wrench_act(mob/living/user, obj/item/tool) . = ..() - return default_unfasten_wrench(user, tool, 0.5 SECONDS) + default_unfasten_wrench(user, tool, time = 0.5 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/tank_frame/screwdriver_act_secondary(mob/living/user, obj/item/tool) . = ..() diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 9ebd5a8e764..399a35a083d 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -214,9 +214,11 @@ return ..() -/obj/machinery/portable_atmospherics/scrubber/huge/attackby(obj/item/W, mob/user) - if(default_unfasten_wrench(user, W)) +/obj/machinery/portable_atmospherics/scrubber/huge/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(default_unfasten_wrench(user, tool)) if(!movable) on = FALSE - else - return ..() + return TOOL_ACT_TOOLTYPE_SUCCESS + return FALSE + diff --git a/code/modules/explorer_drone/scanner_array.dm b/code/modules/explorer_drone/scanner_array.dm index afc7607f162..66a272bc688 100644 --- a/code/modules/explorer_drone/scanner_array.dm +++ b/code/modules/explorer_drone/scanner_array.dm @@ -235,10 +235,10 @@ GLOBAL_LIST_INIT(scan_conditions,init_scan_conditions()) else icon_state = "scanner_off" -/obj/machinery/exoscanner/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 10) - return TRUE +/obj/machinery/exoscanner/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 1 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/exoscanner/set_anchored(anchorvalue) . = ..() diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index 22a2094077f..ca13f0a3740 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -60,33 +60,36 @@ GLOBAL_LIST_INIT(oilfry_blacklisted_items, typecacheof(list( if(in_range(user, src) || isobserver(user)) . += span_notice("The status display reads: Frying at [fry_speed*100]% speed.
Using [oil_use] units of oil per second.") -/obj/machinery/deepfryer/attackby(obj/item/I, mob/user) - if(istype(I, /obj/item/reagent_containers/pill)) +/obj/machinery/deepfryer/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + +/obj/machinery/deepfryer/attackby(obj/item/weapon, mob/user, params) + if(istype(weapon, /obj/item/reagent_containers/pill)) if(!reagents.total_volume) - to_chat(user, span_warning("There's nothing to dissolve [I] in!")) + to_chat(user, span_warning("There's nothing to dissolve [weapon] in!")) return - user.visible_message(span_notice("[user] drops [I] into [src]."), span_notice("You dissolve [I] in [src].")) - I.reagents.trans_to(src, I.reagents.total_volume, transfered_by = user) - qdel(I) + user.visible_message(span_notice("[user] drops [weapon] into [src]."), span_notice("You dissolve [weapon] in [src].")) + weapon.reagents.trans_to(src, weapon.reagents.total_volume, transfered_by = user) + qdel(weapon) return if(!reagents.has_reagent(/datum/reagent/consumable/cooking_oil)) to_chat(user, span_warning("[src] has no cooking oil to fry with!")) return - if(I.resistance_flags & INDESTRUCTIBLE) - to_chat(user, span_warning("You don't feel it would be wise to fry [I]...")) + if(weapon.resistance_flags & INDESTRUCTIBLE) + to_chat(user, span_warning("You don't feel it would be wise to fry [weapon]...")) return - if(istype(I, /obj/item/food/deepfryholder)) + if(istype(weapon, /obj/item/food/deepfryholder)) to_chat(user, span_userdanger("Your cooking skills are not up to the legendary Doublefry technique.")) return - if(default_unfasten_wrench(user, I)) - return - else if(default_deconstruction_screwdriver(user, "fryer_off", "fryer_off" ,I)) //where's the open maint panel icon?! + if(default_deconstruction_screwdriver(user, "fryer_off", "fryer_off", weapon)) //where's the open maint panel icon?! return else - if(is_type_in_typecache(I, deepfry_blacklisted_items) || is_type_in_typecache(I, GLOB.oilfry_blacklisted_items) || SEND_SIGNAL(I, COMSIG_CONTAINS_STORAGE) || HAS_TRAIT(I, TRAIT_NODROP) || (I.item_flags & (ABSTRACT | DROPDEL))) + if(is_type_in_typecache(weapon, deepfry_blacklisted_items) || is_type_in_typecache(weapon, GLOB.oilfry_blacklisted_items) || SEND_SIGNAL(weapon, COMSIG_CONTAINS_STORAGE) || HAS_TRAIT(weapon, TRAIT_NODROP) || (weapon.item_flags & (ABSTRACT | DROPDEL))) return ..() - else if(!frying && user.transferItemToLoc(I, src)) - fry(I, user) + else if(!frying && user.transferItemToLoc(weapon, src)) + fry(weapon, user) /obj/machinery/deepfryer/process(delta_time) ..() diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 3ffa4a42384..34b143524cf 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -104,6 +104,11 @@ else startgibbing(user) +/obj/machinery/gibber/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/gibber/attackby(obj/item/P, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P)) return @@ -111,9 +116,6 @@ else if(default_pry_open(P)) return - else if(default_unfasten_wrench(user, P)) - return - else if(default_deconstruction_crowbar(P)) return else diff --git a/code/modules/food_and_drinks/kitchen_machinery/griddle.dm b/code/modules/food_and_drinks/kitchen_machinery/griddle.dm index 9abcd0db196..19fc4f6e5a5 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/griddle.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/griddle.dm @@ -123,10 +123,10 @@ else grill_loop.stop() -/obj/machinery/griddle/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 2 SECONDS) - return TRUE +/obj/machinery/griddle/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 2 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS ///Override to prevent storage dumping onto the griddle until I figure out how to navigate the mess that is storage code to allow me to nicely move the dumped objects onto the griddle. /obj/machinery/griddle/get_dumping_location() diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index 2c19df8da99..7aa66eac327 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -107,6 +107,14 @@ icon_state = "mw" return ..() +/obj/machinery/microwave/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(dirty >= 100) + return FALSE + if(default_unfasten_wrench(user, tool)) + update_appearance() + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/microwave/attackby(obj/item/O, mob/living/user, params) if(operating) return @@ -114,7 +122,7 @@ return if(dirty < 100) - if(default_deconstruction_screwdriver(user, icon_state, icon_state, O) || default_unfasten_wrench(user, O)) + if(default_deconstruction_screwdriver(user, icon_state, icon_state, O)) update_appearance() return diff --git a/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm index 3c6cd46266b..2da23768bbd 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm @@ -40,6 +40,12 @@ GLOBAL_LIST_EMPTY(monkey_recyclers) if(in_range(user, src) || isobserver(user)) . += span_notice("The status display reads: Producing [cube_production] cubes for every monkey inserted.") +/obj/machinery/monkey_recycler/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(default_unfasten_wrench(user, tool)) + power_change() + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/monkey_recycler/attackby(obj/item/O, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", O)) return @@ -47,10 +53,6 @@ GLOBAL_LIST_EMPTY(monkey_recyclers) if(default_pry_open(O)) return - if(default_unfasten_wrench(user, O)) - power_change() - return - if(default_deconstruction_crowbar(O)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/oven.dm b/code/modules/food_and_drinks/kitchen_machinery/oven.dm index 8cc23986ac9..1bec3cdfba6 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/oven.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/oven.dm @@ -172,11 +172,10 @@ if(default_deconstruction_crowbar(I, ignore_panel = TRUE)) return -/obj/machinery/oven/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 2 SECONDS) - return TRUE - +/obj/machinery/oven/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 2 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/item/plate/oven_tray name = "oven tray" diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index f0a380ca965..44be3f45108 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -68,6 +68,11 @@ qdel(what) LAZYREMOVE(processor_contents, what) +/obj/machinery/processor/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/processor/attackby(obj/item/O, mob/living/user, params) if(processing) to_chat(user, span_warning("[src] is in the process of processing!")) @@ -78,9 +83,6 @@ if(default_pry_open(O)) return - if(default_unfasten_wrench(user, O)) - return - if(default_deconstruction_crowbar(O)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index d70140abfb8..8ecf86d9684 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -70,6 +70,12 @@ if(!machine_stat) . += emissive_appearance(icon, "[initial(icon_state)]-light-mask", alpha = src.alpha) +/obj/machinery/smartfridge/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(default_unfasten_wrench(user, tool)) + power_change() + return TOOL_ACT_TOOLTYPE_SUCCESS + /******************* * Item Adding ********************/ @@ -85,10 +91,6 @@ if(default_pry_open(O)) return - if(default_unfasten_wrench(user, O)) - power_change() - return - if(default_deconstruction_crowbar(O)) SStgui.update_uis(src) return diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 89988c1733f..11fea29e044 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -143,6 +143,10 @@ if(honeycombs.len >= get_max_honeycomb()) . += span_warning("There's no room for more honeycomb!") +/obj/structure/beebox/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/beebox/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/honey_frame)) @@ -156,10 +160,6 @@ to_chat(user, span_warning("There's no room for any more frames in the apiary!")) return - if(I.tool_behaviour == TOOL_WRENCH) - if(default_unfasten_wrench(user, I, time = 20)) - return - if(istype(I, /obj/item/queen_bee)) if(queen_bee) to_chat(user, span_warning("This hive already has a queen!")) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 9b56c72a772..91a1eba21fc 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -719,6 +719,11 @@ else if(myseed) visible_message(span_warning("The pests seem to behave oddly in [myseed.name] tray, but quickly settle down...")) +/obj/machinery/hydroponics/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) //Called when mob user "attacks" it with object O if(IS_EDIBLE(O) || istype(O, /obj/item/reagent_containers)) // Syringe stuff (and other reagent containers now too) @@ -873,9 +878,6 @@ SEND_SIGNAL(O, COMSIG_TRY_STORAGE_INSERT, G, user, TRUE) return - else if(default_unfasten_wrench(user, O)) - return - else if(istype(O, /obj/item/shovel/spade)) if(!myseed && !weedlevel) to_chat(user, span_warning("[src] doesn't have any plants or weeds!")) diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index 7640bac889c..4d37dd64273 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -99,6 +99,11 @@ if(in_range(user, src) || isobserver(user)) . += span_notice("The status display reads: Extracting [seed_multiplier] to [seed_multiplier * 4] seed(s) per piece of produce.
Machine can store up to [max_seeds] seeds.") +/obj/machinery/seed_extractor/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/seed_extractor/attackby(obj/item/O, mob/living/user, params) if(default_deconstruction_screwdriver(user, "sextractor_open", "sextractor", O)) @@ -107,9 +112,6 @@ if(default_pry_open(O)) return - if(default_unfasten_wrench(user, O)) - return - if(default_deconstruction_crowbar(O)) return diff --git a/code/modules/instruments/stationary.dm b/code/modules/instruments/stationary.dm index 97fe44d1dfd..8245ed03f00 100644 --- a/code/modules/instruments/stationary.dm +++ b/code/modules/instruments/stationary.dm @@ -26,9 +26,10 @@ . = ..() song.ui_interact(user) -/obj/structure/musician/wrench_act(mob/living/user, obj/item/I) - default_unfasten_wrench(user, I, 40) - return TRUE +/obj/structure/musician/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 4 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/musician/piano name = "space minimoog" diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 2cd49360b1c..fdaa882f406 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -769,12 +769,15 @@ density = TRUE var/busy = FALSE +/obj/machinery/bookbinder/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/bookbinder/attackby(obj/hitby, mob/user, params) if(istype(hitby, /obj/item/paper)) prebind_book(user, hitby) return - if(default_unfasten_wrench(user, hitby)) - return TRUE return ..() /obj/machinery/bookbinder/proc/prebind_book(mob/user, obj/item/paper/draw_from) diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index d65b201acf0..7e62c6dc6f9 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -160,9 +160,12 @@ else unregister_input_turf() // someone just un-wrenched us, unregister the turf +/obj/machinery/mineral/ore_redemption/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/mineral/ore_redemption/attackby(obj/item/W, mob/user, params) - if(default_unfasten_wrench(user, W)) - return if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W)) updateUsrDialog() return diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 53ea759c025..94996795a20 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -359,11 +359,13 @@ object.forceMove(drop_location()) to_chat(user, span_notice("You take [object] out of [src]. [busy ? "The [src] comes to a halt." : ""]")) -/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params) - if(default_unfasten_wrench(user, O)) - return +/obj/machinery/photocopier/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS - else if(istype(O, /obj/item/paper)) +/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params) + if(istype(O, /obj/item/paper)) if(copier_empty()) if(!user.temporarilyRemoveItemFromInventory(O)) return diff --git a/code/modules/plumbing/plumbers/_plumb_machinery.dm b/code/modules/plumbing/plumbers/_plumb_machinery.dm index a957d23937c..014a3240d9a 100644 --- a/code/modules/plumbing/plumbers/_plumb_machinery.dm +++ b/code/modules/plumbing/plumbers/_plumb_machinery.dm @@ -30,10 +30,10 @@ /obj/machinery/plumbing/AltClick(mob/user) return ..() // This hotkey is BLACKLISTED since it's used by /datum/component/simple_rotation -/obj/machinery/plumbing/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I) - return TRUE +/obj/machinery/plumbing/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/plumbing/plunger_act(obj/item/plunger/P, mob/living/user, reinforced) to_chat(user, span_notice("You start furiously plunging [name].")) diff --git a/code/modules/power/floodlight.dm b/code/modules/power/floodlight.dm index 4d7c57e880d..3819cee732a 100644 --- a/code/modules/power/floodlight.dm +++ b/code/modules/power/floodlight.dm @@ -107,16 +107,15 @@ if(user) to_chat(user, span_notice("You set [src] to [setting_text].")) -/obj/machinery/power/floodlight/attackby(obj/item/O, mob/user, params) - if(O.tool_behaviour == TOOL_WRENCH) - default_unfasten_wrench(user, O, time = 20) - change_setting(1) - if(anchored) - connect_to_network() - else - disconnect_from_network() +/obj/machinery/power/floodlight/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + change_setting(1) + if(anchored) + connect_to_network() else - . = ..() + disconnect_from_network() + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/power/floodlight/attack_hand(mob/user, list/modifiers) . = ..() diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 2714c491bd1..87c5fce29be 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -254,10 +254,10 @@ return ..() -/obj/machinery/power/emitter/wrench_act(mob/living/user, obj/item/item) +/obj/machinery/power/emitter/wrench_act(mob/living/user, obj/item/tool) . = ..() - default_unfasten_wrench(user, item) - return TRUE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/power/emitter/welder_act(mob/living/user, obj/item/item) ..() diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index b0d65bbe757..b37775f6610 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -120,10 +120,10 @@ no power level overlay is currently in the overlays list. return ..() -/obj/machinery/field/generator/wrench_act(mob/living/user, obj/item/wrench) - ..() - default_unfasten_wrench(user, wrench) - return TRUE +/obj/machinery/field/generator/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/field/generator/welder_act(mob/living/user, obj/item/welder) . = ..() diff --git a/code/modules/power/supermatter/supermatter_hit_procs.dm b/code/modules/power/supermatter/supermatter_hit_procs.dm index e3683efb376..68869d906ba 100644 --- a/code/modules/power/supermatter/supermatter_hit_procs.dm +++ b/code/modules/power/supermatter/supermatter_hit_procs.dm @@ -226,10 +226,10 @@ dust_mob(user, vis_msg, mob_msg) /obj/machinery/power/supermatter_crystal/wrench_act(mob/user, obj/item/tool) - ..() + . = ..() if (moveable) - default_unfasten_wrench(user, tool, time = 20) - return TRUE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/power/supermatter_crystal/Bumped(atom/movable/hit_object) if(isliving(hit_object)) diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index 996a4f887db..781f10d10a4 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -64,13 +64,15 @@ icon_state = "coil[anchored]" update_cable_icons_on_turf(get_turf(src)) +/obj/machinery/power/energy_accumulator/tesla_coil/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/power/energy_accumulator/tesla_coil/attackby(obj/item/W, mob/user, params) if(default_deconstruction_screwdriver(user, "coil_open[anchored]", "coil[anchored]", W)) return - if(default_unfasten_wrench(user, W)) - return - if(default_deconstruction_crowbar(W)) return @@ -142,13 +144,15 @@ else icon_state = "grounding_rod[anchored]" +/obj/machinery/power/energy_accumulator/grounding_rod/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/power/energy_accumulator/grounding_rod/attackby(obj/item/W, mob/user, params) if(default_deconstruction_screwdriver(user, "grounding_rod_open[anchored]", "grounding_rod[anchored]", W)) return - if(default_unfasten_wrench(user, W)) - return - if(default_deconstruction_crowbar(W)) return diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 621ce65cdc8..29b771975c5 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -355,9 +355,12 @@ if(beaker) beaker.reagents.ui_interact(usr) +/obj/machinery/chem_dispenser/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/chem_dispenser/attackby(obj/item/I, mob/living/user, params) - if(default_unfasten_wrench(user, I)) - return if(default_deconstruction_screwdriver(user, icon_state, icon_state, I)) update_appearance() return diff --git a/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm b/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm index 6d4c1733238..9596262dc3f 100644 --- a/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm +++ b/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm @@ -66,8 +66,12 @@ This will not clean any inverted reagents. Inverted reagents will still be corre if(panel_open) . += mutable_appearance(icon, "[base_icon_state]_panel-o") -/* beaker swapping/attack code */ +/obj/machinery/chem_mass_spec/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS +/* beaker swapping/attack code */ /obj/machinery/chem_mass_spec/attackby(obj/item/item, mob/user, params) if(processing_reagents) to_chat(user, " The [src] is currently processing a batch!") @@ -77,9 +81,6 @@ This will not clean any inverted reagents. Inverted reagents will still be corre update_appearance() return - if(default_unfasten_wrench(user, item)) - return - if(istype(item, /obj/item/reagent_containers) && !(item.item_flags & ABSTRACT) && item.is_open_container()) var/obj/item/reagent_containers/beaker = item . = TRUE //no afterattack diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index fe6f92dc2d0..3d836ebcc8d 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -123,6 +123,11 @@ if (prob(50)) qdel(src) +/obj/machinery/chem_master/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/chem_master/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0", I)) return @@ -130,8 +135,6 @@ else if(default_deconstruction_crowbar(I)) return - if(default_unfasten_wrench(user, I)) - return if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container()) . = TRUE // no afterattack if(panel_open) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index 51b31a3a05f..38509951bff 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -134,6 +134,11 @@ update_appearance() return TRUE +/obj/machinery/reagentgrinder/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS + /obj/machinery/reagentgrinder/attackby(obj/item/I, mob/living/user, params) //You can only screw open empty grinder if(!beaker && !length(holdingitems) && default_deconstruction_screwdriver(user, icon_state, icon_state, I)) @@ -142,9 +147,6 @@ if(default_deconstruction_crowbar(I)) return - if(default_unfasten_wrench(user, I)) - return - if(panel_open) //Can't insert objects when its screwed open return TRUE diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm index 953bf2b017f..9b97dd74d58 100644 --- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm +++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm @@ -88,6 +88,13 @@ smoke.set_up(reagents, setting*3, efficiency, T) smoke.start() +/obj/machinery/smoke_machine/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(default_unfasten_wrench(user, tool, time = 4 SECONDS)) + on = FALSE + return TOOL_ACT_TOOLTYPE_SUCCESS + return FALSE + /obj/machinery/smoke_machine/attackby(obj/item/I, mob/user, params) add_fingerprint(user) if(istype(I, /obj/item/reagent_containers) && I.is_open_container()) @@ -96,9 +103,6 @@ if(units) to_chat(user, span_notice("You transfer [units] units of the solution to [src].")) return - if(default_unfasten_wrench(user, I, 40)) - on = FALSE - return if(default_deconstruction_screwdriver(user, "smoke0-o", "smoke0", I)) return if(default_deconstruction_crowbar(I)) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 9a5d04b429d..48d88b4654c 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -248,10 +248,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/reagent_dispensers/wall/virusfood, 30 . = ..() AddComponent(/datum/component/plumbing/simple_supply) -/obj/structure/reagent_dispensers/plumbed/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I) - return TRUE +/obj/structure/reagent_dispensers/plumbed/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/structure/reagent_dispensers/plumbed/storage name = "stationary storage tank" diff --git a/code/modules/research/anomaly/anomaly_refinery.dm b/code/modules/research/anomaly/anomaly_refinery.dm index f29beef1846..de35b946604 100644 --- a/code/modules/research/anomaly/anomaly_refinery.dm +++ b/code/modules/research/anomaly/anomaly_refinery.dm @@ -31,7 +31,7 @@ var/test_status = null /// Determines which tank will be the merge_gases target (destroyed upon testing). var/obj/item/tank/tank_to_target - + // These vars are used for the explosion simulation and doesn't affect the core detonation. /// Combined result of the first two tanks. Exists only in our machine. var/datum/gas_mixture/combined_gasmix @@ -101,9 +101,9 @@ return ..() /obj/machinery/research/anomaly_refinery/wrench_act(mob/living/user, obj/item/tool) - if(!default_unfasten_wrench(user, tool)) - return FALSE - return TRUE + . = ..() + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/research/anomaly_refinery/screwdriver_act(mob/living/user, obj/item/tool) if(!default_deconstruction_screwdriver(user, "[base_icon_state]-off", "[base_icon_state]", tool)) @@ -212,7 +212,7 @@ combined_gasmix.merge(second_gasmix.copy()) else combined_gasmix.react() - + reaction_increment += 1 /// We dont allow incomplete valves to go in but do code in checks for incomplete valves. Just in case. @@ -289,7 +289,7 @@ var/list/data = list() var/list/parsed_gasmixes = list() var/obj/item/tank/other_tank - + if(inserted_bomb?.tank_one && inserted_bomb?.tank_two) other_tank = inserted_bomb.tank_one == tank_to_target ? inserted_bomb.tank_two : inserted_bomb.tank_one diff --git a/code/modules/research/ordnance/doppler_array.dm b/code/modules/research/ordnance/doppler_array.dm index d3f0eb30006..56c93fbbe79 100644 --- a/code/modules/research/ordnance/doppler_array.dm +++ b/code/modules/research/ordnance/doppler_array.dm @@ -61,9 +61,8 @@ return ..() /obj/machinery/doppler_array/wrench_act(mob/living/user, obj/item/tool) - if(!default_unfasten_wrench(user, tool)) - return FALSE - return TRUE + default_unfasten_wrench(user, tool) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/doppler_array/screwdriver_act(mob/living/user, obj/item/tool) if(!default_deconstruction_screwdriver(user, "[base_icon_state]", "[base_icon_state]", tool)) @@ -92,8 +91,8 @@ else playsound(src, 'sound/machines/terminal_error.ogg', 25) -/** - * Checks a specified tachyon record for fitting reactions, then returns a list with +/** + * Checks a specified tachyon record for fitting reactions, then returns a list with * the experiment typepath as key and score as value. * The score is the same for all explosive experiments (light radius). */ diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index db13a72c420..d7bff35b965 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -34,10 +34,10 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE) density = TRUE anchored = TRUE -/obj/machinery/bsa/wrench_act(mob/living/user, obj/item/I) - ..() - default_unfasten_wrench(user, I, 10) - return TRUE +/obj/machinery/bsa/wrench_act(mob/living/user, obj/item/tool) + . = ..() + default_unfasten_wrench(user, tool, time = 1 SECONDS) + return TOOL_ACT_TOOLTYPE_SUCCESS /obj/machinery/bsa/back name = "Bluespace Artillery Generator" diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 61739757cb3..b0fefa0da41 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -430,12 +430,14 @@ GLOBAL_LIST_EMPTY(vending_products) default_deconstruction_crowbar(I) return TRUE -/obj/machinery/vending/wrench_act(mob/living/user, obj/item/I) - ..() - if(panel_open) - default_unfasten_wrench(user, I, time = 60) +/obj/machinery/vending/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(!panel_open) + return FALSE + if(default_unfasten_wrench(user, tool, time = 6 SECONDS)) unbuckle_all_mobs(TRUE) - return TRUE + return TOOL_ACT_TOOLTYPE_SUCCESS + return FALSE /obj/machinery/vending/screwdriver_act(mob/living/user, obj/item/I) if(..())