Adds deconstruction for DNA scanner and cloning pod.

Adding wires to a machine frame uses one unit of wire.
Wires returned from deconstructing return 1 unit of wire.
Fixes issue #1001
This commit is contained in:
Perakp
2013-12-07 08:55:07 +02:00
parent b3f95e6e79
commit b8a7957a22
18 changed files with 143 additions and 143 deletions
+41 -10
View File
@@ -339,16 +339,15 @@
/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()
@@ -378,6 +377,9 @@
/obj/machinery/dna_scannernew/proc/close()
if(open)
if(panel_open)
usr << "<span class='notice'>Close the maintenance panel first.</span>"
return 0
open = 0
density = 1
for(var/mob/living/carbon/C in loc)
@@ -409,6 +411,9 @@
/obj/machinery/dna_scannernew/proc/open()
if(!open)
if(panel_open)
usr << "<span class='notice'>Close the maintenance panel first.</span>"
return
if(locked)
usr << "<span class='notice'>The bolts are locked down, securing the door shut.</span>"
return
@@ -432,6 +437,31 @@
return
/obj/machinery/dna_scannernew/attackby(obj/item/weapon/grab/G, mob/user)
if(istype(G, /obj/item/weapon/screwdriver))
if(occupant)
user << "<span class='notice'>The maintenance panel is locked.</span>"
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)
@@ -482,6 +512,7 @@
del(src)
//DNA COMPUTER
/obj/machinery/computer/scan_consolenew
name = "\improper DNA scanner access console"
desc = "Scan DNA."
+1 -9
View File
@@ -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)
-1
View File
@@ -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
+29 -1
View File
@@ -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,6 +241,19 @@
//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 << "<span class='notice'>The maintenance panel is locked.</span>"
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."
+6 -4
View File
@@ -125,9 +125,9 @@
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)
@@ -137,8 +137,10 @@
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.amount--
if(!CP.amount) del(CP)
else CP.update_icon()
components += CC
req_components[I]--
update_req_desc()
+21
View File
@@ -108,6 +108,7 @@ Class Procs:
var/uid
var/manual = 0
var/global/gl_uid = 1
var/panel_open = 0
/obj/machinery/New()
..()
@@ -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]."
@@ -68,9 +68,12 @@
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 +84,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
-1
View File
@@ -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
+4 -19
View File
@@ -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."
+6 -14
View File
@@ -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)
..()
+5 -12
View File
@@ -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)
+6 -19
View File
@@ -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."
+6 -23
View File
@@ -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."
+1 -1
View File
@@ -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)
+1 -2
View File
@@ -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:<BR>"
for(var/wire in src.wires)
+5 -20
View File
@@ -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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB