diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm index 5548d063461..4d17428fc9b 100644 --- a/code/modules/surgery/bodyparts/robot_bodyparts.dm +++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm @@ -295,28 +295,29 @@ TRAIT_RESISTHIGHPRESSURE, ), AUGMENTATION_TRAIT) -/obj/item/bodypart/chest/robot/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers) - if(istype(weapon, /obj/item/stock_parts/power_store/cell)) +/obj/item/bodypart/chest/robot/item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if(istype(tool, /obj/item/stock_parts/power_store/cell)) if(cell) - to_chat(user, span_warning("You have already inserted a cell!")) - return - else - if(!user.transferItemToLoc(weapon, src)) - return - cell = weapon - to_chat(user, span_notice("You insert the cell.")) - else if(istype(weapon, /obj/item/stack/cable_coil)) + to_chat(user, span_warning("A cell is already present in [src]!")) + return ITEM_INTERACT_BLOCKING + if(!user.transferItemToLoc(tool, src)) + return ITEM_INTERACT_BLOCKING + cell = tool + to_chat(user, span_notice("You insert [cell] into [src].")) + return ITEM_INTERACT_SUCCESS + + if(istype(tool, /obj/item/stack/cable_coil)) if(wired) - to_chat(user, span_warning("You have already inserted wire!")) - return - var/obj/item/stack/cable_coil/coil = weapon - if (coil.use(1)) - wired = TRUE - to_chat(user, span_notice("You insert the wire.")) - else + to_chat(user, span_warning("[src] is already wired up!")) + return ITEM_INTERACT_BLOCKING + var/obj/item/stack/cable_coil/coil = tool + if (!coil.use(1)) to_chat(user, span_warning("You need one length of coil to wire it!")) - else - return ..() + return ITEM_INTERACT_BLOCKING + wired = TRUE + to_chat(user, span_notice("You wire the cell inside of [src].")) + return ITEM_INTERACT_SUCCESS + return NONE /obj/item/bodypart/chest/robot/wirecutter_act(mob/living/user, obj/item/cutter) . = ..() @@ -440,25 +441,28 @@ . += "It has two eye sockets occupied by flashes." . += span_notice("You can remove the seated flash[single_flash ? "":"es"] with a crowbar.") -/obj/item/bodypart/head/robot/attackby(obj/item/weapon, mob/user, list/modifiers, list/attack_modifiers) - if(istype(weapon, /obj/item/assembly/flash/handheld)) - var/obj/item/assembly/flash/handheld/flash = weapon - if(flash1 && flash2) - to_chat(user, span_warning("You have already inserted the eyes!")) - return - else if(flash.burnt_out) - to_chat(user, span_warning("You can't use a broken flash!")) - return - else - if(!user.transferItemToLoc(flash, src)) - return - if(flash1) - flash2 = flash - else - flash1 = flash - to_chat(user, span_notice("You insert the flash into the eye socket.")) - return - return ..() +/obj/item/bodypart/head/robot/item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if(!istype(tool, /obj/item/assembly/flash/handheld)) + return NONE + + var/obj/item/assembly/flash/handheld/flash = tool + if(flash1 && flash2) + to_chat(user, span_warning("[src] already has both flash-eyes present!")) + return ITEM_INTERACT_BLOCKING + + if(flash.burnt_out) + to_chat(user, span_warning("You can't use a broken flash!")) + return ITEM_INTERACT_BLOCKING + + if(!user.transferItemToLoc(flash, src)) + return ITEM_INTERACT_BLOCKING + + if(flash1) + flash2 = flash + else + flash1 = flash + to_chat(user, span_notice("You insert the flash into the eye socket.")) + return ITEM_INTERACT_SUCCESS /obj/item/bodypart/head/robot/crowbar_act(mob/living/user, obj/item/prytool) ..() diff --git a/code/modules/surgery/operations/operation_dissection.dm b/code/modules/surgery/operations/operation_dissection.dm index 1756d536e02..74c119edd63 100644 --- a/code/modules/surgery/operations/operation_dissection.dm +++ b/code/modules/surgery/operations/operation_dissection.dm @@ -115,14 +115,14 @@ . = ..() . += span_notice("It is worth [value] research points.") -/obj/item/research_notes/attackby(obj/item/attacking_item, mob/living/user, list/modifiers, list/attack_modifiers) - if(istype(attacking_item, /obj/item/research_notes)) - var/obj/item/research_notes/notes = attacking_item - value = value + notes.value - change_vol() - qdel(notes) - return - return ..() +/obj/item/research_notes/item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if(!istype(tool, /obj/item/research_notes)) + return NONE + var/obj/item/research_notes/notes = tool + value = value + notes.value + change_vol() + qdel(notes) + return ITEM_INTERACT_SUCCESS /// proc that changes name and icon depending on value /obj/item/research_notes/proc/change_vol() diff --git a/code/modules/surgery/organs/autosurgeon.dm b/code/modules/surgery/organs/autosurgeon.dm index 388b25da125..d75f7fd4ec9 100644 --- a/code/modules/surgery/organs/autosurgeon.dm +++ b/code/modules/surgery/organs/autosurgeon.dm @@ -122,11 +122,11 @@ add_fingerprint(user) use_autosurgeon(target, user, 8 SECONDS) -/obj/item/autosurgeon/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers) - if(isorgan(attacking_item)) - load_organ(attacking_item, user) - else - return ..() +/obj/item/autosurgeon/item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if(isorgan(tool)) + load_organ(tool, user) + return ITEM_INTERACT_SUCCESS + return NONE /obj/item/autosurgeon/screwdriver_act(mob/living/user, obj/item/screwtool) if(..())