mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 19:15:11 +01:00
Setting computer vars on de/construction
This commit is contained in:
@@ -8,6 +8,8 @@ obj/machinery/air_sensor
|
||||
|
||||
var/id_tag
|
||||
var/frequency = 1439
|
||||
|
||||
circuit = /obj/item/weapon/circuitboard/air_management
|
||||
|
||||
var/on = 1
|
||||
var/output = 3
|
||||
@@ -97,39 +99,6 @@ obj/machinery/computer/general_air_control
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
@@ -295,39 +264,7 @@ Max Output Pressure: [output_pressure] kPa<BR>"}
|
||||
|
||||
var/cutoff_temperature = 2000
|
||||
var/on_temperature = 1200
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
circuit = /obj/item/weapon/circuitboard/air_management/injector_control
|
||||
|
||||
process()
|
||||
if(automation)
|
||||
|
||||
@@ -25,9 +25,17 @@
|
||||
var/frame_desc = null
|
||||
var/contain_parts = 1
|
||||
|
||||
//TODO: move this into constructable_frame.dm, as circuitboards are used to construct all kinds of machines
|
||||
/obj/item/weapon/circuitboard/proc/construct_machine(var/obj/machinery/M)
|
||||
return
|
||||
//Called when the circuitboard is used to contruct a new computer.
|
||||
/obj/item/weapon/circuitboard/proc/construct_computer(var/obj/machinery/computer/C)
|
||||
if (istype(C, build_path))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Called when a computer is deconstructed to produce a circuitboard
|
||||
/obj/item/weapon/circuitboard/proc/deconstruct_computer(var/obj/machinery/computer/C)
|
||||
if (istype(C, build_path))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*
|
||||
Circuit Board Definitions
|
||||
@@ -37,20 +45,31 @@
|
||||
name = "Circuit board (Message Monitor)"
|
||||
build_path = "/obj/machinery/computer/message_monitor"
|
||||
origin_tech = "programming=3"
|
||||
|
||||
//TODO: Move these into computer/camera.dm
|
||||
/obj/item/weapon/circuitboard/security
|
||||
name = "Circuit board (Security)"
|
||||
name = "Circuit board (Security Camera Monitor)"
|
||||
build_path = "/obj/machinery/computer/security"
|
||||
var/network = list("SS13")
|
||||
req_access = list(access_security)
|
||||
var/locked = 1
|
||||
var/emagged = 0
|
||||
|
||||
/obj/item/weapon/circuitboard/security/construct_computer(var/obj/machinery/computer/security/C)
|
||||
if (..(C))
|
||||
C.network = network
|
||||
|
||||
/obj/item/weapon/circuitboard/security/deconstruct_computer(var/obj/machinery/computer/security/C)
|
||||
if (..(C))
|
||||
network = C.network
|
||||
|
||||
/obj/item/weapon/circuitboard/security/engineering
|
||||
name = "Circuit board (Engineering)"
|
||||
name = "Circuit board (Engineering Camera Monitor)"
|
||||
build_path = "/obj/machinery/computer/security/engineering"
|
||||
network = list("Engineering","Power Alarms","Atmosphere Alarms","Fire Alarms")
|
||||
req_access = list()
|
||||
/obj/item/weapon/circuitboard/security/mining
|
||||
name = "Circuit board (Mining)"
|
||||
name = "Circuit board (Mining Camera Monitor)"
|
||||
build_path = "/obj/machinery/computer/security/mining"
|
||||
network = list("MINE")
|
||||
req_access = list()
|
||||
@@ -109,9 +128,19 @@
|
||||
/obj/item/weapon/circuitboard/air_management
|
||||
name = "Circuit board (Atmospheric Monitor)"
|
||||
build_path = "/obj/machinery/computer/general_air_control"
|
||||
/obj/item/weapon/circuitboard/injector_control
|
||||
var/frequency = 1439
|
||||
/obj/item/weapon/circuitboard/air_management/injector_control
|
||||
name = "Circuit board (Injector Control)"
|
||||
build_path = "/obj/machinery/computer/general_air_control/fuel_injection"
|
||||
|
||||
/obj/item/weapon/circuitboard/air_management/construct_computer(var/obj/machinery/computer/general_air_control/C)
|
||||
if (..(C))
|
||||
C.frequency = frequency
|
||||
|
||||
/obj/item/weapon/circuitboard/air_management/deconstruct_computer(var/obj/machinery/computer/general_air_control/C)
|
||||
if (..(C))
|
||||
frequency = C.frequency
|
||||
|
||||
/obj/item/weapon/circuitboard/atmos_alert
|
||||
name = "Circuit board (Atmospheric Alert)"
|
||||
build_path = "/obj/machinery/computer/atmos_alert"
|
||||
@@ -177,12 +206,21 @@
|
||||
name = "Circuit board (Supply ordering console)"
|
||||
build_path = "/obj/machinery/computer/ordercomp"
|
||||
origin_tech = "programming=2"
|
||||
|
||||
/obj/item/weapon/circuitboard/supplycomp
|
||||
name = "Circuit board (Supply shuttle console)"
|
||||
build_path = "/obj/machinery/computer/supplycomp"
|
||||
origin_tech = "programming=3"
|
||||
var/contraband_enabled = 0
|
||||
|
||||
/obj/item/weapon/circuitboard/supplycomp/construct_computer(var/obj/machinery/computer/supplycomp/SC)
|
||||
if (..(SC))
|
||||
SC.can_order_contraband = contraband_enabled
|
||||
|
||||
/obj/item/weapon/circuitboard/supplycomp/deconstruct_computer(var/obj/machinery/computer/supplycomp/SC)
|
||||
if (..(SC))
|
||||
contraband_enabled = SC.can_order_contraband
|
||||
|
||||
/obj/item/weapon/circuitboard/operating
|
||||
name = "Circuit board (Operating Computer)"
|
||||
build_path = "/obj/machinery/computer/operating"
|
||||
@@ -400,12 +438,5 @@
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You connect the monitor."
|
||||
var/B = new src.circuit.build_path ( src.loc )
|
||||
if(istype(circuit,/obj/item/weapon/circuitboard/supplycomp))
|
||||
var/obj/machinery/computer/supplycomp/SC = B
|
||||
var/obj/item/weapon/circuitboard/supplycomp/C = circuit
|
||||
SC.can_order_contraband = C.contraband_enabled
|
||||
if(istype(circuit,/obj/item/weapon/circuitboard/security))
|
||||
var/obj/machinery/computer/security/C = B
|
||||
var/obj/item/weapon/circuitboard/security/CB = circuit
|
||||
C.network = CB.network
|
||||
src.circuit.construct_computer(B)
|
||||
del(src)
|
||||
@@ -9,6 +9,7 @@
|
||||
var/last_pic = 1.0
|
||||
var/list/network = list("SS13")
|
||||
var/mapping = 0//For the overview file, interesting bit of code.
|
||||
circuit = /obj/item/weapon/circuitboard/security
|
||||
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
@@ -85,39 +86,6 @@
|
||||
use_power(50)
|
||||
return 1
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/CF = new /obj/structure/computerframe(loc)
|
||||
new /obj/item/weapon/shard(loc)
|
||||
var/obj/item/weapon/circuitboard/security/CB = new /obj/item/weapon/circuitboard/security(CF)
|
||||
CB.network = network
|
||||
for (var/obj/C in src)
|
||||
C.loc = loc
|
||||
CF.circuit = CB
|
||||
CF.state = 3
|
||||
CF.icon_state = "3"
|
||||
CF.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/CF = new /obj/structure/computerframe( loc )
|
||||
var/obj/item/weapon/circuitboard/security/CB = new /obj/item/weapon/circuitboard/security(CF)
|
||||
CB.network = network
|
||||
for (var/obj/C in src)
|
||||
C.loc = loc
|
||||
CF.circuit = CB
|
||||
CF.state = 4
|
||||
CF.icon_state = "4"
|
||||
CF.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
//Camera control: moving.
|
||||
proc/jump_on_click(var/mob/user,var/A)
|
||||
if(user.machine != src)
|
||||
@@ -171,6 +139,7 @@
|
||||
icon_state = "telescreen"
|
||||
network = list("thunder")
|
||||
density = 0
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/telescreen/update_icon()
|
||||
icon_state = initial(icon_state)
|
||||
@@ -183,11 +152,13 @@
|
||||
desc = "Damn, why do they never have anything interesting on these things?"
|
||||
icon = 'icons/obj/status_display.dmi'
|
||||
icon_state = "entertainment"
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/wooden_tv
|
||||
name = "Security Cameras"
|
||||
desc = "An old TV hooked into the stations camera network."
|
||||
icon_state = "security_det"
|
||||
circuit = null
|
||||
|
||||
|
||||
/obj/machinery/computer/security/mining
|
||||
@@ -195,15 +166,18 @@
|
||||
desc = "Used to access the various cameras on the outpost."
|
||||
icon_state = "miningcameras"
|
||||
network = list("MINE")
|
||||
circuit = /obj/item/weapon/circuitboard/security/mining
|
||||
|
||||
/obj/machinery/computer/security/engineering
|
||||
name = "Engineering Cameras"
|
||||
desc = "Used to monitor fires and breaches."
|
||||
icon_state = "engineeringcameras"
|
||||
network = list("Engineering","Power Alarms","Atmosphere Alarms","Fire Alarms")
|
||||
circuit = /obj/item/weapon/circuitboard/security/engineering
|
||||
|
||||
/obj/machinery/computer/security/nuclear
|
||||
name = "Mission Monitor"
|
||||
desc = "Used to access the built-in cameras in helmets."
|
||||
icon_state = "syndicam"
|
||||
network = list("NUKE")
|
||||
circuit = null
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 300
|
||||
active_power_usage = 300
|
||||
var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassembly
|
||||
var/circuit = null //The path to the circuit board type. If circuit==null, the computer can't be disassembled.
|
||||
var/processing = 0
|
||||
|
||||
/obj/machinery/computer/New()
|
||||
@@ -120,6 +120,7 @@
|
||||
user << "\blue You disconnect the monitor."
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
M.deconstruct_computer(src)
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
|
||||
@@ -114,9 +114,7 @@
|
||||
if(component_check)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
del(O)
|
||||
new_machine.component_parts = list()
|
||||
new_machine.component_parts.Cut()
|
||||
for(var/obj/O in src)
|
||||
if(circuit.contain_parts) // things like disposal don't want their parts in them
|
||||
O.loc = new_machine
|
||||
|
||||
Reference in New Issue
Block a user