diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index cc15c46e76..00268c6aa3 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -2,7 +2,7 @@ name = "Sleeper Console" icon = 'icons/obj/Cryogenic2.dmi' icon_state = "sleeperconsole" - var/obj/machinery/sleeper/connected = null + var/obj/machinery/sleeper/sleeper anchored = 1 //About time someone fixed this. density = 0 dir = 8 @@ -13,12 +13,17 @@ /obj/machinery/sleep_console/New() ..() - spawn(5) - //src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir)) - src.connected = locate(/obj/machinery/sleeper) in range(2,src) - return - return + findsleeper() +/obj/machinery/sleep_console/proc/findsleeper() + spawn( 5 ) + var/obj/machinery/sleeper/sleepernew = null + for(dir in list(NORTH,EAST,SOUTH,WEST)) // Loop through every direction + sleepernew = locate(/obj/machinery/sleeper, get_step(src, dir)) // Try to find a scanner in that direction + if(sleepernew) + sleeper = sleepernew + sleepernew.console = src + return /obj/machinery/sleep_console/attack_ai(var/mob/user) return attack_hand(user) @@ -26,15 +31,18 @@ /obj/machinery/sleep_console/attack_hand(var/mob/user) if(..()) return 1 - if(connected) - connected.ui_interact(user) + if(!sleeper) + findsleeper() + if(sleeper) + return sleeper.ui_interact(user) + else + user << "Sleeper not found!" /obj/machinery/sleep_console/attackby(var/obj/item/I, var/mob/user) if(computer_deconstruction_screwdriver(user, I)) return else - src.attack_hand(user) - return + return attack_hand(user) /obj/machinery/sleep_console/power_change() ..() @@ -55,6 +63,7 @@ var/list/available_chemicals = list("inaprovaline" = "Inaprovaline", "stoxin" = "Soporific", "paracetamol" = "Paracetamol", "anti_toxin" = "Dylovene", "dexalin" = "Dexalin") var/obj/item/weapon/reagent_containers/glass/beaker = null var/filtering = 0 + var/obj/machinery/sleep_console/console use_power = 1 idle_power_usage = 15 @@ -72,14 +81,6 @@ component_parts += new /obj/item/weapon/reagent_containers/syringe(src) component_parts += new /obj/item/weapon/reagent_containers/syringe(src) component_parts += new /obj/item/stack/material/glass/reinforced(src, 2) - - spawn(5) - //src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir)) - var/obj/machinery/sleep_console/C = locate(/obj/machinery/sleep_console) in range(2,src) - if(C) - C.connected = src - return - RefreshParts() /obj/machinery/sleeper/initialize() @@ -176,12 +177,12 @@ return 1 /obj/machinery/sleeper/attackby(var/obj/item/I, var/mob/user) + add_fingerprint(user) if(default_deconstruction_screwdriver(user, I)) return - if(default_deconstruction_crowbar(user, I)) + else if(default_deconstruction_crowbar(user, I)) return - add_fingerprint(user) - if(istype(I, /obj/item/weapon/reagent_containers/glass)) + else if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(!beaker) beaker = I user.drop_item() @@ -251,21 +252,21 @@ if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE - occupant.loc = loc + occupant.loc = src.loc occupant = null for(var/atom/movable/A in src) // In case an object was dropped inside or something if(A == beaker || A == circuit) continue if(A in component_parts) continue - A.loc = loc + A.loc = src.loc update_use_power(1) update_icon() toggle_filter() /obj/machinery/sleeper/proc/remove_beaker() if(beaker) - beaker.loc = loc + beaker.loc = src.loc beaker = null toggle_filter() diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index b82ef0cf61..8e4fbb58a6 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -1,6 +1,5 @@ // Pretty much everything here is stolen from the dna scanner FYI - /obj/machinery/bodyscanner var/mob/living/carbon/occupant var/locked @@ -9,22 +8,15 @@ icon_state = "body_scanner_0" density = 1 anchored = 1 - circuit = /obj/item/weapon/circuitboard/body_scanner - use_power = 1 idle_power_usage = 60 active_power_usage = 10000 //10 kW. It's a big all-body scanner. - light_color = "#00FF00" + var/obj/machinery/body_scanconsole/console /obj/machinery/bodyscanner/New() ..() - spawn( 5 ) - var/obj/machinery/body_scanconsole/C = locate(/obj/machinery/body_scanconsole) in range(2,src) - if(C) - C.connected = src - component_parts = list() component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) @@ -42,10 +34,9 @@ /obj/machinery/bodyscanner/attackby(var/obj/item/G, user as mob) if(default_deconstruction_screwdriver(user, G)) return - if(default_deconstruction_crowbar(user, G)) + else if(default_deconstruction_crowbar(user, G)) return - - if(istype(G, /obj/item/weapon/grab)) + else if(istype(G, /obj/item/weapon/grab)) var/obj/item/weapon/grab/H = G if(panel_open) user << "Close the maintenance panel first." @@ -68,6 +59,8 @@ icon_state = "body_scanner_1" add_fingerprint(user) qdel(G) + else + return /obj/machinery/bodyscanner/MouseDrop_T(mob/living/carbon/O, mob/user as mob) if(!istype(O)) @@ -166,7 +159,6 @@ //Body Scan Console /obj/machinery/body_scanconsole - var/obj/machinery/bodyscanner/connected var/known_implants = list(/obj/item/weapon/implant/chem, /obj/item/weapon/implant/death_alarm, /obj/item/weapon/implant/loyalty, /obj/item/weapon/implant/tracking) var/delete var/temphtml @@ -179,6 +171,7 @@ circuit = /obj/item/weapon/circuitboard/scanner_console var/printing = null var/printing_text = null + var/obj/machinery/bodyscanner/scanner /obj/machinery/body_scanconsole/New() ..() @@ -187,9 +180,21 @@ /obj/machinery/body_scanconsole/attackby(var/obj/item/I, var/mob/user) if(computer_deconstruction_screwdriver(user, I)) return + else if(istype(I, /obj/item/device/multitool)) //Did you want to link it? + var/obj/item/device/multitool/P = I + if(P.connectable) + if(istype(P.connectable, /obj/machinery/bodyscanner)) + var/obj/machinery/bodyscanner/C = P.connectable + scanner = C + C.console = src + user << " You link the [src] to the [P.connectable]!" + else + user << " You store the [src] in the [P]'s buffer!" + P.connectable = src + return else src.attack_hand(user) - return + return /obj/machinery/body_scanconsole/power_change() if(stat & BROKEN) @@ -199,7 +204,7 @@ stat &= ~NOPOWER else spawn(rand(0, 15)) - src.icon_state = "body_scannerconsole-p" + icon_state = "body_scannerconsole-p" stat |= NOPOWER /obj/machinery/body_scanconsole/ex_act(severity) @@ -219,11 +224,11 @@ /obj/machinery/body_scanconsole/proc/findscanner() spawn( 5 ) var/obj/machinery/bodyscanner/bodyscannernew = null - // Loop through every direction - for(dir in list(NORTH,EAST,SOUTH,WEST)) - // Try to find a scanner in that direction - bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir)) - src.connected = bodyscannernew + for(dir in list(NORTH,EAST,SOUTH,WEST)) // Loop through every direction + bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir)) // Try to find a scanner in that direction + if(bodyscannernew) + scanner = bodyscannernew + bodyscannernew.console = src return /obj/machinery/body_scanconsole/attack_ai(user as mob) @@ -240,22 +245,22 @@ user << "Close the maintenance panel first." return - if(!src.connected) - findscanner() + if(!scanner) + user << "Scanner not found!" ui_interact(user) /obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) var/data[0] - data["connected"] = connected ? 1 : 0 + data["connected"] = scanner ? 1 : 0 - if(connected) - data["occupied"] = connected.occupant ? 1 : 0 + if(scanner) + data["occupied"] = scanner.occupant ? 1 : 0 var/occupantData[0] - if(connected.occupant && ishuman(connected.occupant)) - var/mob/living/carbon/human/H = connected.occupant + if(scanner.occupant && ishuman(scanner.occupant)) + var/mob/living/carbon/human/H = scanner.occupant occupantData["name"] = H.name occupantData["stat"] = H.stat occupantData["health"] = H.health @@ -393,8 +398,8 @@ /obj/machinery/body_scanconsole/proc/generate_printing_text() var/dat = "" - if(connected) - var/mob/living/carbon/human/occupant = connected.occupant + if(scanner) + var/mob/living/carbon/human/occupant = scanner.occupant dat = "Occupant Statistics:
" //Blah obvious if(istype(occupant)) //is there REALLY someone in there? var/t1 diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index a9ca501664..305b1af357 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -5,7 +5,7 @@ //Create global frame type list if it hasn't been made already. construction_frame_wall = list() construction_frame_floor = list() - for(var/R in typesof(/datum/frame/frame_types)-/datum/frame/frame_types) + for(var/R in typesof(/datum/frame/frame_types) - /datum/frame/frame_types) var/datum/frame/frame_types/type = new R if(type.frame_style == "wall") construction_frame_wall += type @@ -251,7 +251,7 @@ if(istype(P, /obj/item/weapon/wrench)) if(state == 0 && !anchored) user << "You start to wrench the frame into place." - playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) anchored = 1 if(!need_circuit && circuit) @@ -263,7 +263,7 @@ user << "You wrench the frame into place." else if(state == 0 && anchored) - playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 20)) user << "You unfasten the frame." anchored = 0 @@ -272,11 +272,11 @@ if(state == 0) var/obj/item/weapon/weldingtool/WT = P if(WT.remove_fuel(0, user)) - playsound(loc, 'sound/items/Welder.ogg', 50, 1) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, 20)) if(src && WT.isOn()) user << "You deconstruct the frame." - new /obj/item/stack/material/steel(loc, frame_type.frame_size) + new /obj/item/stack/material/steel(src.loc, frame_type.frame_size) qdel(src) return else if(!WT.remove_fuel(0, user)) @@ -288,7 +288,7 @@ var/obj/item/weapon/circuitboard/B = P var/datum/frame/frame_types/board_type = B.board_type if(board_type.name == frame_type.name) - playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You place the circuit board inside the frame." circuit = P user.drop_item() @@ -304,18 +304,18 @@ else if(istype(P, /obj/item/weapon/screwdriver)) if(state == 1) if(need_circuit && circuit) - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You screw the circuit board into place." state = 2 else if(state == 2) if(need_circuit && circuit) - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You unfasten the circuit board." state = 1 else if(!need_circuit && circuit) - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You unfasten the outer cover." state = 0 @@ -327,8 +327,8 @@ component_check = 0 break if(component_check) - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) - var/obj/machinery/new_machine = new circuit.build_path(loc, dir) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + var/obj/machinery/new_machine = new circuit.build_path(src.loc, dir) // Handle machines that have allocated default parts in thier constructor. if(new_machine.component_parts) for(var/CP in new_machine.component_parts) @@ -357,9 +357,9 @@ return else if(frame_type.frame_class == "alarm") - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You fasten the cover." - var/obj/machinery/B = new circuit.build_path(loc) + var/obj/machinery/B = new circuit.build_path(src.loc) B.pixel_x = pixel_x B.pixel_y = pixel_y B.set_dir(dir) @@ -371,9 +371,9 @@ else if(state == 4) if(frame_type.frame_class == "computer") - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You connect the monitor." - var/obj/machinery/B = new circuit.build_path(loc) + var/obj/machinery/B = new circuit.build_path(src.loc) B.pixel_x = pixel_x B.pixel_y = pixel_y B.set_dir(dir) @@ -384,9 +384,9 @@ return else if(frame_type.frame_class == "display") - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You connect the monitor." - var/obj/machinery/B = new circuit.build_path(loc) + var/obj/machinery/B = new circuit.build_path(src.loc) B.pixel_x = pixel_x B.pixel_y = pixel_y B.set_dir(dir) @@ -399,39 +399,39 @@ else if(istype(P, /obj/item/weapon/crowbar)) if(state == 1) if(need_circuit && circuit) - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the circuit board." state = 0 - circuit.loc = loc + circuit.forceMove(src.loc) circuit = null if(frame_type.frame_class == "machine") req_components = null else if(state == 3) if(frame_type.frame_class == "machine") - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) if(components.len == 0) user << "There are no components to remove." else user << "You remove the components." for(var/obj/item/weapon/W in components) - W.forceMove(loc) + W.forceMove(src.loc) check_components() update_desc() user << desc else if(state == 4) if(frame_type.frame_class == "computer") - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the glass panel." state = 3 - new /obj/item/stack/material/glass(loc, 2) + new /obj/item/stack/material/glass(src.loc, 2) else if(frame_type.frame_class == "display") - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the glass panel." state = 3 - new /obj/item/stack/material/glass(loc, 2) + new /obj/item/stack/material/glass(src.loc, 2) else if(istype(P, /obj/item/stack/cable_coil)) if(state == 2) @@ -440,7 +440,7 @@ user << "You need five coils of wire to add them to the frame." return user << "You start to add cables to the frame." - playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20) && state == 2) if(C.use(5)) user << "You add cables to the frame." @@ -451,28 +451,28 @@ else if(istype(P, /obj/item/weapon/wirecutters)) if(state == 3) if(frame_type.frame_class == "computer") - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." state = 2 - new /obj/item/stack/cable_coil(loc, 5) + new /obj/item/stack/cable_coil(src.loc, 5) else if(frame_type.frame_class == "display") - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." state = 2 - new /obj/item/stack/cable_coil(loc, 5) + new /obj/item/stack/cable_coil(src.loc, 5) else if(frame_type.frame_class == "alarm") - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." state = 2 - new /obj/item/stack/cable_coil(loc, 5) + new /obj/item/stack/cable_coil(src.loc, 5) else if(frame_type.frame_class == "machine") - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." state = 2 - new /obj/item/stack/cable_coil(loc, 5) + new /obj/item/stack/cable_coil(src.loc, 5) else if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass") if(state == 3) @@ -481,7 +481,7 @@ if(G.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return - playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start to put in the glass panel." if(do_after(user, 20) && state == 3) if(G.use(2)) @@ -493,7 +493,7 @@ if(G.get_amount() < 2) user << "You need two sheets of glass to put in the glass panel." return - playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start to put in the glass panel." if(do_after(user, 20) && state == 3) if(G.use(2)) @@ -505,7 +505,7 @@ if(frame_type.frame_class == "machine") for(var/I in req_components) if(istype(P, I) && (req_components[I] > 0)) - playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CP = P if(CP.get_amount() > 1) @@ -522,7 +522,7 @@ else if(istype(P, /obj/item/stack/material/glass/reinforced)) var/obj/item/stack/material/glass/reinforced/CP = P if(CP.get_amount() > 1) - var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided + var/camt = min(CP.amount, req_components[I]) // amount of glass to take, idealy amount required, but limited by amount provided var/obj/item/stack/material/glass/reinforced/CC = new /obj/item/stack/material/glass/reinforced(src) CC.amount = camt CC.update_icon() diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 755fc1415e..3fa1a81c66 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -166,11 +166,11 @@ Class Procs: qdel(src) return if(2.0) - if (prob(50)) + if(prob(50)) qdel(src) return if(3.0) - if (prob(25)) + if(prob(25)) qdel(src) return else @@ -183,20 +183,20 @@ Class Procs: /obj/machinery/proc/auto_use_power() if(!powered(power_channel)) return 0 - if(src.use_power == 1) - use_power(idle_power_usage,power_channel, 1) - else if(src.use_power >= 2) - use_power(active_power_usage,power_channel, 1) + if(use_power == 1) + use_power(idle_power_usage, power_channel, 1) + else if(use_power >= 2) + use_power(active_power_usage, power_channel, 1) return 1 /obj/machinery/proc/operable(var/additional_flags = 0) return !inoperable(additional_flags) /obj/machinery/proc/inoperable(var/additional_flags = 0) - return (stat & (NOPOWER|BROKEN|additional_flags)) + return (stat & (NOPOWER | BROKEN | additional_flags)) /obj/machinery/CanUseTopic(var/mob/user) - if(!interact_offline && (stat & (NOPOWER|BROKEN))) + if(!interact_offline && (stat & (NOPOWER | BROKEN))) return STATUS_CLOSE return ..() @@ -224,11 +224,10 @@ Class Procs: return 1 if(user.lying || user.stat) return 1 - if ( ! (istype(usr, /mob/living/carbon/human) || \ - istype(usr, /mob/living/silicon))) + if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/living/silicon))) usr << "You don't have the dexterity to do this!" return 1 - if (ishuman(user)) + if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 55) visible_message("[H] stares cluelessly at [src].") @@ -253,7 +252,7 @@ Class Procs: O.show_message("\icon[src] [msg]", 2) /obj/machinery/proc/ping(text=null) - if (!text) + if(!text) text = "\The [src] pings." state(text, "blue") @@ -267,7 +266,7 @@ Class Procs: var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() - if (electrocute_mob(user, get_area(src), src, 0.7)) + if(electrocute_mob(user, get_area(src), src, 0.7)) var/area/temp_area = get_area(src) if(temp_area) var/obj/machinery/power/apc/temp_apc = temp_area.get_apc() @@ -305,7 +304,7 @@ Class Procs: RefreshParts() else user << "Following parts detected in the machine:" - for(var/var/obj/item/C in component_parts) + for(var/var/obj/item/C in component_parts) //var/var/obj/item/C? user << " [C.name]" return 1 @@ -319,48 +318,49 @@ Class Procs: /obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S) if(!istype(S)) return 0 - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) panel_open = !panel_open user << "You [panel_open ? "open" : "close"] the maintenance hatch of [src]." update_icon() return 1 -/obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/weapon/wirecutters/W, var/wiresexposed) - if(!istype(W)) - return 0 - if(!wiresexposed) - return 0 - user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) - new/obj/item/stack/cable_coil(get_turf(src), 5) - . = dismantle() - -/obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S, var/wiresexposed) - if(!istype(S)) - return 0 - wiresexposed = !wiresexposed - user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" - update_icon() - return 1 - /obj/machinery/proc/computer_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S) if(!istype(S)) return 0 if(!circuit) return 0 user << "You start disconnecting the monitor." - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) if(do_after(user, 20)) if(stat & BROKEN) user << "The broken glass falls out." - new /obj/item/weapon/material/shard(loc) + new /obj/item/weapon/material/shard(src.loc) else user << "You disconnect the monitor." . = dismantle() +/obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S, var/wiresexposed) + if(!istype(S)) + return 0 + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + wiresexposed = !wiresexposed + user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" + update_icon() + return 1 + +/obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/weapon/wirecutters/W, var/wiresexposed) + if(!istype(W)) + return 0 + if(!wiresexposed) + return 0 + user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) + new/obj/item/stack/cable_coil(get_turf(src), 5) + . = dismantle() + /obj/machinery/proc/dismantle() - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/structure/frame/A = new /obj/structure/frame(loc) + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + var/obj/structure/frame/A = new /obj/structure/frame(src.loc) var/obj/item/weapon/circuitboard/M = circuit A.circuit = M A.anchored = 1 @@ -370,8 +370,8 @@ Class Procs: A.need_circuit = 0 if(A.frame_type.frame_class == "machine") - for(var/obj/D in src.component_parts) - D.forceMove(loc) + for(var/obj/D in component_parts) + D.forceMove(src.loc) if(A.components) A.components.Cut() else diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 186f76b82e..96ab5eab20 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -31,7 +31,6 @@ component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/cell/high(src) component_parts += new /obj/item/stack/cable_coil(src, 5) - RefreshParts() update_icon() @@ -79,9 +78,9 @@ if(!has_cell_power()) return 0 - if(src.use_power == 1) + if(use_power == 1) cell.use(idle_power_usage * CELLRATE) - else if(src.use_power >= 2) + else if(use_power >= 2) cell.use(active_power_usage * CELLRATE) return 1 @@ -265,7 +264,7 @@ if(!occupant) return - occupant.forceMove(loc) + occupant.forceMove(src.loc) occupant.reset_view() occupant = null update_icon() diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm index fb313477ac..3a036eec8e 100644 --- a/code/game/machinery/wall_frames.dm +++ b/code/game/machinery/wall_frames.dm @@ -19,7 +19,7 @@ /obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/wrench)) - new refund_type(get_turf(loc), refund_amt) + new refund_type(get_turf(src.loc), refund_amt) qdel(src) return ..() @@ -44,7 +44,7 @@ if(!(ndir in cardinal)) return - var/obj/machinery/M = new build_machine_type(get_turf(loc), ndir, 1, frame_type) + var/obj/machinery/M = new build_machine_type(get_turf(src.loc), ndir, 1, frame_type) M.fingerprints = fingerprints M.fingerprintshidden = fingerprintshidden M.fingerprintslast = fingerprintslast @@ -64,14 +64,14 @@ if(frame_type.frame_size != 5) new /obj/item/stack/material/steel(usr.loc, (5 - frame_type.frame_size)) - if(get_dist(on_wall,usr)>1) + if(get_dist(on_wall, usr)>1) return var/ndir if(reverse) - ndir = get_dir(usr,on_wall) + ndir = get_dir(usr, on_wall) else - ndir = get_dir(on_wall,usr) + ndir = get_dir(on_wall, usr) if(!(ndir in cardinal)) return diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 23c30d3a3d..55255d2097 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -4,6 +4,7 @@ icon = 'icons/mecha/mech_bay.dmi' icon_state = "recharge_floor" density = 0 + anchored = 1 layer = TURF_LAYER + 0.1 circuit = /obj/item/weapon/circuitboard/mech_recharger @@ -14,13 +15,11 @@ /obj/machinery/mech_recharger/New() ..() component_parts = list() - component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/manipulator(src) - RefreshParts() /obj/machinery/mech_recharger/Crossed(var/obj/mecha/M) @@ -50,7 +49,7 @@ ..() if(!charging) return - if(charging.loc != loc) // Could be qdel or teleport or something + if(charging.loc != src.loc) // Could be qdel or teleport or something stop_charging() return var/done = 1 @@ -95,4 +94,4 @@ if(!charging) return - charging = null + charging = null \ No newline at end of file diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index cbc60670e7..4e6154189a 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -21,8 +21,8 @@ origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1) var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage var/obj/machinery/clonepod/connecting //same for cryopod linkage - var/obj/machinery/connectable //Used to connect machinery, currently only used by Xenobio2. - + var/obj/machinery/connectable //Used to connect machinery. + /obj/item/device/multitool/attack_self(mob/user) var/clear = alert("Do you want to clear the buffers on the [src]?",, "Yes", "No",) if(clear == "Yes") diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index fcb8fb3d37..1ff101d464 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -99,9 +99,9 @@ return if(wiresexposed && istype(W, /obj/item/weapon/wirecutters)) user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") - playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) new/obj/item/stack/cable_coil(get_turf(src), 5) - var/obj/structure/frame/A = new /obj/structure/frame(loc) + var/obj/structure/frame/A = new /obj/structure/frame(src.loc) var/obj/item/weapon/circuitboard/M = circuit A.frame_type = M.board_type A.pixel_x = pixel_x diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm index 7695913eed..f49b80e6df 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/research.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm @@ -1,5 +1,5 @@ #ifndef T_BOARD -#error T_BOARD macro is not defined but we need it! +#error T_BOARD macro is not defined but we need it! #endif /obj/item/weapon/circuitboard/rdconsole @@ -9,12 +9,12 @@ /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) if(istype(I,/obj/item/weapon/screwdriver)) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") - if(src.build_path == /obj/machinery/computer/rdconsole/core) - src.name = T_BOARD("RD Console - Robotics") - src.build_path = /obj/machinery/computer/rdconsole/robotics + if(build_path == /obj/machinery/computer/rdconsole/core) + name = T_BOARD("RD Console - Robotics") + build_path = /obj/machinery/computer/rdconsole/robotics user << "Access protocols set to robotics." else - src.name = T_BOARD("RD Console") - src.build_path = /obj/machinery/computer/rdconsole/core + name = T_BOARD("RD Console") + build_path = /obj/machinery/computer/rdconsole/core user << "Access protocols set to default." - return + return \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm index 1fd629855f..1e4fe2afd9 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm @@ -4,16 +4,29 @@ obj/item/weapon/circuitboard/rdserver name = T_BOARD("R&D server") - build_path = "/obj/machinery/r_n_d/server" + build_path = /obj/machinery/r_n_d/server/core board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3) req_components = list( /obj/item/stack/cable_coil = 2, /obj/item/weapon/stock_parts/scanning_module = 1) +obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob) + if(istype(I,/obj/item/weapon/screwdriver)) + user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") + if(build_path == /obj/machinery/r_n_d/server/core) + name = T_BOARD("RD Console - Robotics") + build_path = /obj/machinery/r_n_d/server/robotics + user << "Access protocols set to robotics." + else + name = T_BOARD("RD Console") + build_path = /obj/machinery/r_n_d/server/core + user << "Access protocols set to default." + return + /obj/item/weapon/circuitboard/destructive_analyzer name = T_BOARD("destructive analyzer") - build_path = "/obj/machinery/r_n_d/destructive_analyzer" + build_path = /obj/machinery/r_n_d/destructive_analyzer board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( @@ -23,7 +36,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/autolathe name = T_BOARD("autolathe") - build_path = "/obj/machinery/autolathe" + build_path = /obj/machinery/autolathe board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( @@ -33,7 +46,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/protolathe name = T_BOARD("protolathe") - build_path = "/obj/machinery/r_n_d/protolathe" + build_path = /obj/machinery/r_n_d/protolathe board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( @@ -43,7 +56,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/circuit_imprinter name = T_BOARD("circuit imprinter") - build_path = "/obj/machinery/r_n_d/circuit_imprinter" + build_path = /obj/machinery/r_n_d/circuit_imprinter board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( @@ -53,7 +66,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/mechfab name = "Circuit board (Exosuit Fabricator)" - build_path = "/obj/machinery/mecha_part_fabricator" + build_path = /obj/machinery/mecha_part_fabricator board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( @@ -64,7 +77,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/prosthetics name = "Circuit board (Prosthetics Fabricator)" - build_path = "/obj/machinery/pros_fabricator" + build_path = /obj/machinery/pros_fabricator board_type = new /datum/frame/frame_types/machine origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 57691fed9b..5b9e6dc26d 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -24,13 +24,11 @@ /obj/structure/filingcabinet/filingcabinet //not changing the path to avoid unecessary map issues, but please don't name stuff like this in the future -Pete icon_state = "tallcabinet" - /obj/structure/filingcabinet/initialize() for(var/obj/item/I in loc) if(istype(I, /obj/item/weapon/paper) || istype(I, /obj/item/weapon/folder) || istype(I, /obj/item/weapon/photo) || istype(I, /obj/item/weapon/paper_bundle)) I.loc = src - /obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob) if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder) || istype(P, /obj/item/weapon/photo) || istype(P, /obj/item/weapon/paper_bundle)) user << "You put [P] in [src]." @@ -57,7 +55,6 @@ else user << "You can't put [P] in [src]!" - /obj/structure/filingcabinet/attack_hand(mob/user as mob) if(contents.len <= 0) user << "\The [src] is empty." @@ -103,14 +100,12 @@ sleep(5) icon_state = initial(icon_state) - /* * Security Record Cabinets */ /obj/structure/filingcabinet/security var/virgin = 1 - /obj/structure/filingcabinet/security/proc/populate() if(virgin) for(var/datum/data/record/G in data_core.general) diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm index ed23b965df..606f256e83 100644 --- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm +++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm @@ -76,19 +76,20 @@ scanner_seal_integrity = round(scanner_seal_integrity + amount_used * 10) return if(istype(I, /obj/item/weapon/reagent_containers/glass)) + var/obj/item/weapon/reagent_containers/glass/G = I + if(!G.is_open_container()) + return var/choice = alert("What do you want to do with the container?","Radiometric Scanner","Add coolant","Empty coolant","Scan container") if(choice == "Add coolant") - var/obj/item/weapon/reagent_containers/glass/G = I var/amount_transferred = min(src.reagents.maximum_volume - src.reagents.total_volume, G.reagents.total_volume) - G.reagents.trans_to(src, amount_transferred) - user << "You empty [amount_transferred]u of coolant into [src]." + var/trans = G.reagents.trans_to_obj(src, amount_transferred) + user << "You empty [trans ? trans : 0]u of coolant into [src]." update_coolant() return else if(choice == "Empty coolant") - var/obj/item/weapon/reagent_containers/glass/G = I var/amount_transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, src.reagents.total_volume) - src.reagents.trans_to(G, amount_transferred) - user << "You remove [amount_transferred]u of coolant from [src]." + var/trans = src.reagents.trans_to(G, amount_transferred) + user << "You remove [trans ? trans : 0]u of coolant from [src]." update_coolant() return if(scanned_item) @@ -148,15 +149,15 @@ data["radiation"] = round(radiation) data["t_left_radspike"] = round(t_left_radspike) data["rad_shield_on"] = rad_shield - + // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) // the ui does not exist, so we'll create a new() one // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm ui = new(user, src, ui_key, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825) // when the ui is first opened this is the data it will use - ui.set_initial_data(data) + ui.set_initial_data(data) // open the new ui window ui.open() // auto update every Master Controller tick diff --git a/code/modules/xenobio2/machinery/injector.dm b/code/modules/xenobio2/machinery/injector.dm index e2c68f8a27..3193311890 100644 --- a/code/modules/xenobio2/machinery/injector.dm +++ b/code/modules/xenobio2/machinery/injector.dm @@ -74,7 +74,7 @@ if(occupant) occupant.forceMove(loc) occupant = null - + /obj/machinery/xenobio2/manualinjector/proc/eject_beaker() if(beaker) var/obj/item/weapon/reagent_containers/glass/beaker/B = beaker @@ -136,10 +136,9 @@ move_into_injector(user,G.affecting) - /obj/item/weapon/circuitboard/xenobioinjectormachine name = T_BOARD("biological injector") - build_path = "/obj/machinery/xenobio2/manualinjector" - board_type = "machine" + build_path = /obj/machinery/xenobio2/manualinjector + board_type = /datum/frame/frame_types/machine origin_tech = list() //To be filled, req_components = list() //To be filled, \ No newline at end of file diff --git a/code/modules/xenobio2/machinery/injector_computer.dm b/code/modules/xenobio2/machinery/injector_computer.dm index 7bcccd55ca..12887506c2 100644 --- a/code/modules/xenobio2/machinery/injector_computer.dm +++ b/code/modules/xenobio2/machinery/injector_computer.dm @@ -61,7 +61,7 @@ if(isxeno(injector.occupant)) var/mob/living/simple_animal/xeno/X = injector.occupant data["compatible"] = 1 - data["instability"] = 100 * (X.mut_level / X.mut_max) + data["instability"] = 100 * (X.mut_level / X.mut_max) else data["compatible"] = null @@ -109,6 +109,5 @@ /obj/item/weapon/circuitboard/xenobio2computer name = T_BOARD("injector control console") - build_path = "/obj/item/weapon/circuitboard/xenobio2computer" - board_type = "computer" + build_path = /obj/item/weapon/circuitboard/xenobio2computer origin_tech = list() //To be filled, diff --git a/html/changelogs/Sin4 - framecleanup.yml b/html/changelogs/Sin4 - framecleanup.yml new file mode 100644 index 0000000000..a43b593703 --- /dev/null +++ b/html/changelogs/Sin4 - framecleanup.yml @@ -0,0 +1,39 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Sin4 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Advanced Body Scanners are now deconstructable" + - bugfix: "You can now add coolant to the Radiocarbon Spectrometers" + - tweak: "Frame code revamped and cleaned up." + - rscadd: "R&D server circuitboards can be swapped between core and robotics types using a screwdriver." \ No newline at end of file