Merge pull request #6052 from PsiOmegaDelta/Mapping

Fixes #6027
This commit is contained in:
Ccomp5950
2014-08-19 12:01:14 -05:00
9 changed files with 244 additions and 297 deletions

View File

@@ -85,6 +85,7 @@ obj/machinery/computer/general_air_control
var/list/sensor_information = list()
var/datum/radio_frequency/radio_connection
circuit = /obj/item/weapon/circuitboard/air_management
attack_hand(mob/user)
if(..(user))
@@ -97,39 +98,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
@@ -196,6 +164,7 @@ obj/machinery/computer/general_air_control
var/list/output_info
var/pressure_setting = ONE_ATMOSPHERE * 45
circuit = /obj/item/weapon/circuitboard/air_management/tank_control
return_text()
@@ -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)

View File

@@ -19,30 +19,62 @@
icon_state = "id_mod"
item_state = "electronic"
origin_tech = "programming=2"
var/id = null
var/frequency = null
var/build_path = null
var/board_type = "computer"
var/list/req_components = null
var/powernet = null
var/list/records = null
var/frame_desc = null
var/contain_parts = 1
//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
*/
/obj/item/weapon/circuitboard/message_monitor
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 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 Camera Monitor)"
build_path = "/obj/machinery/computer/security/mining"
network = list("MINE")
req_access = list()
/obj/item/weapon/circuitboard/aicore
name = "Circuit board (AI core)"
name = "Circuit board (AI Core)"
origin_tech = "programming=4;biotech=2"
board_type = "other"
/obj/item/weapon/circuitboard/aiupload
@@ -91,14 +123,27 @@
name = "Circuit board (Station Alerts)"
build_path = "/obj/machinery/computer/station_alert"
/obj/item/weapon/circuitboard/atmospheresiphonswitch
name = "Circuit board (Atmosphere siphon control)"
name = "Circuit board (Atmosphere Siphon Control)"
build_path = "/obj/machinery/computer/atmosphere/siphonswitch"
/obj/item/weapon/circuitboard/air_management
name = "Circuit board (Atmospheric monitor)"
name = "Circuit board (Atmospheric Monitor)"
build_path = "/obj/machinery/computer/general_air_control"
/obj/item/weapon/circuitboard/injector_control
name = "Circuit board (Injector control)"
var/frequency = 1439
/obj/item/weapon/circuitboard/air_management/tank_control
name = "Circuit board (Tank Control)"
build_path = "/obj/machinery/computer/general_air_control/large_tank_control"
/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"
@@ -125,11 +170,11 @@
name = "Circuit board (Turbine control)"
build_path = "/obj/machinery/computer/turbine_computer"
/obj/item/weapon/circuitboard/solar_control
name = "Circuit board (Solar Control)" //name fixed 250810
name = "Circuit board (Solar Control)"
build_path = "/obj/machinery/power/solar_control"
origin_tech = "programming=2;powerstorage=2"
/obj/item/weapon/circuitboard/powermonitor
name = "Circuit board (Power Monitor)" //name fixed 250810
name = "Circuit board (Power Monitor)"
build_path = "/obj/machinery/power/monitor"
/obj/item/weapon/circuitboard/olddoor
name = "Circuit board (DoorMex)"
@@ -164,12 +209,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"
@@ -387,16 +441,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(circuit.powernet) B:powernet = circuit.powernet
if(circuit.id) B:id = circuit.id
if(circuit.records) B:records = circuit.records
if(circuit.frequency) B:frequency = circuit.frequency
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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -1,140 +1,134 @@
// the power monitoring computer
// for the moment, just report the status of all APCs in the same powernet
/obj/machinery/power/monitor
name = "power monitoring computer"
desc = "It monitors power levels across the station."
icon = 'icons/obj/computer.dmi'
icon_state = "power"
density = 1
anchored = 1
use_power = 2
idle_power_usage = 20
active_power_usage = 80
//fix for issue 521, by QualityVan.
//someone should really look into why circuits have a powernet var, it's several kinds of retarded.
/obj/machinery/power/monitor/New()
..()
var/obj/structure/cable/attached = null
var/turf/T = loc
if(isturf(T))
attached = locate() in T
if(attached)
powernet = attached.get_powernet()
/obj/machinery/power/monitor/attack_ai(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
/obj/machinery/power/monitor/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
/obj/machinery/power/monitor/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/powermonitor/M = new /obj/item/weapon/circuitboard/powermonitor( A )
for (var/obj/C in src)
C.loc = src.loc
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/powermonitor/M = new /obj/item/weapon/circuitboard/powermonitor( A )
for (var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 4
A.icon_state = "4"
A.anchored = 1
del(src)
else
src.attack_hand(user)
return
/obj/machinery/power/monitor/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=powcomp")
return
user.set_machine(src)
var/t = "<TT><B>Power Monitoring</B><HR>"
t += "<BR><HR><A href='?src=\ref[src];update=1'>Refresh</A>"
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A>"
if(!powernet)
t += "\red No connection"
else
var/list/L = list()
for(var/obj/machinery/power/terminal/term in powernet.nodes)
if(istype(term.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = term.master
L += A
t += "<PRE>Total power: [powernet.avail] W<BR>Total load: [num2text(powernet.viewload,10)] W<BR>"
t += "<FONT SIZE=-1>"
if(L.len > 0)
t += "Area Eqp./Lgt./Env. Load Cell<HR>"
var/list/S = list(" Off","AOff"," On", " AOn")
var/list/chg = list("N","C","F")
for(var/obj/machinery/power/apc/A in L)
t += copytext(add_tspace("\The [A.area]", 30), 1, 30)
t += " [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
t += "</FONT></PRE></TT>"
user << browse(t, "window=powcomp;size=420x900")
onclose(user, "powcomp")
/obj/machinery/power/monitor/Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=powcomp")
usr.unset_machine()
return
if( href_list["update"] )
src.updateDialog()
return
/obj/machinery/power/monitor/power_change()
..()
if(stat & BROKEN)
icon_state = "broken"
else
if (stat & NOPOWER)
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
else
icon_state = initial(icon_state)
// the power monitoring computer
// for the moment, just report the status of all APCs in the same powernet
/obj/machinery/power/monitor
name = "power monitoring computer"
desc = "It monitors power levels across the station."
icon = 'icons/obj/computer.dmi'
icon_state = "power"
//computer stuff
density = 1
anchored = 1.0
var/circuit = /obj/item/weapon/circuitboard/powermonitor
use_power = 1
idle_power_usage = 300
active_power_usage = 300
/obj/machinery/power/monitor/New()
..()
var/obj/structure/cable/attached = null
var/turf/T = loc
if(isturf(T))
attached = locate() in T
if(attached)
powernet = attached.get_powernet()
/obj/machinery/power/monitor/attack_ai(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
/obj/machinery/power/monitor/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
/obj/machinery/power/monitor/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=powcomp")
return
user.set_machine(src)
var/t = "<TT><B>Power Monitoring</B><HR>"
t += "<BR><HR><A href='?src=\ref[src];update=1'>Refresh</A>"
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A>"
if(!powernet)
t += "\red No connection"
else
var/list/L = list()
for(var/obj/machinery/power/terminal/term in powernet.nodes)
if(istype(term.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = term.master
L += A
t += "<PRE>Total power: [powernet.avail] W<BR>Total load: [num2text(powernet.viewload,10)] W<BR>"
t += "<FONT SIZE=-1>"
if(L.len > 0)
t += "Area Eqp./Lgt./Env. Load Cell<HR>"
var/list/S = list(" Off","AOff"," On", " AOn")
var/list/chg = list("N","C","F")
for(var/obj/machinery/power/apc/A in L)
t += copytext(add_tspace("\The [A.area]", 30), 1, 30)
t += " [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
t += "</FONT></PRE></TT>"
user << browse(t, "window=powcomp;size=420x900")
onclose(user, "powcomp")
/obj/machinery/power/monitor/Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=powcomp")
usr.unset_machine()
return
if( href_list["update"] )
src.updateDialog()
return
/obj/machinery/power/monitor/power_change()
..()
if(stat & BROKEN)
icon_state = "broken"
else
if (stat & NOPOWER)
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
else
icon_state = initial(icon_state)
//copied from computer.dm
/obj/machinery/power/monitor/attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/weapon/circuitboard/M = new circuit( A )
A.circuit = M
A.anchored = 1
for (var/obj/C in src)
C.loc = src.loc
if (src.stat & BROKEN)
user << "\blue The broken glass falls out."
new /obj/item/weapon/shard( src.loc )
A.state = 3
A.icon_state = "3"
else
user << "\blue You disconnect the monitor."
A.state = 4
A.icon_state = "4"
M.deconstruct_computer(src)
del(src)
else
src.attack_hand(user)
return

View File

@@ -385,12 +385,12 @@
/obj/machinery/power/smes/magical
name = "magical power storage unit"
desc = "A high-capacity superconducting magnetic energy storage (SMES) unit. Magically produces power."
process()
capacity = INFINITY
charge = INFINITY
..()
output = SMESMAXOUTPUT
/obj/machinery/power/smes/magical/process()
capacity = INFINITY
charge = INFINITY
..()
/proc/rate_control(var/S, var/V, var/C, var/Min=1, var/Max=5, var/Limit=null)
var/href = "<A href='?src=\ref[S];rate control=1;[V]"