diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index b065c87b8ab..4876c904de7 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -57,9 +57,10 @@ if(exchange_parts(user, I)) return - default_deconstruction_crowbar(I) + if(default_deconstruction_crowbar(I)) + return - if(istype(I, /obj/item/wrench)) + if(iswrench(I)) if(!panel_open) to_chat(user, "Open the maintenance panel first.") return @@ -75,6 +76,8 @@ break build_network() update_icon() + else + return ..() /obj/machinery/atmospherics/unary/cold_sink/freezer/update_icon() if(panel_open) @@ -216,9 +219,10 @@ if(exchange_parts(user, I)) return - default_deconstruction_crowbar(I) + if(default_deconstruction_crowbar(I)) + return - if(istype(I, /obj/item/wrench)) + if(iswrench(I)) if(!panel_open) to_chat(user, "Open the maintenance panel first.") return @@ -234,6 +238,8 @@ break build_network() update_icon() + else + return ..() /obj/machinery/atmospherics/unary/heat_reservoir/heater/update_icon() if(panel_open) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 3c9c27f1590..07d955390b7 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -143,19 +143,20 @@ take_victim(usr,usr) -/obj/machinery/optable/attackby(obj/item/W as obj, mob/living/carbon/user as mob, params) - if(istype(W, /obj/item/grab)) - if(iscarbon(W:affecting)) - take_victim(W:affecting,usr) - qdel(W) - return - if(istype(W, /obj/item/wrench)) - playsound(src.loc, W.usesound, 50, 1) - if(do_after(user, 20 * W.toolspeed, target = src)) +/obj/machinery/optable/attackby(obj/item/I, mob/living/carbon/user, params) + if(istype(I, /obj/item/grab)) + var/obj/item/grab/G = I + if(iscarbon(G.affecting)) + take_victim(G.affecting, user) + qdel(G) + if(iswrench(I)) + playsound(loc, I.usesound, 50, 1) + if(do_after(user, 20 * I.toolspeed, target = src)) to_chat(user, "You deconstruct the table.") new /obj/item/stack/sheet/plasteel(loc, 5) qdel(src) - + else + return ..() /obj/machinery/optable/proc/check_table(mob/living/carbon/patient as mob) if(src.victim && get_turf(victim) == get_turf(src) && victim.lying) diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index a90bc66bce3..f3701945017 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -43,19 +43,21 @@ QDEL_NULL(storedpda) return ..() -/obj/machinery/pdapainter/attackby(var/obj/item/O as obj, var/mob/user as mob, params) - if(istype(O, /obj/item/pda)) +/obj/machinery/pdapainter/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/pda)) if(storedpda) to_chat(user, "There is already a PDA inside.") return else - var/obj/item/pda/P = usr.get_active_hand() + var/obj/item/pda/P = user.get_active_hand() if(istype(P)) - user.drop_item() - storedpda = P - P.loc = src - P.add_fingerprint(usr) - update_icon() + if(user.drop_item()) + storedpda = P + P.forceMove(src) + P.add_fingerprint(user) + update_icon() + else + return ..() /obj/machinery/pdapainter/attack_hand(mob/user as mob) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 7d386ddfb1a..cf04a159799 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -97,10 +97,10 @@ return if(beaker.reagents.total_volume < beaker.reagents.maximum_volume) - src.occupant.transfer_blood_to(beaker, 1) - for(var/datum/reagent/x in src.occupant.reagents.reagent_list) - src.occupant.reagents.trans_to(beaker, 3) - src.occupant.transfer_blood_to(beaker, 1) + occupant.transfer_blood_to(beaker, 1) + for(var/datum/reagent/x in occupant.reagents.reagent_list) + occupant.reagents.trans_to(beaker, 3) + occupant.transfer_blood_to(beaker, 1) if(occupant) for(var/A in occupant.reagents.addiction_list) @@ -117,7 +117,7 @@ if(M == occupant) continue else - M.forceMove(src.loc) + M.forceMove(loc) updateDialog() return @@ -253,7 +253,7 @@ to_chat(usr, "Close the maintenance panel first.") return 0 - if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) + if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) if(href_list["chemical"]) if(occupant) if(occupant.stat == DEAD) @@ -268,7 +268,7 @@ toggle_filter() if(href_list["ejectify"]) eject() - src.add_fingerprint(usr) + add_fingerprint(usr) return 1 /obj/machinery/sleeper/blob_act() @@ -280,31 +280,31 @@ return -/obj/machinery/sleeper/attackby(var/obj/item/G as obj, var/mob/user as mob, params) - if(istype(G, /obj/item/reagent_containers/glass)) +/obj/machinery/sleeper/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/reagent_containers/glass)) if(!beaker) if(!user.drop_item()) - to_chat(user, "\The [G] is stuck to you!") + to_chat(user, "[I] is stuck to you!") return - beaker = G - G.forceMove(src) - user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") + beaker = I + I.forceMove(src) + user.visible_message("[user] adds \a [I] to [src]!", "You add \a [I] to [src]!") return else to_chat(user, "The sleeper has a beaker already.") return - if(istype(G, /obj/item/screwdriver)) - if(src.occupant) + if(isscrewdriver(I)) + if(occupant) to_chat(user, "The maintenance panel is locked.") return - default_deconstruction_screwdriver(user, "[base_icon]-o", "[base_icon]-open", G) + default_deconstruction_screwdriver(user, "[base_icon]-o", "[base_icon]-open", I) return - if(istype(G, /obj/item/wrench)) - if(src.occupant) + if(iswrench(I)) + if(occupant) to_chat(user, "The scanner is occupied.") return if(panel_open) @@ -312,51 +312,52 @@ return if(dir == 4) orient = "LEFT" - dir = 8 + setDir(8) else orient = "RIGHT" - dir = 4 - playsound(src.loc, G.usesound, 50, 1) + setDir(4) + playsound(loc, I.usesound, 50, 1) return - if(exchange_parts(user, G)) + if(exchange_parts(user, I)) return - if(istype(G, /obj/item/crowbar)) - default_deconstruction_crowbar(G) + if(default_deconstruction_crowbar(I)) return - if(istype(G, /obj/item/grab)) + if(istype(I, /obj/item/grab)) + var/obj/item/grab/G = I if(panel_open) to_chat(user, "Close the maintenance panel first.") return - if(!ismob(G:affecting)) + if(!ismob(G.affecting)) return - if(src.occupant) + if(occupant) to_chat(user, "The sleeper is already occupied!") return - for(var/mob/living/carbon/slime/M in range(1,G:affecting)) - if(M.Victim == G:affecting) - to_chat(usr, "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head.") + for(var/mob/living/carbon/slime/M in range(1, G.affecting)) + if(M.Victim == G.affecting) + to_chat(usr, "[G.affecting.name] will not fit into the sleeper because they have a slime latched onto their head.") return - visible_message("[user] starts putting [G:affecting:name] into the sleeper.") + visible_message("[user] starts putting [G.affecting:name] into the sleeper.") - if(do_after(user, 20, target = G:affecting)) - if(src.occupant) + if(do_after(user, 20, target = G.affecting)) + if(occupant) to_chat(user, "The sleeper is already occupied!") return - if(!G || !G:affecting) return + if(!G || !G.affecting) + return var/mob/M = G:affecting M.forceMove(src) - src.occupant = M - src.icon_state = "[base_icon]" + occupant = M + icon_state = "[base_icon]" to_chat(M, "You feel cool air surround you. You go numb as your senses turn inward.") - src.add_fingerprint(user) + add_fingerprint(user) qdel(G) - return - return + else + return ..() /obj/machinery/sleeper/ex_act(severity) @@ -365,21 +366,21 @@ switch(severity) if(1.0) for(var/atom/movable/A as mob|obj in src) - A.forceMove(src.loc) + A.forceMove(loc) A.ex_act(severity) qdel(src) return if(2.0) if(prob(50)) for(var/atom/movable/A as mob|obj in src) - A.forceMove(src.loc) + A.forceMove(loc) A.ex_act(severity) qdel(src) return if(3.0) if(prob(25)) for(var/atom/movable/A as mob|obj in src) - A.forceMove(src.loc) + A.forceMove(loc) A.ex_act(severity) qdel(src) return @@ -422,10 +423,10 @@ to_chat(user, "The sleeper does not offer that chemical!") return - if(src.occupant) - if(src.occupant.reagents) - if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= max_chem) - src.occupant.reagents.add_reagent(chemical, amount) + if(occupant) + if(occupant.reagents) + if(occupant.reagents.get_reagent_amount(chemical) + amount <= max_chem) + occupant.reagents.add_reagent(chemical, amount) return else to_chat(user, "You can not inject any more of this chemical.") @@ -445,8 +446,8 @@ if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other return - src.icon_state = "[base_icon]-open" - src.go_out() + icon_state = "[base_icon]-open" + go_out() add_fingerprint(usr) return @@ -504,15 +505,15 @@ visible_message("[user] starts putting [L.name] into the sleeper.") if(do_after(user, 20, target = L)) - if(src.occupant) + if(occupant) to_chat(user, "The sleeper is already occupied!") return if(!L) return L.forceMove(src) - src.occupant = L - src.icon_state = "[base_icon]" + occupant = L + icon_state = "[base_icon]" to_chat(L, "You feel cool air surround you. You go numb as your senses turn inward.") - src.add_fingerprint(user) + add_fingerprint(user) if(user.pulling == L) user.stop_pulling() return @@ -527,7 +528,7 @@ set src in oview(1) if(usr.stat != 0 || !(ishuman(usr))) return - if(src.occupant) + if(occupant) to_chat(usr, "The sleeper is already occupied!") return if(panel_open) @@ -541,17 +542,17 @@ return visible_message("[usr] starts climbing into the sleeper.") if(do_after(usr, 20, target = usr)) - if(src.occupant) + if(occupant) to_chat(usr, "The sleeper is already occupied!") return usr.stop_pulling() usr.forceMove(src) - src.occupant = usr - src.icon_state = "[base_icon]" + occupant = usr + icon_state = "[base_icon]" for(var/obj/O in src) qdel(O) - src.add_fingerprint(usr) + add_fingerprint(usr) return return diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index f2dc8c8bfa2..dae751d9ed0 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -2,9 +2,9 @@ name = "body scanner" icon = 'icons/obj/Cryogenic2.dmi' icon_state = "bodyscanner-open" - density = 1 + density = TRUE dir = 8 - anchored = 1 + anchored = TRUE idle_power_usage = 1250 active_power_usage = 2500 @@ -32,7 +32,7 @@ if(M == occupant) continue else - M.forceMove(src.loc) + M.forceMove(loc) /obj/machinery/bodyscanner/New() ..() @@ -54,37 +54,36 @@ component_parts += new /obj/item/stack/cable_coil(null, 2) RefreshParts() -/obj/machinery/bodyscanner/attackby(var/obj/item/G as obj, var/mob/user as mob) - if(istype(G, /obj/item/screwdriver)) - if(src.occupant) +/obj/machinery/bodyscanner/attackby(obj/item/I, mob/user) + if(isscrewdriver(I)) + if(occupant) to_chat(user, "The maintenance panel is locked.") return - default_deconstruction_screwdriver(user, "bodyscanner-o", "bodyscanner-open", G) + default_deconstruction_screwdriver(user, "bodyscanner-o", "bodyscanner-open", I) return - if(istype(G, /obj/item/wrench)) - if(src.occupant) + if(iswrench(I)) + if(occupant) to_chat(user, "The scanner is occupied.") return if(panel_open) to_chat(user, "Close the maintenance panel first.") return if(dir == 4) - dir = 8 + setDir(8) else - dir = 4 - playsound(src.loc, G.usesound, 50, 1) + setDir(4) + playsound(loc, I.usesound, 50, 1) return - if(exchange_parts(user, G)) + if(exchange_parts(user, I)) return - if(istype(G, /obj/item/crowbar)) - default_deconstruction_crowbar(G) + if(default_deconstruction_crowbar(I)) return - if(istype(G, /obj/item/grab)) - var/obj/item/grab/TYPECAST_YOUR_SHIT = G + if(istype(I, /obj/item/grab)) + var/obj/item/grab/TYPECAST_YOUR_SHIT = I if(panel_open) to_chat(user, "Close the maintenance panel first.") return @@ -105,7 +104,9 @@ occupant = M icon_state = "body_scanner_1" add_fingerprint(user) - qdel(G) + qdel(TYPECAST_YOUR_SHIT) + else + return ..() /obj/machinery/bodyscanner/MouseDrop_T(mob/living/carbon/human/O, mob/user as mob) @@ -123,7 +124,7 @@ to_chat(user, "Close the maintenance panel first.") return 0 //panel open if(occupant) - to_chat(user, "\The [src] is already occupied.") + to_chat(user, "[src] is already occupied.") return 0 //occupied if(O.buckled) @@ -137,7 +138,7 @@ return 0 if(O == user) - visible_message("[user] climbs into \the [src].") + visible_message("[user] climbs into [src].") else visible_message("[user] puts [O] into the body scanner.") @@ -175,21 +176,21 @@ switch(severity) if(1.0) for(var/atom/movable/A as mob|obj in src) - A.forceMove(src.loc) + A.forceMove(loc) A.ex_act(severity) qdel(src) return if(2.0) if(prob(50)) for(var/atom/movable/A as mob|obj in src) - A.forceMove(src.loc) + A.forceMove(loc) A.ex_act(severity) qdel(src) return if(3.0) if(prob(25)) for(var/atom/movable/A as mob|obj in src) - A.forceMove(src.loc) + A.forceMove(loc) A.ex_act(severity) qdel(src) return @@ -238,7 +239,7 @@ stat &= ~NOPOWER else spawn(rand(0, 15)) - src.icon_state = "bodyscannerconsole-p" + icon_state = "bodyscannerconsole-p" stat |= NOPOWER /obj/machinery/body_scanconsole/New() @@ -292,33 +293,35 @@ break -/obj/machinery/body_scanconsole/attackby(var/obj/item/G as obj, var/mob/user as mob, params) - if(istype(G, /obj/item/screwdriver)) - default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", G) +/obj/machinery/body_scanconsole/attackby(obj/item/I, mob/user, params) + if(default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", I)) return - if(istype(G, /obj/item/wrench)) + if(iswrench(I)) if(panel_open) to_chat(user, "Close the maintenance panel first.") return if(dir == 4) - dir = 8 + setDir(8) else - dir = 4 - playsound(loc, G.usesound, 50, 1) + setDir(4) + playsound(loc, I.usesound, 50, 1) - if(exchange_parts(user, G)) + if(exchange_parts(user, I)) return - default_deconstruction_crowbar(G) + if(default_deconstruction_crowbar(I)) + return + else + return ..() -/obj/machinery/body_scanconsole/attack_ai(user as mob) +/obj/machinery/body_scanconsole/attack_ai(user) return attack_hand(user) -/obj/machinery/body_scanconsole/attack_ghost(user as mob) +/obj/machinery/body_scanconsole/attack_ghost(user) return attack_hand(user) -/obj/machinery/body_scanconsole/attack_hand(user as mob) +/obj/machinery/body_scanconsole/attack_hand(user) if(stat & (NOPOWER|BROKEN)) return @@ -326,13 +329,13 @@ to_chat(user, "Close the maintenance panel first.") return - if(!src.connected) + if(!connected) findscanner() ui_interact(user) -/obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600) @@ -475,14 +478,14 @@ return 1 if(href_list["ejectify"]) - src.connected.eject() + connected.eject() if(href_list["print_p"]) generate_printing_text() if(!(printing) && printing_text) printing = 1 - visible_message("\The [src] rattles and prints out a sheet of paper.") + visible_message("[src] rattles and prints out a sheet of paper.") var/obj/item/paper/P = new /obj/item/paper(loc) playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) P.info = "
Body Scan - [href_list["name"]]

" @@ -654,7 +657,7 @@ if(occupant.disabilities & NEARSIGHTED) dat += "Retinal misalignment detected.
" else - dat += "\The [src] is empty." + dat += "[src] is empty." else dat = " Error: No Body Scanner connected." diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index f9d83ff43f6..0828ecb57b9 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -969,31 +969,31 @@ playsound(src.loc, 'sound/effects/sparks4.ogg', 50, 1) return -/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob, params) - src.add_fingerprint(user) +/obj/machinery/alarm/attackby(obj/item/I, mob/user, params) + add_fingerprint(user) switch(buildstage) if(2) - if(istype(W, /obj/item/screwdriver)) // Opening that Air Alarm up. + if(isscrewdriver(I)) // Opening that Air Alarm up. // to_chat(user, "You pop the Air Alarm's maintence panel open.") wiresexposed = !wiresexposed to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]") update_icon() return - if(istype(W, /obj/item/wirecutters)) // cutting the wires out + if(iswirecutter(I)) // cutting the wires out if(wires.wires_status == 31) // all wires cut var/obj/item/stack/cable_coil/new_coil = new /obj/item/stack/cable_coil() new_coil.amount = 5 - new_coil.loc = user.loc + new_coil.forceMove(user.loc) buildstage = 1 update_icon() return - if(wiresexposed && ((istype(W, /obj/item/multitool) || istype(W, /obj/item/wirecutters)))) + if(wiresexposed && ((ismultitool(I) || iswirecutter(I)))) return attack_hand(user) - if(istype(W, /obj/item/card/id) || istype(W, /obj/item/pda))// trying to unlock the interface with an ID card + if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))// trying to unlock the interface with an ID card if(stat & (NOPOWER|BROKEN)) to_chat(user, "It does nothing") return @@ -1004,13 +1004,11 @@ updateUsrDialog() else to_chat(user, "Access denied.") - - return if(1) - if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/coil = W + if(istype(I, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/coil = I if(coil.amount < 5) to_chat(user, "You need more cable for this!") return @@ -1026,34 +1024,35 @@ first_run() return - else if(istype(W, /obj/item/crowbar)) + else if(iscrowbar(I)) to_chat(user, "You start prying out the circuit.") - playsound(get_turf(src), W.usesound, 50, 1) - if(do_after(user, 20 * W.toolspeed, target = src)) + playsound(get_turf(src), I.usesound, 50, 1) + if(do_after(user, 20 * I.toolspeed, target = src)) if(buildstage != 1) return to_chat(user, "You pry out the circuit!") var/obj/item/airalarm_electronics/circuit = new /obj/item/airalarm_electronics() - circuit.loc = user.loc + circuit.forceMove(user.loc) buildstage = 0 update_icon() - return + return if(0) - if(istype(W, /obj/item/airalarm_electronics)) + if(istype(I, /obj/item/airalarm_electronics)) to_chat(user, "You insert the circuit!") - playsound(get_turf(src), W.usesound, 50, 1) - qdel(W) + playsound(get_turf(src), I.usesound, 50, 1) + qdel(I) buildstage = 1 update_icon() return - else if(istype(W, /obj/item/wrench)) + else if(iswrench(I)) to_chat(user, "You remove the fire alarm assembly from the wall!") new /obj/item/mounted/frame/alarm_frame(get_turf(user)) - playsound(get_turf(src), W.usesound, 50, 1) + playsound(get_turf(src), I.usesound, 50, 1) qdel(src) + return - return 0 + return ..() /obj/machinery/alarm/power_change() if(powered(power_channel)) diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 57ade18dab3..6b728f2a20b 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -36,8 +36,8 @@ if(charging) to_chat(user, "Current charge: [round(charging.percent(), 1)]%") -/obj/machinery/cell_charger/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/stock_parts/cell)) +/obj/machinery/cell_charger/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/stock_parts/cell)) if(stat & BROKEN) to_chat(user, "[src] is broken!") return @@ -57,19 +57,19 @@ if(!user.drop_item()) return - W.forceMove(src) - charging = W + I.forceMove(src) + charging = I user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.") chargelevel = -1 updateicon() - else if(iswrench(W)) + else if(iswrench(I)) if(charging) to_chat(user, "Remove the cell first!") return anchored = !anchored to_chat(user, "You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground") - playsound(src.loc, W.usesound, 75, 1) + playsound(src.loc, I.usesound, 75, 1) else return ..() diff --git a/code/game/machinery/chiller.dm b/code/game/machinery/chiller.dm index f48d59593ca..d2f76a7c42a 100644 --- a/code/game/machinery/chiller.dm +++ b/code/game/machinery/chiller.dm @@ -68,8 +68,8 @@ user << browse(null, "window=aircond") user.unset_machine() else - ..() - return + return ..() + /obj/machinery/space_heater/air_conditioner/attack_hand(mob/user as mob) src.add_fingerprint(user) interact(user) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index ee53fdbce8b..881136dbd58 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -349,19 +349,19 @@ use_power(200) //Let's unlock this early I guess. Might be too early, needs tweaking. -/obj/machinery/clonepod/attackby(obj/item/W, mob/user, params) +/obj/machinery/clonepod/attackby(obj/item/I, mob/user, params) if(!(occupant || mess)) - if(default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]", W)) + if(default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]", I)) return - if(exchange_parts(user, W)) + if(exchange_parts(user, I)) return - if(default_deconstruction_crowbar(W)) + if(default_deconstruction_crowbar(I)) return - if(W.GetID()) - if(!check_access(W)) + if(I.GetID()) + if(!check_access(I)) to_chat(user, "Access Denied.") return if(!(occupant || mess)) @@ -374,34 +374,33 @@ go_out() //Removing cloning pod biomass - else if(istype(W, /obj/item/reagent_containers/food/snacks/meat)) - to_chat(user, "\The [src] processes \the [W].") - biomass += BIOMASS_MEAT_AMOUNT - user.drop_item() - qdel(W) - return - else if(istype(W, /obj/item/wrench)) + else if(istype(I, /obj/item/reagent_containers/food/snacks/meat)) + if(user.drop_item()) + to_chat(user, "[src] processes [I].") + biomass += BIOMASS_MEAT_AMOUNT + qdel(I) + else if(iswrench(I)) if(occupant) to_chat(user, "Can not do that while [src] is in use.") else if(anchored) - anchored = 0 + anchored = FALSE connected.pods -= src connected = null else - anchored = 1 - playsound(loc, W.usesound, 100, 1) + anchored = TRUE + playsound(loc, I.usesound, 100, 1) if(anchored) user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.") else user.visible_message("[user] unsecures [src] from the floor.", "You unsecure [src] from the floor.") - else if(istype(W, /obj/item/multitool)) - var/obj/item/multitool/M = W + else if(ismultitool(I)) + var/obj/item/multitool/M = I M.buffer = src to_chat(user, "You load connection data from [src] to [M].") return else - ..() + return ..() /obj/machinery/clonepod/emag_act(user) if(isnull(occupant)) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 88827a6ab05..a44ec4344b7 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -112,7 +112,7 @@ to_chat(user, "\The [I] is no longer in storage.") return - visible_message("The console beeps happily as it disgorges \the [I].") + visible_message("The console beeps happily as it disgorges [I].") dispense_item(I) @@ -120,7 +120,8 @@ if(!allowed(user)) to_chat(user, "Access Denied.") return - if(!allow_items) return + if(!allow_items) + return if(frozen_items.len == 0) to_chat(user, "There is nothing to recover from storage.") @@ -323,15 +324,15 @@ // Also make sure there is a valid control computer /obj/machinery/cryopod/proc/despawn_occupant() //Drop all items into the pod. - for(var/obj/item/W in occupant) - occupant.unEquip(W) - W.forceMove(src) + for(var/obj/item/I in occupant) + occupant.unEquip(I) + I.forceMove(src) - if(W.contents.len) //Make sure we catch anything not handled by qdel() on the items. - if(should_preserve_item(W) != CRYO_DESTROY) // Don't remove the contents of things that need preservation + if(I.contents.len) //Make sure we catch anything not handled by qdel() on the items. + if(should_preserve_item(I) != CRYO_DESTROY) // Don't remove the contents of things that need preservation continue - for(var/obj/item/O in W.contents) - if(istype(O,/obj/item/tank)) //Stop eating pockets, you fuck! + for(var/obj/item/O in I.contents) + if(istype(O, /obj/item/tank)) //Stop eating pockets, you fuck! continue O.forceMove(src) @@ -345,23 +346,23 @@ items -= occupant // Don't delete the occupant items -= announce // or the autosay radio. - for(var/obj/item/W in items) - if(istype(W,/obj/item/pda)) - var/obj/item/pda/P = W + for(var/obj/item/I in items) + if(istype(I, /obj/item/pda)) + var/obj/item/pda/P = I QDEL_NULL(P.id) qdel(P) continue - var/preserve = should_preserve_item(W) + var/preserve = should_preserve_item(I) if(preserve == CRYO_DESTROY) - qdel(W) + qdel(I) else if(control_computer && control_computer.allow_items) - control_computer.frozen_items += W + control_computer.frozen_items += I if(preserve == CRYO_OBJECTIVE) - control_computer.objective_items += W - W.loc = null + control_computer.objective_items += I + I.loc = null else - W.forceMove(loc) + I.forceMove(loc) // Skip past any cult sacrifice objective using this person if(GAMEMODE_IS_CULT && is_sacrifice_target(occupant.mind)) @@ -461,22 +462,23 @@ #undef CRYO_PRESERVE #undef CRYO_OBJECTIVE -/obj/machinery/cryopod/attackby(var/obj/item/G as obj, var/mob/user as mob, params) +/obj/machinery/cryopod/attackby(obj/item/I, mob/user, params) - if(istype(G, /obj/item/grab)) + if(istype(I, /obj/item/grab)) + var/obj/item/grab/G = I if(occupant) - to_chat(user, "\The [src] is in use.") + to_chat(user, "[src] is in use.") return - if(!ismob(G:affecting)) + if(!ismob(G.affecting)) return - if(!check_occupant_allowed(G:affecting)) + if(!check_occupant_allowed(G.affecting)) return var/willing = null //We don't want to allow people to be forced into despawning. - var/mob/living/M = G:affecting + var/mob/living/M = G.affecting time_till_despawn = initial(time_till_despawn) if(!istype(M) || M.stat == DEAD) @@ -485,20 +487,21 @@ if(M.client) if(alert(M,"Would you like to enter long-term storage?",,"Yes","No") == "Yes") - if(!M || !G || !G:affecting) return + if(!M || !G || !G.affecting) return willing = willing_time_divisor else willing = 1 if(willing) - visible_message("[user] starts putting [G:affecting:name] into \the [src].") + visible_message("[user] starts putting [G.affecting.name] into [src].") - if(do_after(user, 20, target = G:affecting)) - if(!M || !G || !G:affecting) return + if(do_after(user, 20, target = G.affecting)) + if(!M || !G || !G.affecting) + return if(occupant) - to_chat(user, "\The [src] is in use.") + to_chat(user, "[src] is in use.") return take_occupant(M, willing) @@ -516,6 +519,8 @@ to_chat(M, "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.") take_occupant(M, willing) + else + return ..() /obj/machinery/cryopod/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) @@ -567,7 +572,7 @@ if(willing) if(!Adjacent(L)) - to_chat(user, "You're not close enough to \the [src].") + to_chat(user, "You're not close enough to [src].") return if(L == user) visible_message("[user] starts climbing into the cryo pod.") @@ -633,14 +638,13 @@ if(occupant) items -= occupant if(announce) items -= announce - for(var/obj/item/W in items) - W.loc = get_turf(src) + for(var/obj/item/I in items) + I.forceMove(get_turf(src)) go_out() add_fingerprint(usr) name = initial(name) - return /obj/machinery/cryopod/verb/move_inside() set name = "Enter Pod" @@ -659,7 +663,7 @@ to_chat(usr, "You're too busy getting your life sucked out of you.") return - visible_message("[usr] starts climbing into \the [src].") + visible_message("[usr] starts climbing into [src].") if(do_after(usr, 20, target = usr)) diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index f8d7432c540..527ed23639c 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -20,17 +20,19 @@ var/list/doppler_arrays = list() /obj/machinery/doppler_array/process() return PROCESS_KILL -/obj/machinery/doppler_array/attackby(var/obj/item/O, var/mob/user, params) - if(istype(O, /obj/item/wrench)) +/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params) + if(iswrench(I)) if(!anchored && !isinspace()) - anchored = 1 + anchored = TRUE power_change() to_chat(user, "You fasten [src].") else if(anchored) - anchored = 0 + anchored = FALSE power_change() to_chat(user, "You unfasten [src].") - playsound(loc, O.usesound, 50, 1) + playsound(loc, I.usesound, 50, 1) + else + return ..() /obj/machinery/doppler_array/verb/rotate() set name = "Rotate Tachyon-doppler Dish" diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm index bb47a4939ec..89974f9b337 100644 --- a/code/game/machinery/dye_generator.dm +++ b/code/game/machinery/dye_generator.dm @@ -41,7 +41,7 @@ stat |= BROKEN icon_state = "[initial(icon_state)]-broken" -/obj/machinery/dye_generator/attack_hand(mob/user as mob) +/obj/machinery/dye_generator/attack_hand(mob/user) ..() src.add_fingerprint(user) if(stat & (BROKEN|NOPOWER)) @@ -50,18 +50,18 @@ dye_color = temp set_light(2, l_color = temp) -/obj/machinery/dye_generator/attackby(obj/item/W, mob/user, params) +/obj/machinery/dye_generator/attackby(obj/item/I, mob/user, params) - if(default_unfasten_wrench(user, W, time = 60)) + if(default_unfasten_wrench(user, I, time = 60)) return - if(istype(W, /obj/item/hair_dye_bottle)) - user.visible_message("[user] fills the [W] up with some dye.","You fill the [W] up with some hair dye.") - var/obj/item/hair_dye_bottle/HD = W + if(istype(I, /obj/item/hair_dye_bottle)) + var/obj/item/hair_dye_bottle/HD = I + user.visible_message("[user] fills the [HD] up with some dye.","You fill the [HD] up with some hair dye.") HD.dye_color = dye_color HD.update_dye_overlay() else - ..() + return ..() //Hair Dye Bottle @@ -87,7 +87,7 @@ I.color = dye_color overlays += I -/obj/item/hair_dye_bottle/attack(mob/living/carbon/M as mob, mob/user as mob) +/obj/item/hair_dye_bottle/attack(mob/living/carbon/M, mob/user) if(user.a_intent != INTENT_HELP) ..() return diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 8cb98021576..b3664c58cd6 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -45,7 +45,7 @@ FIRE ALARM /obj/machinery/firealarm/emag_act(mob/user) if(!emagged) - emagged = 1 + emagged = TRUE if(user) user.visible_message("Sparks fly out of the [src]!", "You emag [src], disabling its thermal sensors.") @@ -62,19 +62,15 @@ FIRE ALARM /obj/machinery/firealarm/attack_ghost(mob/user) ui_interact(user) -/obj/machinery/firealarm/bullet_act(BLAH) - return alarm() - - /obj/machinery/firealarm/emp_act(severity) if(prob(50/severity)) alarm(rand(30/severity, 60/severity)) ..() -/obj/machinery/firealarm/attackby(obj/item/W, mob/user, params) +/obj/machinery/firealarm/attackby(obj/item/I, mob/user, params) add_fingerprint(user) - if(istype(W, /obj/item/screwdriver) && buildstage == 2) + if(iswirecutter(I) && buildstage == 2) wiresexposed = !wiresexposed update_icon() return @@ -82,37 +78,37 @@ FIRE ALARM if(wiresexposed) switch(buildstage) if(2) - if(istype(W, /obj/item/multitool)) + if(ismultitool(I)) detecting = !detecting if(detecting) user.visible_message("[user] has reconnected [src]'s detecting unit!", "You have reconnected [src]'s detecting unit.") else user.visible_message("[user] has disconnected [src]'s detecting unit!", "You have disconnected [src]'s detecting unit.") - else if(istype(W, /obj/item/wirecutters)) // cutting the wires out + else if(iswirecutter(I)) // cutting the wires out to_chat(user, "You cut the wires!") - playsound(loc, W.usesound, 50, 1) + playsound(loc, I.usesound, 50, 1) var/obj/item/stack/cable_coil/new_coil = new /obj/item/stack/cable_coil() new_coil.amount = 5 - new_coil.loc = user.loc + new_coil.forceMove(user.loc) buildstage = 1 update_icon() if(1) - if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/coil = W + if(istype(I, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/coil = I if(!coil.use(5)) to_chat(user, "You cut the wires!") return buildstage = 2 - playsound(get_turf(src), W.usesound, 50, 1) - to_chat(user, "You wire \the [src]!") + playsound(get_turf(src), I.usesound, 50, 1) + to_chat(user, "You wire [src]!") update_icon() - else if(istype(W, /obj/item/crowbar)) + else if(iscrowbar(I)) to_chat(user, "You pry out the circuit!") - playsound(get_turf(src), W.usesound, 50, 1) - if(do_after(user, 20 * W.toolspeed, target = src)) + playsound(get_turf(src), I.usesound, 50, 1) + if(do_after(user, 20 * I.toolspeed, target = src)) if(buildstage != 1) return var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics() @@ -120,20 +116,20 @@ FIRE ALARM buildstage = 0 update_icon() if(0) - if(istype(W, /obj/item/firealarm_electronics)) + if(istype(I, /obj/item/firealarm_electronics)) to_chat(user, "You insert the circuit!") - qdel(W) + qdel(I) buildstage = 1 update_icon() - else if(istype(W, /obj/item/wrench)) + else if(iswrench(I)) to_chat(user, "You remove the fire alarm assembly from the wall!") new /obj/item/mounted/frame/firealarm(get_turf(user)) - playsound(get_turf(src), W.usesound, 50, 1) + playsound(get_turf(src), I.usesound, 50, 1) qdel(src) - return - alarm() + else + return ..() /obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed if(stat & (NOPOWER|BROKEN)) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index da64430b941..4b57a9542b2 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -38,14 +38,16 @@ // sd_set_light(0) //Don't want to render prison breaks impossible -/obj/machinery/flasher/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/wirecutters)) +/obj/machinery/flasher/attackby(obj/item/I, mob/user, params) + if(iswirecutter(I)) add_fingerprint(user) disable = !disable if(disable) - user.visible_message("[user] has disconnected the [src]'s flashbulb!", "You disconnect the [src]'s flashbulb!") + user.visible_message("[user] has disconnected [src]'s flashbulb!", "You disconnect [src]'s flashbulb!") if(!disable) - user.visible_message("[user] has connected the [src]'s flashbulb!", "You connect the [src]'s flashbulb!") + user.visible_message("[user] has connected [src]'s flashbulb!", "You connect [src]'s flashbulb!") + else + return ..() //Let the AI trigger them directly. /obj/machinery/flasher/attack_ai(mob/user) @@ -95,8 +97,8 @@ if((M.m_intent != MOVE_INTENT_WALK) && (anchored)) flash() -/obj/machinery/flasher/portable/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/wrench)) +/obj/machinery/flasher/portable/attackby(obj/item/I, mob/user, params) + if(iswrench(I)) add_fingerprint(user) anchored = !anchored @@ -107,6 +109,8 @@ else if(anchored) user.show_message(text("[src] is now secured.")) overlays += "[base_state]-s" + else + return ..() // Flasher button /obj/machinery/flasher_button diff --git a/code/game/machinery/gameboard.dm b/code/game/machinery/gameboard.dm index f1bd8b65a10..526a935cf90 100644 --- a/code/game/machinery/gameboard.dm +++ b/code/game/machinery/gameboard.dm @@ -93,8 +93,11 @@ if(href_list["close"]) close_game() -/obj/machinery/gameboard/attackby(var/obj/item/G as obj, var/mob/user as mob, params) - if(istype(G, /obj/item/wrench)) - default_unfasten_wrench(user, G) - else if(istype(G, /obj/item/crowbar)) - default_deconstruction_crowbar(G, ignore_panel = 1) +/obj/machinery/gameboard/attackby(obj/item/I, mob/user, params) + if(default_unfasten_wrench(user, I)) + return + + if(default_deconstruction_crowbar(I, ignore_panel = TRUE)) + return + else + return ..() \ No newline at end of file diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm index 6d90de7bf4d..450260f5f79 100644 --- a/code/game/machinery/guestpass.dm +++ b/code/game/machinery/guestpass.dm @@ -48,20 +48,22 @@ var/list/internal_log = list() var/mode = 0 // 0 - making pass, 1 - viewing logs -/obj/machinery/computer/guestpass/attackby(obj/O, mob/user, params) - if(istype(O, /obj/item/card/id)) +/obj/machinery/computer/guestpass/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/card/id)) if(!giver) - user.drop_item() - O.loc = src - giver = O - updateUsrDialog() + if(user.drop_item()) + I.forceMove(src) + giver = I + updateUsrDialog() else to_chat(user, "There is already ID card inside.") + else + return ..() /obj/machinery/computer/guestpass/proc/get_changeable_accesses() return giver.access -/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob) +/obj/machinery/computer/guestpass/attack_ai(mob/user) return attack_hand(user) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 58404b133bd..4e049cc5546 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -55,17 +55,20 @@ var/list/holopads = list() holograph_range += 1 * B.rating holo_range = holograph_range -/obj/machinery/hologram/holopad/attackby(obj/item/P as obj, mob/user as mob, params) - if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P)) +/obj/machinery/hologram/holopad/attackby(obj/item/I, mob/user, params) + if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", I)) return - if(exchange_parts(user, P)) + if(exchange_parts(user, I)) return - if(default_unfasten_wrench(user, P)) + if(default_unfasten_wrench(user, I)) return - default_deconstruction_crowbar(P) + if(default_deconstruction_crowbar(I)) + return + else + return ..() /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 411543b662f..22d1177c437 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -68,21 +68,23 @@ icon_state = "[base_state]-p" // src.sd_set_light(0) -/obj/machinery/sparker/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/detective_scanner)) +/obj/machinery/sparker/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/detective_scanner)) return - if(istype(W, /obj/item/screwdriver)) + if(isscrewdriver(I)) add_fingerprint(user) - src.disable = !src.disable - if(src.disable) - user.visible_message("[user] has disabled the [src]!", "You disable the connection to the [src].") + disable = !disable + if(disable) + user.visible_message("[user] has disabled [src]!", "You disable the connection to [src].") icon_state = "[base_state]-d" - if(!src.disable) - user.visible_message("[user] has reconnected the [src]!", "You fix the connection to the [src].") - if(src.powered()) + if(!disable) + user.visible_message("[user] has reconnected [src]!", "You fix the connection to [src].") + if(powered()) icon_state = "[base_state]" else icon_state = "[base_state]-p" + else + return ..() /obj/machinery/sparker/attack_ai() if(src.anchored) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index d7a4a3e2b04..4ccaa246578 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -88,17 +88,17 @@ to_chat(usr, "There's nothing attached to the IV drip!") -/obj/machinery/iv_drip/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/reagent_containers)) +/obj/machinery/iv_drip/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/reagent_containers)) if(beaker) to_chat(user, "There is already a reagent container loaded!") return if(!user.drop_item()) return - W.forceMove(src) - beaker = W - to_chat(user, "You attach [W] to [src].") + I.forceMove(src) + beaker = I + to_chat(user, "You attach [I] to [src].") update_icon() else return ..() diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index ee4f2e6eb62..116a0f8dbe1 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -97,17 +97,18 @@ updateicon() - else if(istype(I, /obj/item/card/id)||istype(I, /obj/item/pda)) + else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda)) if(open) - if(src.allowed(user)) - src.locked = !src.locked - to_chat(user, "Controls are now [src.locked ? "locked" : "unlocked"].") + if(allowed(user)) + locked = !locked + to_chat(user, "Controls are now [locked ? "locked" : "unlocked"].") else to_chat(user, "Access denied.") updateDialog() else to_chat(user, "You must open the cover first!") - return + else + return ..() /obj/machinery/navbeacon/attack_ai(mob/user) interact(user, 1) diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index f6ecd511b2b..a4c2bcd9edf 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -31,18 +31,18 @@ emagged = 1 //Set the emag var to true. -/obj/machinery/poolcontroller/attackby(obj/item/P as obj, mob/user as mob, params) //Proc is called when a user hits the pool controller with something. - if(istype(P,/obj/item/multitool)) //If the mob hits the pool controller with a multitool, reset the emagged status +/obj/machinery/poolcontroller/attackby(obj/item/I, mob/user, params) //Proc is called when a user hits the pool controller with something. + if(ismultitool(I)) //If the mob hits the pool controller with a multitool, reset the emagged status if(emagged) //Check the emag status - to_chat(user, "You re-enable \the [src]'s temperature safeguards.")//Inform the user that they have just fixed the safeguards. + to_chat(user, "You re-enable [src]'s temperature safeguards.")//Inform the user that they have just fixed the safeguards. - emagged = 0 //Set the emagged var to false. + emagged = FALSE //Set the emagged var to false. else to_chat(user, "Nothing happens.")//If not emagged, don't do anything, and don't tell the user that it can be emagged. else //If it's not a multitool, defer to /obj/machinery/attackby - ..() + return ..() /obj/machinery/poolcontroller/attack_hand(mob/user as mob) ui_interact(user) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 68e6eaf2ad2..abc8d137679 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -54,7 +54,7 @@ to_chat(user, "[src] isn't connected to anything!") return 1 else - ..() + return ..() /obj/machinery/recharger/attack_hand(mob/user) if(issilicon(user)) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index fd973290244..f987b698772 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -136,18 +136,21 @@ else icon_state = "borgcharger0" -/obj/machinery/recharge_station/attackby(obj/item/P as obj, mob/user as mob, params) - if(istype(P, /obj/item/screwdriver)) - if(src.occupant) +/obj/machinery/recharge_station/attackby(obj/item/I, mob/user, params) + if(isscrewdriver(I)) + if(occupant) to_chat(user, "The maintenance panel is locked.") return - default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", P) + default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", I) return - if(exchange_parts(user, P)) + if(exchange_parts(user, I)) return - default_deconstruction_crowbar(P) + if(default_deconstruction_crowbar(I)) + return + else + return ..() /obj/machinery/recharge_station/proc/process_occupant() if(src.occupant) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index d80a628927b..72c0cd91002 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -51,6 +51,7 @@ var/const/SAFETY_COOLDOWN = 100 /obj/machinery/recycler/attackby(obj/item/I, mob/user, params) + add_fingerprint(user) if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) return @@ -60,9 +61,10 @@ var/const/SAFETY_COOLDOWN = 100 if(default_unfasten_wrench(user, I)) return - default_deconstruction_crowbar(I) - ..() - add_fingerprint(user) + if(default_deconstruction_crowbar(I)) + return + else + return ..() /obj/machinery/recycler/emag_act(mob/user) if(!emagged) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index e9c7c497d72..3aae4af4405 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -269,7 +269,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() return //err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed. -/obj/machinery/requests_console/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/requests_console/attackby(obj/item/I, mob/user) /* if(istype(O, /obj/item/crowbar)) if(open) @@ -292,14 +292,15 @@ var/list/obj/machinery/requests_console/allConsoles = list() else to_chat(user, "You can't do much with that.")*/ - if(istype(O, /obj/item/card/id)) - if(inoperable(MAINT)) return + if(istype(I, /obj/item/card/id)) + if(inoperable(MAINT)) + return if(screen == RCS_MESSAUTH) - var/obj/item/card/id/T = O + var/obj/item/card/id/T = I msgVerified = text("Verified by [T.registered_name] ([T.assignment])") updateUsrDialog() if(screen == RCS_ANNOUNCE) - var/obj/item/card/id/ID = O + var/obj/item/card/id/ID = I if(access_RC_announce in ID.GetAccess()) announceAuth = 1 announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name @@ -308,16 +309,18 @@ var/list/obj/machinery/requests_console/allConsoles = list() to_chat(user, "You are not authorized to send announcements.") updateUsrDialog() if(screen == RCS_SHIPPING) - var/obj/item/card/id/T = O + var/obj/item/card/id/T = I msgVerified = text("Sender verified as [T.registered_name] ([T.assignment])") updateUsrDialog() - if(istype(O, /obj/item/stamp)) - if(inoperable(MAINT)) return + if(istype(I, /obj/item/stamp)) + if(inoperable(MAINT)) + return if(screen == RCS_MESSAUTH) - var/obj/item/stamp/T = O + var/obj/item/stamp/T = I msgStamped = text("Stamped with the [T.name]") updateUsrDialog() - return + else + return ..() /obj/machinery/requests_console/proc/reset_message(var/mainmenu = 0) message = "" diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 1962e3631fb..3777dfc866d 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -56,27 +56,26 @@ return else // insert cell - var/obj/item/stock_parts/cell/C = usr.get_active_hand() + var/obj/item/stock_parts/cell/C = user.get_active_hand() if(istype(C)) - user.drop_item() - cell = C - C.loc = src - C.add_fingerprint(usr) + if(user.drop_item()) + cell = C + C.forceMove(src) + C.add_fingerprint(user) - user.visible_message("[user] inserts a power cell into [src].", "You insert the power cell into [src].") + user.visible_message("[user] inserts a power cell into [src].", "You insert the power cell into [src].") else to_chat(user, "The hatch must be open to insert a power cell.") return - else if(istype(I, /obj/item/screwdriver)) + else if(isscrewdriver(I)) open = !open - user.visible_message("[user] [open ? "opens" : "closes"] the hatch on the [src].", "You [open ? "open" : "close"] the hatch on the [src].") + user.visible_message("[user] [open ? "opens" : "closes"] the hatch on [src].", "You [open ? "open" : "close"] the hatch on [src].") update_icon() if(!open && user.machine == src) user << browse(null, "window=spaceheater") user.unset_machine() else - ..() - return + return ..() /obj/machinery/space_heater/attack_hand(mob/user as mob) src.add_fingerprint(user) @@ -106,7 +105,7 @@ else on = !on - user.visible_message("[user] switches [on ? "on" : "off"] the [src].","You switch [on ? "on" : "off"] the [src].") + user.visible_message("[user] switches [on ? "on" : "off"] [src].","You switch [on ? "on" : "off"] [src].") update_icon() return @@ -131,7 +130,7 @@ usr.put_in_hands(cell) cell.add_fingerprint(usr) cell = null - usr.visible_message("[usr] removes the power cell from \the [src].", "You remove the power cell from \the [src].") + usr.visible_message("[usr] removes the power cell from [src].", "You remove the power cell from [src].") if("cellinstall") @@ -143,7 +142,7 @@ C.loc = src C.add_fingerprint(usr) - usr.visible_message("[usr] inserts a power cell into \the [src].", "You insert the power cell into \the [src].") + usr.visible_message("[usr] inserts a power cell into [src].", "You insert the power cell into [src].") updateDialog() else diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 7ec64373373..37d1c3ae93c 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -158,14 +158,14 @@ return -/obj/machinery/power/singularity_beacon/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W,/obj/item/screwdriver)) +/obj/machinery/power/singularity_beacon/attackby(obj/item/I, mob/user, params) + if(isscrewdriver(I)) if(active) to_chat(user, "You need to deactivate the beacon first!") return if(anchored) - anchored = 0 + anchored = FALSE to_chat(user, "You unscrew the beacon from the floor.") disconnect_from_network() return @@ -173,11 +173,10 @@ if(!connect_to_network()) to_chat(user, "This device must be placed over an exposed cable.") return - anchored = 1 + anchored = TRUE to_chat(user, "You screw the beacon to the floor and attach the cable.") - return - ..() - return + else + return ..() /obj/machinery/power/singularity_beacon/Destroy() diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index a4c73cc8fac..b269ab31c40 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -486,7 +486,8 @@ else to_chat(user, "The [I] wont fit! The [src] can only hold up to [max_beakers] containers.") return - ..() + else + return ..() /obj/item/bombcore/chemical/CheckParts(list/parts_list) ..() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index a1248fc0b6d..618549ec288 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -38,21 +38,20 @@ break return power_station -/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob, params) +/obj/machinery/computer/teleporter/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/gps)) var/obj/item/gps/L = I if(L.locked_location && !(stat & (NOPOWER|BROKEN))) if(!user.unEquip(L)) - to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]") + to_chat(user, "[I] is stuck to your hand, you cannot put it in [src]") return - L.loc = src + L.forceMove(src) locked = L - to_chat(user, "You insert the GPS device into the [name]'s slot.") + to_chat(user, "You insert the GPS device into the [src]'s slot.") else - ..() - return + return ..() -/obj/machinery/computer/teleporter/emag_act(user as mob) +/obj/machinery/computer/teleporter/emag_act(mob/user) if(!emagged) emagged = 1 to_chat(user, "The teleporter can now lock on to Syndicate beacons!") @@ -341,14 +340,18 @@ //--FalseIncarnate return -/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user, params) - if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W)) +/obj/machinery/teleport/hub/attackby(obj/item/I, mob/user, params) + if(default_deconstruction_screwdriver(user, "tele-o", "tele0", I)) return - if(exchange_parts(user, W)) + if(exchange_parts(user, I)) return - default_deconstruction_crowbar(W) + if(default_deconstruction_crowbar(I)) + return + + else + return ..() /obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj, turf/T) var/obj/machinery/computer/teleporter/com = power_station.teleporter_console @@ -438,14 +441,18 @@ else icon_state = "tele0" -/obj/machinery/teleport/perma/attackby(obj/item/W, mob/user, params) - if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W)) +/obj/machinery/teleport/perma/attackby(obj/item/I, mob/user, params) + if(default_deconstruction_screwdriver(user, "tele-o", "tele0", I)) return - if(exchange_parts(user, W)) + if(exchange_parts(user, I)) return - default_deconstruction_crowbar(W) + if(default_deconstruction_crowbar(I)) + return + + else + return ..() /obj/machinery/teleport/station name = "station" @@ -506,40 +513,40 @@ teleporter_console = null return ..() -/obj/machinery/teleport/station/attackby(var/obj/item/W, mob/user, params) - if(istype(W, /obj/item/multitool) && !panel_open) - var/obj/item/multitool/M = W +/obj/machinery/teleport/station/attackby(obj/item/I, mob/user, params) + if(ismultitool(I) && !panel_open) + var/obj/item/multitool/M = I if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src) if(linked_stations.len < efficiency) linked_stations.Add(M.buffer) M.buffer = null - to_chat(user, "You upload the data from the [W.name]'s buffer.") + to_chat(user, "You upload the data from [M]'s buffer.") else to_chat(user, "This station can't hold more information, try to use better parts.") - if(default_deconstruction_screwdriver(user, "controller-o", "controller", W)) + if(default_deconstruction_screwdriver(user, "controller-o", "controller", I)) update_icon() return - if(exchange_parts(user, W)) + if(exchange_parts(user, I)) return - default_deconstruction_crowbar(W) + if(default_deconstruction_crowbar(I)) + return if(panel_open) - if(istype(W, /obj/item/multitool)) - var/obj/item/multitool/M = W + if(ismultitool(I)) + var/obj/item/multitool/M = I M.buffer = src - to_chat(user, "You download the data to the [W.name]'s buffer.") - return - if(istype(W, /obj/item/wirecutters)) + to_chat(user, "You download the data to the [M]'s buffer.") + if(iswirecutter(I)) link_console_and_hub() to_chat(user, "You reconnect the station to nearby machinery.") - return - if(istype(W, /obj/item/circuitboard/teleporter_perma)) - var/obj/item/circuitboard/teleporter_perma/C = W + if(istype(I, /obj/item/circuitboard/teleporter_perma)) + var/obj/item/circuitboard/teleporter_perma/C = I C.target = teleporter_console.target - to_chat(user, "You copy the targeting information from \the [src] to \the [W]") - return + to_chat(user, "You copy the targeting information from [src] to [C]") + else + return ..() /obj/machinery/teleport/station/attack_ai() src.attack_hand() diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 45294f01286..09385fa3a3e 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -344,12 +344,12 @@ domutcheck(H, null, MUTCHK_FORCED) H.update_mutations() -/obj/machinery/transformer/gene_applier/attackby(obj/item/W, mob/living/user, params) - if(istype(W, /obj/item/disk/data)) +/obj/machinery/transformer/gene_applier/attackby(obj/item/I, mob/living/user, params) + if(istype(I, /obj/item/disk/data)) if(locked) to_chat(user, "Access Denied.") return FALSE - var/obj/item/disk/data/D = W + var/obj/item/disk/data/D = I if(!D.buf) to_chat(user, "Error: No data found.") return FALSE diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index db228aff04f..50f09b89cd6 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -292,7 +292,7 @@ insert_item(user, I) return else - ..() + return ..() //Override this proc to do per-machine checks on the inserted item, but remember to call the parent to handle these generic checks before your logic! /obj/machinery/vending/proc/item_slot_check(mob/user, obj/item/I)