Attack chain refactoring: Broadening tool_act into item_interact, moving some item interactions to... atom/item_interact / item/interact_with_atom (#79968)

## About The Pull Request

Implements half of this (with some minor changes): 


![image](https://github.com/tgstation/tgstation/assets/51863163/bf5cc4bb-5a1f-42e3-921d-9a57bc6096cc)

The ultimate goal of this is to split our attack chain in two: 
- One for non-combat item interactions
  - Health analyzer scanning
  - using tools on stuff
  - surgery
  - Niche other interactions
- One for combat attacking
  - Item hit thing, item deal damage. 
  - Special effects on attack would go here.  

This PR begins this by broadining tool act into item interact. 

Item interact is a catch-all proc ran at the beginning of attack chain,
before `pre_attack` and such, that handles the first part of the chain.

This allows us to easily catch item interaction and cancel the attack
part of the chain by using deliberate bitflag return values, rather than
`TRUE` / `FALSE`*.

*Because right now, `TRUE` = `cancel attack`, no matter what, which is
unclear to people.

Instead of moving as much as possible to the new proc in this PR, I
started by doing some easy, obvious things. More things can be moved in
the future, or technically they don't even need to move in a lot of
cases.

## Changelog

🆑 Melbert
refactor: Refactored some methods of items interacting with other
objects or mobs, such as surgery and health analzyers. Report if
anything seems wrong
/🆑
This commit is contained in:
MrMelbert
2023-12-09 00:50:19 -06:00
committed by GitHub
parent 65a30878cb
commit 1e76fd70b4
153 changed files with 710 additions and 609 deletions
@@ -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)
+10 -8
View File
@@ -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)
+23 -7
View File
@@ -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))
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(can_perform_surgery(user, params))
return TRUE
if(..())
return TRUE
user.changeNext_move(attacking_item.attack_speed)
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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)
@@ -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)
+5 -5
View File
@@ -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)
@@ -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
@@ -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)
+4 -4
View File
@@ -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.
@@ -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)
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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)
@@ -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)
+75 -25
View File
@@ -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,48 @@
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(!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
//! Tool-specific behavior procs.
///
/**
* 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
/**
* 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)
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -758,11 +758,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)
+2 -2
View File
@@ -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
+5 -7
View File
@@ -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)
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -39,7 +39,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)
@@ -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))
@@ -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
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -82,7 +82,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)
+14 -14
View File
@@ -832,16 +832,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."))
@@ -862,7 +862,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)
@@ -882,14 +882,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
@@ -898,7 +898,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)
@@ -916,7 +916,7 @@
return
unbolt()
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
/obj/machinery/door/airlock/welder_act(mob/living/user, obj/item/tool)
@@ -943,19 +943,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
@@ -971,7 +971,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)
+4 -4
View File
@@ -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)
. = ..()
+4 -4
View File
@@ -495,17 +495,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)
@@ -514,7 +514,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
+11 -11
View File
@@ -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)
. = ..()
+1 -1
View File
@@ -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)
. = ..()
+4 -4
View File
@@ -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)
+1 -1
View File
@@ -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()
. = ..()
+1 -1
View File
@@ -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)
@@ -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)
+4 -4
View File
@@ -103,22 +103,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)
. = ..()
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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))
+6 -7
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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))
+5 -5
View File
@@ -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)
+2 -3
View File
@@ -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
@@ -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))
@@ -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))
@@ -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)
/obj/item/healthanalyzer/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
. = ITEM_INTERACT_SUCCESS
flick("[icon_state]-scan", src) //makes it so that it plays the scan animation upon scanning, including clumsy scanning
@@ -86,12 +92,14 @@
add_fingerprint(user)
/obj/item/healthanalyzer/attack_secondary(mob/living/victim, mob/living/user, params)
/obj/item/healthanalyzer/interact_with_atom_secondary(atom/interacting_with, mob/living/user)
if(!isliving(interacting_with))
return NONE
if(!user.can_read(src) || user.is_blind())
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
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,
@@ -521,21 +529,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)
@@ -544,34 +555,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/attack(mob/living/carbon/patient, mob/living/carbon/human/user)
/obj/item/healthanalyzer/simple/proc/violence_damage(mob/living/user)
user.adjustBruteLoss(4)
/obj/item/healthanalyzer/simple/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
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()
. = ..()
@@ -610,39 +634,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_damage(mob/living/user)
user.adjustBruteLoss(1)
user.reagents.add_reagent(/datum/reagent/toxin, rand(1, 3))
/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
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()
. = ..()
@@ -658,7 +657,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
@@ -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)
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."))
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!"))
/obj/item/sequence_scanner/interact_with_atom(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 or DNA-less Species
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, '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
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)
. = ..()
@@ -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) || 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) || 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 = "<b>Slime scan results:</b>\
@@ -76,30 +76,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))
+14 -14
View File
@@ -45,30 +45,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)
+6 -3
View File
@@ -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)
. = ..()
+2 -2
View File
@@ -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,7 +105,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
)
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)
@@ -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
@@ -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))
+14 -11
View File
@@ -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
@@ -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
+20 -14
View File
@@ -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,22 +134,28 @@
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(isnull(affecting) || !IS_ROBOTIC_LIMB(affecting))
return ITEM_INTERACT_BLOCKING
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]."))
if(!do_after(user, 5 SECONDS, attacked_humanoid))
return
item_heal_robotic(attacked_humanoid, user, 15, 0)
else
return ..()
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, 5 SECONDS, attacked_humanoid))
return ITEM_INTERACT_BLOCKING
item_heal_robotic(attacked_humanoid, user, 15, 0)
return ITEM_INTERACT_SUCCESS
/obj/item/weldingtool/afterattack(atom/attacked_atom, mob/user, proximity)
. = ..()
+2 -2
View File
@@ -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)
. = ..()
+2 -2
View File
@@ -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."
+6 -6
View File
@@ -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)
+3 -3
View File
@@ -651,17 +651,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))
@@ -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"
@@ -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)
+1 -1
View File
@@ -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))
+7 -7
View File
@@ -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)
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)
. = ..()
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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()
. = ..()
@@ -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 ///////////////////////
+7 -7
View File
@@ -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)
+3 -3
View File
@@ -147,7 +147,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))
@@ -155,13 +155,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
+2 -2
View File
@@ -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)
@@ -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
+1 -1
View File
@@ -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)
. = ..()
+9 -9
View File
@@ -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)
+1 -1
View File
@@ -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)
. = ..()
+3 -2
View File
@@ -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
@@ -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"
+1 -1
View File
@@ -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)
@@ -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)
@@ -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)
@@ -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)
. = ..()
@@ -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)
@@ -452,20 +452,20 @@
else
to_chat(user, "<span class='warning'>You can't access the maintenance panel while the pod is " \
+ (on ? "active" : (occupant ? "full" : "open")) + "!</span>")
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))
@@ -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))
@@ -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)
@@ -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)
@@ -219,5 +219,5 @@
if(default_unfasten_wrench(user, tool))
if(!movable)
on = FALSE
return TOOL_ACT_TOOLTYPE_SUCCESS
return ITEM_INTERACT_SUCCESS
return FALSE
+5 -5
View File
@@ -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)
. = ..()
+3 -3
View File
@@ -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))
+1 -3
View File
@@ -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])"
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
. = ..()
+1 -1
View File
@@ -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)
@@ -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)
. = ..()
@@ -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
@@ -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

Some files were not shown because too many files have changed in this diff Show More