diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm index ae0c99642f..e83c05b192 100644 --- a/code/game/objects/items/paintkit.dm +++ b/code/game/objects/items/paintkit.dm @@ -166,7 +166,7 @@ if(istype(O,/obj/item/kit/suit)) var/obj/item/kit/suit/kit = O kit.customize(src, user) - return + return TRUE return ..() /obj/item/kit/suit/rig diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index d4be6c15ca..faaf6ea68b 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -49,12 +49,12 @@ name = "dufflebag of holding" icon_state = "holdingduffle" -/obj/item/storage/backpack/holding/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/backpack/holding/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/storage/backpack/holding)) to_chat(user, "The Bluespace interfaces of the two devices conflict and malfunction.") qdel(W) - return - . = ..() + return TRUE + return ..() //Please don't clutter the parent storage item with stupid hacks. /obj/item/storage/backpack/holding/can_be_inserted(obj/item/W as obj, stop_messages = 0) @@ -527,4 +527,4 @@ desc = "A satchel designed for the Go Go ERT Rangers series to allow for slightly bigger carry capacity for the ERT-Rangers.\ Unlike the show claims, it is not a phoron-enhanced satchel of holding with plot-relevant content." icon = 'icons/obj/clothing/ranger.dmi' - icon_state = "ranger_satchel" \ No newline at end of file + icon_state = "ranger_satchel" diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm index abd975fd96..157f172186 100644 --- a/code/game/objects/items/weapons/storage/bible.dm +++ b/code/game/objects/items/weapons/storage/bible.dm @@ -36,7 +36,7 @@ A.reagents.del_reagent("water") A.reagents.add_reagent("holywater",water2holy) -/obj/item/storage/bible/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/bible/attackby(obj/item/W, mob/user) if (src.use_sound) playsound(src, src.use_sound, 50, 1, -5) - ..() + return ..() diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index a9a146c404..3faac0a8b1 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -476,8 +476,9 @@ user.visible_message("[user] manages to light the match on the matchbox.") else playsound(src, 'sound/items/cigs_lighters/matchstick_hit.ogg', 25, 0, -1) - W.update_icon() - return + W.update_icon() + return TRUE + return ..() /obj/item/storage/box/autoinjectors name = "box of injectors" diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 505fed9c22..272010ca66 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -130,16 +130,17 @@ add_overlay(image('icons/obj/crayons.dmi',crayon.colourName)) appearance = ma -/obj/item/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/fancy/crayons/attackby(obj/item/W, mob/user) if(istype(W,/obj/item/pen/crayon)) - switch(W:colourName) + var/obj/item/pen/crayon/crayon = W + switch(crayon.colourName) if("mime") to_chat(user, "This crayon is too sad to be contained in this box.") - return + return TRUE if("rainbow") to_chat(user, "This crayon is too powerful to be contained in this box.") - return - ..() + return TRUE + return ..() /obj/item/storage/fancy/markers name = "box of markers" @@ -172,16 +173,17 @@ ma.add_overlay(image('icons/obj/crayons.dmi',"m"+marker.colourName)) appearance = ma -/obj/item/storage/fancy/markers/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/fancy/markers/attackby(obj/item/W, mob/user) if(istype(W,/obj/item/pen/crayon/marker)) - switch(W:colourName) + var/obj/item/pen/crayon/marker/marker = W + switch(marker.colourName) if("mime") to_chat(user, "This marker is too depressing to be contained in this box.") - return + return TRUE if("rainbow") to_chat(user, "This marker is too childish to be contained in this box.") - return - ..() + return TRUE + return ..() /* * Cracker Packet @@ -407,9 +409,10 @@ else add_overlay("ledb") -/obj/item/storage/lockbox/vials/attackby(obj/item/W as obj, mob/user as mob) - ..() - update_icon() +/obj/item/storage/lockbox/vials/attackby(obj/item/W, mob/user) + . = ..() + if(.) + update_icon() /* * Box of Chocolates/Heart Box diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index dcf2fe4caf..4296363252 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -204,7 +204,7 @@ I.color = wrapper_color add_overlay(I) -/obj/item/storage/pill_bottle/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/pill_bottle/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/pen) || istype(W, /obj/item/flashlight/pen)) var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) if(length(tmp_label) > 50) @@ -217,8 +217,8 @@ to_chat(user, "You set the label to \"[tmp_label]\".") label_text = tmp_label update_name_label() - else - ..() + return TRUE + return ..() /obj/item/storage/pill_bottle/proc/update_name_label() if(!label_text) diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm index 08635b2375..612a6fc9d1 100644 --- a/code/game/objects/items/weapons/storage/lockbox.dm +++ b/code/game/objects/items/weapons/storage/lockbox.dm @@ -17,7 +17,8 @@ var/icon_broken = "lockbox+b" -/obj/item/storage/lockbox/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/lockbox/attackby(obj/item/W, mob/user) + if (istype(W, /obj/item/card/id)) if(src.broken) to_chat(user, "It appears to be broken.") @@ -28,25 +29,26 @@ src.icon_state = src.icon_locked to_chat(user, "You lock \the [src]!") close_all() - return else src.icon_state = src.icon_closed to_chat(user, "You unlock \the [src]!") - return else to_chat(user, "Access Denied") - else if(istype(W, /obj/item/melee/energy/blade)) + return TRUE + + if(istype(W, /obj/item/melee/energy/blade)) if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying.")) var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(5, 0, src.loc) spark_system.start() playsound(src, 'sound/weapons/blade1.ogg', 50, 1) playsound(src, "sparks", 50, 1) - if(!locked) - ..() - else + + if(locked) to_chat(user, "It's locked!") - return + return TRUE + + return ..() /obj/item/storage/lockbox/show_to(mob/user as mob) diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index cf3c0a62be..7acfafdee3 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -33,7 +33,8 @@ if(Adjacent(user)) . += "The service panel is [src.open ? "open" : "closed"]." -/obj/item/storage/secure/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/secure/attackby(obj/item/W, mob/user) + if(locked) if (istype(W, /obj/item/melee/energy/blade) && emag_act(INFINITY, user, "You slice through the lock of \the [src]")) var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() @@ -41,14 +42,15 @@ spark_system.start() playsound(src, 'sound/weapons/blade1.ogg', 50, 1) playsound(src, "sparks", 50, 1) - return + return TRUE if (W.is_screwdriver()) if (do_after(user, 20 * W.toolspeed)) src.open =! src.open playsound(src, W.usesound, 50, 1) user.show_message(text("You [] the service panel.", (src.open ? "open" : "close"))) - return + return TRUE + if (istype(W, /obj/item/multitool) && (src.open == 1)&& (!src.l_hacking)) user.show_message("Now attempting to reset internal memory, please hold.", 1) src.l_hacking = 1 @@ -64,15 +66,15 @@ else user.show_message("Unable to reset internal memory.", 1) src.l_hacking = 0 - else src.l_hacking = 0 - return + else + src.l_hacking = 0 + return TRUE //At this point you have exhausted all the special things to do when locked // ... but it's still locked. - return + return TRUE // -> storage/attackby() what with handle insertion, etc - ..() - + return ..() /obj/item/storage/secure/MouseDrop(over_object, src_location, over_location) if (locked) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 21870fff15..b1ac35faba 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -473,15 +473,11 @@ return 1 //This proc is called when you want to place an item into the storage item. -/obj/item/storage/attackby(obj/item/W as obj, mob/user as mob, silent) - - . = ..() - if(.) - return +/obj/item/storage/attackby(obj/item/W, mob/user, silent) //Robots can't interact with storage items. if(isrobot(user)) - return FALSE + return ..() if(istype(W, /obj/item/lightreplacer)) var/obj/item/lightreplacer/LP = W @@ -499,26 +495,25 @@ to_chat(user, "You inserted [amt_inserted] light\s into \the [LP.name]. You have [LP.uses] light\s remaining.") return TRUE - if(!can_be_inserted(W)) - return FALSE - - if(istype(W, /obj/item/tray)) - var/obj/item/tray/T = W - if(T.calc_carry() > 0) - if(prob(85)) + if(can_be_inserted(W)) + if(istype(W, /obj/item/tray)) + var/obj/item/tray/T = W + if(T.calc_carry() > 0) + if(prob(85)) + if (!silent) + to_chat(user, "The tray won't fit in [src].") + return TRUE + W.forceMove(get_turf(user)) + if ((user.client && user.s_active != src)) + user.client.screen -= W + W.dropped(user) if (!silent) - to_chat(user, "The tray won't fit in [src].") + to_chat(user, "God damn it!") return TRUE - W.forceMove(get_turf(user)) - if ((user.client && user.s_active != src)) - user.client.screen -= W - W.dropped(user) - if (!silent) - to_chat(user, "God damn it!") - return TRUE + W.add_fingerprint(user) + return handle_item_insertion(W, silent) - W.add_fingerprint(user) - return handle_item_insertion(W, silent) + return ..() /obj/item/storage/dropped(mob/user as mob) return diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index 34109793ec..28310d7540 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -19,7 +19,7 @@ if (pockets.handle_mousedrop(usr, over_object)) ..(over_object) -/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/suit/storage/attackby(obj/item/W, mob/user) . = ..() if(!.) return pockets.attackby(W, user) diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index 71dd43cb84..7ad39863d5 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -42,7 +42,7 @@ data["on"] = on data["open"] = open data["locked"] = locked - + data["vocal"] = vocal data["amount"] = amount @@ -58,7 +58,7 @@ data["eattiles"] = eattiles data["maketiles"] = maketiles data["bmode"] = dir2text(targetdirection) - + return data /mob/living/bot/floorbot/attack_hand(var/mob/user) @@ -76,7 +76,7 @@ /mob/living/bot/floorbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) if(..()) return TRUE - + add_fingerprint(src) switch(action) @@ -86,7 +86,7 @@ else turn_on() . = TRUE - + if(locked && !issilicon(usr)) return @@ -344,13 +344,15 @@ /* Assembly */ -/obj/item/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/floor/T, mob/living/user as mob) +/obj/item/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/floor/T, mob/living/user) + if(!istype(T, /obj/item/stack/tile/floor)) - ..() - return + return ..() + if(contents.len >= 1) to_chat(user, "They wont fit in as there is already stuff inside.") - return + return TRUE + if(user.s_active) user.s_active.close(user) if(T.use(10)) @@ -361,7 +363,7 @@ qdel(src) else to_chat(user, "You need 10 floor tiles for a floorbot.") - return + return TRUE /obj/item/toolbox_tiles desc = "It's a toolbox with tiles sticking out the top" diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm index 8cfc24c099..00ff27c29e 100644 --- a/code/modules/mob/living/bot/medbot.dm +++ b/code/modules/mob/living/bot/medbot.dm @@ -267,7 +267,7 @@ /mob/living/bot/medbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) if(..()) return TRUE - + usr.set_machine(src) add_fingerprint(usr) @@ -470,16 +470,22 @@ /* Construction */ -/obj/item/storage/firstaid/attackby(var/obj/item/robot_parts/S, mob/user as mob) - if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm))) - ..() - return +/obj/item/storage/firstaid/attackby(var/obj/item/W, mob/user) - if(contents.len >= 1) - to_chat(user, "You need to empty [src] out first.") - return + var/valid_for_construction = istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm) + if(istype(W, /obj/item/organ/external/arm)) + var/obj/item/organ/external/arm/arm = W + if(arm.robotic == ORGAN_ROBOT) + valid_for_construction = TRUE - var/obj/item/firstaid_arm_assembly/A = new /obj/item/firstaid_arm_assembly + if(!valid_for_construction) + return ..() + + if(contents.len) + to_chat(user, SPAN_NOTICE("You need to empty [src] out first.")) + return TRUE + + var/obj/item/firstaid_arm_assembly/A = new /obj/item/firstaid_arm_assembly(get_turf(src)) if(istype(src, /obj/item/storage/firstaid/fire)) A.skin = "ointment" else if(istype(src, /obj/item/storage/firstaid/toxin)) @@ -487,34 +493,12 @@ else if(istype(src, /obj/item/storage/firstaid/o2)) A.skin = "o2" - qdel(S) + qdel(W) user.put_in_hands(A) - to_chat(user, "You add the robot arm to the first aid kit.") - user.drop_from_inventory(src) - qdel(src) - -/obj/item/storage/firstaid/attackby(var/obj/item/organ/external/S, mob/user as mob) - if (!istype(S, /obj/item/organ/external/arm) || S.robotic != ORGAN_ROBOT) - ..() - return - - if(contents.len >= 1) - to_chat(user, "You need to empty [src] out first.") - return - - var/obj/item/firstaid_arm_assembly/A = new /obj/item/firstaid_arm_assembly - if(istype(src, /obj/item/storage/firstaid/fire)) - A.skin = "ointment" - else if(istype(src, /obj/item/storage/firstaid/toxin)) - A.skin = "tox" - else if(istype(src, /obj/item/storage/firstaid/o2)) - A.skin = "o2" - - qdel(S) - user.put_in_hands(A) - to_chat(user, "You add the robot arm to the first aid kit.") + to_chat(user, SPAN_NOTICE("You add the robot arm to the first aid kit.")) user.drop_from_inventory(src) qdel(src) + return TRUE /obj/item/firstaid_arm_assembly name = "first aid/robot arm assembly"