diff --git a/code/game/dna.dm b/code/game/dna.dm index 2e980b50ad0..b8b346cc6fd 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -240,54 +240,54 @@ if(blocks[NEARSIGHTEDBLOCK]) M.disabilities |= NEARSIGHTED - M << "\red Your eyes feel strange." + M << "Your eyes feel strange." if(blocks[EPILEPSYBLOCK]) M.disabilities |= EPILEPSY - M << "\red You get a headache." + M << "You get a headache." if(blocks[STRANGEBLOCK]) - M << "\red You feel strange." + M << "You feel strange." if(prob(95)) if(prob(50)) randmutb(M) else randmuti(M) else randmutg(M) if(blocks[COUGHBLOCK]) M.disabilities |= COUGHING - M << "\red You start coughing." + M << "You start coughing." if(blocks[CLUMSYBLOCK]) - M << "\red You feel lightheaded." + M << "You feel lightheaded." M.mutations |= CLUMSY if(blocks[TOURETTESBLOCK]) M.disabilities |= TOURETTES - M << "\red You twitch." + M << "You twitch." if(blocks[NERVOUSBLOCK]) M.disabilities |= NERVOUS - M << "\red You feel nervous." + M << "You feel nervous." if(blocks[DEAFBLOCK]) M.sdisabilities |= DEAF M.ear_deaf = 1 - M << "\red You can't seem to hear anything..." + M << "You can't seem to hear anything." if(blocks[BLINDBLOCK]) M.sdisabilities |= BLIND - M << "\red You can't seem to see anything." + M << "You can't seem to see anything." if(blocks[HULKBLOCK]) if(inj || prob(10)) M.mutations |= HULK - M << "\blue Your muscles hurt." + M << "Your muscles hurt." if(blocks[XRAYBLOCK]) if(inj || prob(30)) M.mutations |= XRAY - M << "\blue The walls suddenly disappear." + M << "The walls suddenly disappear." M.sight |= SEE_MOBS|SEE_OBJS|SEE_TURFS M.see_in_dark = 8 M.see_invisible = SEE_INVISIBLE_LEVEL_TWO if(blocks[FIREBLOCK]) if(inj || prob(30)) M.mutations |= COLD_RESISTANCE - M << "\blue Your body feels warm." + M << "Your body feels warm." if(blocks[TELEBLOCK]) if(inj || prob(25)) M.mutations |= TK - M << "\blue You feel smarter." + M << "You feel smarter." /* If you want the new mutations to work, UNCOMMENT THIS. @@ -339,20 +339,21 @@ /obj/machinery/dna_scannernew/New() ..() - component_parts = newlist( - /obj/item/weapon/circuitboard/clonescanner, - /obj/item/weapon/stock_parts/scanning_module, - /obj/item/weapon/stock_parts/manipulator, - /obj/item/weapon/stock_parts/micro_laser, - /obj/item/weapon/stock_parts/console_screen, - /obj/item/weapon/cable_coil, - /obj/item/weapon/cable_coil - ) - RefreshParts() + component_parts = list() + component_parts += new /obj/item/weapon/circuitboard/clonescanner(null) + component_parts += new /obj/item/weapon/stock_parts/scanning_module(null) + component_parts += new /obj/item/weapon/stock_parts/manipulator(null) + component_parts += new /obj/item/weapon/stock_parts/micro_laser(null) + component_parts += new /obj/item/weapon/stock_parts/console_screen(null) + component_parts += new /obj/item/weapon/cable_coil(null, 1) + component_parts += new /obj/item/weapon/cable_coil(null, 1) -/obj/machinery/dna_scannernew/proc/toggle_open() - if(open) return close() - else return open() + +/obj/machinery/dna_scannernew/proc/toggle_open(mob/user=usr) + if(!user) + return + if(open) return close(user) + else return open(user) /obj/machinery/dna_scannernew/container_resist() var/mob/living/user = usr @@ -363,8 +364,7 @@ user.next_move = world.time + 100 user.last_special = world.time + 100 user << "You lean on the back of [src] and start pushing the door open. (this will take about [breakout_time] minutes.)" - for(var/mob/O in viewers(src)) - O << "You hear a metallic creaking from [src]!" + user.visible_message("You hear a metallic creaking from [src]!") if(do_after(user,(breakout_time*60*10))) //minutes * 60seconds * 10deciseconds if(!user || user.stat != CONSCIOUS || user.loc != src || open || !locked) @@ -374,10 +374,13 @@ visible_message("[user] successfully broke out of [src]!") user << "You successfully break out of [src]!" - open() + open(user) -/obj/machinery/dna_scannernew/proc/close() +/obj/machinery/dna_scannernew/proc/close(mob/user) if(open) + if(panel_open) + user << "Close the maintenance panel first." + return 0 open = 0 density = 1 for(var/mob/living/carbon/C in loc) @@ -407,10 +410,13 @@ return 1 -/obj/machinery/dna_scannernew/proc/open() +/obj/machinery/dna_scannernew/proc/open(mob/user) if(!open) + if(panel_open) + user << "Close the maintenance panel first." + return if(locked) - usr << "The bolts are locked down, securing the door shut." + user << "The bolts are locked down, securing the door shut." return var/turf/T = get_turf(src) if(T) @@ -428,10 +434,35 @@ /obj/machinery/dna_scannernew/relaymove(mob/user as mob) if(user.stat) return - open() + open(user) return /obj/machinery/dna_scannernew/attackby(obj/item/weapon/grab/G, mob/user) + + if(istype(G, /obj/item/weapon/screwdriver)) + if(occupant) + user << "The maintenance panel is locked." + return + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + panel_open = !panel_open + if(panel_open) + icon_state = "[icon_state]_maintenance" + user << "You open the maintenance panel of [src]." + else + if(open) + icon_state = "[initial(icon_state)]_open" + else + icon_state = "[initial(icon_state)]" + user << "You close the maintenance panel of [src]." + return + + if(istype(G, /obj/item/weapon/crowbar)) + if(panel_open) + for(var/obj/I in contents) // in case there is something in the scanner + I.loc = src.loc + default_deconstruction_crowbar() + return + if(!istype(G, /obj/item/weapon/grab) || !ismob(G.affecting)) return if(!open) @@ -443,8 +474,9 @@ del(G) /obj/machinery/dna_scannernew/attack_hand(mob/user) - if(..()) return - toggle_open() + if(..()) + return + toggle_open(user) add_fingerprint(user) @@ -482,6 +514,7 @@ del(src) +//DNA COMPUTER /obj/machinery/computer/scan_consolenew name = "\improper DNA scanner access console" desc = "Scan DNA." @@ -509,7 +542,7 @@ user.drop_item() I.loc = src src.diskette = I - user << "You insert [I]." + user << "You insert [I]." src.updateUsrDialog() return else @@ -749,7 +782,7 @@ if("togglelock") if(connected) connected.locked = !connected.locked if("toggleopen") - if(connected) connected.toggle_open() + if(connected) connected.toggle_open(usr) if("setduration") if(!num) num = round(input(usr, "Choose pulse duration:", "Input an Integer", null) as num|null) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 16cd92e782f..6a31eb60051 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -176,21 +176,13 @@ var/global/list/autolathe_recipes_hidden = list( \ return 1 if (opened) if(istype(O, /obj/item/weapon/crowbar)) - playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) - M.state = 2 - M.icon_state = "box_1" - for(var/obj/I in component_parts) - if(I.reliability != 100 && crit_fail) - I.crit_fail = 1 - I.loc = src.loc if(m_amount >= 3750) var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc) G.amount = round(m_amount / 3750) if(g_amount >= 3750) var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc) G.amount = round(g_amount / 3750) - del(src) + default_deconstruction_crowbar() return 1 else user.set_machine(src) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 6f6db8ad4ec..7577a2ddbe7 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -14,7 +14,6 @@ var/c_tag_order = 999 var/status = 1.0 anchored = 1.0 - var/panel_open = 0 // 0 = Closed / 1 = Open var/invuln = null var/obj/item/device/camera_bug/bug = null var/obj/item/weapon/camera_assembly/assembly = null diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 958bd693066..2498538e4f2 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -19,6 +19,19 @@ var/attempting = 0 //One clone attempt at a time thanks var/eject_wait = 0 //Don't eject them as soon as they are created fuckkk +/obj/machinery/clonepod/New() + ..() + component_parts = list() + component_parts += new /obj/item/weapon/circuitboard/clonepod(src) + component_parts += new /obj/item/weapon/stock_parts/scanning_module(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) + component_parts += new /obj/item/weapon/stock_parts/console_screen(src) + component_parts += new /obj/item/weapon/cable_coil(src, 1) + component_parts += new /obj/item/weapon/cable_coil(src, 1) + + //The return of data disks?? Just for transferring between genetics machine/cloning machine. //TO-DO: Make the genetics machine accept them. /obj/item/weapon/disk/data @@ -98,6 +111,8 @@ //Start growing a human clone in the pod! /obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/ui, var/se, var/mindref, var/mrace) + if(panel_open) + return 0 if(mess || attempting) return 0 var/datum/mind/clonemind = locate(mindref) @@ -217,7 +232,7 @@ src.occupant = null if (src.locked) src.locked = 0 - if (!src.mess) + if (!src.mess && !panel_open) icon_state = "pod_0" use_power(200) return @@ -226,14 +241,27 @@ //Let's unlock this early I guess. Might be too early, needs tweaking. /obj/machinery/clonepod/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/screwdriver)) + if(occupant || mess || locked) + user << "The maintenance panel is locked." + return + playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) + default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]") + return + + if(istype(W, /obj/item/weapon/crowbar)) + if(panel_open) + default_deconstruction_crowbar() + return + if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if (!src.check_access(W)) - user << "\red Access Denied." + user << "Access Denied." return if ((!src.locked) || (isnull(src.occupant))) return if ((src.occupant.health < -20) && (src.occupant.stat != 2)) - user << "\red Access Refused." + user << "Access Refused." return else src.locked = 0 @@ -264,6 +292,8 @@ set category = "Object" set src in oview(1) + if(!usr) + return if (usr.stat != 0) return src.go_out() diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index a41d002efe0..ebe0566804d 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -49,7 +49,7 @@ /obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P as obj, mob/user as mob) if(P.crit_fail) - user << "\red This part is faulty, you cannot add this to the machine!" + user << "This part is faulty, you cannot add this to the machine!" return switch(state) if(1) @@ -57,17 +57,17 @@ var/obj/item/weapon/cable_coil/C = P if(C.amount >= 5) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - user << "\blue You start to add cables to the frame." + user << "You start to add cables to the frame." if(do_after(user, 20)) if(C) C.amount -= 5 if(!C.amount) del(C) - user << "\blue You add cables to the frame." + user << "You add cables to the frame." state = 2 icon_state = "box_1" if(istype(P, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - user << "\blue You dismantle the frame" + user << "You dismantle the frame." new /obj/item/stack/sheet/metal(src.loc, 5) del(src) if(2) @@ -75,7 +75,7 @@ var/obj/item/weapon/circuitboard/B = P if(B.board_type == "machine") playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - user << "\blue You add the circuit board to the frame." + user << "You add the circuit board to the frame." circuit = P user.drop_item() P.loc = src @@ -86,10 +86,10 @@ update_namelist() update_req_desc() else - user << "\red This frame does not accept circuit boards of this type!" + user << "This frame does not accept circuit boards of this type!" if(istype(P, /obj/item/weapon/wirecutters)) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - user << "\blue You remove the cables." + user << "You remove the cables." state = 1 icon_state = "box_0" var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc ) @@ -102,9 +102,9 @@ circuit.loc = src.loc circuit = null if(components.len == 0) - user << "\blue You remove the circuit board." + user << "You remove the circuit board." else - user << "\blue You remove the circuit board and other components." + user << "You remove the circuit board and other components." for(var/obj/item/weapon/W in components) W.loc = src.loc desc = initial(desc) @@ -125,32 +125,33 @@ del(O) new_machine.component_parts = list() for(var/obj/O in src) - O.loc = new_machine + O.loc = null new_machine.component_parts += O - circuit.loc = new_machine + circuit.loc = null new_machine.RefreshParts() del(src) if(istype(P, /obj/item/weapon)) + var/success for(var/I in req_components) if(istype(P, text2path(I)) && (req_components[I] > 0)) + success=1 if(istype(P, /obj/item/weapon/cable_coil)) var/obj/item/weapon/cable_coil/CP = P - if(CP.amount > 1) - var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src) - CC.amount = 1 + var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src, 1, CP.item_color) + if(CP.use(1)) components += CC req_components[I]-- update_req_desc() - break + break user.drop_item() P.loc = src components += P req_components[I]-- update_req_desc() break - if(P.loc != src && !istype(P, /obj/item/weapon/cable_coil)) - user << "\red You cannot add that component to the machine!" + if(!success) + user << "You cannot add that to the machine!" //Machine Frame Circuit Boards diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 2ea74cf174e..f04a742c876 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -108,6 +108,7 @@ Class Procs: var/uid var/manual = 0 var/global/gl_uid = 1 + var/panel_open = 0 /obj/machinery/New() ..() @@ -211,7 +212,7 @@ Class Procs: if ( ! (istype(usr, /mob/living/carbon/human) || \ istype(usr, /mob/living/silicon) || \ istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") ) - usr << "\red You don't have the dexterity to do this!" + usr << "You don't have the dexterity to do this!" return 1 /* //distance checks are made by atom/proc/DblClick @@ -224,7 +225,7 @@ Class Procs: visible_message("\red [H] stares cluelessly at [src] and drools.") return 1 else if(prob(H.getBrainLoss())) - user << "\red You momentarily forget how to use [src]." + user << "You momentarily forget how to use [src]." return 1 src.add_fingerprint(user) @@ -238,3 +239,23 @@ Class Procs: uid = gl_uid gl_uid++ +/obj/machinery/proc/default_deconstruction_crowbar() + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) + M.state = 2 + M.icon_state = "box_1" + for(var/obj/I in component_parts) + if(I.reliability != 100 && crit_fail) + I.crit_fail = 1 + I.loc = src.loc + del(src) + +/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/icon_state_open, var/icon_state_closed) + if (!panel_open) + panel_open = 1 + icon_state = icon_state_open + user << "You open the maintenance hatch of [src]." + else + panel_open = 0 + icon_state = icon_state_closed + user << "You close the maintenance hatch of [src]." diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index a3c1ee3f340..b4c9e607982 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -24,26 +24,26 @@ switch(construct_op) if(0) if(istype(P, /obj/item/weapon/screwdriver)) - user << "You unfasten the bolts." + user << "You unfasten the bolts." playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) construct_op ++ if(1) if(istype(P, /obj/item/weapon/screwdriver)) - user << "You fasten the bolts." + user << "You fasten the bolts." playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) construct_op -- if(istype(P, /obj/item/weapon/wrench)) - user << "You dislodge the external plating." + user << "You dislodge the external plating." playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) construct_op ++ if(2) if(istype(P, /obj/item/weapon/wrench)) - user << "You secure the external plating." + user << "You secure the external plating." playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) construct_op -- if(istype(P, /obj/item/weapon/wirecutters)) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - user << "You remove the cables." + user << "You remove the cables." construct_op ++ var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( user.loc ) A.amount = 5 @@ -51,26 +51,25 @@ if(3) if(istype(P, /obj/item/weapon/cable_coil)) var/obj/item/weapon/cable_coil/A = P - if(A.amount >= 5) - user << "You insert the cables." - A.amount -= 5 - if(A.amount <= 0) - user.drop_item() - del(A) + if(A.use(5)) + user << "You insert the cables." construct_op -- stat &= ~BROKEN // the machine's not borked anymore! else - user << "You need more cable" + user << "You need more cable to do that." if(istype(P, /obj/item/weapon/crowbar)) - user << "You begin prying out the circuit board and components..." + user << "You begin prying out the circuit board and components..." playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) if(do_after(user,60)) - user << "You finish prying out the components." + user << "You finish prying out the components." // Drop all the component stuff - if(contents.len > 0) - for(var/obj/x in src) - x.loc = user.loc + if(component_parts) + for(var/obj/I in component_parts) + if(I.reliability != 100 && crit_fail) + I.crit_fail = 1 + I.loc = src.loc + else // If the machine wasn't made during runtime, probably doesn't have components: @@ -81,13 +80,14 @@ for(var/i = 1, i <= C.req_components[I], i++) newpath = text2path(I) var/obj/item/s = new newpath - s.loc = user.loc - if(istype(P, /obj/item/weapon/cable_coil)) - var/obj/item/weapon/cable_coil/A = P + s.loc = src.loc + if(istype(s, /obj/item/weapon/cable_coil)) + var/obj/item/weapon/cable_coil/A = s A.amount = 1 + A.update_icon() // Drop a circuit board too - C.loc = user.loc + C.loc = src.loc // Create a machine frame and delete the current machine var/obj/machinery/constructable_frame/machine_frame/F = new diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 661c885b4d7..d7b3aa81b6a 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -40,7 +40,6 @@ var/shoot_inventory = 0 //Fire items at customers! We're broken! var/shut_up = 0 //Stop spouting those godawful pitches! var/extended_inventory = 0 //can we access the hidden inventory? - var/panel_open = 0 //Hacking that vending machine. Gonna get a free candy bar. var/scan_id = 1 var/obj/item/weapon/coin/coin var/datum/wires/vending/wires = null diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 9bf3da5d6ff..864ff0f51d2 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -34,7 +34,6 @@ var/list/queue = list() var/processing_queue = 0 var/screen = "main" - var/opened = 0 var/temp var/list/part_sets = list( //set names must be unique "Cyborg"=list( @@ -701,25 +700,11 @@ /obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/screwdriver)) - if (!opened) - opened = 1 - icon_state = "fab-o" - user << "You open the maintenance hatch of [src]." - else - opened = 0 - icon_state = "fab-idle" - user << "You close the maintenance hatch of [src]." + default_deconstruction_screwdriver(user, "fab-o", "fab-idle") + return - if (opened) + if (panel_open) if(istype(W, /obj/item/weapon/crowbar)) - playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) - M.state = 2 - M.icon_state = "box_1" - for(var/obj/I in component_parts) - if(I.reliability != 100 && crit_fail) - I.crit_fail = 1 - I.loc = src.loc if(src.resources["metal"] >= 3750) var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc) G.amount = round(src.resources["metal"] / G.perunit) @@ -744,7 +729,7 @@ if(src.resources["bananium"] >= 2000) var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown(src.loc) G.amount = round(src.resources["bananium"] / G.perunit) - del(src) + default_deconstruction_crowbar() return 1 else user << "\red You can't load the [src.name] while it's opened." diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 00777fcc9eb..0c4bd97519a 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -302,8 +302,8 @@ if(src.amount < used) return 0 else if (src.amount == used) - //handle mob icon update - if(ismob(loc)) + .=1 //Because del(src) stops the proc, set the default return value to 1 + if(ismob(loc)) //handle mob icon update var/mob/M = loc M.u_equip(src) del(src) diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index 628956fa68a..f8569d10924 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -53,7 +53,6 @@ display round(lastgen) and plasmatank amount var/active = 0 var/power_gen = 5000 - var/open = 0 var/recent_fault = 0 var/power_output = 1 @@ -115,8 +114,8 @@ display round(lastgen) and plasmatank amount component_parts = list() component_parts += new /obj/item/weapon/stock_parts/matter_bin(src) component_parts += new /obj/item/weapon/stock_parts/micro_laser(src) - component_parts += new /obj/item/weapon/cable_coil(src) - component_parts += new /obj/item/weapon/cable_coil(src) + component_parts += new /obj/item/weapon/cable_coil(src, 1) + component_parts += new /obj/item/weapon/cable_coil(src, 1) component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new board_path(src) var/obj/sheet = new sheet_path(null) @@ -231,21 +230,14 @@ display round(lastgen) and plasmatank amount playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) else if(istype(O, /obj/item/weapon/screwdriver)) - open = !open + panel_open = !panel_open playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) - if(open) + if(panel_open) user << "\blue You open the access panel." else user << "\blue You close the access panel." - else if(istype(O, /obj/item/weapon/crowbar) && !open) - var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc) - for(var/obj/item/I in component_parts) - if(I.reliability < 100) - I.crit_fail = 1 - I.loc = src.loc - new_frame.state = 2 - new_frame.icon_state = "box_1" - del(src) + else if(istype(O, /obj/item/weapon/crowbar) && panel_open) + default_deconstruction_crowbar() /obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob) ..() diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 5da8dbf3688..5ac1762d266 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -52,19 +52,12 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). if (shocked) shock(user,50) if (istype(O, /obj/item/weapon/screwdriver)) - if (!opened) - opened = 1 - if(linked_console) - linked_console.linked_imprinter = null - linked_console = null - icon_state = "circuit_imprinter_t" - user << "You open the maintenance hatch of [src]." - else - opened = 0 - icon_state = "circuit_imprinter" - user << "You close the maintenance hatch of [src]." + if(linked_console) + linked_console.linked_imprinter = null + linked_console = null + default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter") return - if (opened) + if (panel_open) if(istype(O, /obj/item/weapon/crowbar)) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index a6501553fad..bee0c198916 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -44,27 +44,14 @@ Note: Must be placed within 3 tiles of the R&D Console if (shocked) shock(user,50) if (istype(O, /obj/item/weapon/screwdriver)) - if (!opened) - opened = 1 - if(linked_console) - linked_console.linked_destroy = null - linked_console = null - icon_state = "d_analyzer_t" - user << "You open the maintenance hatch of [src]." - else - opened = 0 - icon_state = "d_analyzer" - user << "You close the maintenance hatch of [src]." + if(linked_console) + linked_console.linked_destroy = null + linked_console = null + default_deconstruction_screwdriver(user, "d_analyzer_t", "d_analyzer") return - if (opened) + if (panel_open) if(istype(O, /obj/item/weapon/crowbar)) - playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) - M.state = 2 - M.icon_state = "box_1" - for(var/obj/I in component_parts) - I.loc = src.loc - del(src) + default_deconstruction_crowbar() return 1 else user << "\red You can't load the [src.name] while it's opened." diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index de1a92ec018..ec908f22d73 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -57,30 +57,13 @@ Note: Must be placed west/left of and R&D console to function. if (O.is_open_container()) return 1 if (istype(O, /obj/item/weapon/screwdriver)) - if (!opened) - opened = 1 - if(linked_console) - linked_console.linked_lathe = null - linked_console = null - icon_state = "protolathe_t" - user << "You open the maintenance hatch of [src]." - else - opened = 0 - icon_state = "protolathe" - user << "You close the maintenance hatch of [src]." + if(linked_console) + linked_console.linked_lathe = null + linked_console = null + default_deconstruction_screwdriver(user, "protolathe_t", "protolathe") return - if (opened) + if (panel_open) if(istype(O, /obj/item/weapon/crowbar)) - playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) - M.state = 2 - M.icon_state = "box_1" - for(var/obj/I in component_parts) - if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker)) - reagents.trans_to(I, reagents.total_volume) - if(I.reliability != 100 && crit_fail) - I.crit_fail = 1 - I.loc = src.loc if(m_amount >= 3750) var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc) G.amount = round(m_amount / G.perunit) @@ -108,7 +91,7 @@ Note: Must be placed west/left of and R&D console to function. if(adamantine_amount >= 2000) var/obj/item/stack/sheet/mineral/adamantine/G = new /obj/item/stack/sheet/mineral/adamantine(src.loc) G.amount = round(adamantine_amount / G.perunit) - del(src) + default_deconstruction_crowbar() return 1 else user << "\red You can't load the [src.name] while it's opened." diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index cb1bd68ca44..b77802f59b8 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -99,7 +99,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/proc/SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any). for(var/obj/machinery/r_n_d/D in oview(3,src)) - if(D.linked_console != null || D.disabled || D.opened) + if(D.linked_console != null || D.disabled || D.panel_open) continue if(istype(D, /obj/machinery/r_n_d/destructive_analyzer)) if(linked_destroy == null) diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 68def8bd39c..ee922a055a6 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -17,7 +17,6 @@ var/hack_wire var/disable_wire var/shock_wire - var/opened = 0 var/obj/machinery/computer/rdconsole/linked_console /obj/machinery/r_n_d/New() @@ -53,7 +52,7 @@ /obj/machinery/r_n_d/attack_hand(mob/user as mob) if (shocked) shock(user,50) - if(opened) + if(panel_open) var/dat as text dat += "[src.name] Wires:
" for(var/wire in src.wires) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 06aa463f2b0..b90917b53e1 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -19,8 +19,8 @@ component_parts = list() component_parts += new /obj/item/weapon/circuitboard/rdserver(src) component_parts += new /obj/item/weapon/stock_parts/scanning_module(src) - component_parts += new /obj/item/weapon/cable_coil(src) - component_parts += new /obj/item/weapon/cable_coil(src) + component_parts += new /obj/item/weapon/cable_coil(src, 1) + component_parts += new /obj/item/weapon/cable_coil(src, 1) RefreshParts() src.initialize(); //Agouri @@ -131,27 +131,12 @@ if (shocked) shock(user,50) if (istype(O, /obj/item/weapon/screwdriver)) - if (!opened) - opened = 1 - icon_state = "server_o" - user << "You open the maintenance hatch of [src]." - else - opened = 0 - icon_state = "server" - user << "You close the maintenance hatch of [src]." + default_deconstruction_screwdriver(user, "server_o", "server") return - if (opened) + if (panel_open) if(istype(O, /obj/item/weapon/crowbar)) griefProtection() - playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) - var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc) - M.state = 2 - M.icon_state = "box_1" - for(var/obj/I in component_parts) - if(I.reliability != 100 && crit_fail) - I.crit_fail = 1 - I.loc = src.loc - del(src) + default_deconstruction_crowbar() return 1 /obj/machinery/r_n_d/server/attack_hand(mob/user as mob) // I guess only exists to stop ninjas or hell does it even work I dunno. See also ninja gloves. diff --git a/icons/obj/Cryogenic2.dmi b/icons/obj/Cryogenic2.dmi index 7314ac709af..91e301beded 100644 Binary files a/icons/obj/Cryogenic2.dmi and b/icons/obj/Cryogenic2.dmi differ diff --git a/icons/obj/cloning.dmi b/icons/obj/cloning.dmi index af0bb42e602..a65c2a43f78 100644 Binary files a/icons/obj/cloning.dmi and b/icons/obj/cloning.dmi differ