diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 99a584e927..e0178d8885 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -134,78 +134,92 @@ toggle_cam(null, 0) ..() -/obj/machinery/camera/attackby(obj/item/W, mob/living/user, params) - var/msg = "You attach [W] into the assembly's inner circuits." - var/msg2 = "[src] already has that upgrade!" +// Construction/Deconstruction +/obj/machinery/camera/screwdriver_act(mob/living/user, obj/item/I) + panel_open = !panel_open + to_chat(user, "You screw the camera's panel [panel_open ? "open" : "closed"].") + I.play_tool_sound(src) + return TRUE - // DECONSTRUCTION - if(istype(W, /obj/item/screwdriver)) - panel_open = !panel_open - to_chat(user, "You screw the camera's panel [panel_open ? "open" : "closed"].") - W.play_tool_sound(src) - return +/obj/machinery/camera/wirecutter_act(mob/living/user, obj/item/I) + if(!panel_open) + return FALSE + toggle_cam(user, 1) + obj_integrity = max_integrity //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex. + I.play_tool_sound(src) + return TRUE +/obj/machinery/camera/multitool_act(mob/living/user, obj/item/I) + if(!panel_open) + return FALSE + + setViewRange((view_range == initial(view_range)) ? short_range : initial(view_range)) + to_chat(user, "You [(view_range == initial(view_range)) ? "restore" : "mess up"] the camera's focus.") + return + +/obj/machinery/camera/welder_act(mob/living/user, obj/item/I) + if(!panel_open) + return FALSE + + if(!I.tool_start_check(user, amount=0)) + return TRUE + + to_chat(user, "You start to weld [src]...") + if(I.use_tool(src, user, 100, volume=50)) + user.visible_message("[user] unwelds [src], leaving it as just a frame bolted to the wall.", + "You unweld [src], leaving it as just a frame bolted to the wall") + deconstruct(TRUE) + + return TRUE + +/obj/machinery/camera/attackby(obj/item/I, mob/living/user, params) + // UPGRADES if(panel_open) - if(istype(W, /obj/item/wirecutters)) //enable/disable the camera - toggle_cam(user, 1) - obj_integrity = max_integrity //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex. - return - - else if(istype(W, /obj/item/device/multitool)) //change focus - setViewRange((view_range == initial(view_range)) ? short_range : initial(view_range)) - to_chat(user, "You [(view_range == initial(view_range)) ? "restore" : "mess up"] the camera's focus.") - return - - else if(istype(W, /obj/item/weldingtool)) - if(weld(W, user)) - visible_message("[user] unwelds [src], leaving it as just a frame bolted to the wall.", "You unweld [src], leaving it as just a frame bolted to the wall") - deconstruct(TRUE) - return - - else if(istype(W, /obj/item/device/analyzer)) + if(istype(I, /obj/item/device/analyzer)) if(!isXRay()) - if(!user.temporarilyRemoveItemFromInventory(W)) + if(!user.temporarilyRemoveItemFromInventory(I)) return - qdel(W) + qdel(I) upgradeXRay() - to_chat(user, "[msg]") + to_chat(user, "You attach [I] into the assembly's inner circuits.") else - to_chat(user, "[msg2]") + to_chat(user, "[src] already has that upgrade!") return - else if(istype(W, /obj/item/stack/sheet/mineral/plasma)) + else if(istype(I, /obj/item/stack/sheet/mineral/plasma)) if(!isEmpProof()) - var/obj/item/stack/sheet/mineral/plasma/P = W - upgradeEmpProof() - to_chat(user, "[msg]") - P.use(1) + if(I.use_tool(src, user, 0, amount=1)) + upgradeEmpProof() + to_chat(user, "You attach [I] into the assembly's inner circuits.") else - to_chat(user, "[msg2]") + to_chat(user, "[src] already has that upgrade!") return - else if(istype(W, /obj/item/device/assembly/prox_sensor)) + else if(istype(I, /obj/item/device/assembly/prox_sensor)) if(!isMotion()) + if(!user.temporarilyRemoveItemFromInventory(I)) + return upgradeMotion() - to_chat(user, "[msg]") - qdel(W) + to_chat(user, "You attach [I] into the assembly's inner circuits.") + qdel(I) else - to_chat(user, "[msg2]") + to_chat(user, "[src] already has that upgrade!") return // OTHER - if((istype(W, /obj/item/paper) || istype(W, /obj/item/device/pda)) && isliving(user)) + if((istype(I, /obj/item/paper) || istype(I, /obj/item/device/pda)) && isliving(user)) var/mob/living/U = user var/obj/item/paper/X = null var/obj/item/device/pda/P = null var/itemname = "" var/info = "" - if(istype(W, /obj/item/paper)) - X = W + if(istype(I, /obj/item/paper)) + X = I itemname = X.name info = X.info else - P = W + P = I itemname = P.name info = P.notehtml to_chat(U, "You hold \the [itemname] up to the camera...") @@ -225,7 +239,7 @@ O << browse(text("[][]", itemname, info), text("window=[]", itemname)) return - else if(istype(W, /obj/item/device/camera_bug)) + else if(istype(I, /obj/item/device/camera_bug)) if(!can_use()) to_chat(user, "Camera non-functional.") return @@ -235,12 +249,12 @@ bug = null else to_chat(user, "Camera bugged.") - bug = W + bug = I bug.bugged_cameras[src.c_tag] = src return - else if(istype(W, /obj/item/pai_cable)) - var/obj/item/pai_cable/cable = W + else if(istype(I, /obj/item/pai_cable)) + var/obj/item/pai_cable/cable = I cable.plugin(src, user) return @@ -370,20 +384,6 @@ return null -/obj/machinery/camera/proc/weld(obj/item/weldingtool/W, mob/living/user) - if(busy) - return FALSE - if(!W.tool_start_check(user, amount=0)) - return FALSE - - to_chat(user, "You start to weld [src]...") - busy = TRUE - if(W.use_tool(src, user, 100, volume=50)) - busy = FALSE - return TRUE - busy = FALSE - return FALSE - /obj/machinery/camera/proc/Togglelight(on=0) for(var/mob/living/silicon/ai/A in GLOB.ai_list) for(var/obj/machinery/camera/cam in A.lit_cameras) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 203abeabb7..ead3e6636c 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -244,32 +244,33 @@ dish_quants[S.name] = 1 sortList(dish_quants) -/obj/machinery/vending/attackby(obj/item/W, mob/user, params) +/obj/machinery/vending/crowbar_act(mob/living/user, obj/item/I) + if(!component_parts) + return FALSE + default_deconstruction_crowbar(I) + return TRUE + +/obj/machinery/vending/wrench_act(mob/living/user, obj/item/I) if(panel_open) - if(default_unfasten_wrench(user, W, time = 60)) - return + default_unfasten_wrench(user, I, time = 60) + return TRUE - if(component_parts) - if(default_deconstruction_crowbar(W)) - return - - if(istype(W, /obj/item/screwdriver)) - if(anchored) - panel_open = !panel_open - to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") - cut_overlays() - if(panel_open) - add_overlay("[initial(icon_state)]-panel") - W.play_tool_sound(src) - updateUsrDialog() - else - to_chat(user, "You must first secure [src].") - return - else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/wirecutters)) +/obj/machinery/vending/screwdriver_act(mob/living/user, obj/item/I) + if(anchored) + default_deconstruction_screwdriver(user, icon_state, icon_state, I) + cut_overlays() if(panel_open) - attack_hand(user) + add_overlay("[initial(icon_state)]-panel") + updateUsrDialog() + else + to_chat(user, "You must first secure [src].") + return TRUE + +/obj/machinery/vending/attackby(obj/item/I, mob/user, params) + if(panel_open && is_wire_tool(I)) + wires.interact(user) return - else if(istype(W, /obj/item/coin)) + else if(istype(I, /obj/item/coin)) if(coin) to_chat(user, "[src] already has [coin] inserted") return @@ -279,32 +280,32 @@ if(!premium.len) to_chat(user, "[src] doesn't have a coin slot.") return - if(!user.transferItemToLoc(W, src)) + if(!user.transferItemToLoc(I, src)) return - coin = W - to_chat(user, "You insert [W] into [src].") + coin = I + to_chat(user, "You insert [I] into [src].") return - else if(istype(W, /obj/item/stack/spacecash)) + else if(istype(I, /obj/item/stack/spacecash)) if(coin) to_chat(user, "[src] already has [coin] inserted") return if(bill) to_chat(user, "[src] already has [bill] inserted") return - var/obj/item/stack/S = W + var/obj/item/stack/S = I if(!premium.len) to_chat(user, "[src] doesn't have a bill slot.") return S.use(1) - bill = new S.type(src,1) - to_chat(user, "You insert [W] into [src].") + bill = new S.type(src, 1) + to_chat(user, "You insert [I] into [src].") return - else if(istype(W, refill_canister) && refill_canister != null) + else if(istype(I, refill_canister) && refill_canister != null) if(stat & (BROKEN|NOPOWER)) to_chat(user, "It does nothing.") else if(panel_open) //if the panel is open we attempt to refill the machine - var/obj/item/vending_refill/canister = W + var/obj/item/vending_refill/canister = I if(canister.charges[STANDARD_CHARGE] == 0) to_chat(user, "This [canister.name] is empty!") else diff --git a/code/game/shuttle_engines.dm b/code/game/shuttle_engines.dm index b169fc0b2c..396358ae47 100644 --- a/code/game/shuttle_engines.dm +++ b/code/game/shuttle_engines.dm @@ -26,7 +26,7 @@ return FAILED_UNFASTEN return ..() -/obj/structure/shuttle/engine/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) +/obj/structure/shuttle/engine/default_unfasten_wrench(mob/user, obj/item/I, time = 20) . = ..() if(. == SUCCESSFUL_UNFASTEN) if(anchored) @@ -34,42 +34,40 @@ else state = ENGINE_UNWRENCHED -/obj/structure/shuttle/engine/attackby(obj/item/I, mob/user, params) - add_fingerprint(user) - if(default_unfasten_wrench(user, I)) - return - else if(istype(I, /obj/item/weldingtool)) - switch(state) - if(ENGINE_UNWRENCHED) - to_chat(user, "The [src.name] needs to be wrenched to the floor!") - if(EM_SECURED) - if(!I.tool_start_check(user, amount=0)) - return +/obj/structure/shuttle/engine/wrench_act(mob/living/user, obj/item/I) + default_unfasten_wrench(user, I) + return TRUE - user.visible_message("[user.name] starts to weld the [name] to the floor.", \ - "You start to weld \the [src] to the floor...", \ - "You hear welding.") +/obj/structure/shuttle/engine/welder_act(mob/living/user, obj/item/I) + switch(state) + if(ENGINE_UNWRENCHED) + to_chat(user, "The [src.name] needs to be wrenched to the floor!") + if(EM_SECURED) + if(!I.tool_start_check(user, amount=0)) + return TRUE - if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50)) - state = ENGINE_WELDED - to_chat(user, "You weld \the [src] to the floor.") - alter_engine_power(engine_power) + user.visible_message("[user.name] starts to weld the [name] to the floor.", \ + "You start to weld \the [src] to the floor...", \ + "You hear welding.") - if(EM_WELDED) - if(!I.tool_start_check(user, amount=0)) - return + if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50)) + state = ENGINE_WELDED + to_chat(user, "You weld \the [src] to the floor.") + alter_engine_power(engine_power) - user.visible_message("[user.name] starts to cut the [name] free from the floor.", \ - "You start to cut \the [src] free from the floor...", \ - "You hear welding.") + if(EM_WELDED) + if(!I.tool_start_check(user, amount=0)) + return TRUE - if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50)) - state = ENGINE_WRENCHED - to_chat(user, "You cut \the [src] free from the floor.") - alter_engine_power(-engine_power) - return - else - return ..() + user.visible_message("[user.name] starts to cut the [name] free from the floor.", \ + "You start to cut \the [src] free from the floor...", \ + "You hear welding.") + + if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50)) + state = ENGINE_WRENCHED + to_chat(user, "You cut \the [src] free from the floor.") + alter_engine_power(-engine_power) + return TRUE /obj/structure/shuttle/engine/Destroy() if(state == ENGINE_WELDED) diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm index 74bb61ccb9..51caf8335e 100644 --- a/code/modules/clothing/masks/hailer.dm +++ b/code/modules/clothing/masks/hailer.dm @@ -38,26 +38,26 @@ aggressiveness = 1 //Borgs are nicecurity! actions_types = list(/datum/action/item_action/halt) -/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/screwdriver)) - switch(aggressiveness) - if(1) - to_chat(user, "You set the restrictor to the middle position.") - aggressiveness = 2 - if(2) - to_chat(user, "You set the restrictor to the last position.") - aggressiveness = 3 - if(3) - to_chat(user, "You set the restrictor to the first position.") - aggressiveness = 1 - if(4) - to_chat(user, "You adjust the restrictor but nothing happens, probably because it's broken.") - else if(istype(W, /obj/item/wirecutters)) - if(aggressiveness != 4) - to_chat(user, "You broke the restrictor!") - aggressiveness = 4 - else - ..() +/obj/item/clothing/mask/gas/sechailer/screwdriver_act(mob/living/user, obj/item/I) + switch(aggressiveness) + if(1) + to_chat(user, "You set the restrictor to the middle position.") + aggressiveness = 2 + if(2) + to_chat(user, "You set the restrictor to the last position.") + aggressiveness = 3 + if(3) + to_chat(user, "You set the restrictor to the first position.") + aggressiveness = 1 + if(4) + to_chat(user, "You adjust the restrictor but nothing happens, probably because it's broken.") + return TRUE + +/obj/item/clothing/mask/gas/sechailer/wirecutter_act(mob/living/user, obj/item/I) + if(aggressiveness != 4) + to_chat(user, "You broke the restrictor!") + aggressiveness = 4 + return TRUE /obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, action) if(istype(action, /datum/action/item_action/halt)) diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index f587e578d9..bd9901460a 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -93,7 +93,7 @@ return FAILED_UNFASTEN return ..() -/obj/machinery/power/rad_collector/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) +/obj/machinery/power/rad_collector/default_unfasten_wrench(mob/user, obj/item/I, time = 20) . = ..() if(. == SUCCESSFUL_UNFASTEN) if(anchored) @@ -128,11 +128,11 @@ else return ..() -/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/wrench) - default_unfasten_wrench(user, wrench, 0) +/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/I) + default_unfasten_wrench(user, I, 0) return TRUE -/obj/machinery/power/rad_collector/crowbar_act(mob/living/user, obj/item/crowbar) +/obj/machinery/power/rad_collector/crowbar_act(mob/living/user, obj/item/I) if(loaded_tank) if(locked) to_chat(user, "The controls are locked!") @@ -142,7 +142,7 @@ to_chat(user, "There isn't a tank loaded!") return TRUE -/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/multitool) +/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/I) if(!is_station_level(z) && !SSresearch.science_tech) to_chat(user, "[src] isn't linked to a research system!") return TRUE diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 507fdcaa66..fd1989ebf8 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -219,7 +219,7 @@ return ..() -/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) +/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/I, time = 20) . = ..() if(. == SUCCESSFUL_UNFASTEN) if(anchored) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 4315cf70b5..45149d1346 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -89,7 +89,7 @@ field_generator power level display return ..() -/obj/machinery/field/generator/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) +/obj/machinery/field/generator/default_unfasten_wrench(mob/user, obj/item/I, time = 20) . = ..() if(. == SUCCESSFUL_UNFASTEN) if(anchored) diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm index 837a2b15c7..d82189e520 100644 --- a/code/modules/power/terminal.dm +++ b/code/modules/power/terminal.dm @@ -74,9 +74,6 @@ to_chat(user, "You cut the cables and dismantle the power terminal.") qdel(src) - -/obj/machinery/power/terminal/attackby(obj/item/W, mob/living/user, params) - if(istype(W, /obj/item/wirecutters)) - dismantle(user, W) - else - return ..() +/obj/machinery/power/terminal/wirecutter_act(mob/living/user, obj/item/I) + dismantle(user, I) + return TRUE diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index e42715af22..138f6f3b65 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -30,7 +30,7 @@ zap_cooldown -= (C.rating * 20) input_power_multiplier = power_multiplier -/obj/machinery/power/tesla_coil/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) +/obj/machinery/power/tesla_coil/default_unfasten_wrench(mob/user, obj/item/I, time = 20) . = ..() if(. == SUCCESSFUL_UNFASTEN) if(panel_open) @@ -103,7 +103,7 @@ buckle_lying = FALSE buckle_requires_restraints = TRUE -/obj/machinery/power/grounding_rod/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20) +/obj/machinery/power/grounding_rod/default_unfasten_wrench(mob/user, obj/item/I, time = 20) . = ..() if(. == SUCCESSFUL_UNFASTEN) if(panel_open) diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm index 23d6d5502b..9b0a0dc21e 100644 --- a/code/modules/recycling/disposal/construction.dm +++ b/code/modules/recycling/disposal/construction.dm @@ -106,73 +106,68 @@ return FALSE return TRUE -// attackby item +// construction/deconstruction // wrench: (un)anchor // weldingtool: convert to real pipe +/obj/structure/disposalconstruct/wrench_act(mob/living/user, obj/item/I) + if(anchored) + anchored = FALSE + density = FALSE + to_chat(user, "You detach the [pipename] from the underfloor.") + else + var/ispipe = is_pipe() // Indicates if we should change the level of this pipe -/obj/structure/disposalconstruct/attackby(obj/item/I, mob/user, params) - var/ispipe = is_pipe() // Indicates if we should change the level of this pipe + var/turf/T = get_turf(src) + if(T.intact && isfloorturf(T)) + to_chat(user, "You can only attach the [pipename] if the floor plating is removed!") + return TRUE - add_fingerprint(user) + if(!ispipe && iswallturf(T)) + to_chat(user, "You can't build [pipename]s on walls, only disposal pipes!") + return TRUE - var/turf/T = get_turf(src) - if(T.intact && isfloorturf(T)) - to_chat(user, "You can only attach the [pipename] if the floor plating is removed!") - return + if(ispipe) + var/dpdir = get_disposal_dir() + for(var/obj/structure/disposalpipe/CP in T) + var/pdir = CP.dpdir + if(istype(CP, /obj/structure/disposalpipe/broken)) + pdir = CP.dir + if(pdir & dpdir) + to_chat(user, "There is already a disposal pipe at that location!") + return TRUE - if(!ispipe && iswallturf(T)) - to_chat(user, "You can't build [pipename]s on walls, only disposal pipes!") - return + else // Disposal or outlet + var/found_trunk = FALSE + for(var/obj/structure/disposalpipe/CP in T) + if(istype(CP, /obj/structure/disposalpipe/trunk)) + found_trunk = TRUE + break - if(istype(I, /obj/item/wrench)) - if(anchored) - anchored = FALSE - density = FALSE - to_chat(user, "You detach the [pipename] from the underfloor.") - else - if(ispipe) - var/dpdir = get_disposal_dir() - for(var/obj/structure/disposalpipe/CP in T) - var/pdir = CP.dpdir - if(istype(CP, /obj/structure/disposalpipe/broken)) - pdir = CP.dir - if(pdir & dpdir) - to_chat(user, "There is already a disposal pipe at that location!") - return - level = 1 // Pipes only, don't want disposal bins to disappear under the floors + if(!found_trunk) + to_chat(user, "The [pipename] requires a trunk underneath it in order to work!") + return TRUE - else // Disposal or outlet - var/found_trunk = FALSE - for(var/obj/structure/disposalpipe/CP in T) - if(istype(CP, /obj/structure/disposalpipe/trunk)) - found_trunk = TRUE - break + anchored = TRUE + density = initial(pipe_type.density) + to_chat(user, "You attach the [pipename] to the underfloor.") + I.play_tool_sound(src, 100) + update_icon() + return TRUE - if(!found_trunk) - to_chat(user, "The [pipename] requires a trunk underneath it in order to work!") - return +/obj/structure/disposalconstruct/welder_act(mob/living/user, obj/item/I) + if(anchored) + if(!I.tool_start_check(user, amount=0)) + return TRUE - anchored = TRUE - density = initial(pipe_type.density) - to_chat(user, "You attach the [pipename] to the underfloor.") - I.play_tool_sound(src, 100) - update_icon() + to_chat(user, "You start welding the [pipename] in place...") + if(I.use_tool(src, user, 8, volume=50)) + to_chat(user, "The [pipename] has been welded in place.") + var/obj/O = new pipe_type(loc, src) + transfer_fingerprints_to(O) - else if(istype(I, /obj/item/weldingtool)) - if(anchored) - if(!I.tool_start_check(user, amount=0)) - return - - to_chat(user, "You start welding the [pipename] in place...") - if(I.use_tool(src, user, 8, volume=50)) - to_chat(user, "The [pipename] has been welded in place.") - var/obj/O = new pipe_type(loc, src) - transfer_fingerprints_to(O) - - return - else - to_chat(user, "You need to attach it to the plating first!") - return + else + to_chat(user, "You need to attach it to the plating first!") + return TRUE /obj/structure/disposalconstruct/proc/is_pipe() return ispath(pipe_type, /obj/structure/disposalpipe) diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index d63439f7e7..b71413200a 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -30,37 +30,37 @@ density = TRUE anchored = TRUE +/obj/machinery/bsa/wrench_act(mob/living/user, obj/item/I) + default_unfasten_wrench(user, I, 10) + return TRUE + /obj/machinery/bsa/back name = "Bluespace Artillery Generator" desc = "Generates cannon pulse. Needs to be linked with a fusor." icon_state = "power_box" -/obj/machinery/bsa/back/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/device/multitool)) - var/obj/item/device/multitool/M = W +/obj/machinery/bsa/back/multitool_act(mob/living/user, obj/item/I) + if(istype(I, /obj/item/device/multitool)) // Only this multitool type has a data buffer. + var/obj/item/device/multitool/M = I M.buffer = src - to_chat(user, "You store linkage information in [W]'s buffer.") - else if(istype(W, /obj/item/wrench)) - default_unfasten_wrench(user, W, 10) - return TRUE + to_chat(user, "You store linkage information in [I]'s buffer.") else - return ..() + to_chat(user, "[I] has no data buffer!") + return TRUE /obj/machinery/bsa/front name = "Bluespace Artillery Bore" desc = "Do not stand in front of cannon during operation. Needs to be linked with a fusor." icon_state = "emitter_center" -/obj/machinery/bsa/front/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/device/multitool)) - var/obj/item/device/multitool/M = W +/obj/machinery/bsa/front/multitool_act(mob/living/user, obj/item/I) + if(istype(I, /obj/item/device/multitool)) // Only this multitool type has a data buffer. + var/obj/item/device/multitool/M = I M.buffer = src - to_chat(user, "You store linkage information in [W]'s buffer.") - else if(istype(W, /obj/item/wrench)) - default_unfasten_wrench(user, W, 10) - return TRUE + to_chat(user, "You store linkage information in [I]'s buffer.") else - return ..() + to_chat(user, "[I] has no data buffer!") + return TRUE /obj/machinery/bsa/middle name = "Bluespace Artillery Fusor" @@ -69,9 +69,9 @@ var/obj/machinery/bsa/back/back var/obj/machinery/bsa/front/front -/obj/machinery/bsa/middle/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/device/multitool)) - var/obj/item/device/multitool/M = W +/obj/machinery/bsa/middle/multitool_act(mob/living/user, obj/item/I) + if(istype(I, /obj/item/device/multitool)) // Only this multitool type has a data buffer. + var/obj/item/device/multitool/M = I if(M.buffer) if(istype(M.buffer, /obj/machinery/bsa/back)) back = M.buffer @@ -81,11 +81,11 @@ front = M.buffer M.buffer = null to_chat(user, "You link [src] with [front].") - else if(istype(W, /obj/item/wrench)) - default_unfasten_wrench(user, W, 10) - return TRUE + else + to_chat(user, "[I]'s data buffer is empty!") else - return ..() + to_chat(user, "[I] has no data buffer!") + return TRUE /obj/machinery/bsa/middle/proc/check_completion() if(!front || !back) @@ -136,6 +136,9 @@ bound_x = -192 appearance_flags = NONE //Removes default TILE_BOUND +/obj/machinery/bsa/full/wrench_act(mob/living/user, obj/item/I) + return FALSE + /obj/machinery/bsa/full/proc/get_front_turf() switch(dir) if(WEST) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 8b19c6bd73..a3e10c1a31 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -9,18 +9,18 @@ D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0), TEXT_SOUTH = list(-2), TEXT_EAST = list(0), TEXT_WEST = list( 2))) -/obj/vehicle/ridden/scooter/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/wrench)) - to_chat(user, "You begin to remove the handlebars...") - if(I.use_tool(src, user, 40, volume=50)) - var/obj/vehicle/ridden/scooter/skateboard/S = new(drop_location()) - new /obj/item/stack/rods(drop_location(), 2) - to_chat(user, "You remove the handlebars from [src].") - if(has_buckled_mobs()) - var/mob/living/carbon/H = buckled_mobs[1] - unbuckle_mob(H) - S.buckle_mob(H) - qdel(src) +/obj/vehicle/ridden/scooter/wrench_act(mob/living/user, obj/item/I) + to_chat(user, "You begin to remove the handlebars...") + if(I.use_tool(src, user, 40, volume=50)) + var/obj/vehicle/ridden/scooter/skateboard/S = new(drop_location()) + new /obj/item/stack/rods(drop_location(), 2) + to_chat(user, "You remove the handlebars from [src].") + if(has_buckled_mobs()) + var/mob/living/carbon/H = buckled_mobs[1] + unbuckle_mob(H) + S.buckle_mob(H) + qdel(src) + return TRUE /obj/vehicle/ridden/scooter/Moved() . = ..() @@ -100,14 +100,7 @@ w_class = WEIGHT_CLASS_NORMAL /obj/item/scooter_frame/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/wrench)) - to_chat(user, "You deconstruct [src].") - new /obj/item/stack/rods(drop_location(), 10) - I.play_tool_sound(src) - qdel(src) - return - - else if(istype(I, /obj/item/stack/sheet/metal)) + if(istype(I, /obj/item/stack/sheet/metal)) if(!I.tool_start_check(user, amount=5)) return to_chat(user, "You begin to add wheels to [src].") @@ -115,20 +108,18 @@ to_chat(user, "You finish making wheels for [src].") new /obj/vehicle/ridden/scooter/skateboard(user.loc) qdel(src) + else + return ..() + +/obj/item/scooter_frame/wrench_act(mob/living/user, obj/item/I) + to_chat(user, "You deconstruct [src].") + new /obj/item/stack/rods(drop_location(), 10) + I.play_tool_sound(src) + qdel(src) + return TRUE /obj/vehicle/ridden/scooter/skateboard/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/screwdriver)) - to_chat(user, "You begin to deconstruct and remove the wheels on [src]...") - if(I.use_tool(src, user, 20, volume=50)) - to_chat(user, "You deconstruct the wheels on [src].") - new /obj/item/stack/sheet/metal(drop_location(), 5) - new /obj/item/scooter_frame(drop_location()) - if(has_buckled_mobs()) - var/mob/living/carbon/H = buckled_mobs[1] - unbuckle_mob(H) - qdel(src) - - else if(istype(I, /obj/item/stack/rods)) + if(istype(I, /obj/item/stack/rods)) if(!I.tool_start_check(user, amount=2)) return to_chat(user, "You begin making handlebars for [src].") @@ -140,3 +131,18 @@ unbuckle_mob(H) S.buckle_mob(H) qdel(src) + else + return ..() + +/obj/vehicle/ridden/scooter/skateboard/screwdriver_act(mob/living/user, obj/item/I) + to_chat(user, "You begin to deconstruct and remove the wheels on [src]...") + if(I.use_tool(src, user, 20, volume=50)) + to_chat(user, "You deconstruct the wheels on [src].") + new /obj/item/stack/sheet/metal(drop_location(), 5) + new /obj/item/scooter_frame(drop_location()) + if(has_buckled_mobs()) + var/mob/living/carbon/H = buckled_mobs[1] + unbuckle_mob(H) + qdel(src) + return TRUE +