diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm index d5cc72b7640..ceba0a2f182 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm @@ -45,10 +45,30 @@ ///from obj/machinery/bsa/full/proc/fire(): () #define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" #define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0) -///for any tool behaviors: (mob/living/user, obj/item/I, list/recipes) + +/// Sent from [atom/proc/item_interaction], when this atom is left-clicked on by a mob with an item +/// Sent from the very beginning of the click chain, intended for generic atom-item interactions +/// Args: (mob/living/user, obj/item/tool, list/modifiers) +/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm) +#define COMSIG_ATOM_ITEM_INTERACTION "atom_item_interaction" +/// Sent from [atom/proc/item_interaction], when this atom is right-clicked on by a mob with an item +/// Sent from the very beginning of the click chain, intended for generic atom-item interactions +/// Args: (mob/living/user, obj/item/tool, list/modifiers) +/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm) +#define COMSIG_ATOM_ITEM_INTERACTION_SECONDARY "atom_item_interaction_secondary" +/// Sent from [atom/proc/item_interaction], to an item clicking on an atom +/// Args: (mob/living/user, atom/interacting_with, list/modifiers) +/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm) +#define COMSIG_ITEM_INTERACTING_WITH_ATOM "item_interacting_with_atom" +/// Sent from [atom/proc/item_interaction], to an item right-clicking on an atom +/// Args: (mob/living/user, atom/interacting_with, list/modifiers) +/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm) +#define COMSIG_ITEM_INTERACTING_WITH_ATOM_SECONDARY "item_interacting_with_atom_secondary" +/// Sent from [atom/proc/item_interaction], when this atom is left-clicked on by a mob with a tool of a specific tool type +/// Args: (mob/living/user, obj/item/tool, list/recipes) +/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm) #define COMSIG_ATOM_TOOL_ACT(tooltype) "tool_act_[tooltype]" - #define COMPONENT_BLOCK_TOOL_ATTACK (1<<0) -///for any rightclick tool behaviors: (mob/living/user, obj/item/I) +/// Sent from [atom/proc/item_interaction], when this atom is right-clicked on by a mob with a tool of a specific tool type +/// Args: (mob/living/user, obj/item/tool) +/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm) #define COMSIG_ATOM_SECONDARY_TOOL_ACT(tooltype) "tool_secondary_act_[tooltype]" - // We have the same returns here as COMSIG_ATOM_TOOL_ACT - // #define COMPONENT_BLOCK_TOOL_ATTACK (1<<0) diff --git a/code/__DEFINES/tools.dm b/code/__DEFINES/tools.dm index 591aa22aa2b..a35f53a6fe2 100644 --- a/code/__DEFINES/tools.dm +++ b/code/__DEFINES/tools.dm @@ -25,12 +25,14 @@ // tool sound is only played when op is started. If not, it's played twice. #define MIN_TOOL_SOUND_DELAY 20 -// tool_act chain flags +/// Return when an item interaction is successful. +/// This cancels the rest of the chain entirely and indicates success. +#define ITEM_INTERACT_SUCCESS (1<<0) // Same as TRUE, as most tool (legacy) tool acts return TRUE on success +/// Return to prevent the rest of the attacck chain from being executed / preventing the item user from thwacking the target. +/// Similar to [ITEM_INTERACT_SUCCESS], but does not necessarily indicate success. +#define ITEM_INTERACT_BLOCKING (1<<1) +/// Return to skip the rest of the interaction chain, going straight to attack. +#define ITEM_INTERACT_SKIP_TO_ATTACK (1<<2) -/// When a tooltype_act proc is successful -#define TOOL_ACT_TOOLTYPE_SUCCESS (1<<0) -/// When [COMSIG_ATOM_TOOL_ACT] blocks the act -#define TOOL_ACT_SIGNAL_BLOCKING (1<<1) - -/// When [TOOL_ACT_TOOLTYPE_SUCCESS] or [TOOL_ACT_SIGNAL_BLOCKING] are set -#define TOOL_ACT_MELEE_CHAIN_BLOCKING (TOOL_ACT_TOOLTYPE_SUCCESS | TOOL_ACT_SIGNAL_BLOCKING) +/// Combination flag for any item interaction that blocks the rest of the attack chain +#define ITEM_INTERACT_ANY_BLOCKER (ITEM_INTERACT_SUCCESS | ITEM_INTERACT_BLOCKING) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 213e3dae195..38889db1ea1 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -2,16 +2,20 @@ * This is the proc that handles the order of an item_attack. * * The order of procs called is: - * * [/atom/proc/tool_act] on the target. If it returns TOOL_ACT_TOOLTYPE_SUCCESS or TOOL_ACT_SIGNAL_BLOCKING, the chain will be stopped. + * * [/atom/proc/tool_act] on the target. If it returns ITEM_INTERACT_SUCCESS or ITEM_INTERACT_BLOCKING, the chain will be stopped. * * [/obj/item/proc/pre_attack] on src. If this returns TRUE, the chain will be stopped. * * [/atom/proc/attackby] on the target. If it returns TRUE, the chain will be stopped. * * [/obj/item/proc/afterattack]. The return value does not matter. */ /obj/item/proc/melee_attack_chain(mob/user, atom/target, params) - var/is_right_clicking = LAZYACCESS(params2list(params), RIGHT_CLICK) + var/list/modifiers = params2list(params) + var/is_right_clicking = LAZYACCESS(modifiers, RIGHT_CLICK) - if(tool_behaviour && (target.tool_act(user, src, tool_behaviour, is_right_clicking) & TOOL_ACT_MELEE_CHAIN_BLOCKING)) + var/item_interact_result = target.item_interaction(user, src, modifiers, is_right_clicking) + if(item_interact_result & ITEM_INTERACT_SUCCESS) return TRUE + if(item_interact_result & ITEM_INTERACT_BLOCKING) + return FALSE var/pre_attack_result if (is_right_clicking) @@ -153,12 +157,24 @@ return SECONDARY_ATTACK_CALL_NORMAL /obj/attackby(obj/item/attacking_item, mob/user, params) - return ..() || ((obj_flags & CAN_BE_HIT) && attacking_item.attack_atom(src, user, params)) - -/mob/living/attackby(obj/item/attacking_item, mob/living/user, params) - if(can_perform_surgery(user, params)) + if(..()) return TRUE + if(!(obj_flags & CAN_BE_HIT)) + return FALSE + return attacking_item.attack_atom(src, user, params) +/mob/living/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + for(var/datum/surgery/operation as anything in surgeries) + if(IS_IN_INVALID_SURGICAL_POSITION(src, operation)) + continue + if(!(operation.surgery_flags & SURGERY_SELF_OPERABLE) && (user == src)) + continue + if(operation.next_step(user, modifiers)) + return ITEM_INTERACT_SUCCESS + + return ..() + +/mob/living/attackby(obj/item/attacking_item, mob/living/user, params) if(..()) return TRUE user.changeNext_move(attacking_item.attack_speed) diff --git a/code/controllers/subsystem/eigenstate.dm b/code/controllers/subsystem/eigenstate.dm index 54636a4fd79..f167fdf24d1 100644 --- a/code/controllers/subsystem/eigenstate.dm +++ b/code/controllers/subsystem/eigenstate.dm @@ -119,4 +119,4 @@ SUBSYSTEM_DEF(eigenstates) /datum/controller/subsystem/eigenstates/proc/tool_interact(atom/source, mob/user, obj/item/item) SIGNAL_HANDLER to_chat(user, span_notice("The unstable nature of [source] makes it impossible to use [item] on [source.p_them()]!")) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING diff --git a/code/datums/components/combustible_flooder.dm b/code/datums/components/combustible_flooder.dm index 2fa7e31695f..5b5c7b61219 100644 --- a/code/datums/components/combustible_flooder.dm +++ b/code/datums/components/combustible_flooder.dm @@ -89,4 +89,4 @@ if(tool.get_temperature() >= FIRE_MINIMUM_TEMPERATURE_TO_EXIST) flood(user, tool.get_temperature()) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING diff --git a/code/datums/components/explodable.dm b/code/datums/components/explodable.dm index 3093c995ced..956d562bfb6 100644 --- a/code/datums/components/explodable.dm +++ b/code/datums/components/explodable.dm @@ -81,7 +81,7 @@ SIGNAL_HANDLER if(check_if_detonate(tool)) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Shot by something /datum/component/explodable/proc/projectile_react(datum/source, obj/projectile/shot) diff --git a/code/datums/components/interaction_booby_trap.dm b/code/datums/components/interaction_booby_trap.dm index 6f57e4f6b75..12cf0a7c677 100644 --- a/code/datums/components/interaction_booby_trap.dm +++ b/code/datums/components/interaction_booby_trap.dm @@ -93,7 +93,7 @@ SIGNAL_HANDLER on_defused_callback?.Invoke(source, user, tool) qdel(src) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Give people a little hint /datum/component/interaction_booby_trap/proc/on_examine(atom/source, mob/examiner, list/examine_list) diff --git a/code/datums/components/lockable_storage.dm b/code/datums/components/lockable_storage.dm index d4d833b707d..52aba799741 100644 --- a/code/datums/components/lockable_storage.dm +++ b/code/datums/components/lockable_storage.dm @@ -112,11 +112,11 @@ /datum/component/lockable_storage/proc/on_screwdriver_act(atom/source, mob/user, obj/item/tool) SIGNAL_HANDLER if(!can_hack_open || !source.atom_storage.locked) - return COMPONENT_BLOCK_TOOL_ATTACK + return NONE panel_open = !panel_open source.balloon_alert(user, "panel [panel_open ? "opened" : "closed"]") - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_SUCCESS /** * Called when a multitool is used on the parent, if it's hackable. @@ -125,13 +125,13 @@ /datum/component/lockable_storage/proc/on_multitool_act(atom/source, mob/user, obj/item/tool) SIGNAL_HANDLER if(!can_hack_open || !source.atom_storage.locked) - return COMPONENT_BLOCK_TOOL_ATTACK + return NONE if(!panel_open) source.balloon_alert(user, "panel closed!") - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING source.balloon_alert(user, "hacking...") INVOKE_ASYNC(src, PROC_REF(hack_open), source, user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_SUCCESS ///Does a do_after to hack the storage open, takes a long time cause idk. /datum/component/lockable_storage/proc/hack_open(atom/source, mob/user, obj/item/tool) diff --git a/code/datums/components/material/remote_materials.dm b/code/datums/components/material/remote_materials.dm index 17561581083..373b1af7bee 100644 --- a/code/datums/components/material/remote_materials.dm +++ b/code/datums/components/material/remote_materials.dm @@ -136,15 +136,15 @@ handles linking back and forth. SIGNAL_HANDLER if(!I.multitool_check_buffer(user, I)) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING var/obj/item/multitool/M = I if (!QDELETED(M.buffer) && istype(M.buffer, /obj/machinery/ore_silo)) if (silo == M.buffer) to_chat(user, span_warning("[parent] is already connected to [silo]!")) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING if(!check_z_level(M.buffer)) to_chat(user, span_warning("[parent] is too far away to get a connection signal!")) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING var/obj/machinery/ore_silo/new_silo = M.buffer var/datum/component/material_container/new_container = new_silo.GetComponent(/datum/component/material_container) @@ -168,7 +168,7 @@ handles linking back and forth. mat_container = new_container RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, TYPE_PROC_REF(/datum/component/remote_materials, SiloAttackBy)) to_chat(user, span_notice("You connect [parent] to [silo] from the multitool's buffer.")) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /** * Checks if the param silo is in the same level as this components parent i.e. connected machine, rcd, etc diff --git a/code/datums/components/seclight_attachable.dm b/code/datums/components/seclight_attachable.dm index 65c64fdb8ce..d82f274a07c 100644 --- a/code/datums/components/seclight_attachable.dm +++ b/code/datums/components/seclight_attachable.dm @@ -236,7 +236,7 @@ return INVOKE_ASYNC(src, PROC_REF(unscrew_light), source, user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Invoked asyncronously from [proc/on_screwdriver]. Handles removing the light from our parent. /datum/component/seclite_attachable/proc/unscrew_light(obj/item/source, mob/user, obj/item/tool) diff --git a/code/datums/components/shell.dm b/code/datums/components/shell.dm index 88747bd2f60..77f0b16ab71 100644 --- a/code/datums/components/shell.dm +++ b/code/datums/components/shell.dm @@ -225,10 +225,10 @@ if(shell_flags & SHELL_FLAG_ALLOW_FAILURE_ACTION) return source.balloon_alert(user, "it's locked!") - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING attached_circuit.interact(user) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /** * Called when a screwdriver is used on the parent. Removes the circuitboard from the component. @@ -245,12 +245,12 @@ if(shell_flags & SHELL_FLAG_ALLOW_FAILURE_ACTION) return source.balloon_alert(user, "it's locked!") - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING tool.play_tool_sound(parent) source.balloon_alert(user, "you unscrew [attached_circuit] from [parent].") remove_circuit() - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /** * Checks for when the circuitboard moves. If it moves, removes it from the component. diff --git a/code/datums/components/supermatter_crystal.dm b/code/datums/components/supermatter_crystal.dm index 15048ffff93..f3047f87768 100644 --- a/code/datums/components/supermatter_crystal.dm +++ b/code/datums/components/supermatter_crystal.dm @@ -212,7 +212,7 @@ SIGNAL_HANDLER if(tool_act_callback) tool_act_callback.Invoke(user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING attackby_hit(source, tool, user) /datum/component/supermatter_crystal/proc/bumped_hit(datum/source, atom/movable/hit_object) diff --git a/code/datums/components/torn_wall.dm b/code/datums/components/torn_wall.dm index 566275bdfa6..9b36921a39f 100644 --- a/code/datums/components/torn_wall.dm +++ b/code/datums/components/torn_wall.dm @@ -65,7 +65,7 @@ /datum/component/torn_wall/proc/on_welded(atom/source, mob/user, obj/item/tool) SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(try_repair), source, user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Fix us up /datum/component/torn_wall/proc/try_repair(atom/source, mob/user, obj/item/tool) @@ -78,7 +78,7 @@ qdel(src) return source.update_appearance(UPDATE_ICON) - source.tool_act(user, tool, TOOL_WELDER, is_right_clicking = FALSE) // Keep going + try_repair(source, user, tool) // Keep going /// Give them a hint /datum/component/torn_wall/proc/on_examined(atom/source, mob/user, list/examine_list) diff --git a/code/datums/elements/rust.dm b/code/datums/elements/rust.dm index f34182384ce..135f45b7c2f 100644 --- a/code/datums/elements/rust.dm +++ b/code/datums/elements/rust.dm @@ -45,7 +45,7 @@ SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(handle_tool_use), source, user, item) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// We call this from secondary_tool_act because we sleep with do_after /datum/element/rust/proc/handle_tool_use(atom/source, mob/user, obj/item/item) diff --git a/code/datums/status_effects/debuffs/strandling.dm b/code/datums/status_effects/debuffs/strandling.dm index e6198eb544f..6050a3df304 100644 --- a/code/datums/status_effects/debuffs/strandling.dm +++ b/code/datums/status_effects/debuffs/strandling.dm @@ -38,7 +38,7 @@ return INVOKE_ASYNC(src, PROC_REF(try_remove_effect), user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Signal proc for [COMSIG_CARBON_PRE_MISC_HELP], allowing someone to remove the effect by hand /datum/status_effect/strandling/proc/on_self_check(mob/living/carbon/source, mob/living/helper) diff --git a/code/game/atom/atom_tool_acts.dm b/code/game/atom/atom_tool_acts.dm index f6ce7eb96c7..078615dba75 100644 --- a/code/game/atom/atom_tool_acts.dm +++ b/code/game/atom/atom_tool_acts.dm @@ -1,29 +1,51 @@ /** - *Tool behavior procedure. Redirects to tool-specific procs by default. + * ## Item interaction * - * You can override it to catch all tool interactions, for use in complex deconstruction procs. + * Handles non-combat iteractions of a tool on this atom, + * such as using a tool on a wall to deconstruct it, + * or scanning someone with a health analyzer * - * Must return parent proc ..() in the end if overridden + * This can be overridden to add custom item interactions to this atom + * + * Do not call this directly */ -/atom/proc/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) - var/act_result - var/signal_result +/atom/proc/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + SHOULD_CALL_PARENT(TRUE) + PROTECTED_PROC(TRUE) var/is_left_clicking = !is_right_clicking - - if(is_left_clicking) // Left click first for sensibility - var/list/processing_recipes = list() //List of recipes that can be mutated by sending the signal - signal_result = SEND_SIGNAL(src, COMSIG_ATOM_TOOL_ACT(tool_type), user, tool, processing_recipes) - if(signal_result & COMPONENT_BLOCK_TOOL_ATTACK) // The COMSIG_ATOM_TOOL_ACT signal is blocking the act - return TOOL_ACT_SIGNAL_BLOCKING - if(processing_recipes.len) - process_recipes(user, tool, processing_recipes) - if(QDELETED(tool)) - return TRUE + var/early_sig_return = NONE + if(is_left_clicking) + early_sig_return = SEND_SIGNAL(src, COMSIG_ATOM_ITEM_INTERACTION, user, tool, modifiers) \ + | SEND_SIGNAL(tool, COMSIG_ITEM_INTERACTING_WITH_ATOM, user, src, modifiers) else - signal_result = SEND_SIGNAL(src, COMSIG_ATOM_SECONDARY_TOOL_ACT(tool_type), user, tool) - if(signal_result & COMPONENT_BLOCK_TOOL_ATTACK) // The COMSIG_ATOM_TOOL_ACT signal is blocking the act - return TOOL_ACT_SIGNAL_BLOCKING + early_sig_return = SEND_SIGNAL(src, COMSIG_ATOM_ITEM_INTERACTION_SECONDARY, user, tool, modifiers) \ + | SEND_SIGNAL(tool, COMSIG_ITEM_INTERACTING_WITH_ATOM_SECONDARY, user, src, modifiers) + if(early_sig_return) + return early_sig_return + + var/interact_return = is_left_clicking \ + ? tool.interact_with_atom(src, user) \ + : tool.interact_with_atom_secondary(src, user) + if(interact_return) + return interact_return + + var/tool_type = tool.tool_behaviour + if(!tool_type) // here on only deals with ... tools + return NONE + + var/list/processing_recipes = list() + var/signal_result = is_left_clicking \ + ? SEND_SIGNAL(src, COMSIG_ATOM_TOOL_ACT(tool_type), user, tool, processing_recipes) \ + : SEND_SIGNAL(src, COMSIG_ATOM_SECONDARY_TOOL_ACT(tool_type), user, tool) + if(signal_result) + return signal_result + if(length(processing_recipes)) + process_recipes(user, tool, processing_recipes) + if(QDELETED(tool)) + return ITEM_INTERACT_SUCCESS // Safe-ish to assume that if we deleted our item something succeeded + + var/act_result = NONE // or FALSE, or null, as some things may return switch(tool_type) if(TOOL_CROWBAR) @@ -40,20 +62,58 @@ act_result = is_left_clicking ? welder_act(user, tool) : welder_act_secondary(user, tool) if(TOOL_ANALYZER) act_result = is_left_clicking ? analyzer_act(user, tool) : analyzer_act_secondary(user, tool) + // SKYRAT EDIT ADDITION START - SKYRAT TOOLS + if(TOOL_BILLOW) + act_result = is_left_clicking ? billow_act(user, tool) : billow_act_secondary(user, tool) + if(TOOL_TONG) + act_result = is_left_clicking ? tong_act(user, tool) : tong_act_secondary(user, tool) + if(TOOL_HAMMER) + act_result = is_left_clicking ? hammer_act(user, tool) : hammer_act_secondary(user, tool) + if(TOOL_BLOWROD) + act_result = is_left_clicking ? blowrod_act(user, tool) : blowrod_act_secondary(user, tool) + // SKYRAT EDIT ADDITION END + if(!act_result) - return + return NONE // A tooltype_act has completed successfully if(is_left_clicking) log_tool("[key_name(user)] used [tool] on [src] at [AREACOORD(src)]") - SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_PRIMARY(tool_type), src) + SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_PRIMARY(tool_type), src) else log_tool("[key_name(user)] used [tool] on [src] (right click) at [AREACOORD(src)]") - SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_SECONDARY(tool_type), src) - return TOOL_ACT_TOOLTYPE_SUCCESS + SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_SECONDARY(tool_type), src) + return act_result + +/** + * Called when this item is being used to interact with an atom, + * IE, a mob is clicking on an atom with this item. + * + * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code. + * Return NONE to allow default interaction / tool handling. + */ +/obj/item/proc/interact_with_atom(atom/interacting_with, mob/living/user) + return NONE -//! Tool-specific behavior procs. -/// +/** + * Called when this item is being used to interact with an atom WITH RIGHT CLICK, + * IE, a mob is right clicking on an atom with this item. + * + * Default behavior has it run the same code as left click. + * + * Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code. + * Return NONE to allow default interaction / tool handling. + */ +/obj/item/proc/interact_with_atom_secondary(atom/interacting_with, mob/living/user) + return interact_with_atom(interacting_with, user) + +/* + * Tool-specific behavior procs. + * + * Return an ITEM_INTERACT_ flag to handle the event, or NONE to allow the mob to attack the atom. + * Returning TRUE will also cancel attacks. It is equivalent to an ITEM_INTERACT_ flag. (This is legacy behavior, and is not to be relied on) + * Returning FALSE or null will also allow the mob to attack the atom. (This is also legacy behavior) + */ /// Called on an object when a tool with crowbar capabilities is used to left click an object /atom/proc/crowbar_act(mob/living/user, obj/item/tool) diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index 90cafd9180a..c4cf5bb125a 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -107,7 +107,7 @@ . = ..() if(default_unfasten_wrench(user, tool)) power_change() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/pdapainter/attackby(obj/item/O, mob/living/user, params) if(machine_stat & BROKEN) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index e96d17a823d..f8d05a885d6 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -759,11 +759,11 @@ return update_last_used(user) -/obj/machinery/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) +/obj/machinery/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) if(SEND_SIGNAL(user, COMSIG_TRY_USE_MACHINE, src) & COMPONENT_CANT_USE_MACHINE_TOOLS) - return TOOL_ACT_MELEE_CHAIN_BLOCKING + return ITEM_INTERACT_ANY_BLOCKER . = ..() - if(. & TOOL_ACT_SIGNAL_BLOCKING) + if(. & ITEM_INTERACT_BLOCKING) return update_last_used(user) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 1a62fa0261b..0a01b325149 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -230,11 +230,11 @@ /obj/machinery/autolathe/crowbar_act(mob/living/user, obj/item/tool) if(default_deconstruction_crowbar(tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/autolathe/screwdriver_act_secondary(mob/living/user, obj/item/tool) if(default_deconstruction_screwdriver(user, "autolathe_t", "autolathe", tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/autolathe/attackby(obj/item/attacking_item, mob/living/user, params) if(user.combat_mode) //so we can hit the machine diff --git a/code/game/machinery/barsigns.dm b/code/game/machinery/barsigns.dm index a4bff1fa999..8bdd3ab3b17 100644 --- a/code/game/machinery/barsigns.dm +++ b/code/game/machinery/barsigns.dm @@ -129,7 +129,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32) if(panel_open) balloon_alert(user, "panel opened") set_sign(new /datum/barsign/hiddensigns/signoff) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "panel closed") @@ -138,22 +138,20 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32) else set_sign(chosen_sign) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/barsign/wrench_act(mob/living/user, obj/item/tool) - . = ..() if(!panel_open) balloon_alert(user, "open the panel first!") - return FALSE + return ITEM_INTERACT_BLOCKING tool.play_tool_sound(src) if(!do_after(user, (10 SECONDS), target = src)) - return FALSE + return ITEM_INTERACT_BLOCKING tool.play_tool_sound(src) deconstruct(disassembled = TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS - + return ITEM_INTERACT_SUCCESS /obj/machinery/barsign/attackby(obj/item/attacking_item, mob/user) diff --git a/code/game/machinery/botlaunchpad.dm b/code/game/machinery/botlaunchpad.dm index c5059f850eb..5c0ba432d35 100644 --- a/code/game/machinery/botlaunchpad.dm +++ b/code/game/machinery/botlaunchpad.dm @@ -29,7 +29,7 @@ var/obj/item/multitool/multitool = tool multitool.set_buffer(src) balloon_alert(user, "saved to multitool buffer") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS // Checks the turf for a bot and launches it if it's the only mob on the pad. diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 92968aa1dd4..54640e6490b 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -41,7 +41,7 @@ return FALSE if(default_unfasten_wrench(user, tool)) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/cell_charger/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stock_parts/cell) && !panel_open) diff --git a/code/game/machinery/computer/atmos_computers/_air_sensor.dm b/code/game/machinery/computer/atmos_computers/_air_sensor.dm index 66429dee8c5..3a8cd36de89 100644 --- a/code/game/machinery/computer/atmos_computers/_air_sensor.dm +++ b/code/game/machinery/computer/atmos_computers/_air_sensor.dm @@ -112,7 +112,7 @@ multi_tool.set_buffer(src) balloon_alert(user, "sensor added to buffer") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /** * A portable version of the /obj/machinery/air_sensor @@ -207,20 +207,19 @@ /obj/item/air_sensor/wrench_act(mob/living/user, obj/item/tool) if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN) - return TOOL_ACT_TOOLTYPE_SUCCESS - return + return ITEM_INTERACT_SUCCESS /obj/item/air_sensor/welder_act(mob/living/user, obj/item/tool) if(!tool.tool_start_check(user, amount = 1)) - return + return ITEM_INTERACT_BLOCKING loc.balloon_alert(user, "dismantling sensor") if(!tool.use_tool(src, user, 2 SECONDS, volume = 30, amount = 1)) - return + return ITEM_INTERACT_BLOCKING loc.balloon_alert(user, "sensor dismanteled") deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/air_sensor/deconstruct(disassembled) if(!(obj_flags & NO_DECONSTRUCTION)) diff --git a/code/game/machinery/computer/atmos_computers/_atmos_control.dm b/code/game/machinery/computer/atmos_computers/_atmos_control.dm index 57403a27d3d..094f12e36e3 100644 --- a/code/game/machinery/computer/atmos_computers/_atmos_control.dm +++ b/code/game/machinery/computer/atmos_computers/_atmos_control.dm @@ -99,7 +99,7 @@ //register the sensor's unique ID with it's assositated chamber connected_sensors[sensor.chamber_id] = sensor.id_tag user.balloon_alert(user, "sensor connected to [src]") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index f8b819dd697..0d3c04ccd6f 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -93,7 +93,7 @@ tool.play_tool_sound(src) new /obj/item/stack/sheet/mineral/wood(get_turf(src), drop_amount) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/barricade/wooden/crude name = "crude plank barricade" diff --git a/code/game/machinery/dish_drive.dm b/code/game/machinery/dish_drive.dm index e84e21314b3..1cd8b3c7bf0 100644 --- a/code/game/machinery/dish_drive.dm +++ b/code/game/machinery/dish_drive.dm @@ -83,7 +83,7 @@ /obj/machinery/dish_drive/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/dish_drive/attackby(obj/item/dish, mob/living/user, params) if(is_type_in_list(dish, collectable_items) && !user.combat_mode) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 1809725f457..509e3347f84 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -847,16 +847,16 @@ /obj/machinery/door/airlock/screwdriver_act(mob/living/user, obj/item/tool) if(panel_open && detonated) to_chat(user, span_warning("[src] has no maintenance panel!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS toggle_panel_open() to_chat(user, span_notice("You [panel_open ? "open":"close"] the maintenance panel of the airlock.")) tool.play_tool_sound(src) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/airlock/wirecutter_act(mob/living/user, obj/item/tool) if(panel_open && security_level == AIRLOCK_SECURITY_PLASTEEL) - . = TOOL_ACT_TOOLTYPE_SUCCESS // everything after this shouldn't result in attackby + . = ITEM_INTERACT_SUCCESS // everything after this shouldn't result in attackby if(hasPower() && shock(user, 60)) // Protective grille of wiring is electrified return . to_chat(user, span_notice("You start cutting through the outer grille.")) @@ -877,7 +877,7 @@ note.forceMove(tool.drop_location()) note = null update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/airlock/crowbar_act(mob/living/user, obj/item/tool) @@ -897,14 +897,14 @@ layer_flavor = "inner layer of shielding" next_level = AIRLOCK_SECURITY_NONE else - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.visible_message(span_notice("You start prying away [src]'s [layer_flavor].")) if(!tool.use_tool(src, user, 40, volume=100)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!panel_open || security_level != starting_level) // if the plating's already been broken, don't break it again - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.visible_message(span_notice("[user] removes [src]'s shielding."), span_notice("You remove [src]'s [layer_flavor].")) security_level = next_level @@ -913,7 +913,7 @@ modify_max_integrity(max_integrity / AIRLOCK_INTEGRITY_MULTIPLIER) damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_N update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/airlock/wrench_act(mob/living/user, obj/item/tool) if(!locked) @@ -931,7 +931,7 @@ return unbolt() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/airlock/welder_act(mob/living/user, obj/item/tool) @@ -958,19 +958,19 @@ layer_flavor = "inner layer of shielding" next_level = AIRLOCK_SECURITY_PLASTEEL_I_S else - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!tool.tool_start_check(user, amount=1)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You begin cutting the [layer_flavor]...")) if(!tool.use_tool(src, user, 4 SECONDS, volume=50)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!panel_open || security_level != starting_level) // see if anyone's screwing with us - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.visible_message( span_notice("[user] cuts through [src]'s shielding."), // passers-by don't get the full picture @@ -986,7 +986,7 @@ if(security_level == AIRLOCK_SECURITY_NONE) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/airlock/proc/try_reinforce(mob/user, obj/item/stack/sheet/material, amt_required, new_security_level) if(material.get_amount() < amt_required) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 0077839234a..db09a0db560 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -329,7 +329,7 @@ /obj/machinery/door/welder_act(mob/living/user, obj/item/tool) try_to_weld(tool, user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/crowbar_act(mob/living/user, obj/item/tool) if(user.combat_mode) @@ -340,7 +340,7 @@ var/obj/item/crowbar/crowbar = tool forced_open = crowbar.force_opens try_to_crowbar(tool, user, forced_open) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/attackby(obj/item/weapon, mob/living/user, params) if(istype(weapon, /obj/item/access_key)) @@ -359,7 +359,7 @@ /obj/machinery/door/welder_act_secondary(mob/living/user, obj/item/tool) try_to_weld_secondary(tool, user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/crowbar_act_secondary(mob/living/user, obj/item/tool) var/forced_open = FALSE @@ -367,7 +367,7 @@ var/obj/item/crowbar/crowbar = tool forced_open = crowbar.force_opens try_to_crowbar_secondary(tool, user, forced_open) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) . = ..() diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 1bf5d86095f..ff505403255 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -493,17 +493,17 @@ if(boltslocked) to_chat(user, span_notice("There are screws locking the bolts in place!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS tool.play_tool_sound(src) user.visible_message(span_notice("[user] starts undoing [src]'s bolts..."), \ span_notice("You start unfastening [src]'s floor bolts...")) if(!tool.use_tool(src, user, DEFAULT_STEP_TIME)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, TRUE) user.visible_message(span_notice("[user] unfastens [src]'s bolts."), \ span_notice("You undo [src]'s floor bolts.")) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/firedoor/screwdriver_act(mob/living/user, obj/item/tool) if(operating || !welded) @@ -512,7 +512,7 @@ span_notice("You [boltslocked ? "unlock" : "lock"] [src]'s floor bolts.")) tool.play_tool_sound(src) boltslocked = !boltslocked - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/firedoor/try_to_activate_door(mob/user, access_bypass = FALSE) return diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 2f57238127d..f1d29735a24 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -36,15 +36,15 @@ . = ..() if (density) balloon_alert(user, "open the door first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS else if (default_deconstruction_screwdriver(user, icon_state, icon_state, tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/poddoor/multitool_act(mob/living/user, obj/item/tool) . = ..() if (density) balloon_alert(user, "open the door first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if (!panel_open) return if (deconstruction != BLASTDOOR_FINISHED) @@ -55,16 +55,16 @@ id = change_id to_chat(user, span_notice("You change the ID to [id].")) balloon_alert(user, "id changed") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/poddoor/crowbar_act(mob/living/user, obj/item/tool) . = ..() if(machine_stat & NOPOWER) open(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if (density) balloon_alert(user, "open the door first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if (!panel_open) return if (deconstruction != BLASTDOOR_FINISHED) @@ -75,13 +75,13 @@ id = null deconstruction = BLASTDOOR_NEEDS_ELECTRONICS balloon_alert(user, "removed airlock electronics") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/poddoor/wirecutter_act(mob/living/user, obj/item/tool) . = ..() if (density) balloon_alert(user, "open the door first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if (!panel_open) return if (deconstruction != BLASTDOOR_NEEDS_ELECTRONICS) @@ -93,13 +93,13 @@ new /obj/item/stack/cable_coil(loc, amount) deconstruction = BLASTDOOR_NEEDS_WIRES balloon_alert(user, "removed internal cables") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/poddoor/welder_act(mob/living/user, obj/item/tool) . = ..() if (density) balloon_alert(user, "open the door first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if (!panel_open) return if (deconstruction != BLASTDOOR_NEEDS_WIRES) @@ -111,7 +111,7 @@ new /obj/item/stack/sheet/plasteel(loc, amount) user.balloon_alert(user, "torn apart") qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/door/poddoor/examine(mob/user) . = ..() diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 39197c7cb86..c01fb139c35 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -231,7 +231,7 @@ Possible to do for anyone motivated enough: /obj/machinery/holopad/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/holopad/set_anchored(anchorvalue) . = ..() diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index bd5bf3b0109..a28f855862a 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -53,7 +53,7 @@ loc.balloon_alert(user, "[src] dismantled") deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/igniter/deconstruct(disassembled) if(!(obj_flags & NO_DECONSTRUCTION)) @@ -68,7 +68,7 @@ id = change_id balloon_alert(user, "id set to [id]") to_chat(user, span_notice("You change the ID to [id].")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/igniter/incinerator_ordmix id = INCINERATOR_ORDMIX_IGNITER @@ -198,7 +198,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/sparker, 26) loc.balloon_alert(user, "[src] dismantled") deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/sparker/deconstruct(disassembled) if(!(obj_flags & NO_DECONSTRUCTION)) @@ -212,7 +212,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/sparker, 26) id = change_id balloon_alert(user, "id set to [id]") to_chat(user, span_notice("You change the ID to [id].")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/sparker/update_icon_state() if(disable) diff --git a/code/game/machinery/medical_kiosk.dm b/code/game/machinery/medical_kiosk.dm index eba423624bb..12562c428ad 100644 --- a/code/game/machinery/medical_kiosk.dm +++ b/code/game/machinery/medical_kiosk.dm @@ -108,7 +108,7 @@ /obj/machinery/medical_kiosk/wrench_act(mob/living/user, obj/item/tool) //Allows for wrenching/unwrenching the machine. ..() default_unfasten_wrench(user, tool, time = 0.1 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/medical_kiosk/RefreshParts() . = ..() diff --git a/code/game/machinery/medipen_refiller.dm b/code/game/machinery/medipen_refiller.dm index 8f17ad3faba..b56e35b2389 100644 --- a/code/game/machinery/medipen_refiller.dm +++ b/code/game/machinery/medipen_refiller.dm @@ -94,7 +94,7 @@ /obj/machinery/medipen_refiller/wrench_act(mob/living/user, obj/item/tool) default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/medipen_refiller/crowbar_act(mob/living/user, obj/item/tool) default_deconstruction_crowbar(tool) diff --git a/code/game/machinery/newscaster/newscaster_machine.dm b/code/game/machinery/newscaster/newscaster_machine.dm index a3ab8523037..99ea0d31620 100644 --- a/code/game/machinery/newscaster/newscaster_machine.dm +++ b/code/game/machinery/newscaster/newscaster_machine.dm @@ -491,7 +491,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30) /obj/machinery/newscaster/welder_act(mob/living/user, obj/item/tool) if(user.combat_mode) return - . = TOOL_ACT_TOOLTYPE_SUCCESS + . = ITEM_INTERACT_SUCCESS if(!(machine_stat & BROKEN)) to_chat(user, span_notice("[src] does not need repairs.")) return @@ -520,7 +520,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30) to_chat(user, span_notice("You [anchored ? "un" : ""]secure [src].")) new /obj/item/wallframe/newscaster(loc) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/newscaster/play_attack_sound(damage, damage_type = BRUTE, damage_flag = 0) switch(damage_type) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index bc544aefda5..8d7131a0aa8 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -120,22 +120,22 @@ /obj/machinery/recharger/wrench_act(mob/living/user, obj/item/tool) if(charging) to_chat(user, span_notice("Remove the charging item first!")) - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_BLOCKING set_anchored(!anchored) power_change() to_chat(user, span_notice("You [anchored ? "attached" : "detached"] [src].")) tool.play_tool_sound(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/recharger/screwdriver_act(mob/living/user, obj/item/tool) if(!anchored || charging) - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_BLOCKING . = default_deconstruction_screwdriver(user, base_icon_state, base_icon_state, tool) if(.) update_appearance() /obj/machinery/recharger/crowbar_act(mob/living/user, obj/item/tool) - return (!anchored || charging) ? TOOL_ACT_SIGNAL_BLOCKING : default_deconstruction_crowbar(tool) + return (!anchored || charging) ? ITEM_INTERACT_BLOCKING : default_deconstruction_crowbar(tool) /obj/machinery/recharger/attack_hand(mob/user, list/modifiers) . = ..() diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index e78cdc56392..a17d9b845b0 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -75,7 +75,7 @@ /obj/machinery/recycler/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/recycler/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) diff --git a/code/game/machinery/sheetifier.dm b/code/game/machinery/sheetifier.dm index 30ce4860074..249eff1cfbe 100644 --- a/code/game/machinery/sheetifier.dm +++ b/code/game/machinery/sheetifier.dm @@ -61,7 +61,7 @@ /obj/machinery/sheetifier/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/sheetifier/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, initial(icon_state), initial(icon_state), I)) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 62f1b6f71a1..91ce119d3df 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -436,12 +436,11 @@ /obj/machinery/power/shieldwallgen/wrench_act(mob/living/user, obj/item/tool) - . = ..() - . |= default_unfasten_wrench(user, tool, time = 0) - var/turf/T = get_turf(src) - update_cable_icons_on_turf(T) - if(. == SUCCESSFUL_UNFASTEN && anchored) + var/unfasten_result = default_unfasten_wrench(user, tool, time = 0) + update_cable_icons_on_turf(get_turf(src)) + if(unfasten_result == SUCCESSFUL_UNFASTEN && anchored) connect_to_network() + return ITEM_INTERACT_SUCCESS /obj/machinery/power/shieldwallgen/screwdriver_act(mob/user, obj/item/tool) if(!panel_open && locked) @@ -465,9 +464,9 @@ balloon_alert(user, "malfunctioning!") else balloon_alert(user, "no access!") - + return - + add_fingerprint(user) if(is_wire_tool(W) && panel_open) wires.interact(user) diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index b4777c084c9..209b7101564 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -187,7 +187,7 @@ /obj/machinery/space_heater/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/space_heater/attackby(obj/item/I, mob/user, params) add_fingerprint(user) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index c561028746e..2f150d109f7 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -334,7 +334,7 @@ GLOBAL_LIST_INIT(dye_registry, list( if(!panel_open || busy) return FALSE default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/washing_machine/attackby(obj/item/W, mob/living/user, params) if(default_deconstruction_screwdriver(user, null, null, W)) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 3d37d2e52b4..2ad1096ac58 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -28,17 +28,17 @@ if(user_unbuckle_mob(buckled_mobs[1],user)) return TRUE -/atom/movable/attackby(obj/item/attacking_item, mob/user, params) - if(!can_buckle || !istype(attacking_item, /obj/item/riding_offhand) || !user.Adjacent(src)) +/atom/movable/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + if(!can_buckle || !istype(tool, /obj/item/riding_offhand) || !user.Adjacent(src)) return ..() - var/obj/item/riding_offhand/riding_item = attacking_item + var/obj/item/riding_offhand/riding_item = tool var/mob/living/carried_mob = riding_item.rider if(carried_mob == user) //Piggyback user. - return + return ITEM_INTERACT_BLOCKING user.unbuckle_mob(carried_mob) carried_mob.forceMove(get_turf(src)) - return mouse_buckle_handling(carried_mob, user) + return mouse_buckle_handling(carried_mob, user) ? ITEM_INTERACT_SUCCESS: ITEM_INTERACT_BLOCKING //literally just the above extension of attack_hand(), but for silicons instead (with an adjacency check, since attack_robot() being called doesn't mean that you're adjacent to something) /atom/movable/attack_robot(mob/living/user) diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index 9edeca9411e..eb3586bc917 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -34,7 +34,6 @@ if(locate(/obj/machinery/power/apc) in get_turf(user)) var/obj/machinery/power/apc/mounted_apc = locate(/obj/machinery/power/apc) in get_turf(user) mounted_apc.attackby(src, user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS T.attackby(src, user) - return TOOL_ACT_TOOLTYPE_SUCCESS - + return ITEM_INTERACT_SUCCESS diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 4f5cc1b5e8a..0bcf3c0e78d 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -71,15 +71,19 @@ diode = null return TRUE -/obj/item/laser_pointer/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) +/obj/item/laser_pointer/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) . = ..() - if(isnull(crystal_lens) || !(tool.tool_behaviour == TOOL_WIRECUTTER || tool.tool_behaviour == TOOL_HEMOSTAT)) - return + if(. & ITEM_INTERACT_ANY_BLOCKER) + return . + if(isnull(crystal_lens)) + return . + if(tool_behaviour != TOOL_WIRECUTTER && tool_behaviour != TOOL_HEMOSTAT) + return . tool.play_tool_sound(src) balloon_alert(user, "removed crystal lens") crystal_lens.forceMove(drop_location()) crystal_lens = null - return TRUE + return ITEM_INTERACT_SUCCESS /obj/item/laser_pointer/attackby(obj/item/attack_item, mob/user, params) if(istype(attack_item, /obj/item/stock_parts/micro_laser)) diff --git a/code/game/objects/items/devices/scanners/autopsy_scanner.dm b/code/game/objects/items/devices/scanners/autopsy_scanner.dm index 4c72c255351..701cd1f21d4 100644 --- a/code/game/objects/items/devices/scanners/autopsy_scanner.dm +++ b/code/game/objects/items/devices/scanners/autopsy_scanner.dm @@ -13,13 +13,19 @@ custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT*2) custom_price = PAYCHECK_COMMAND -/obj/item/autopsy_scanner/attack(mob/living/M, mob/living/carbon/human/user) +/obj/item/autopsy_scanner/interact_with_atom(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE if(!user.can_read(src) || user.is_blind()) - return + return ITEM_INTERACT_BLOCKING + + var/mob/living/M = interacting_with if(M.stat != DEAD && !HAS_TRAIT(M, TRAIT_FAKEDEATH)) // good job, you found a loophole to_chat(user, span_deadsay("[icon2html(src, user)] ERROR! CANNOT SCAN LIVE CADAVERS. PROCURE HEALTH ANALYZER OR TERMINATE PATIENT.")) - return + return ITEM_INTERACT_BLOCKING + + . = ITEM_INTERACT_SUCCESS // Clumsiness/brain damage check if ((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) diff --git a/code/game/objects/items/devices/scanners/health_analyzer.dm b/code/game/objects/items/devices/scanners/health_analyzer.dm index b6b3006ee6f..ac58e972d1f 100644 --- a/code/game/objects/items/devices/scanners/health_analyzer.dm +++ b/code/game/objects/items/devices/scanners/health_analyzer.dm @@ -54,9 +54,15 @@ if(SCANMODE_WOUND) to_chat(user, span_notice("You switch the health analyzer to report extra info on wounds.")) -/obj/item/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user) - if(!user.can_read(src)) //SKYRAT EDIT: Blind People Can Analyze Again - return +/obj/item/healthanalyzer/interact_with_atom(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE + if(!user.can_read(src)) //SKYRAT EDIT CHANGE - Blind People Can Analyze Again- ORIGINAL: if(!user.can_read(src) || user.is_blind()) + return ITEM_INTERACT_BLOCKING + + var/mob/living/M = interacting_with + + . = ITEM_INTERACT_SUCCESS flick("[icon_state]-scan", src) //makes it so that it plays the scan animation upon scanning, including clumsy scanning @@ -86,13 +92,14 @@ add_fingerprint(user) -/obj/item/healthanalyzer/attack_secondary(mob/living/victim, mob/living/user, params) - //if(!user.can_read(src) || user.is_blind()) - ORIGINAL - if(!user.can_read(src)) // SKYRAT EDIT CHANGE - Blind people can analyse again - return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN +/obj/item/healthanalyzer/interact_with_atom_secondary(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE + if(!user.can_read(src)) // SKYRAT EDIT CHANGE - Blind people can analyze again - ORIGINAL: if(!user.can_read(src) || user.is_blind()) + return ITEM_INTERACT_BLOCKING - chemscan(user, victim) - return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + chemscan(user, interacting_with) + return ITEM_INTERACT_SUCCESS /obj/item/healthanalyzer/add_item_context( obj/item/source, @@ -542,21 +549,24 @@ icon_state = "first_aid" desc = "A helpful, child-proofed, and most importantly, extremely cheap MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds. While it might not sound very informative for it to be able to tell you if you have a gaping hole in your body or not, it applies a temporary holoimage near the wound with information that is guaranteed to double the efficacy and speed of treatment." mode = SCANNER_NO_MODE - // Cooldown for when the analyzer will allow you to ask it for encouragement. Don't get greedy! + give_wound_treatment_bonus = TRUE + + /// Cooldown for when the analyzer will allow you to ask it for encouragement. Don't get greedy! var/next_encouragement - // The analyzer's current emotion. Affects the sprite overlays and if it's going to prick you for being greedy or not. + /// The analyzer's current emotion. Affects the sprite overlays and if it's going to prick you for being greedy or not. var/emotion = AID_EMOTION_NEUTRAL - // Encouragements to play when attack_selfing + /// Encouragements to play when attack_selfing var/list/encouragements = list("briefly displays a happy face, gazing emptily at you", "briefly displays a spinning cartoon heart", "displays an encouraging message about eating healthy and exercising", \ "reminds you that everyone is doing their best", "displays a message wishing you well", "displays a sincere thank-you for your interest in first-aid", "formally absolves you of all your sins") - // How often one can ask for encouragement + /// How often one can ask for encouragement var/patience = 10 SECONDS - give_wound_treatment_bonus = TRUE + /// What do we scan for, only used in descriptions + var/scan_for_what = "serious injuries" /obj/item/healthanalyzer/simple/attack_self(mob/user) if(next_encouragement < world.time) playsound(src, 'sound/machines/ping.ogg', 50, FALSE) - to_chat(user, span_notice("\The [src] makes a happy ping and [pick(encouragements)]!")) + to_chat(user, span_notice("[src] makes a happy ping and [pick(encouragements)]!")) next_encouragement = world.time + 10 SECONDS show_emotion(AID_EMOTION_HAPPY) else if(emotion != AID_EMOTION_ANGRY) @@ -565,35 +575,47 @@ violence(user) /obj/item/healthanalyzer/simple/proc/greed_warning(mob/user) - to_chat(user, span_warning("\The [src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement.")) + to_chat(user, span_warning("[src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement.")) show_emotion(AID_EMOTION_ANGRY) /obj/item/healthanalyzer/simple/proc/violence(mob/user) playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE) if(isliving(user)) var/mob/living/L = user - to_chat(L, span_warning("\The [src] makes a disappointed buzz and pricks your finger for being greedy. Ow!")) + to_chat(L, span_warning("[src] makes a disappointed buzz and pricks your finger for being greedy. Ow!")) flick(icon_state + "_pinprick", src) - L.adjustBruteLoss(4) - L.dropItemToGround(src) + violence_damage(user) + user.dropItemToGround(src) show_emotion(AID_EMOTION_HAPPY) +/obj/item/healthanalyzer/simple/proc/violence_damage(mob/living/user) + user.adjustBruteLoss(4) -/obj/item/healthanalyzer/simple/attack(mob/living/carbon/patient, mob/living/carbon/human/user) - if(!user.can_read(src)) //SKYRAT EDIT: Blind People Can Analyze Again - return +/obj/item/healthanalyzer/simple/interact_with_atom(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE + if(!user.can_read(src)) //SKYRAT EDIT CHANGE - Blind People Can Analyze Again - ORIGINAL: if(!user.can_read(src) || user.is_blind()) + return ITEM_INTERACT_BLOCKING add_fingerprint(user) - user.visible_message(span_notice("[user] scans [patient] for serious injuries."), span_notice("You scan [patient] for serious injuries.")) + user.visible_message( + span_notice("[user] scans [interacting_with] for [scan_for_what]."), + span_notice("You scan [interacting_with] for [scan_for_what]."), + ) - if(!istype(patient)) + if(!iscarbon(interacting_with)) playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE) - to_chat(user, span_notice("\The [src] makes a sad buzz and briefly displays an unhappy face, indicating it can't scan [patient].")) + to_chat(user, span_notice("[src] makes a sad buzz and briefly displays an unhappy face, indicating it can't scan [interacting_with].")) show_emotion(AI_EMOTION_SAD) - return + return ITEM_INTERACT_BLOCKING - woundscan(user, patient, src, simple_scan = TRUE) + do_the_scan(interacting_with, user) flick(icon_state + "_pinprick", src) + update_appearance(UPDATE_OVERLAYS) + return ITEM_INTERACT_SUCCESS + +/obj/item/healthanalyzer/simple/proc/do_the_scan(mob/living/carbon/scanning, mob/living/user) + woundscan(user, scanning, src, simple_scan = TRUE) /obj/item/healthanalyzer/simple/update_overlays() . = ..() @@ -632,39 +654,14 @@ encouragements = list("encourages you to take your medication", "briefly displays a spinning cartoon heart", "reasures you about your condition", \ "reminds you that everyone is doing their best", "displays a message wishing you well", "displays a message saying how proud it is that you're taking care of yourself", "formally absolves you of all your sins") patience = 20 SECONDS + scan_for_what = "diseases" -/obj/item/healthanalyzer/simple/disease/greed_warning(mob/user) - to_chat(user, span_warning("\The [src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement.")) - show_emotion(AID_EMOTION_ANGRY) - -/obj/item/healthanalyzer/simple/disease/violence(mob/user) - playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE) - if(isliving(user)) - var/mob/living/L = user - to_chat(L, span_warning("\The [src] makes a disappointed buzz and pricks your finger for being greedy. Ow!")) - flick(icon_state + "_pinprick", src) - L.adjustBruteLoss(1) - L.reagents.add_reagent(/datum/reagent/toxin, rand(1, 3)) - L.dropItemToGround(src) - show_emotion(AID_EMOTION_ANGRY) - -/obj/item/healthanalyzer/simple/disease/attack(mob/living/carbon/patient, mob/living/carbon/human/user) - if(!user.can_read(src) || user.is_blind()) - return +/obj/item/healthanalyzer/simple/disease/violence_damage(mob/living/user) + user.adjustBruteLoss(1) + user.reagents.add_reagent(/datum/reagent/toxin, rand(1, 3)) - add_fingerprint(user) - user.visible_message(span_notice("[user] scans [patient] for diseases."), span_notice("You scan [patient] for diseases.")) - - if(!istype(user)) - playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE) - to_chat(user, span_notice("\The [src] makes a sad buzz and briefly displays a frowny face, indicating it can't scan [patient].")) - emotion = AID_EMOTION_SAD - update_appearance(UPDATE_OVERLAYS) - return - - diseasescan(user, patient, src) // this updates emotion - update_appearance(UPDATE_OVERLAYS) - flick(icon_state + "_pinprick", src) +/obj/item/healthanalyzer/simple/disease/do_the_scan(mob/living/carbon/scanning, mob/living/user) + diseasescan(user, scanning, src) /obj/item/healthanalyzer/simple/disease/update_overlays() . = ..() @@ -680,7 +677,7 @@ if(emotion != AID_EMOTION_NEUTRAL) addtimer(CALLBACK(src, PROC_REF(reset_emotions)), 4 SECONDS) // longer on purpose -//Checks the individual for any diseases that are visible to the scanner, and displays the diseases in the attacked to the attacker. +/// Checks the individual for any diseases that are visible to the scanner, and displays the diseases in the attacked to the attacker. /proc/diseasescan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/simple/scanner) if(!istype(patient) || user.incapacitated()) return diff --git a/code/game/objects/items/devices/scanners/sequence_scanner.dm b/code/game/objects/items/devices/scanners/sequence_scanner.dm index 5882b156e1a..b5504ab1742 100644 --- a/code/game/objects/items/devices/scanners/sequence_scanner.dm +++ b/code/game/objects/items/devices/scanners/sequence_scanner.dm @@ -29,32 +29,42 @@ if(LAZYLEN(genetic_makeup_buffer) > 0) . += span_notice("It has the genetic makeup of \"[genetic_makeup_buffer["name"]]\" stored inside its buffer") -/obj/item/sequence_scanner/attack(mob/living/target, mob/living/carbon/human/user) +/obj/item/sequence_scanner/interact_with_atom(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE + add_fingerprint(user) + //no scanning if its a husk or DNA-less Species - if (!HAS_TRAIT(target, TRAIT_GENELESS) && !HAS_TRAIT(target, TRAIT_BADDNA)) - user.visible_message(span_notice("[user] analyzes [target]'s genetic sequence.")) + if (!HAS_TRAIT(interacting_with, TRAIT_GENELESS) && !HAS_TRAIT(interacting_with, TRAIT_BADDNA)) + user.visible_message(span_notice("[user] analyzes [interacting_with]'s genetic sequence.")) balloon_alert(user, "sequence analyzed") - playsound(user.loc, 'sound/items/healthanalyzer.ogg', 50) // close enough - gene_scan(target, user) - else - user.visible_message(span_notice("[user] fails to analyze [target]'s genetic sequence."), span_warning("[target] has no readable genetic sequence!")) + playsound(user, 'sound/items/healthanalyzer.ogg', 50) // close enough + gene_scan(interacting_with, user) + return ITEM_INTERACT_SUCCESS + + user.visible_message(span_notice("[user] fails to analyze [interacting_with]'s genetic sequence."), span_warning("[interacting_with] has no readable genetic sequence!")) + return ITEM_INTERACT_BLOCKING + +/obj/item/sequence_scanner/interact_with_atom_secondary(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE -/obj/item/sequence_scanner/attack_secondary(mob/living/target, mob/living/carbon/human/user, max_interact_count = 1) add_fingerprint(user) + //no scanning if its a husk, DNA-less Species or DNA that isn't able to be copied by a changeling/disease - if (!HAS_TRAIT(target, TRAIT_GENELESS) && !HAS_TRAIT(target, TRAIT_BADDNA) && !HAS_TRAIT(target, TRAIT_NO_DNA_COPY)) - user.visible_message(span_warning("[user] is scanning [target]'s genetic makeup.")) + if (!HAS_TRAIT(interacting_with, TRAIT_GENELESS) && !HAS_TRAIT(interacting_with, TRAIT_BADDNA) && !HAS_TRAIT(interacting_with, TRAIT_NO_DNA_COPY)) + user.visible_message(span_warning("[user] is scanning [interacting_with]'s genetic makeup.")) if(!do_after(user, 3 SECONDS)) balloon_alert(user, "scan failed!") - user.visible_message(span_warning("[user] fails to scan [target]'s genetic makeup.")) - return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN - makeup_scan(target, user) + user.visible_message(span_warning("[user] fails to scan [interacting_with]'s genetic makeup.")) + return ITEM_INTERACT_BLOCKING + makeup_scan(interacting_with, user) balloon_alert(user, "makeup scanned") - return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN - else - user.visible_message(span_notice("[user] fails to analyze [target]'s genetic makeup."), span_warning("[target] has no readable genetic makeup!")) - return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + return ITEM_INTERACT_SUCCESS + + user.visible_message(span_notice("[user] fails to analyze [interacting_with]'s genetic makeup."), span_warning("[interacting_with] has no readable genetic makeup!")) + return ITEM_INTERACT_BLOCKING /obj/item/sequence_scanner/afterattack_secondary(obj/object, mob/user, proximity) . = ..() diff --git a/code/game/objects/items/devices/scanners/slime_scanner.dm b/code/game/objects/items/devices/scanners/slime_scanner.dm index fe7ac245da0..a20203d0675 100644 --- a/code/game/objects/items/devices/scanners/slime_scanner.dm +++ b/code/game/objects/items/devices/scanners/slime_scanner.dm @@ -13,14 +13,17 @@ throw_range = 7 custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT*0.30, /datum/material/glass=SMALL_MATERIAL_AMOUNT * 0.20) -/obj/item/slime_scanner/attack(mob/living/living_mob, mob/living/user) - if(user.stat || !user.can_read(src)) //SKYRAT EDIT CHANGE - Blind People Can Analyze Again - ORIGINAL : if(user.stat || !user.can_read(src) || user.is_blind()) - return - if (!isslime(living_mob)) +/obj/item/slime_scanner/interact_with_atom(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE + if(!user.can_read(src)) //SKYRAT EDIT CHANGE - Blind People Can Analyze Again - ORIGINAL : if(!user.can_read(src) || user.is_blind()) + return ITEM_INTERACT_BLOCKING + if (!isslime(interacting_with)) to_chat(user, span_warning("This device can only scan slimes!")) - return - var/mob/living/simple_animal/slime/scanned_slime = living_mob + return ITEM_INTERACT_BLOCKING + var/mob/living/simple_animal/slime/scanned_slime = interacting_with slime_scan(scanned_slime, user) + return ITEM_INTERACT_SUCCESS /proc/slime_scan(mob/living/simple_animal/slime/scanned_slime, mob/living/user) var/to_render = "Slime scan results:\ diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 931eded30bc..70820314305 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -78,30 +78,31 @@ effective or pretty fucking useless. var/intensity = 10 // how much damage the radiation does var/wavelength = 10 // time it takes for the radiation to kick in, in seconds -/obj/item/healthanalyzer/rad_laser/attack(mob/living/M, mob/living/user) +/obj/item/healthanalyzer/rad_laser/interact_with_atom(atom/interacting_with, mob/living/user) if(!stealth || !irradiate) - ..() + . = ..() - if(!irradiate) - return + if(!ishuman(interacting_with) || !irradiate) + return . - var/mob/living/carbon/human/human_target = M + var/mob/living/carbon/human/human_target = interacting_with if(istype(human_target) && !used && SSradiation.wearing_rad_protected_clothing(human_target)) //intentionally not checking for TRAIT_RADIMMUNE here so that tatortot can still fuck up and waste their cooldown. - to_chat(user, span_warning("[M]'s clothing is fully protecting [M.p_them()] from irradiation!")) - return + to_chat(user, span_warning("[interacting_with]'s clothing is fully protecting [interacting_with.p_them()] from irradiation!")) + return . | ITEM_INTERACT_BLOCKING if(!used) - log_combat(user, M, "irradiated", src) + log_combat(user, interacting_with, "irradiated", src) var/cooldown = get_cooldown() used = TRUE icon_state = "health1" addtimer(VARSET_CALLBACK(src, used, FALSE), cooldown) addtimer(VARSET_CALLBACK(src, icon_state, "health"), cooldown) - to_chat(user, span_warning("Successfully irradiated [M].")) - addtimer(CALLBACK(src, PROC_REF(radiation_aftereffect), M, intensity), (wavelength+(intensity*4))*5) - return + to_chat(user, span_warning("Successfully irradiated [interacting_with].")) + addtimer(CALLBACK(src, PROC_REF(radiation_aftereffect), interacting_with, intensity), (wavelength+(intensity*4))*5) + return . | ITEM_INTERACT_SUCCESS to_chat(user, span_warning("The radioactive microlaser is still recharging.")) + return . | ITEM_INTERACT_BLOCKING /obj/item/healthanalyzer/rad_laser/proc/radiation_aftereffect(mob/living/M, passed_intensity) if(QDELETED(M) || !ishuman(M) || HAS_TRAIT(M, TRAIT_RADIMMUNE)) diff --git a/code/game/objects/items/emags.dm b/code/game/objects/items/emags.dm index 58e0ad881a4..141e242fc03 100644 --- a/code/game/objects/items/emags.dm +++ b/code/game/objects/items/emags.dm @@ -49,30 +49,30 @@ user.visible_message(span_notice("[user] shows you: [icon2html(src, viewers(user))] [name]."), span_notice("You show [src].")) add_fingerprint(user) -/obj/item/card/emagfake/afterattack(atom/target, mob/user, proximity_flag, click_parameters) - . = ..() - if (!proximity_flag) - return - . |= AFTERATTACK_PROCESSED_ITEM +/obj/item/card/emagfake/interact_with_atom(atom/interacting_with, mob/living/user) playsound(src, 'sound/items/bikehorn.ogg', 50, TRUE) + return ITEM_INTERACT_SKIP_TO_ATTACK // So it does the attack animation. /obj/item/card/emag/Initialize(mapload) . = ..() type_blacklist = list(typesof(/obj/machinery/door/airlock) + typesof(/obj/machinery/door/window/) + typesof(/obj/machinery/door/firedoor) - typesof(/obj/machinery/door/airlock/tram)) //list of all typepaths that require a specialized emag to hack. -/obj/item/card/emag/attack() - return +/obj/item/card/emag/interact_with_atom(atom/interacting_with, mob/living/user) + if(!can_emag(interacting_with, user)) + return ITEM_INTERACT_BLOCKING + log_combat(user, interacting_with, "attempted to emag") + interacting_with.emag_act(user, src) + return ITEM_INTERACT_SUCCESS -/obj/item/card/emag/afterattack(atom/target, mob/user, proximity) +/obj/item/card/emag/afterattack(atom/target, mob/user, proximity_flag, click_parameters) . = ..() - var/atom/A = target - if(!proximity && prox_check) + // Proximity based emagging is handled by above + // This is only for ranged emagging + if(proximity_flag || prox_check) return + . |= AFTERATTACK_PROCESSED_ITEM - if(!can_emag(target, user)) - return - log_combat(user, A, "attempted to emag") - A.emag_act(user, src) + interact_with_atom(target, user) /obj/item/card/emag/proc/can_emag(atom/target, mob/user) for (var/subtypelist in type_blacklist) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 3d4ea3676b3..b9e5ee828fc 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -33,9 +33,12 @@ /// How much we add to flesh_healing for burn wounds on application var/flesh_regeneration -/obj/item/stack/medical/attack(mob/living/patient, mob/user) - . = ..() - try_heal(patient, user) +/obj/item/stack/medical/interact_with_atom(atom/interacting_with, mob/living/user) + if(!isliving(interacting_with)) + return NONE + + try_heal(interacting_with, user) + return ITEM_INTERACT_SUCCESS /obj/item/stack/medical/apply_fantasy_bonuses(bonus) . = ..() diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index d67c6fc8588..064f933573c 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -92,7 +92,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ ) use(2) user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/rods/welder_act_secondary(mob/living/user, obj/item/tool) if(tool.use_tool(src, user, delay = 0, volume = 40)) @@ -105,20 +105,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ ) use(1) user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS - -/obj/item/stack/rods/welder_act_secondary(mob/living/user, obj/item/tool) - if(tool.use_tool(src, user, delay = 0, volume = 40)) - var/obj/item/stack/tile/iron/two/new_item = new(user.loc) - user.visible_message( - span_notice("[user.name] shaped [src] into floor tiles with [tool]."), - blind_message = span_hear("You hear welding."), - vision_distance = COMBAT_MESSAGE_RANGE, - ignored_mobs = user - ) - use(1) - user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/rods/cyborg/Initialize(mapload) AddElement(/datum/element/update_icon_blocker) diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 7a180bc5dbd..5a789d34350 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -382,7 +382,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( to_chat(user, span_notice("You melt [src] down into [new_glass.name].")) new_glass.forceMove((Adjacent(user) ? user.drop_location() : loc)) //stack merging is handled automatically. qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/shard/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index ebf4c2ff4ee..309d23aac9f 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -202,7 +202,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ ) use(1) user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/sheet/iron/welder_act_secondary(mob/living/user, obj/item/tool) if(tool.use_tool(src, user, delay = 0, volume = 40)) @@ -215,7 +215,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ ) use(1) user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/sheet/iron/afterattack_secondary(atom/target, mob/user, proximity_flag, click_parameters) if(isopenturf(target)) diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index 09cc3d5bed2..51d21d6ef6c 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -11,17 +11,20 @@ merge_type = /obj/item/stack/telecrystal novariants = FALSE -/obj/item/stack/telecrystal/attack(mob/target, mob/user) - if(target == user) //You can't go around smacking people with crystals to find out if they have an uplink or not. - for(var/obj/item/implant/uplink/I in target) - if(I?.imp_in) - var/datum/component/uplink/hidden_uplink = I.GetComponent(/datum/component/uplink) - if(hidden_uplink) - hidden_uplink.add_telecrystals(amount) - use(amount) - to_chat(user, span_notice("You press [src] onto yourself and charge your hidden uplink.")) - else - return ..() +/obj/item/stack/telecrystal/interact_with_atom(atom/interacting_with, mob/living/user) + if(interacting_with != user) //You can't go around smacking people with crystals to find out if they have an uplink or not. + return NONE + + for(var/obj/item/implant/uplink/uplink in interacting_with) + if(!uplink.imp_in) + continue + + var/datum/component/uplink/hidden_uplink = uplink.GetComponent(/datum/component/uplink) + if(hidden_uplink) + hidden_uplink.add_telecrystals(amount) + use(amount) + to_chat(user, span_notice("You press [src] onto yourself and charge your hidden uplink.")) + return ITEM_INTERACT_SUCCESS /obj/item/stack/telecrystal/five amount = 5 diff --git a/code/game/objects/items/stacks/tiles/tile_iron.dm b/code/game/objects/items/stacks/tiles/tile_iron.dm index e06df0728a7..b1ff419208a 100644 --- a/code/game/objects/items/stacks/tiles/tile_iron.dm +++ b/code/game/objects/items/stacks/tiles/tile_iron.dm @@ -117,7 +117,7 @@ ) use(4) user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/tile/iron/welder_act_secondary(mob/living/user, obj/item/tool) if(get_amount() < 2) @@ -133,7 +133,7 @@ ) use(2) user.put_in_inactive_hand(new_item) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/tile/iron/base //this subtype should be used for most stuff merge_type = /obj/item/stack/tile/iron/base diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index a88a069e421..53c42ed35ab 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -112,7 +112,7 @@ /obj/item/weldingtool/screwdriver_act(mob/living/user, obj/item/tool) flamethrower_screwdriver(tool, user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/weldingtool/attackby(obj/item/tool, mob/user, params) if(istype(tool, /obj/item/stack/rods)) @@ -134,28 +134,32 @@ LAZYREMOVE(update_overlays_on_z, sparks) target.cut_overlay(sparks) -/obj/item/weldingtool/attack(mob/living/carbon/human/attacked_humanoid, mob/living/user) - if(!istype(attacked_humanoid)) - return ..() +/obj/item/weldingtool/interact_with_atom(atom/interacting_with, mob/living/user) + if(!ishuman(interacting_with)) + return NONE + if(user.combat_mode) + return NONE + var/mob/living/carbon/human/attacked_humanoid = interacting_with var/obj/item/bodypart/affecting = attacked_humanoid.get_bodypart(check_zone(user.zone_selected)) - - if(affecting && IS_ROBOTIC_LIMB(affecting) && !user.combat_mode) - if(src.use_tool(attacked_humanoid, user, 0, volume=50, amount=1)) - if(user == attacked_humanoid) - user.visible_message(span_notice("[user] starts to fix some of the dents on [attacked_humanoid]'s [affecting.name]."), - span_notice("You start fixing some of the dents on [attacked_humanoid == user ? "your" : "[attacked_humanoid]'s"] [affecting.name].")) - /* SKYRAT EDIT START - ORIGINAL: - if(!do_after(user, 5 SECONDS, attacked_humanoid)) - return - */ - // SKYRAT EDIT CHANGE START - if(!do_after(user, (user == attacked_humanoid ? self_delay : other_delay))) - return - // SKYRAT EDIT CHANGE END - item_heal_robotic(attacked_humanoid, user, 15, 0) - else - return ..() + if(isnull(affecting) || !IS_ROBOTIC_LIMB(affecting)) + return ITEM_INTERACT_BLOCKING + + if(!use_tool(attacked_humanoid, user, 0, volume=50, amount=1)) + return ITEM_INTERACT_BLOCKING + + if(user == attacked_humanoid) + user.visible_message(span_notice("[user] starts to fix some of the dents on [attacked_humanoid]'s [affecting.name]."), + span_notice("You start fixing some of the dents on [attacked_humanoid == user ? "your" : "[attacked_humanoid]'s"] [affecting.name].")) + if(!do_after(user, self_delay, attacked_humanoid)) // SKYRAT EDIT CHANGE - ORIGINAL: if(!do_after(user, 5 SECONDS, attacked_humanoid)) + return ITEM_INTERACT_BLOCKING + // SKYRAT EDIT ADDITION START + if(!do_after(user, other_delay, attacked_humanoid)) + return ITEM_INTERACT_BLOCKING + // SKYRAT EDIT ADDITION END + + item_heal_robotic(attacked_humanoid, user, 15, 0) + return ITEM_INTERACT_SUCCESS /obj/item/weldingtool/afterattack(atom/attacked_atom, mob/user, proximity) . = ..() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 6769dab38e2..952ecb14f29 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -457,10 +457,10 @@ if("purple") saber_color = "red" else - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "changed to [saber_color]") update_appearance(UPDATE_ICON) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/toy/sword/vv_edit_var(vname, vval) . = ..() diff --git a/code/game/objects/items/wall_mounted.dm b/code/game/objects/items/wall_mounted.dm index 7589de01ad8..4b77eb0455c 100644 --- a/code/game/objects/items/wall_mounted.dm +++ b/code/game/objects/items/wall_mounted.dm @@ -64,7 +64,7 @@ var/turf/T = get_step(get_turf(user), user.dir) if(iswallturf(T)) T.attackby(src, user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/wallframe/wrench_act(mob/living/user, obj/item/tool) var/metal_amt = round(custom_materials[GET_MATERIAL_REF(/datum/material/iron)]/SHEET_MATERIAL_AMOUNT) //Replace this shit later @@ -79,7 +79,7 @@ if(glass_amt) new /obj/item/stack/sheet/glass(get_turf(src), glass_amt) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/electronics desc = "Looks like a circuit. Probably is." diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index b2a7d912cb2..04db148ea5b 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -136,25 +136,25 @@ /obj/structure/ai_core/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/ai_core/screwdriver_act(mob/living/user, obj/item/tool) . = ..() if(state == AI_READY_CORE) if(!core_mmi) balloon_alert(user, "no brain installed!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS else if(!core_mmi.brainmob?.mind || suicide_check()) balloon_alert(user, "brain is inactive!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS else balloon_alert(user, "connecting neural network...") if(!tool.use_tool(src, user, 10 SECONDS)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!ai_structure_to_mob()) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "connected neural network") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/ai_core/attackby(obj/item/P, mob/living/user, params) if(!anchored) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 7a283e38639..8517a321ceb 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -650,17 +650,17 @@ LINEN BINS return FALSE if(amount) to_chat(user, span_warning("The [src] must be empty first!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(tool.use_tool(src, user, 0.5 SECONDS, volume=50)) to_chat(user, span_notice("You disassemble the [src].")) new /obj/item/stack/rods(loc, 2) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/bedsheetbin/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 0.5 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/bedsheet)) diff --git a/code/game/objects/structures/broken_flooring.dm b/code/game/objects/structures/broken_flooring.dm index b2be42ae40d..3d1fa986505 100644 --- a/code/game/objects/structures/broken_flooring.dm +++ b/code/game/objects/structures/broken_flooring.dm @@ -32,7 +32,7 @@ balloon_alert(user, "tile reclaimed") new /obj/item/stack/tile/iron(get_turf(src)) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/broken_flooring/singular icon_state = "singular" diff --git a/code/game/objects/structures/cannons/cannon.dm b/code/game/objects/structures/cannons/cannon.dm index dea2864fabe..3408ade8283 100644 --- a/code/game/objects/structures/cannons/cannon.dm +++ b/code/game/objects/structures/cannons/cannon.dm @@ -51,7 +51,7 @@ if(!anchorable_cannon) return FALSE default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/cannon/attackby(obj/item/used_item, mob/user, params) if(charge_ignited) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 3721d198a17..13ab18fdb0e 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -272,7 +272,7 @@ electronics.forceMove(drop_location()) electronics = null qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/displaycase_chassis/attackby(obj/item/attacking_item, mob/user, params) if(istype(attacking_item, /obj/item/electronics/airlock)) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 9ea8eff12e3..9f4f4fdd73f 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -91,11 +91,11 @@ qdel(src) return T -/obj/structure/falsewall/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) - if(!opening) +/obj/structure/falsewall/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + if(!opening || !tool.tool_behaviour) return ..() to_chat(user, span_warning("You must wait until the door has stopped moving!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_BLOCKING /obj/structure/falsewall/screwdriver_act(mob/living/user, obj/item/tool) if(!density) @@ -104,19 +104,19 @@ var/turf/loc_turf = get_turf(src) if(loc_turf.density) to_chat(user, span_warning("[src] is blocked!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!isfloorturf(loc_turf)) to_chat(user, span_warning("[src] bolts must be tightened on the floor!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.visible_message(span_notice("[user] tightens some bolts on the wall."), span_notice("You tighten the bolts on the wall.")) ChangeToWall() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/falsewall/welder_act(mob/living/user, obj/item/tool) if(tool.use_tool(src, user, 0 SECONDS, volume=50)) dismantle(user, TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return /obj/structure/falsewall/attackby(obj/item/W, mob/user, params) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index c5cb790d0a8..959f0c7a74c 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -204,7 +204,7 @@ return FALSE tool.play_tool_sound(src, 100) deconstruct() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/grille/screwdriver_act(mob/living/user, obj/item/tool) if(!isturf(loc)) @@ -219,7 +219,7 @@ set_anchored(!anchored) user.visible_message(span_notice("[user] [anchored ? "fastens" : "unfastens"] [src]."), \ span_notice("You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/grille/attackby(obj/item/W, mob/user, params) user.changeNext_move(CLICK_CD_MELEE) diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index 1c914734cbf..ca019c05c12 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -277,7 +277,7 @@ if(default_unfasten_wrench(user, tool, time = GUILLOTINE_WRENCH_DELAY)) setDir(SOUTH) current_action = GUILLOTINE_ACTION_IDLE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS current_action = GUILLOTINE_ACTION_IDLE return FALSE diff --git a/code/game/objects/structures/janitor.dm b/code/game/objects/structures/janitor.dm index 7721a6d39ac..4f5bdf28127 100644 --- a/code/game/objects/structures/janitor.dm +++ b/code/game/objects/structures/janitor.dm @@ -229,7 +229,7 @@ /obj/structure/mop_bucket/janitorialcart/crowbar_act(mob/living/user, obj/item/tool) if(!CART_HAS_MINIMUM_REAGENT_VOLUME) balloon_alert(user, "mop bucket is empty!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.balloon_alert_to_viewers("starts dumping [src]...", "started dumping [src]...") user.visible_message(span_notice("[user] begins to dumping the contents of [src]'s mop bucket."), span_notice("You begin to dump the contents of [src]'s mop bucket...")) if(tool.use_tool(src, user, 5 SECONDS, volume = 50)) @@ -238,7 +238,7 @@ reagents.expose(loc) reagents.clear_reagents() update_appearance(UPDATE_OVERLAYS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/mop_bucket/janitorialcart/attackby_secondary(obj/item/weapon, mob/user, params) . = ..() diff --git a/code/game/objects/structures/loom.dm b/code/game/objects/structures/loom.dm index d01c17b0a6d..2d10df50a74 100644 --- a/code/game/objects/structures/loom.dm +++ b/code/game/objects/structures/loom.dm @@ -21,4 +21,4 @@ /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 + return ITEM_INTERACT_SUCCESS diff --git a/code/game/objects/structures/mannequin.dm b/code/game/objects/structures/mannequin.dm index 618b935e690..4fc14ada0b2 100644 --- a/code/game/objects/structures/mannequin.dm +++ b/code/game/objects/structures/mannequin.dm @@ -87,7 +87,7 @@ /obj/structure/mannequin/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/mannequin/update_overlays() . = ..() diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 5baacb8a651..03e37346c57 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -154,7 +154,7 @@ /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 + return ITEM_INTERACT_SUCCESS /////////////////////// TOOL OVERRIDES /////////////////////// diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm index 22d40c01412..0d6799b0583 100644 --- a/code/game/objects/structures/reflector.dm +++ b/code/game/objects/structures/reflector.dm @@ -79,21 +79,21 @@ P.decayedRange = max(P.decayedRange--, 0) return BULLET_ACT_FORCE_PIERCE -/obj/structure/reflector/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) - if(admin) - return FALSE +/obj/structure/reflector/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + if(admin && tool.tool_behaviour) + return ITEM_INTERACT_BLOCKING return ..() /obj/structure/reflector/screwdriver_act(mob/living/user, obj/item/tool) can_rotate = !can_rotate to_chat(user, span_notice("You [can_rotate ? "unlock" : "lock"] [src]'s rotation.")) tool.play_tool_sound(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reflector/wrench_act(mob/living/user, obj/item/tool) if(anchored) to_chat(user, span_warning("Unweld [src] from the floor first!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.visible_message(span_notice("[user] starts to dismantle [src]."), span_notice("You start to dismantle [src]...")) if(!tool.use_tool(src, user, 8 SECONDS, volume=50)) return @@ -102,7 +102,7 @@ if(buildstackamount) new buildstacktype(drop_location(), buildstackamount) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reflector/welder_act(mob/living/user, obj/item/tool) if(!tool.tool_start_check(user, amount=1)) @@ -130,7 +130,7 @@ set_anchored(FALSE) to_chat(user, span_notice("You cut [src] free from the floor.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reflector/attackby(obj/item/W, mob/user, params) if(admin) diff --git a/code/game/objects/structures/showcase.dm b/code/game/objects/structures/showcase.dm index 2349d9b0f49..225b43c2a91 100644 --- a/code/game/objects/structures/showcase.dm +++ b/code/game/objects/structures/showcase.dm @@ -148,7 +148,7 @@ to_chat(user, span_notice("You unscrew the screws.")) tool.play_tool_sound(src, 100) deconstruction_state = SHOWCASE_SCREWDRIVERED - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/showcase/crowbar_act(mob/living/user, obj/item/tool) if(!tool.use_tool(src, user, 2 SECONDS, volume=100)) @@ -156,13 +156,13 @@ to_chat(user, span_notice("You start to crowbar the showcase apart...")) new /obj/item/stack/sheet/iron(drop_location(), 4) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/showcase/wrench_act(mob/living/user, obj/item/tool) if(deconstruction_state != SHOWCASE_CONSTRUCTED) return FALSE default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS //Feedback is given in examine because showcases can basically have any sprite assigned to them diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index d79e8892197..c3ec9b166f9 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -212,7 +212,7 @@ to_chat(user, span_notice("You start disassembling [src]...")) if(tool.use_tool(src, user, 2 SECONDS, volume=50)) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/table/wrench_act_secondary(mob/living/user, obj/item/tool) if(obj_flags & NO_DECONSTRUCTION || !deconstruction_ready) @@ -221,7 +221,7 @@ if(tool.use_tool(src, user, 4 SECONDS, volume=50)) playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE) deconstruct(TRUE, 1) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/table/attackby(obj/item/I, mob/living/user, params) var/list/modifiers = params2list(params) diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 855501803ca..ec00eb110a7 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -37,7 +37,7 @@ /obj/structure/tank_dispenser/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/tank_dispenser/attackby(obj/item/I, mob/living/user, params) var/full diff --git a/code/game/objects/structures/votingbox.dm b/code/game/objects/structures/votingbox.dm index 0e46a0b4444..00eeeb55ae2 100644 --- a/code/game/objects/structures/votingbox.dm +++ b/code/game/objects/structures/votingbox.dm @@ -133,7 +133,7 @@ /obj/structure/votebox/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 4 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/votebox/crowbar_act(mob/living/user, obj/item/I) . = ..() diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 40dfa98c756..f809a3c32fd 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -190,16 +190,16 @@ return return ..() -/obj/structure/window/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) +/obj/structure/window/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) if(!can_be_reached(user)) - return TRUE //skip the afterattack + return ITEM_INTERACT_SKIP_TO_ATTACK // Guess you get to hit it add_fingerprint(user) return ..() /obj/structure/window/welder_act(mob/living/user, obj/item/tool) if(atom_integrity >= max_integrity) to_chat(user, span_warning("[src] is already in good condition!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!tool.tool_start_check(user, amount = 0)) return FALSE to_chat(user, span_notice("You begin repairing [src]...")) @@ -207,7 +207,7 @@ atom_integrity = max_integrity update_nearby_icons() to_chat(user, span_notice("You repair [src].")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/window/screwdriver_act(mob/living/user, obj/item/tool) if(obj_flags & NO_DECONSTRUCTION) @@ -235,7 +235,7 @@ if(tool.use_tool(src, user, decon_speed, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored))) set_anchored(TRUE) to_chat(user, span_notice("You fasten the frame to the floor.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/window/wrench_act(mob/living/user, obj/item/tool) if(anchored) @@ -245,14 +245,14 @@ to_chat(user, span_notice("You begin to disassemble [src]...")) if(!tool.use_tool(src, user, decon_speed, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored))) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/obj/item/stack/sheet/G = new glass_type(user.loc, glass_amount) if (!QDELETED(G)) G.add_fingerprint(user) playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE) to_chat(user, span_notice("You successfully disassemble [src].")) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/window/crowbar_act(mob/living/user, obj/item/tool) if(!anchored || (obj_flags & NO_DECONSTRUCTION)) @@ -272,7 +272,7 @@ else return FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/window/attackby(obj/item/I, mob/living/user, params) if(!can_be_reached(user)) @@ -552,7 +552,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0) if(tool.use_tool(src, user, 10 SECONDS, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored))) state = RWINDOW_SECURE to_chat(user, span_notice("You pry the window back into the frame.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/window/proc/cool_bolts() if(state == RWINDOW_BOLTS_HEATED) diff --git a/code/game/shuttle_engines.dm b/code/game/shuttle_engines.dm index 159dab78cee..8ddae94231d 100644 --- a/code/game/shuttle_engines.dm +++ b/code/game/shuttle_engines.dm @@ -105,7 +105,7 @@ /obj/machinery/power/shuttle_engine/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/power/shuttle_engine/welder_act(mob/living/user, obj/item/tool) . = ..() diff --git a/code/game/turfs/open/floor/plating.dm b/code/game/turfs/open/floor/plating.dm index 8b483cad262..3e58d647023 100644 --- a/code/game/turfs/open/floor/plating.dm +++ b/code/game/turfs/open/floor/plating.dm @@ -177,8 +177,9 @@ ScrapeAway(flags = CHANGETURF_INHERIT_AIR) return TRUE -/turf/open/floor/plating/foam/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) - return +/turf/open/floor/plating/foam/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + SHOULD_CALL_PARENT(FALSE) + return NONE // Fuck you //reinforced plating deconstruction states #define PLATE_INTACT 0 diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm index f33dd9e2531..66004140e59 100644 --- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm +++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm @@ -48,37 +48,29 @@ icon_state = "gizmo_scan" to_chat(user, span_notice("You switch the device to [mode == GIZMO_SCAN? "SCAN": "MARK"] MODE")) -/obj/item/abductor/gizmo/attack(mob/living/target, mob/user) +/obj/item/abductor/gizmo/interact_with_atom(atom/interacting_with, mob/living/user) if(!ScientistCheck(user)) - return + return ITEM_INTERACT_SKIP_TO_ATTACK // So you slap them with it if(!console) to_chat(user, span_warning("The device is not linked to console!")) - return + return ITEM_INTERACT_BLOCKING switch(mode) if(GIZMO_SCAN) - scan(target, user) + scan(interacting_with, user) if(GIZMO_MARK) - mark(target, user) + mark(interacting_with, user) + return ITEM_INTERACT_SUCCESS -/obj/item/abductor/gizmo/afterattack(atom/target, mob/living/user, flag, params) +/obj/item/abductor/gizmo/afterattack(atom/target, mob/user, proximity_flag, click_parameters) . = ..() - if(flag) + // Proximity is already handled via the interact_with_atom proc + if(proximity_flag) return - if(!ScientistCheck(user)) - return . - if(!console) - to_chat(user, span_warning("The device is not linked to console!")) - return . - - switch(mode) - if(GIZMO_SCAN) - scan(target, user) - if(GIZMO_MARK) - mark(target, user) - return . + . |= AFTERATTACK_PROCESSED_ITEM + interact_with_atom(target, user) /obj/item/abductor/gizmo/proc/scan(atom/target, mob/living/user) if(ishuman(target)) @@ -118,20 +110,21 @@ icon_state = "silencer" inhand_icon_state = "gizmo" -/obj/item/abductor/silencer/attack(mob/living/target, mob/user) +/obj/item/abductor/silencer/interact_with_atom(atom/interacting_with, mob/living/user) if(!AbductorCheck(user)) - return - radio_off(target, user) + return ITEM_INTERACT_SKIP_TO_ATTACK // So you slap them with it -/obj/item/abductor/silencer/afterattack(atom/target, mob/living/user, flag, params) + radio_off(interacting_with, user) + return ITEM_INTERACT_SUCCESS + +/obj/item/abductor/silencer/afterattack(atom/target, mob/user, proximity_flag, click_parameters) . = ..() - if(flag) + // Proximity is already handled via the interact_with_atom proc + if(proximity_flag) return + . |= AFTERATTACK_PROCESSED_ITEM - if(!AbductorCheck(user)) - return . - radio_off(target, user) - return . + interact_with_atom(target, user) /obj/item/abductor/silencer/proc/radio_off(atom/target, mob/living/user) if( !(user in (viewers(7,target))) ) @@ -515,7 +508,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} // Stops humans from disassembling abductor headsets. /obj/item/radio/headset/abductor/screwdriver_act(mob/living/user, obj/item/tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/abductor_machine_beacon name = "machine beacon" diff --git a/code/modules/art/statues.dm b/code/modules/art/statues.dm index 89eb6261d42..717f4335969 100644 --- a/code/modules/art/statues.dm +++ b/code/modules/art/statues.dm @@ -32,7 +32,7 @@ if(obj_flags & NO_DECONSTRUCTION) return FALSE default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/statue/attackby(obj/item/W, mob/living/user, params) add_fingerprint(user) diff --git a/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm b/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm index a3c9f2e3e84..7b7b82a1cad 100644 --- a/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm +++ b/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm @@ -194,10 +194,10 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm) if(istype(multi_tool.buffer, /obj/machinery/air_sensor)) if(!allow_link_change) balloon_alert(user, "linking disabled") - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_BLOCKING connect_sensor(multi_tool.buffer) balloon_alert(user, "connected sensor") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/airalarm/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm b/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm index 2ddd298bf01..fef2c072cd8 100644 --- a/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm +++ b/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer.dm @@ -163,7 +163,7 @@ /obj/machinery/electrolyzer/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/electrolyzer/crowbar_act(mob/living/user, obj/item/tool) return default_deconstruction_crowbar(tool) diff --git a/code/modules/atmospherics/machinery/components/tank.dm b/code/modules/atmospherics/machinery/components/tank.dm index 0e9ee55a1aa..6e778168a32 100644 --- a/code/modules/atmospherics/machinery/components/tank.dm +++ b/code/modules/atmospherics/machinery/components/tank.dm @@ -481,7 +481,7 @@ /obj/structure/tank_frame/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 0.5 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/tank_frame/screwdriver_act_secondary(mob/living/user, obj/item/tool) . = ..() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm index 1685a027a5f..3d3c4d9c05a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm @@ -104,13 +104,13 @@ GLOBAL_LIST_EMPTY_TYPED(bluespace_senders, /obj/machinery/atmospherics/component /obj/machinery/atmospherics/components/unary/bluespace_sender/screwdriver_act(mob/living/user, obj/item/tool) if(on) balloon_alert(user, "turn off!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!anchored) balloon_alert(user, "anchor!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(default_deconstruction_screwdriver(user, "[base_icon_state]_open", "[base_icon_state]", tool)) change_pipe_connection(panel_open) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/bluespace_sender/crowbar_act(mob/living/user, obj/item/tool) default_deconstruction_crowbar(tool, custom_deconstruct = bluespace_network.total_moles() > 0 ? TRUE : FALSE) @@ -134,7 +134,7 @@ GLOBAL_LIST_EMPTY_TYPED(bluespace_senders, /obj/machinery/atmospherics/component balloon_alert(user, "open panel!") return if(default_unfasten_wrench(user, tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return /obj/machinery/atmospherics/components/unary/bluespace_sender/default_change_direction_wrench(mob/user, obj/item/item) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 0f2e237d720..22c0f509d16 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -452,20 +452,20 @@ else to_chat(user, "You can't access the maintenance panel while the pod is " \ + (on ? "active" : (occupant ? "full" : "open")) + "!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/cryo_cell/crowbar_act(mob/living/user, obj/item/tool) if(on || state_open) return FALSE if(default_pry_open(tool) || default_deconstruction_crowbar(tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/cryo_cell/wrench_act(mob/living/user, obj/item/tool) if(on || occupant || state_open) return FALSE if(default_change_direction_wrench(user, tool)) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/cryo_cell/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/reagent_containers/cup)) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index 452d5d7b243..ea20f2eeb66 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -47,11 +47,11 @@ var/obj/machinery/air_sensor/sensor = multi_tool.buffer multi_tool.set_buffer(src) sensor.multitool_act(user, multi_tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "injector saved in buffer") multi_tool.set_buffer(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/outlet_injector/CtrlClick(mob/user) if(can_interact(user)) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index 6e84d4fc303..2a3ac2bb082 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -203,13 +203,13 @@ /obj/machinery/atmospherics/components/unary/thermomachine/screwdriver_act(mob/living/user, obj/item/tool) if(on) balloon_alert(user, "turn off!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!anchored) balloon_alert(user, "anchor!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(default_deconstruction_screwdriver(user, "thermo-open", "thermo-0", tool)) change_pipe_connection(panel_open) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/thermomachine/wrench_act(mob/living/user, obj/item/tool) return default_change_direction_wrench(user, tool) @@ -220,11 +220,11 @@ /obj/machinery/atmospherics/components/unary/thermomachine/multitool_act(mob/living/user, obj/item/multitool/multitool) if(!panel_open) balloon_alert(user, "open panel!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS piping_layer = (piping_layer >= PIPING_LAYER_MAX) ? PIPING_LAYER_MIN : (piping_layer + 1) to_chat(user, span_notice("You change the circuitboard to layer [piping_layer].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/thermomachine/default_change_direction_wrench(mob/user, obj/item/I) if(!..()) @@ -236,13 +236,13 @@ /obj/machinery/atmospherics/components/unary/thermomachine/multitool_act_secondary(mob/living/user, obj/item/tool) if(!panel_open) balloon_alert(user, "open panel!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS color_index = (color_index >= GLOB.pipe_paint_colors.len) ? (color_index = 1) : (color_index = 1 + color_index) set_pipe_color(GLOB.pipe_paint_colors[GLOB.pipe_paint_colors[color_index]]) visible_message(span_notice("[user] set [src]'s pipe color to [GLOB.pipe_color_name[pipe_color]]."), ignored_mobs = user) to_chat(user, span_notice("You set [src]'s pipe color to [GLOB.pipe_color_name[pipe_color]].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/thermomachine/proc/check_pipe_on_turf() for(var/obj/machinery/atmospherics/device in get_turf(src)) @@ -255,9 +255,9 @@ /obj/machinery/atmospherics/components/unary/thermomachine/wrench_act_secondary(mob/living/user, obj/item/tool) if(!panel_open || check_pipe_on_turf()) visible_message(span_warning("A pipe is hogging the port, remove the obstruction or change the machine piping layer.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(default_unfasten_wrench(user, tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return /obj/machinery/atmospherics/components/unary/thermomachine/ui_status(mob/user) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index a8a8aac4ff3..46a8d38496f 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -99,11 +99,11 @@ var/obj/machinery/air_sensor/sensor = multi_tool.buffer multi_tool.set_buffer(src) sensor.multitool_act(user, multi_tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "vent saved in buffer") multi_tool.set_buffer(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/vent_pump/screwdriver_act(mob/living/user, obj/item/tool) var/time_to_repair = (10 SECONDS) * (1 - get_integrity_percentage()) @@ -117,7 +117,7 @@ else balloon_alert(user, "interrupted!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/atmospherics/components/unary/vent_pump/atom_fix() set_is_operational(TRUE) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 02f499e00a6..7479b92c420 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -372,21 +372,19 @@ cell_container_opened = !cell_container_opened to_chat(user, span_notice("You [cell_container_opened ? "open" : "close"] the cell container hatch of [src].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/portable_atmospherics/canister/crowbar_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - if(!cell_container_opened || !internal_cell) - return + return ITEM_INTERACT_BLOCKING internal_cell.forceMove(drop_location()) balloon_alert(user, "cell removed") + return ITEM_INTERACT_SUCCESS /obj/machinery/portable_atmospherics/canister/welder_act_secondary(mob/living/user, obj/item/I) - . = TOOL_ACT_TOOLTYPE_SUCCESS if(!I.tool_start_check(user, amount=1)) - return + return ITEM_INTERACT_BLOCKING var/pressure = air_contents.return_pressure() if(pressure > 300) @@ -398,21 +396,24 @@ to_chat(user, span_notice("You cut [src] apart.")) deconstruct(TRUE) + return ITEM_INTERACT_SUCCESS + /obj/machinery/portable_atmospherics/canister/welder_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS if(user.combat_mode) - return FALSE - if(atom_integrity >= max_integrity || (machine_stat & BROKEN) || !tool.tool_start_check(user, amount = 1)) return + if(atom_integrity >= max_integrity || (machine_stat & BROKEN) || !tool.tool_start_check(user, amount = 1)) + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You begin repairing cracks in [src]...")) while(tool.use_tool(src, user, 2.5 SECONDS, volume=40)) atom_integrity = min(atom_integrity + 25, max_integrity) if(atom_integrity >= max_integrity) to_chat(user, span_notice("You've finished repairing [src].")) - return + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You repair some of the cracks in [src]...")) + return ITEM_INTERACT_BLOCKING + /obj/machinery/portable_atmospherics/canister/Exited(atom/movable/gone, direction) . = ..() if(gone == internal_cell) diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 9c00b8faea7..576dff39a8d 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -224,5 +224,5 @@ if(default_unfasten_wrench(user, tool)) if(!movable) on = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return FALSE diff --git a/code/modules/bitrunning/objects/netpod.dm b/code/modules/bitrunning/objects/netpod.dm index 593a7744ce4..2d4e995b19b 100644 --- a/code/modules/bitrunning/objects/netpod.dm +++ b/code/modules/bitrunning/objects/netpod.dm @@ -111,24 +111,24 @@ /obj/machinery/netpod/crowbar_act(mob/living/user, obj/item/tool) if(user.combat_mode) attack_hand(user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(default_pry_open(tool, user) || default_deconstruction_crowbar(tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/netpod/screwdriver_act(mob/living/user, obj/item/tool) if(occupant) balloon_alert(user, "in use!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(state_open) balloon_alert(user, "close first.") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(default_deconstruction_screwdriver(user, "[base_icon_state]_panel", "[base_icon_state]_closed", tool)) update_appearance() // sometimes icon doesnt properly update during flick() ui_close(user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/netpod/attack_hand(mob/living/user, list/modifiers) . = ..() diff --git a/code/modules/cargo/materials_market.dm b/code/modules/cargo/materials_market.dm index 1a617e9e2dc..21540e75908 100644 --- a/code/modules/cargo/materials_market.dm +++ b/code/modules/cargo/materials_market.dm @@ -41,17 +41,17 @@ /obj/machinery/materials_market/wrench_act(mob/living/user, obj/item/tool) . = ..() if(default_unfasten_wrench(user, tool, time = 1.5 SECONDS) == SUCCESSFUL_UNFASTEN) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/materials_market/screwdriver_act(mob/living/user, obj/item/tool) . = ..() if(default_deconstruction_screwdriver(user, "[base_icon_state]_open", "[base_icon_state]", tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/materials_market/crowbar_act(mob/living/user, obj/item/tool) . = ..() if(default_deconstruction_crowbar(tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/materials_market/attackby(obj/item/O, mob/user, params) if(is_type_in_list(O, exportable_material_items)) diff --git a/code/modules/cargo/supplypod_beacon.dm b/code/modules/cargo/supplypod_beacon.dm index 89c474635fa..1fc74c99490 100644 --- a/code/modules/cargo/supplypod_beacon.dm +++ b/code/modules/cargo/supplypod_beacon.dm @@ -69,7 +69,7 @@ /obj/item/supplypod_beacon/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/supplypod_beacon/proc/unlink_console() if(express_console) @@ -107,5 +107,3 @@ if(!user.can_perform_action(src)) return name += " ([tag])" - - diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index 513f7696a89..a1fab1f591d 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -160,7 +160,7 @@ /obj/item/clothing/suit/space/crowbar_act(mob/living/user, obj/item/tool) toggle_spacesuit_cell(user) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/clothing/suit/space/screwdriver_act(mob/living/user, obj/item/tool) var/range_low = 20 // Default min temp c @@ -174,7 +174,7 @@ if(deg_c && deg_c >= range_low && deg_c <= range_high) temperature_setting = round(T0C + deg_c, 0.1) to_chat(user, span_notice("You see the readout change to [deg_c] c.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS // object handling for accessing features of the suit /obj/item/clothing/suit/space/attackby(obj/item/I, mob/user, params) diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index e1631e8fa7c..950adf622ec 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -52,7 +52,7 @@ if(fake) var/obj/machinery/vending/prototype = pick(subtypesof(/obj/machinery/vending)) machine_name = initial(prototype.name) - priority_announce("Rampant brand intelligence has been detected aboard [station_name()]. Please inspect any [origin_machine] brand vendors for aggressive marketing tactics, and reboot them if necessary.", "Machine Learning Alert", ANNOUNCER_BRANDINTELLIGENCE) //SKYRAT EDIT CHANGE - ORIGINAL: priority_announce("Rampant brand intelligence has been detected aboard [station_name()]. Please inspect any [machine_name] brand vendors for aggressive marketing tactics, and reboot them if necessary.", "Machine Learning Alert") + priority_announce("Rampant brand intelligence has been detected aboard [station_name()]. Please inspect any [machine_name] brand vendors for aggressive marketing tactics, and reboot them if necessary.", "Machine Learning Alert", ANNOUNCER_BRANDINTELLIGENCE) //SKYRAT EDIT CHANGE - ORIGINAL: priority_announce("Rampant brand intelligence has been detected aboard [station_name()]. Please inspect any [machine_name] brand vendors for aggressive marketing tactics, and reboot them if necessary.", "Machine Learning Alert") /datum/round_event/brand_intelligence/start() origin_machine.shut_up = FALSE diff --git a/code/modules/events/radiation_leak.dm b/code/modules/events/radiation_leak.dm index b97cc19d9cc..a5aee22a8b2 100644 --- a/code/modules/events/radiation_leak.dm +++ b/code/modules/events/radiation_leak.dm @@ -153,7 +153,7 @@ SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(try_remove_radiation), source, user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Attempts a do_after, and if successful, stops the event /datum/round_event/radiation_leak/proc/try_remove_radiation(obj/machinery/source, mob/living/user, obj/item/tool) diff --git a/code/modules/explorer_drone/scanner_array.dm b/code/modules/explorer_drone/scanner_array.dm index 7f019b0d43c..2cfc6cbf814 100644 --- a/code/modules/explorer_drone/scanner_array.dm +++ b/code/modules/explorer_drone/scanner_array.dm @@ -262,7 +262,7 @@ GLOBAL_LIST_INIT(scan_conditions,init_scan_conditions()) /obj/machinery/exoscanner/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 1 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/exoscanner/set_anchored(anchorvalue) . = ..() diff --git a/code/modules/fishing/aquarium/aquarium.dm b/code/modules/fishing/aquarium/aquarium.dm index cf73325cb00..88d0791acdf 100644 --- a/code/modules/fishing/aquarium/aquarium.dm +++ b/code/modules/fishing/aquarium/aquarium.dm @@ -159,7 +159,7 @@ /obj/structure/aquarium/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/aquarium/plunger_act(obj/item/plunger/P, mob/living/user, reinforced) if(!panel_open) diff --git a/code/modules/fishing/fishing_portal_machine.dm b/code/modules/fishing/fishing_portal_machine.dm index b156a37ba05..37b2c1f0090 100644 --- a/code/modules/fishing/fishing_portal_machine.dm +++ b/code/modules/fishing/fishing_portal_machine.dm @@ -19,7 +19,7 @@ /obj/machinery/fishing_portal_generator/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/fishing_portal_generator/examine(mob/user) . = ..() diff --git a/code/modules/food_and_drinks/machinery/coffeemaker.dm b/code/modules/food_and_drinks/machinery/coffeemaker.dm index ff6d3fd0c8a..424b7e401cc 100644 --- a/code/modules/food_and_drinks/machinery/coffeemaker.dm +++ b/code/modules/food_and_drinks/machinery/coffeemaker.dm @@ -177,7 +177,7 @@ /obj/machinery/coffeemaker/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/coffeemaker/attackby(obj/item/attack_item, mob/living/user, params) //You can only screw open empty grinder diff --git a/code/modules/food_and_drinks/machinery/deep_fryer.dm b/code/modules/food_and_drinks/machinery/deep_fryer.dm index a22aad4aec8..75381f61474 100644 --- a/code/modules/food_and_drinks/machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/machinery/deep_fryer.dm @@ -85,7 +85,7 @@ GLOBAL_LIST_INIT(oilfry_blacklisted_items, typecacheof(list( /obj/machinery/deepfryer/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/deepfryer/attackby(obj/item/weapon, mob/user, params) // Dissolving pills into the frier diff --git a/code/modules/food_and_drinks/machinery/gibber.dm b/code/modules/food_and_drinks/machinery/gibber.dm index 121acceb4c4..5cc23742060 100644 --- a/code/modules/food_and_drinks/machinery/gibber.dm +++ b/code/modules/food_and_drinks/machinery/gibber.dm @@ -111,7 +111,7 @@ /obj/machinery/gibber/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/gibber/attackby(obj/item/P, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P)) diff --git a/code/modules/food_and_drinks/machinery/griddle.dm b/code/modules/food_and_drinks/machinery/griddle.dm index 72949eaca91..5fe48cca50a 100644 --- a/code/modules/food_and_drinks/machinery/griddle.dm +++ b/code/modules/food_and_drinks/machinery/griddle.dm @@ -149,7 +149,7 @@ /obj/machinery/griddle/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 2 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/griddle/proc/on_storage_dump(datum/source, obj/item/storage_source, mob/user) SIGNAL_HANDLER diff --git a/code/modules/food_and_drinks/machinery/microwave.dm b/code/modules/food_and_drinks/machinery/microwave.dm index a95357ef2f0..5333643e955 100644 --- a/code/modules/food_and_drinks/machinery/microwave.dm +++ b/code/modules/food_and_drinks/machinery/microwave.dm @@ -312,21 +312,21 @@ /obj/machinery/microwave/wrench_act(mob/living/user, obj/item/tool) if(default_unfasten_wrench(user, tool)) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/microwave/crowbar_act(mob/living/user, obj/item/tool) if(!default_deconstruction_crowbar(tool)) return - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/microwave/screwdriver_act(mob/living/user, obj/item/tool) if(default_deconstruction_screwdriver(user, icon_state, icon_state, tool)) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/microwave/wirecutter_act(mob/living/user, obj/item/tool) if(broken != REALLY_BROKEN) - return + return NONE user.visible_message( span_notice("[user] starts to fix part of [src]."), @@ -334,7 +334,7 @@ ) if(!tool.use_tool(src, user, 2 SECONDS, volume = 50)) - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_BLOCKING user.visible_message( span_notice("[user] fixes part of [src]."), @@ -342,11 +342,11 @@ ) broken = KINDA_BROKEN // Fix it a bit update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/microwave/welder_act(mob/living/user, obj/item/tool) if(broken != KINDA_BROKEN) - return + return NONE user.visible_message( span_notice("[user] starts to fix part of [src]."), @@ -354,7 +354,7 @@ ) if(!tool.use_tool(src, user, 2 SECONDS, amount = 1, volume = 50)) - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_BLOCKING user.visible_message( span_notice("[user] fixes [src]."), @@ -362,21 +362,23 @@ ) broken = NOT_BROKEN update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS -/obj/machinery/microwave/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) +/obj/machinery/microwave/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) if(operating) return if(dirty >= MAX_MICROWAVE_DIRTINESS) return . = ..() - if(. & TOOL_ACT_MELEE_CHAIN_BLOCKING) - return + if(. & ITEM_INTERACT_ANY_BLOCKER) + return . if(panel_open && is_wire_tool(tool)) wires.interact(user) - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_SUCCESS + + return . /obj/machinery/microwave/attackby(obj/item/item, mob/living/user, params) if(operating) diff --git a/code/modules/food_and_drinks/machinery/monkeyrecycler.dm b/code/modules/food_and_drinks/machinery/monkeyrecycler.dm index 8978c975c5e..afbbf6da0c4 100644 --- a/code/modules/food_and_drinks/machinery/monkeyrecycler.dm +++ b/code/modules/food_and_drinks/machinery/monkeyrecycler.dm @@ -42,7 +42,7 @@ GLOBAL_LIST_EMPTY(monkey_recyclers) . = ..() if(default_unfasten_wrench(user, tool)) power_change() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/monkey_recycler/attackby(obj/item/O, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", O)) diff --git a/code/modules/food_and_drinks/machinery/oven.dm b/code/modules/food_and_drinks/machinery/oven.dm index 10fd47cbcaf..87cffebc8ae 100644 --- a/code/modules/food_and_drinks/machinery/oven.dm +++ b/code/modules/food_and_drinks/machinery/oven.dm @@ -213,7 +213,7 @@ /obj/machinery/oven/wrench_act(mob/living/user, obj/item/tool) default_unfasten_wrench(user, tool, time = 2 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/oven/range name = "range" diff --git a/code/modules/food_and_drinks/machinery/processor.dm b/code/modules/food_and_drinks/machinery/processor.dm index 6520478a1fb..4641da596da 100644 --- a/code/modules/food_and_drinks/machinery/processor.dm +++ b/code/modules/food_and_drinks/machinery/processor.dm @@ -84,7 +84,7 @@ /obj/machinery/processor/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/processor/attackby(obj/item/attacking_item, mob/living/user, params) if(processing) diff --git a/code/modules/food_and_drinks/machinery/smartfridge.dm b/code/modules/food_and_drinks/machinery/smartfridge.dm index 4cf66f27a6f..8dbc90e80d1 100644 --- a/code/modules/food_and_drinks/machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/machinery/smartfridge.dm @@ -50,11 +50,9 @@ move_update_air(old_loc) /obj/machinery/smartfridge/welder_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - if(welded_down) if(!tool.tool_start_check(user, amount=2)) - return + return ITEM_INTERACT_BLOCKING user.visible_message( span_notice("[user.name] starts to cut the [name] free from the floor."), @@ -63,18 +61,18 @@ ) if(!tool.use_tool(src, user, delay=100, volume=100)) - return + return ITEM_INTERACT_BLOCKING welded_down = FALSE to_chat(user, span_notice("You cut [src] free from the floor.")) - return + return ITEM_INTERACT_SUCCESS if(!anchored) balloon_alert(user, "wrench it first!") - return + return ITEM_INTERACT_BLOCKING if(!tool.tool_start_check(user, amount=2)) - return + return ITEM_INTERACT_BLOCKING user.visible_message( span_notice("[user.name] starts to weld the [name] to the floor."), @@ -83,20 +81,19 @@ ) if(!tool.use_tool(src, user, delay = 100, volume = 100)) - return + return ITEM_INTERACT_BLOCKING welded_down = TRUE to_chat(user, span_notice("You weld [src] to the floor.")) + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/welder_act_secondary(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - if(!(machine_stat & BROKEN)) balloon_alert(user, "no repair needed!") - return + return ITEM_INTERACT_BLOCKING if(!tool.tool_start_check(user, amount=1)) - return + return ITEM_INTERACT_BLOCKING user.visible_message( span_notice("[user] is repairing [src]."), @@ -106,21 +103,22 @@ if(tool.use_tool(src, user, delay = 40, volume = 50)) if(!(machine_stat & BROKEN)) - return + return ITEM_INTERACT_BLOCKING to_chat(user, span_notice("You repair [src]")) atom_integrity = max_integrity set_machine_stat(machine_stat & ~BROKEN) update_icon() + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/screwdriver_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - if(default_deconstruction_screwdriver(user, icon_state, icon_state, tool)) if(panel_open) add_overlay("[initial(icon_state)]-panel") else cut_overlay("[initial(icon_state)]-panel") SStgui.update_uis(src) + return ITEM_INTERACT_SUCCESS + return ITEM_INTERACT_BLOCKING /obj/machinery/smartfridge/can_be_unfasten_wrench(mob/user, silent) if(welded_down) @@ -136,21 +134,19 @@ air_update_turf(TRUE, anchorvalue) /obj/machinery/smartfridge/wrench_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN) power_change() + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/crowbar_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - if(default_pry_open(tool, close_after_pry = TRUE)) - return + return ITEM_INTERACT_SUCCESS if(welded_down) balloon_alert(user, "unweld first!") else default_deconstruction_crowbar(tool) + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) if(isnull(held_item)) @@ -476,16 +472,25 @@ else . += span_info("It's not anchored to the floor. It can be [EXAMINE_HINT("wrenched")] down.") . += span_info("The whole rack can be [EXAMINE_HINT("pried")] apart.") + /obj/machinery/smartfridge/drying_rack/welder_act(mob/living/user, obj/item/tool) + return NONE + /obj/machinery/smartfridge/drying_rack/welder_act_secondary(mob/living/user, obj/item/tool) + return NONE + /obj/machinery/smartfridge/drying_rack/default_deconstruction_screwdriver() + return NONE + /obj/machinery/smartfridge/drying_rack/exchange_parts() + return + /obj/machinery/smartfridge/drying_rack/on_deconstruction() new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) -/obj/machinery/smartfridge/drying_rack/crowbar_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS - default_deconstruction_crowbar(tool, ignore_panel = TRUE) +/obj/machinery/smartfridge/drying_rack/crowbar_act(mob/living/user, obj/item/tool) + if(default_deconstruction_crowbar(tool, ignore_panel = TRUE)) + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/drying_rack/ui_data(mob/user) . = ..() diff --git a/code/modules/holodeck/turfs.dm b/code/modules/holodeck/turfs.dm index 1e89052af59..15a82c5aa55 100644 --- a/code/modules/holodeck/turfs.dm +++ b/code/modules/holodeck/turfs.dm @@ -8,8 +8,9 @@ /turf/open/floor/holofloor/attackby(obj/item/I, mob/living/user) return // HOLOFLOOR DOES NOT GIVE A FUCK -/turf/open/floor/holofloor/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) - return +/turf/open/floor/holofloor/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + SHOULD_CALL_PARENT(FALSE) + return NONE // Fuck you /turf/open/floor/holofloor/burn_tile() return //you can't burn a hologram! diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 9ecde7400d9..6636fedd25c 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -144,7 +144,7 @@ /obj/structure/beebox/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/beebox/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/honey_frame)) diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index f37b8a644bf..00a52ab82a8 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -198,7 +198,7 @@ /obj/machinery/biogenerator/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/biogenerator/attackby(obj/item/attacking_item, mob/living/user, params) if(user.combat_mode) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 84201835604..72f897106dc 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -837,7 +837,7 @@ /obj/machinery/hydroponics/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) //Called when mob user "attacks" it with object O diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index 04b0edf44bb..c558cba8b3e 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -91,7 +91,7 @@ /obj/machinery/seed_extractor/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/seed_extractor/attackby(obj/item/attacking_item, mob/living/user, params) if(!isliving(user) || user.combat_mode) diff --git a/code/modules/instruments/stationary.dm b/code/modules/instruments/stationary.dm index c5c7b97e738..ca0e7e2d9e7 100644 --- a/code/modules/instruments/stationary.dm +++ b/code/modules/instruments/stationary.dm @@ -32,7 +32,7 @@ /obj/structure/musician/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 4 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/musician/piano name = "space piano" diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 6a0c4c03005..2a4137da0c8 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -771,7 +771,7 @@ GLOBAL_VAR_INIT(library_table_modified, 0) /obj/machinery/bookbinder/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/bookbinder/attackby(obj/hitby, mob/user, params) if(istype(hitby, /obj/item/paper)) diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index ce045a81298..5aca0ade708 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -194,7 +194,7 @@ /obj/machinery/mineral/ore_redemption/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/mineral/ore_redemption/attackby(obj/item/W, mob/user, params) if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W)) @@ -422,4 +422,3 @@ . += ore_output . += light_in . += light_out - diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index c93e0597675..ed2258d6dad 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -387,7 +387,7 @@ GLOBAL_LIST_INIT(command_strings, list( return TRUE /mob/living/basic/bot/screwdriver_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS + . = ITEM_INTERACT_SUCCESS if(!(bot_access_flags & BOT_CONTROL_PANEL_OPEN)) to_chat(user, span_warning("The maintenance panel is locked!")) return @@ -401,7 +401,7 @@ GLOBAL_LIST_INIT(command_strings, list( if(user.combat_mode) return FALSE - . = TOOL_ACT_TOOLTYPE_SUCCESS + . = ITEM_INTERACT_SUCCESS if(health >= maxHealth) user.balloon_alert(user, "no repairs needed!") diff --git a/code/modules/mob/living/basic/bots/medbot/medbot.dm b/code/modules/mob/living/basic/bots/medbot/medbot.dm index 48e695359ad..44b6ae11b21 100644 --- a/code/modules/mob/living/basic/bots/medbot/medbot.dm +++ b/code/modules/mob/living/basic/bots/medbot/medbot.dm @@ -192,7 +192,7 @@ /mob/living/basic/bot/medbot/multitool_act(mob/living/user, obj/item/multitool/tool) if(!QDELETED(tool.buffer) && istype(tool.buffer, /datum/techweb)) linked_techweb = tool.buffer - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS // Variables sent to TGUI /mob/living/basic/bot/medbot/ui_data(mob/user) diff --git a/code/modules/mob/living/basic/drone/interaction.dm b/code/modules/mob/living/basic/drone/interaction.dm index ad6261f5cce..c528dafcbd6 100644 --- a/code/modules/mob/living/basic/drone/interaction.dm +++ b/code/modules/mob/living/basic/drone/interaction.dm @@ -86,16 +86,16 @@ return FALSE if(health >= maxHealth) to_chat(user, span_warning("[src]'s screws can't get any tighter!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You start to tighten loose screws on [src]...")) if(!tool.use_tool(src, user, 8 SECONDS, volume=50)) to_chat(user, span_warning("You need to remain still to tighten [src]'s screws!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS adjustBruteLoss(-getBruteLoss()) visible_message(span_notice("[user] tightens [src == user ? "[user.p_their()]" : "[src]'s"] loose screws!"), span_notice("[src == user ? "You tighten" : "[user] tightens"] your loose screws.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /// Wrenching un-hacks hacked drones. /mob/living/basic/drone/wrench_act(mob/living/user, obj/item/tool) @@ -111,7 +111,7 @@ span_notice("You reset [src]'s directives to factory defaults!") ) update_drone_hack(FALSE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /mob/living/basic/drone/transferItemToLoc(obj/item/item, newloc, force, silent) return !(item.type in drone_item_whitelist_flat) && ..() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0734a361f76..abcf6dd43a2 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -28,19 +28,21 @@ QDEL_NULL(dna) GLOB.carbon_list -= src -/mob/living/carbon/attackby(obj/item/item, mob/living/user, params) - if(!all_wounds || !(!user.combat_mode || user == src)) - return ..() +/mob/living/carbon/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + . = ..() + if(. & ITEM_INTERACT_SUCCESS) + return . - if(can_perform_surgery(user, params)) - return TRUE + if(!length(all_wounds)) + return . + if(user.combat_mode && user != src) + return . - for(var/i in shuffle(all_wounds)) - var/datum/wound/wound = i - if(wound.try_treating(item, user)) - return TRUE + for(var/datum/wound/wound as anything in shuffle(all_wounds)) + if(wound.try_treating(tool, user)) + return ITEM_INTERACT_SUCCESS - return ..() + return . /mob/living/carbon/CtrlShiftClick(mob/user) ..() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2366cf5e4f2..0b699a3039c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1057,23 +1057,6 @@ if(body_position == LYING_DOWN && !buckled && prob(getBruteLoss()*200/maxHealth)) makeTrail(newloc, T, old_direction) -/** - * Called by mob/living attackby() - * Checks if there's active surgery on the mob that can be continued with the item - */ -/mob/living/proc/can_perform_surgery(mob/living/user, params) - for(var/datum/surgery/operations as anything in surgeries) - if(user.combat_mode) - break - if(IS_IN_INVALID_SURGICAL_POSITION(src, operations)) - continue - if(!(operations.surgery_flags & SURGERY_SELF_OPERABLE) && (user == src)) - continue - var/list/modifiers = params2list(params) - if(operations.next_step(user, modifiers)) - return TRUE - return FALSE - ///Called by mob Move() when the lying_angle is different than zero, to better visually simulate crawling. /mob/living/proc/lying_angle_on_movement(direct) if(direct & EAST) diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 853e6e9c8eb..431d86f096c 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -69,11 +69,11 @@ balloon_alert(user, "[!is_anchored ? "tightening" : "loosening"] bolts...") balloon_alert(src, "bolts being [!is_anchored ? "tightened" : "loosened"]...") if(!tool.use_tool(src, user, 4 SECONDS)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS flip_anchored() balloon_alert(user, "bolts [is_anchored ? "tightened" : "loosened"]") balloon_alert(src, "bolts [is_anchored ? "tightened" : "loosened"]") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /mob/living/silicon/ai/crowbar_act(mob/living/user, obj/item/tool) . = ..() @@ -81,19 +81,19 @@ return if(!is_anchored) balloon_alert(user, "bolt it down first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(opened) if(emagged) balloon_alert(user, "access panel lock damaged!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "closing access panel...") balloon_alert(src, "access panel being closed...") if(!tool.use_tool(src, user, 5 SECONDS)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(src, "access panel closed") balloon_alert(user, "access panel closed") opened = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(stat == DEAD) to_chat(user, span_warning("The access panel looks damaged, you try dislodging the cover.")) else @@ -109,24 +109,24 @@ consent = tgui_alert(src, "[user] is attempting to open your access panel, unlock the cover?", "AI Access Panel", list("Yes", "No")) if(consent == "No" && !consent_override && !emagged) to_chat(user, span_notice("[src] refuses to unlock its access panel.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(consent != "Yes" && (consent_override || emagged)) to_chat(user, span_warning("[src] refuses to unlock its access panel...so you[!emagged ? " swipe your ID and " : " "]open it anyway!")) else if(!consent_override && !emagged) to_chat(user, span_notice("[src] did not respond to your request to unlock its access panel cover lock.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS else to_chat(user, span_notice("[src] did not respond to your request to unlock its access panel cover lock. You[!emagged ? " swipe your ID and " : " "]open it anyway.")) balloon_alert(user, "prying open access panel...") balloon_alert(src, "access panel being pried open...") if(!tool.use_tool(src, user, (stat == DEAD ? 40 SECONDS : 5 SECONDS))) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(src, "access panel opened") balloon_alert(user, "access panel opened") opened = TRUE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /mob/living/silicon/ai/wirecutter_act(mob/living/user, obj/item/tool) . = ..() @@ -134,21 +134,21 @@ return if(!is_anchored) balloon_alert(user, "bolt it down first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!opened) balloon_alert(user, "open the access panel first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(src, "neural network being disconnected...") balloon_alert(user, "disconnecting neural network...") if(!tool.use_tool(src, user, (stat == DEAD ? 40 SECONDS : 5 SECONDS))) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(IS_MALF_AI(src)) to_chat(user, span_userdanger("The voltage inside the wires rises dramatically!")) user.electrocute_act(120, src) opened = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "disconnected neural network") to_chat(src, span_danger("You feel incredibly confused and disorientated.")) if(!ai_mob_to_structure()) - return TOOL_ACT_TOOLTYPE_SUCCESS - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS + return ITEM_INTERACT_SUCCESS diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 9a41f47657f..4ac5b20f43a 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -453,12 +453,12 @@ /mob/living/simple_animal/bot/screwdriver_act(mob/living/user, obj/item/tool) if(bot_cover_flags & BOT_COVER_LOCKED) to_chat(user, span_warning("The maintenance panel is locked!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS tool.play_tool_sound(src) bot_cover_flags ^= BOT_COVER_OPEN to_chat(user, span_notice("The maintenance panel is now [bot_cover_flags & BOT_COVER_OPEN ? "opened" : "closed"].")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /mob/living/simple_animal/bot/welder_act(mob/living/user, obj/item/tool) user.changeNext_move(CLICK_CD_MELEE) @@ -467,15 +467,15 @@ if(health >= maxHealth) to_chat(user, span_warning("[src] does not need a repair!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!(bot_cover_flags & BOT_COVER_OPEN)) to_chat(user, span_warning("Unable to repair with the maintenance panel closed!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(tool.use_tool(src, user, 0 SECONDS, volume=40)) adjustHealth(-10) user.visible_message(span_notice("[user] repairs [src]!"),span_notice("You repair [src].")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /mob/living/simple_animal/bot/attackby(obj/item/attacking_item, mob/living/user, params) if(attacking_item.GetID()) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index ef7b89d3773..af505f53caa 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -151,7 +151,7 @@ return if(!cell) to_chat(user, span_warning("[src] doesn't have a power cell!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS cell.add_fingerprint(user) if(Adjacent(user) && !issilicon(user)) user.put_in_hands(cell) @@ -163,7 +163,7 @@ ) cell = null diag_hud_set_mulebotcell() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /mob/living/simple_animal/bot/mulebot/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/stock_parts/cell) && bot_cover_flags & BOT_COVER_OPEN) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index c37b9a93207..0492cb71489 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -808,7 +808,7 @@ user.balloon_alert(user, "cell removed") internal_cell.forceMove(drop_location()) internal_cell = null - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS else user.balloon_alert(user, "no cell!") @@ -817,24 +817,24 @@ tool.play_tool_sound(src, user, 20, volume=20) deconstruct(TRUE) user.balloon_alert(user, "disassembled") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/modular_computer/welder_act(mob/living/user, obj/item/tool) . = ..() if(atom_integrity == max_integrity) to_chat(user, span_warning("\The [src] does not require repairs.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!tool.tool_start_check(user, amount=1)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You begin repairing damage to \the [src]...")) if(!tool.use_tool(src, user, 20, volume=50)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS atom_integrity = max_integrity to_chat(user, span_notice("You repair \the [src].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/modular_computer/deconstruct(disassembled = TRUE) remove_pai() diff --git a/code/modules/paperwork/desk_bell.dm b/code/modules/paperwork/desk_bell.dm index fda6b212952..e193bbc98b1 100644 --- a/code/modules/paperwork/desk_bell.dm +++ b/code/modules/paperwork/desk_bell.dm @@ -69,7 +69,7 @@ playsound(user, 'sound/items/change_drill.ogg', 50, vary = TRUE) broken_ringer = FALSE times_rang = 0 - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return FALSE return ..() @@ -84,7 +84,7 @@ new/obj/item/stack/sheet/iron(drop_location()) new/obj/item/stack/sheet/iron(drop_location()) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return ..() /// Check if the clapper breaks, and if it does, break it diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 20363ad99fb..f9eafa901aa 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -120,7 +120,7 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department /obj/machinery/fax/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /** * Open and close the wire panel. @@ -139,16 +139,16 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department return var/new_fax_name = tgui_input_text(user, "Enter a new name for the fax machine.", "New Fax Name", , 128) if (!new_fax_name) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if (new_fax_name != fax_name) if (fax_name_exist(new_fax_name)) // Being able to set the same name as another fax machine will give a lot of gimmicks for the traitor. if (syndicate_network != TRUE && !(obj_flags & EMAGGED)) to_chat(user, span_warning("There is already a fax machine with this name on the network.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.log_message("renamed [fax_name] (fax machine) to [new_fax_name].", LOG_GAME) fax_name = new_fax_name - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/fax/attackby(obj/item/item, mob/user, params) if (jammed && clear_jam(item, user)) @@ -546,4 +546,3 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department else return FALSE return TRUE - diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm index 9586ec6e861..9878249a6d1 100644 --- a/code/modules/paperwork/paper_cutter.dm +++ b/code/modules/paperwork/paper_cutter.dm @@ -109,7 +109,7 @@ tool.play_tool_sound(src) balloon_alert(user, "[blade_secured ? "un" : ""]secured") blade_secured = !blade_secured - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/papercutter/attackby(obj/item/inserted_item, mob/user, params) if(istype(inserted_item, /obj/item/paper)) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index de9ae632861..d1a4cbaba4c 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -536,7 +536,7 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks()) /obj/machinery/photocopier/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/photocopier/attackby(obj/item/object, mob/user, params) if(istype(object, /obj/item/paper) || istype(object, /obj/item/photo) || istype(object, /obj/item/documents)) diff --git a/code/modules/photography/photos/frame.dm b/code/modules/photography/photos/frame.dm index 8212b597698..f2d77553ea1 100644 --- a/code/modules/photography/photos/frame.dm +++ b/code/modules/photography/photos/frame.dm @@ -143,7 +143,7 @@ user.visible_message(span_warning("[user] cuts away [framed] from [src]!")) framed = null update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user, params) diff --git a/code/modules/plumbing/plumbers/_plumb_machinery.dm b/code/modules/plumbing/plumbers/_plumb_machinery.dm index be75cf20479..dcfa5faac5c 100644 --- a/code/modules/plumbing/plumbers/_plumb_machinery.dm +++ b/code/modules/plumbing/plumbers/_plumb_machinery.dm @@ -32,7 +32,7 @@ /obj/machinery/plumbing/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_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/plumbing/plumbers/iv_drip.dm b/code/modules/plumbing/plumbers/iv_drip.dm index 1db36c137e6..dc6242779d1 100644 --- a/code/modules/plumbing/plumbers/iv_drip.dm +++ b/code/modules/plumbing/plumbers/iv_drip.dm @@ -33,9 +33,8 @@ return FALSE //Alt click is used for rotation /obj/machinery/iv_drip/plumbing/wrench_act(mob/living/user, obj/item/tool) - . = ..() if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/iv_drip/plumbing/deconstruct(disassembled = TRUE) qdel(src) diff --git a/code/modules/power/apc/apc_tool_act.dm b/code/modules/power/apc/apc_tool_act.dm index 55c9b34a350..25b218a8969 100644 --- a/code/modules/power/apc/apc_tool_act.dm +++ b/code/modules/power/apc/apc_tool_act.dm @@ -130,7 +130,7 @@ if(welder.use_tool(src, user, 4 SECONDS, volume = 50)) update_integrity(min(atom_integrity += 50,max_integrity)) balloon_alert(user, "repaired") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS //disassembling the frame if(!opened || has_electronics || terminal) diff --git a/code/modules/power/floodlight.dm b/code/modules/power/floodlight.dm index 7155ce6aa23..d3c5c1de569 100644 --- a/code/modules/power/floodlight.dm +++ b/code/modules/power/floodlight.dm @@ -261,7 +261,7 @@ connect_to_network() else disconnect_from_network() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/power/floodlight/screwdriver_act(mob/living/user, obj/item/tool) . = ..() diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 39c3e536144..0fe5b32838b 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -69,7 +69,7 @@ cable_layer = GLOB.cable_name_to_layer[choice] balloon_alert(user, "now operating on the [choice]") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/power/multitool_act_secondary(mob/living/user, obj/item/tool) return multitool_act(user, tool) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index d1a5a10a31a..7ba24d69b72 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -263,7 +263,7 @@ /obj/machinery/power/emitter/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_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 88534d7e9b0..93a339c2cc2 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -128,7 +128,7 @@ no power level overlay is currently in the overlays list. /obj/machinery/field/generator/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/field/generator/welder_act(mob/living/user, obj/item/welder) . = ..() diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index 972c98d4862..def7bf7aa4d 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -73,7 +73,7 @@ /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 + return ITEM_INTERACT_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)) @@ -153,7 +153,7 @@ /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 + return ITEM_INTERACT_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)) diff --git a/code/modules/power/turbine/turbine.dm b/code/modules/power/turbine/turbine.dm index bb4afcede94..2ca8b1df7f2 100644 --- a/code/modules/power/turbine/turbine.dm +++ b/code/modules/power/turbine/turbine.dm @@ -116,10 +116,10 @@ /obj/machinery/power/turbine/screwdriver_act(mob/living/user, obj/item/tool) if(active) balloon_alert(user, "turn it off!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!anchored) balloon_alert(user, "anchor first!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS tool.play_tool_sound(src, 50) toggle_panel_open() @@ -130,7 +130,7 @@ balloon_alert(user, "you [panel_open ? "open" : "close"] the maintenance hatch of [src]") update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/power/turbine/wrench_act(mob/living/user, obj/item/tool) return default_change_direction_wrench(user, tool) @@ -146,16 +146,16 @@ /obj/machinery/power/turbine/crowbar_act_secondary(mob/living/user, obj/item/tool) if(!panel_open) balloon_alert(user, "panel is closed!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!installed_part) balloon_alert(user, "no rotor installed!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(active) balloon_alert(user, "[src] is on!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS user.put_in_hands(installed_part) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /** * Allow easy enabling of each machine for connection to the main controller @@ -416,7 +416,7 @@ //failed checks if(!activate_parts(user)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS //log rotor to link later to computer balloon_alert(user, "all parts linked") @@ -425,7 +425,7 @@ to_chat(user, span_notice("You store linkage information in [tool]'s buffer.")) //success - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/power/turbine/core_rotor/multitool_act_secondary(mob/living/user, obj/item/tool) //allow cable layer changing diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index be7ecd1a95d..12faf4b8f72 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -514,7 +514,7 @@ if(Adjacent(user) && !issilicon(user)) user.put_in_hands(bayonet) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS else if(pin?.pin_removable && user.is_holding(src)) user.visible_message(span_warning("[user] attempts to remove [pin] from [src] with [I]."), @@ -525,7 +525,7 @@ user.visible_message(span_notice("[pin] is pried out of [src] by [user], destroying the pin in the process."), span_warning("You pry [pin] out with [I], destroying the pin in the process."), null, 3) QDEL_NULL(pin) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/gun/welder_act(mob/living/user, obj/item/I) . = ..() diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index a0d1e88317a..1e5f828947a 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -450,18 +450,18 @@ /obj/machinery/chem_dispenser/wrench_act(mob/living/user, obj/item/tool) . = ..() if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/chem_dispenser/screwdriver_act(mob/living/user, obj/item/tool) . = ..() if(default_deconstruction_screwdriver(user, icon_state, icon_state, tool)) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/chem_dispenser/crowbar_act(mob/living/user, obj/item/tool) . = ..() if(default_deconstruction_crowbar(tool)) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/chem_dispenser/attackby(obj/item/I, mob/living/user, params) if(is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container()) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 1e2b06e0f62..a95f805130a 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -158,7 +158,7 @@ /obj/machinery/chem_heater/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/chem_heater/attackby(obj/item/I, mob/user, params) if(default_deconstruction_screwdriver(user, "mixer0b", "mixer0b", I)) diff --git a/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm b/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm index 2acf0027a72..90de91a6aaf 100644 --- a/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm +++ b/code/modules/reagents/chemistry/machinery/chem_mass_spec.dm @@ -75,7 +75,7 @@ This will not clean any inverted reagents. Inverted reagents will still be corre /obj/machinery/chem_mass_spec/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /* beaker swapping/attack code */ diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 65698c7e389..2d17d200153 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -127,7 +127,7 @@ /obj/machinery/chem_master/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/chem_master/attackby(obj/item/item, mob/user, params) if(default_deconstruction_screwdriver(user, icon_state, icon_state, item)) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index d98044102d3..f4be905a073 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -142,10 +142,10 @@ /obj/machinery/reagentgrinder/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/reagentgrinder/screwdriver_act(mob/living/user, obj/item/tool) - . = TOOL_ACT_TOOLTYPE_SUCCESS + . = ITEM_INTERACT_SUCCESS if(!beaker && !length(holdingitems)) return default_deconstruction_screwdriver(user, icon_state, icon_state, tool) diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm index 88072874e0f..272ff5bd687 100644 --- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm +++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm @@ -95,7 +95,7 @@ . = ..() if(default_unfasten_wrench(user, tool, time = 4 SECONDS)) on = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return FALSE /obj/machinery/smoke_machine/attackby(obj/item/I, mob/user, params) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 7c9006c9582..c8efeee6790 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -225,7 +225,7 @@ balloon_alert(user, "[leaking ? "opened" : "closed"] [src]'s tap") user.log_message("[leaking ? "opened" : "closed"] [src].", LOG_GAME) tank_leak() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_dispensers/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE) . = ..() @@ -438,7 +438,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/reagent_dispensers/wall/virusfood, 30 /obj/structure/reagent_dispensers/plumbed/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_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 ce09ebb9176..533443a1995 100644 --- a/code/modules/research/anomaly/anomaly_refinery.dm +++ b/code/modules/research/anomaly/anomaly_refinery.dm @@ -110,7 +110,7 @@ /obj/machinery/research/anomaly_refinery/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_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)) diff --git a/code/modules/research/ordnance/doppler_array.dm b/code/modules/research/ordnance/doppler_array.dm index f7c0dfcfc2d..a109e5061df 100644 --- a/code/modules/research/ordnance/doppler_array.dm +++ b/code/modules/research/ordnance/doppler_array.dm @@ -62,8 +62,8 @@ /obj/machinery/doppler_array/wrench_act(mob/living/user, obj/item/tool) default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS - + return ITEM_INTERACT_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)) return FALSE @@ -91,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/research/server.dm b/code/modules/research/server.dm index 56be6864b54..b3c10eaac93 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -154,16 +154,17 @@ if(HDD_OVERLOADED) . += "The front panel is dangling open. The hdd inside is destroyed and the wires are all burned." -/obj/machinery/rnd/server/master/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) +/obj/machinery/rnd/server/master/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking) + if(!tool.tool_behaviour) + return ..() // Only antags are given the training and knowledge to disassemble this thing. if(is_special_character(user)) return ..() - if(user.combat_mode) - return FALSE + return NONE balloon_alert(user, "you can't find an obvious maintenance hatch!") - return TRUE + return ITEM_INTERACT_BLOCKING /obj/machinery/rnd/server/master/attackby(obj/item/attacking_item, mob/user, params) if(istype(attacking_item, /obj/item/computer_disk/hdd_theft)) diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 5795effc2b6..1d6b546bcb9 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -41,7 +41,7 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE) /obj/machinery/bsa/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 1 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/bsa/back name = "Bluespace Artillery Generator" diff --git a/code/modules/transport/_transport_machinery.dm b/code/modules/transport/_transport_machinery.dm index 2d10b4ada5d..1cbbbdeb24b 100644 --- a/code/modules/transport/_transport_machinery.dm +++ b/code/modules/transport/_transport_machinery.dm @@ -114,7 +114,7 @@ SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(try_fix_machine), source, user, tool) - return COMPONENT_BLOCK_TOOL_ATTACK + return ITEM_INTERACT_BLOCKING /// Attempts a do_after, and if successful, stops the event /obj/machinery/transport/proc/try_fix_machine(obj/machinery/transport/machine, mob/living/user, obj/item/tool) diff --git a/code/modules/transport/tram/tram_floors.dm b/code/modules/transport/tram/tram_floors.dm index 08888ea1608..1e1fad836c3 100644 --- a/code/modules/transport/tram/tram_floors.dm +++ b/code/modules/transport/tram/tram_floors.dm @@ -242,7 +242,7 @@ secured = TRUE to_chat(user, span_notice("The tile is securely screwed in place.")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/thermoplastic/crowbar_act_secondary(mob/living/user, obj/item/tool) . = ..() @@ -260,12 +260,12 @@ user.put_in_hands(pulled_tile) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/thermoplastic/welder_act(mob/living/user, obj/item/tool) if(atom_integrity >= max_integrity) to_chat(user, span_warning("[src] is already in good condition!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!tool.tool_start_check(user, amount = 0)) return FALSE to_chat(user, span_notice("You begin repairing [src]...")) @@ -274,7 +274,7 @@ atom_integrity = max_integrity to_chat(user, span_notice("You repair [src].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/item/stack/thermoplastic name = "thermoplastic tram tile" diff --git a/code/modules/transport/tram/tram_structures.dm b/code/modules/transport/tram/tram_structures.dm index 8d9f132ff38..ccf6a99d929 100644 --- a/code/modules/transport/tram/tram_structures.dm +++ b/code/modules/transport/tram/tram_structures.dm @@ -153,7 +153,7 @@ /obj/structure/tram/welder_act(mob/living/user, obj/item/tool) if(atom_integrity >= max_integrity) to_chat(user, span_warning("[src] is already in good condition!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!tool.tool_start_check(user, amount = 0)) return FALSE to_chat(user, span_notice("You begin repairing [src]...")) @@ -161,7 +161,7 @@ atom_integrity = max_integrity to_chat(user, span_notice("You repair [src].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/tram/attackby_secondary(obj/item/tool, mob/user, params) switch(state) @@ -596,7 +596,7 @@ deploy_spoiler() update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You begin repairing [src]...")) if(!tool.use_tool(src, user, 4 SECONDS, volume = 50)) @@ -604,7 +604,7 @@ atom_integrity = max_integrity to_chat(user, span_notice("You repair [src].")) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/tram/spoiler/update_overlays() . = ..() diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 0e5f9bee3ae..a6177c0a77d 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -620,7 +620,7 @@ return FALSE if(default_unfasten_wrench(user, tool, time = 6 SECONDS)) unbuckle_all_mobs(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return FALSE /obj/machinery/vending/screwdriver_act(mob/living/user, obj/item/attack_item) diff --git a/modular_skyrat/master_files/code/game/objects/structures/towel_bins.dm b/modular_skyrat/master_files/code/game/objects/structures/towel_bins.dm index c8eddc849ba..adf8066b6e3 100644 --- a/modular_skyrat/master_files/code/game/objects/structures/towel_bins.dm +++ b/modular_skyrat/master_files/code/game/objects/structures/towel_bins.dm @@ -53,19 +53,19 @@ if(amount) to_chat(user, span_warning("[src] must be empty first!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(tool.use_tool(src, user, 0.5 SECONDS, volume = 50)) to_chat(user, span_notice("You disassemble [src].")) new /obj/item/stack/rods(loc, 2) qdel(src) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/towel_bin/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 0.5 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/towel_bin/attackby(obj/item/attacking_item, mob/user, params) diff --git a/modular_skyrat/modules/aesthetics/lights/code/lighting.dm b/modular_skyrat/modules/aesthetics/lights/code/lighting.dm index f811051d0c0..c5c30f406b0 100644 --- a/modular_skyrat/modules/aesthetics/lights/code/lighting.dm +++ b/modular_skyrat/modules/aesthetics/lights/code/lighting.dm @@ -110,13 +110,13 @@ /obj/machinery/light/multitool_act(mob/living/user, obj/item/multitool) if(!constant_flickering) balloon_alert(user, "ballast is already working!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "repairing the ballast...") if(do_after(user, 2 SECONDS, src)) stop_flickering() balloon_alert(user, "ballast repaired!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return ..() #undef NIGHTSHIFT_LIGHT_MODIFIER diff --git a/modular_skyrat/modules/bsa_overhaul/code/bsa_cannon.dm b/modular_skyrat/modules/bsa_overhaul/code/bsa_cannon.dm index 1460af62361..c43f9f34dc7 100644 --- a/modular_skyrat/modules/bsa_overhaul/code/bsa_cannon.dm +++ b/modular_skyrat/modules/bsa_overhaul/code/bsa_cannon.dm @@ -28,7 +28,7 @@ /obj/machinery/bsa/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool, time = 1 SECONDS) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/bsa/back name = "Bluespace Artillery Generator" diff --git a/modular_skyrat/modules/cargo/code/items/gbp_punchcard.dm b/modular_skyrat/modules/cargo/code/items/gbp_punchcard.dm index 426cfa6072e..4548fe02f67 100644 --- a/modular_skyrat/modules/cargo/code/items/gbp_punchcard.dm +++ b/modular_skyrat/modules/cargo/code/items/gbp_punchcard.dm @@ -55,7 +55,7 @@ /obj/machinery/gbp_redemption/wrench_act(mob/living/user, obj/item/tool) . = ..() default_unfasten_wrench(user, tool) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/gbp_redemption/attackby(obj/item/attacking_item, mob/user, params) if(default_deconstruction_screwdriver(user, "gbp_machine_open", "gbp_machine", attacking_item)) diff --git a/modular_skyrat/modules/officestuff/code/officestuff.dm b/modular_skyrat/modules/officestuff/code/officestuff.dm index a8a69b2ac2a..19aa6f927e8 100644 --- a/modular_skyrat/modules/officestuff/code/officestuff.dm +++ b/modular_skyrat/modules/officestuff/code/officestuff.dm @@ -37,14 +37,14 @@ if(do_after(user, 2 SECONDS, src)) soundloop = new(src, TRUE) balloon_alert(user, "hands unscrewed!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return ..() balloon_alert(user, "screwing the hands...") if(do_after(user, 2 SECONDS, src)) QDEL_NULL(soundloop) balloon_alert(user, "hands screwed tight!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS return ..() /obj/structure/sign/painting/meat name = "Figure With Meat" diff --git a/modular_skyrat/modules/polarized_windows/polarization_controller.dm b/modular_skyrat/modules/polarized_windows/polarization_controller.dm index bf8944f3cdc..214e9257279 100644 --- a/modular_skyrat/modules/polarized_windows/polarization_controller.dm +++ b/modular_skyrat/modules/polarized_windows/polarization_controller.dm @@ -126,7 +126,7 @@ GLOBAL_LIST_EMPTY(polarization_controllers) remove_polarization_controller(source, user, tool) - return TOOL_ACT_SIGNAL_BLOCKING + return ITEM_INTERACT_BLOCKING /** diff --git a/modular_skyrat/modules/primitive_cooking_additions/code/stone_griddle.dm b/modular_skyrat/modules/primitive_cooking_additions/code/stone_griddle.dm index c704eb02c4b..895b5d1783b 100644 --- a/modular_skyrat/modules/primitive_cooking_additions/code/stone_griddle.dm +++ b/modular_skyrat/modules/primitive_cooking_additions/code/stone_griddle.dm @@ -29,4 +29,4 @@ return new /obj/item/stack/sheet/mineral/stone(drop_location(), 5) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS diff --git a/modular_skyrat/modules/primitive_cooking_additions/code/stone_oven.dm b/modular_skyrat/modules/primitive_cooking_additions/code/stone_oven.dm index 42a0b9ad013..c4c21967a3c 100644 --- a/modular_skyrat/modules/primitive_cooking_additions/code/stone_oven.dm +++ b/modular_skyrat/modules/primitive_cooking_additions/code/stone_oven.dm @@ -58,6 +58,6 @@ return new /obj/item/stack/sheet/mineral/stone(drop_location(), 5) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS #undef OVEN_TRAY_Y_OFFSET diff --git a/modular_skyrat/modules/primitive_cooking_additions/code/stone_stove.dm b/modular_skyrat/modules/primitive_cooking_additions/code/stone_stove.dm index eae9c5190a9..0057e758571 100644 --- a/modular_skyrat/modules/primitive_cooking_additions/code/stone_stove.dm +++ b/modular_skyrat/modules/primitive_cooking_additions/code/stone_stove.dm @@ -28,7 +28,7 @@ return new /obj/item/stack/sheet/mineral/stone(drop_location(), 5) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /// Stove component subtype with changed visuals and not much else /datum/component/stove/primitive diff --git a/modular_skyrat/modules/primitive_structures/code/storage_structures.dm b/modular_skyrat/modules/primitive_structures/code/storage_structures.dm index 32fb9a79d43..1788109b6c2 100644 --- a/modular_skyrat/modules/primitive_structures/code/storage_structures.dm +++ b/modular_skyrat/modules/primitive_structures/code/storage_structures.dm @@ -22,7 +22,7 @@ return new /obj/item/stack/sheet/mineral/clay(drop_location(), 5) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/rack/wooden/deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/mineral/wood(drop_location(), 2) @@ -45,7 +45,7 @@ return new /obj/item/stack/sheet/mineral/clay(drop_location(), 5) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/closet/crate/wooden/storage_barrel/deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/mineral/wood(drop_location(), 4) @@ -80,7 +80,7 @@ return new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/seedshelf name = "Seedshelf" @@ -110,7 +110,7 @@ return new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/rationshelf name = "Ration shelf" @@ -140,7 +140,7 @@ return new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/machinery/smartfridge/producedisplay name = "Produce display" @@ -170,4 +170,4 @@ return new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) deconstruct(TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS diff --git a/modular_skyrat/modules/reagent_forging/code/anvil.dm b/modular_skyrat/modules/reagent_forging/code/anvil.dm index 4765664e473..e0516c42abb 100644 --- a/modular_skyrat/modules/reagent_forging/code/anvil.dm +++ b/modular_skyrat/modules/reagent_forging/code/anvil.dm @@ -63,20 +63,20 @@ if(forge_item.in_use) balloon_alert(user, "already in use") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/obj/obj_tong_search = locate() in forge_item.contents if(obj_anvil_search && !obj_tong_search) obj_anvil_search.forceMove(forge_item) update_appearance() forge_item.icon_state = "tong_full" - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!obj_anvil_search && obj_tong_search) obj_tong_search.forceMove(src) update_appearance() forge_item.icon_state = "tong_empty" - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_anvil/hammer_act(mob/living/user, obj/item/tool) //regardless, we will make a sound @@ -88,7 +88,7 @@ if(COOLDOWN_FINISHED(locate_incomplete, heating_remainder)) balloon_alert(user, "metal too cool") locate_incomplete.times_hit -= 3 - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(COOLDOWN_FINISHED(locate_incomplete, striking_cooldown)) var/skill_modifier = user.mind.get_skill_modifier(/datum/skill/smithing, SKILL_SPEED_MODIFIER) * locate_incomplete.average_wait @@ -100,7 +100,7 @@ if(locate_incomplete.times_hit >= locate_incomplete.average_hits) user.balloon_alert(user, "[locate_incomplete] sounds ready") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS locate_incomplete.times_hit -= 3 balloon_alert(user, "bad hit") @@ -110,25 +110,25 @@ qdel(locate_incomplete) update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS //okay, so we didn't find an incomplete item to hammer, do we have a hammerable item? var/obj/locate_obj = locate() in contents if(locate_obj && (locate_obj.skyrat_obj_flags & ANVIL_REPAIR)) if(locate_obj.get_integrity() >= locate_obj.max_integrity) balloon_alert(user, "already repaired") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS while(locate_obj.get_integrity() < locate_obj.max_integrity) if(!do_after(user, 1 SECONDS, src)) balloon_alert(user, "stopped repairing") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS locate_obj.repair_damage(locate_obj.get_integrity() + 10) user.mind.adjust_experience(/datum/skill/smithing, 5) //repairing does give some experience playsound(src, 'modular_skyrat/modules/reagent_forging/sound/forge.ogg', 50, TRUE, ignore_walls = FALSE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_anvil/hammer_act_secondary(mob/living/user, obj/item/tool) hammer_act(user, tool) diff --git a/modular_skyrat/modules/reagent_forging/code/crafting_bench.dm b/modular_skyrat/modules/reagent_forging/code/crafting_bench.dm index 3ab95bee6fb..268c4acdfa1 100644 --- a/modular_skyrat/modules/reagent_forging/code/crafting_bench.dm +++ b/modular_skyrat/modules/reagent_forging/code/crafting_bench.dm @@ -156,20 +156,20 @@ /obj/structure/reagent_crafting_bench/wrench_act(mob/living/user, obj/item/tool) tool.play_tool_sound(src) deconstruct(disassembled = TRUE) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_crafting_bench/hammer_act(mob/living/user, obj/item/tool) playsound(src, 'modular_skyrat/modules/reagent_forging/sound/forge.ogg', 50, TRUE) if(length(contents)) if(!istype(contents[1], /obj/item/forging/complete)) balloon_alert(user, "invalid item") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/obj/item/forging/complete/weapon_to_finish = contents[1] if(!weapon_to_finish.spawning_item) balloon_alert(user, "[weapon_to_finish] cannot be completed") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/list/wood_required_for_weapons = list( /obj/item/stack/sheet/mineral/wood = WEAPON_COMPLETION_WOOD_AMOUNT, @@ -177,26 +177,26 @@ if(!can_we_craft_this(wood_required_for_weapons)) balloon_alert(user, "not enough wood") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/list/things_to_use = can_we_craft_this(wood_required_for_weapons, TRUE) var/obj/thing_just_made = create_thing_from_requirements(things_to_use, user = user, skill_to_grant = /datum/skill/smithing, skill_amount = 30, completing_a_weapon = TRUE) if(!thing_just_made) message_admins("[src] just tried to finish a weapon but somehow created nothing! This is not working as intended!") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert_to_viewers("[thing_just_made] created") update_appearance() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!selected_recipe) balloon_alert(user, "no recipe selected") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!can_we_craft_this(selected_recipe.recipe_requirements)) balloon_alert(user, "missing ingredients") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/skill_modifier = user.mind.get_skill_modifier(selected_recipe.relevant_skill, SKILL_SPEED_MODIFIER) * 1 SECONDS @@ -206,10 +206,10 @@ if(current_hits_to_completion <= -(selected_recipe.required_good_hits)) balloon_alert_to_viewers("recipe failed") clear_recipe() - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert(user, "bad hit") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS COOLDOWN_START(src, hit_cooldown, skill_modifier) @@ -217,12 +217,12 @@ var/list/things_to_use = can_we_craft_this(selected_recipe.recipe_requirements, TRUE) create_thing_from_requirements(things_to_use, selected_recipe, user, selected_recipe.relevant_skill, selected_recipe.relevant_skill_reward) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS current_hits_to_completion++ balloon_alert(user, "good hit") user.mind.adjust_experience(selected_recipe.relevant_skill, selected_recipe.relevant_skill_reward / 15) // Good hits towards the current item grants experience in that skill - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /// Takes the given list of item requirements and checks the surroundings for them, returns TRUE unless return_ingredients_list is set, in which case a list of all the items to use is returned /obj/structure/reagent_crafting_bench/proc/can_we_craft_this(list/required_items, return_ingredients_list = FALSE) diff --git a/modular_skyrat/modules/reagent_forging/code/forge.dm b/modular_skyrat/modules/reagent_forging/code/forge.dm index ca9f8edd423..148ff5b02be 100644 --- a/modular_skyrat/modules/reagent_forging/code/forge.dm +++ b/modular_skyrat/modules/reagent_forging/code/forge.dm @@ -743,7 +743,7 @@ /obj/structure/reagent_forge/billow_act(mob/living/user, obj/item/tool) if(in_use) // Preventing billow use if the forge is in use to prevent spam fail_message(user, "forge busy") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/skill_modifier = user.mind.get_skill_modifier(/datum/skill/smithing, SKILL_SPEED_MODIFIER) var/obj/item/forging/forge_item = tool @@ -752,25 +752,25 @@ if(!forge_fuel_strong && !forge_fuel_weak) fail_message(user, "no fuel in [src]") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(forge_temperature >= MAX_FORGE_TEMP) fail_message(user, "[src] cannot heat further") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert_to_viewers("billowing...") while(forge_temperature < 91) if(!do_after(user, skill_modifier * forge_item.toolspeed, target = src)) balloon_alert_to_viewers("stopped billowing") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS forge_temperature += 10 user.mind.adjust_experience(/datum/skill/smithing, 5) // Billowing, like fueling, gives you some experience in forging in_use = FALSE balloon_alert(user, "successfully heated [src]") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_forge/tong_act(mob/living/user, obj/item/tool) var/skill_modifier = user.mind.get_skill_modifier(/datum/skill/smithing, SKILL_SPEED_MODIFIER) @@ -778,7 +778,7 @@ if(in_use || forge_item.in_use) fail_message(user, "forge busy") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS in_use = TRUE forge_item.in_use = TRUE @@ -786,7 +786,7 @@ if(forge_temperature < MIN_FORGE_TEMP) fail_message(user, "forge too cool") forge_item.in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS // Here we check the item used on us (tongs) for an incomplete forge item of some kind to heat var/obj/item/forging/incomplete/search_incomplete = locate(/obj/item/forging/incomplete) in forge_item.contents @@ -796,14 +796,14 @@ if(!do_after(user, skill_modifier * forge_item.toolspeed, target = src)) balloon_alert_to_viewers("stopped heating [search_incomplete]") forge_item.in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS COOLDOWN_START(search_incomplete, heating_remainder, FORGE_HEATING_DURATION) in_use = FALSE forge_item.in_use = FALSE user.mind.adjust_experience(/datum/skill/smithing, 5) // Heating up forge items grants some experience balloon_alert(user, "successfully heated [search_incomplete]") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS // Here we check the item used on us (tongs) for a stack of some kind to create an object from var/obj/item/stack/search_stack = locate(/obj/item/stack) in forge_item.contents @@ -812,7 +812,7 @@ if(!user_choice) fail_message(user, "nothing chosen") forge_item.in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS // Sets up a list of the materials to give to the item later var/list/material_list = list() @@ -827,14 +827,14 @@ if(!search_stack.use(1)) fail_message(user, "not enough of [search_stack]") forge_item.in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS balloon_alert_to_viewers("heating [search_stack]") if(!do_after(user, skill_modifier * forge_item.toolspeed, target = src)) balloon_alert_to_viewers("stopped heating [search_stack]") forge_item.in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/spawn_item = choice_list[user_choice] var/obj/item/forging/incomplete/incomplete_item = new spawn_item(get_turf(src)) @@ -850,11 +850,11 @@ if(!search_stack) forge_item.icon_state = "tong_empty" - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS in_use = FALSE forge_item.in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_forge/blowrod_act(mob/living/user, obj/item/tool) var/obj/item/glassblowing/blowing_rod/blowing_item = tool @@ -863,27 +863,27 @@ if(in_use) to_chat(user, span_warning("You cannot do multiple things at the same time!")) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS in_use = TRUE if(forge_temperature < MIN_FORGE_TEMP) fail_message(user, "The temperature is not hot enough to start heating [blowing_item].") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS var/obj/item/glassblowing/molten_glass/find_glass = locate() in blowing_item.contents if(!find_glass) fail_message(user, "[blowing_item] does not have any glass to heat up.") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(!COOLDOWN_FINISHED(find_glass, remaining_heat)) fail_message(user, "[find_glass] is still has remaining heat.") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS to_chat(user, span_notice("You begin heating up [blowing_item].")) if(!do_after(user, glassblowing_speed, target = src)) fail_message(user, "[blowing_item] is interrupted in its heating process.") - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS COOLDOWN_START(find_glass, remaining_heat, glassblowing_amount) find_glass.total_time = glassblowing_amount @@ -891,7 +891,7 @@ user.mind.adjust_experience(/datum/skill/smithing, 5) user.mind.adjust_experience(/datum/skill/production, 10) in_use = FALSE - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /obj/structure/reagent_forge/wrench_act(mob/living/user, obj/item/tool) tool.play_tool_sound(src) diff --git a/modular_skyrat/modules/reagent_forging/code/tool_override.dm b/modular_skyrat/modules/reagent_forging/code/tool_override.dm index d2623bfdca2..4448c27d637 100644 --- a/modular_skyrat/modules/reagent_forging/code/tool_override.dm +++ b/modular_skyrat/modules/reagent_forging/code/tool_override.dm @@ -29,65 +29,3 @@ /// Called on an object when a tool with wrench capabilities is used to right click an object /atom/proc/blowrod_act_secondary(mob/living/user, obj/item/tool) return - -/** - *Tool behavior procedure. Redirects to tool-specific procs by default. - * - * You can override it to catch all tool interactions, for use in complex deconstruction procs. - * - * Must return parent proc ..() in the end if overridden - */ -/atom/tool_act(mob/living/user, obj/item/tool, tool_type, is_right_clicking) - var/act_result - var/signal_result - - var/is_left_clicking = !is_right_clicking - - if(is_left_clicking) // Left click first for sensibility - var/list/processing_recipes = list() //List of recipes that can be mutated by sending the signal - signal_result = SEND_SIGNAL(src, COMSIG_ATOM_TOOL_ACT(tool_type), user, tool, processing_recipes) - if(signal_result & COMPONENT_BLOCK_TOOL_ATTACK) // The COMSIG_ATOM_TOOL_ACT signal is blocking the act - return TOOL_ACT_SIGNAL_BLOCKING - if(processing_recipes.len) - process_recipes(user, tool, processing_recipes) - if(QDELETED(tool)) - return TRUE - else - signal_result = SEND_SIGNAL(src, COMSIG_ATOM_SECONDARY_TOOL_ACT(tool_type), user, tool) - if(signal_result & COMPONENT_BLOCK_TOOL_ATTACK) // The COMSIG_ATOM_TOOL_ACT signal is blocking the act - return TOOL_ACT_SIGNAL_BLOCKING - - switch(tool_type) - if(TOOL_CROWBAR) - act_result = is_left_clicking ? crowbar_act(user, tool) : crowbar_act_secondary(user, tool) - if(TOOL_MULTITOOL) - act_result = is_left_clicking ? multitool_act(user, tool) : multitool_act_secondary(user, tool) - if(TOOL_SCREWDRIVER) - act_result = is_left_clicking ? screwdriver_act(user, tool) : screwdriver_act_secondary(user, tool) - if(TOOL_WRENCH) - act_result = is_left_clicking ? wrench_act(user, tool) : wrench_act_secondary(user, tool) - if(TOOL_WIRECUTTER) - act_result = is_left_clicking ? wirecutter_act(user, tool) : wirecutter_act_secondary(user, tool) - if(TOOL_WELDER) - act_result = is_left_clicking ? welder_act(user, tool) : welder_act_secondary(user, tool) - if(TOOL_ANALYZER) - act_result = is_left_clicking ? analyzer_act(user, tool) : analyzer_act_secondary(user, tool) - if(TOOL_BILLOW) - act_result = is_left_clicking ? billow_act(user, tool) : billow_act_secondary(user, tool) - if(TOOL_TONG) - act_result = is_left_clicking ? tong_act(user, tool) : tong_act_secondary(user, tool) - if(TOOL_HAMMER) - act_result = is_left_clicking ? hammer_act(user, tool) : hammer_act_secondary(user, tool) - if(TOOL_BLOWROD) - act_result = is_left_clicking ? blowrod_act(user, tool) : blowrod_act_secondary(user, tool) - if(!act_result) - return - - // A tooltype_act has completed successfully - if(is_left_clicking) - log_tool("[key_name(user)] used [tool] on [src] at [AREACOORD(src)]") - SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_PRIMARY(tool_type), src) - else - log_tool("[key_name(user)] used [tool] on [src] (right click) at [AREACOORD(src)]") - SEND_SIGNAL(tool, COMSIG_TOOL_ATOM_ACTED_SECONDARY(tool_type), src) - return TOOL_ACT_TOOLTYPE_SUCCESS diff --git a/modular_skyrat/modules/reagent_forging/code/water_basin.dm b/modular_skyrat/modules/reagent_forging/code/water_basin.dm index 63c852d6a5f..895dc3f77b1 100644 --- a/modular_skyrat/modules/reagent_forging/code/water_basin.dm +++ b/modular_skyrat/modules/reagent_forging/code/water_basin.dm @@ -69,14 +69,14 @@ /obj/structure/reagent_water_basin/tong_act(mob/living/user, obj/item/tool) var/obj/item/forging/incomplete/search_incomplete = locate(/obj/item/forging/incomplete) in tool.contents if(!search_incomplete) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS playsound(src, 'modular_skyrat/modules/reagent_forging/sound/hot_hiss.ogg', 50, TRUE) if(search_incomplete?.times_hit < search_incomplete.average_hits) to_chat(user, span_warning("You cool down [search_incomplete], but it wasn't ready yet.")) COOLDOWN_RESET(search_incomplete, heating_remainder) - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS if(search_incomplete?.times_hit >= search_incomplete.average_hits) to_chat(user, span_notice("You cool down [search_incomplete] and it's ready.")) @@ -88,7 +88,7 @@ qdel(search_incomplete) tool.icon_state = "tong_empty" - return TOOL_ACT_TOOLTYPE_SUCCESS + return ITEM_INTERACT_SUCCESS /// Fishing source for fishing out of basins that have been upgraded, contains saltwater fish (lizard fish fall under this too!) /datum/fish_source/water_basin