initial commit - cross reference with 5th port - obviously has compile errors

This commit is contained in:
LetterJay
2016-07-03 02:17:19 -05:00
commit 35a1723e98
4355 changed files with 2221257 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
/obj/machinery/computer/operating
name = "operating computer"
desc = "Used to monitor the vitals of a patient during surgery."
icon_screen = "crew"
icon_keyboard = "med_key"
circuit = /obj/item/weapon/circuitboard/computer/operating
var/mob/living/carbon/human/patient = null
var/obj/structure/table/optable/table = null
/obj/machinery/computer/operating/New()
..()
if(ticker)
find_table()
/obj/machinery/computer/operating/initialize()
find_table()
/obj/machinery/computer/operating/proc/find_table()
for(var/dir in cardinal)
table = locate(/obj/structure/table/optable, get_step(src, dir))
if(table)
table.computer = src
break
/obj/machinery/computer/operating/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/computer/operating/interact(mob/user)
var/dat = ""
if(table)
dat += "<B>Patient information:</B><BR>"
if(table.check_patient())
patient = table.patient
dat += get_patient_info()
else
patient = null
dat += "<B>No patient detected</B>"
else
dat += "<B>Operating table not found.</B>"
var/datum/browser/popup = new(user, "op", "Operating Computer", 400, 500)
popup.set_content(dat)
popup.open()
/obj/machinery/computer/operating/proc/get_patient_info()
var/dat = {"
<div class='statusLabel'>Patient:</div> [patient.stat ? "<span class='bad'>Non-Responsive</span>" : "<span class='good'>Stable</span>"]<BR>
<div class='statusLabel'>Blood Type:</div> [patient.dna.blood_type]
<BR>
<div class='line'><div class='statusLabel'>Health:</div><div class='progressBar'><div style='width: [max(patient.health, 0)]%;' class='progressFill good'></div></div><div class='statusValue'>[patient.health]%</div></div>
<div class='line'><div class='statusLabel'>\> Brute Damage:</div><div class='progressBar'><div style='width: [max(patient.getBruteLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getBruteLoss()]%</div></div>
<div class='line'><div class='statusLabel'>\> Resp. Damage:</div><div class='progressBar'><div style='width: [max(patient.getOxyLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getOxyLoss()]%</div></div>
<div class='line'><div class='statusLabel'>\> Toxin Content:</div><div class='progressBar'><div style='width: [max(patient.getToxLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getToxLoss()]%</div></div>
<div class='line'><div class='statusLabel'>\> Burn Severity:</div><div class='progressBar'><div style='width: [max(patient.getFireLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getFireLoss()]%</div></div>
"}
if(patient.surgeries.len)
dat += "<BR><BR><B>Initiated Procedures</B><div class='statusDisplay'>"
for(var/datum/surgery/procedure in patient.surgeries)
dat += "[capitalize(procedure.name)]<BR>"
var/datum/surgery_step/surgery_step = procedure.get_surgery_step()
dat += "Next step: [capitalize(surgery_step.name)]<BR>"
dat += "</div>"
return dat
+147
View File
@@ -0,0 +1,147 @@
/obj/machinery/computer/aifixer
name = "\improper AI system integrity restorer"
desc = "Used with intelliCards containing nonfunctioning AIs to restore them to working order."
req_access = list(access_captain, access_robotics, access_heads)
var/mob/living/silicon/ai/occupier = null
var/active = 0
circuit = /obj/item/weapon/circuitboard/computer/aifixer
icon_keyboard = "tech_key"
icon_screen = "ai-fixer"
/obj/machinery/computer/aifixer/attackby(obj/I, mob/user, params)
if(occupier && istype(I, /obj/item/weapon/screwdriver))
if(stat & (NOPOWER|BROKEN))
user << "<span class='warning'>The screws on [name]'s screen won't budge.</span>"
else
user << "<span class='warning'>The screws on [name]'s screen won't budge and it emits a warning beep.</span>"
else
return ..()
/obj/machinery/computer/aifixer/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/computer/aifixer/interact(mob/user)
var/dat = ""
if (src.occupier)
var/laws
dat += "<h3>Stored AI: [src.occupier.name]</h3>"
dat += "<b>System integrity:</b> [(src.occupier.health+100)/2]%<br>"
if (src.occupier.laws.zeroth)
laws += "<b>0:</b> [src.occupier.laws.zeroth]<BR>"
for (var/index = 1, index <= src.occupier.laws.ion.len, index++)
var/law = src.occupier.laws.ion[index]
if (length(law) > 0)
var/num = ionnum()
laws += "<b>[num]:</b> [law]<BR>"
var/number = 1
for (var/index = 1, index <= src.occupier.laws.inherent.len, index++)
var/law = src.occupier.laws.inherent[index]
if (length(law) > 0)
laws += "<b>[number]:</b> [law]<BR>"
number++
for (var/index = 1, index <= src.occupier.laws.supplied.len, index++)
var/law = src.occupier.laws.supplied[index]
if (length(law) > 0)
laws += "<b>[number]:</b> [law]<BR>"
number++
dat += "<b>Laws:</b><br>[laws]<br>"
if (src.occupier.stat == 2)
dat += "<span class='bad'>AI non-functional</span>"
else
dat += "<span class='good'>AI functional</span>"
if (!src.active)
dat += {"<br><br><A href='byond://?src=\ref[src];fix=1'>Begin Reconstruction</A>"}
else
dat += "<br><br>Reconstruction in process, please wait.<br>"
dat += {"<br><A href='?src=\ref[user];mach_close=computer'>Close</A>"}
//user << browse(dat, "window=computer;size=400x500")
//onclose(user, "computer")
var/datum/browser/popup = new(user, "computer", "AI System Integrity Restorer", 400, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/aifixer/process()
if(..())
src.updateDialog()
return
/obj/machinery/computer/aifixer/Topic(href, href_list)
if(..())
return
if(href_list["fix"])
active = 1
while (occupier.health < 100)
occupier.adjustOxyLoss(-1, 0)
occupier.adjustFireLoss(-1, 0)
occupier.adjustToxLoss(-1, 0)
occupier.adjustBruteLoss(-1, 0)
occupier.updatehealth()
if(occupier.health >= 0 && occupier.stat == DEAD)
occupier.revive()
updateUsrDialog()
update_icon()
sleep(10)
active = 0
add_fingerprint(usr)
updateUsrDialog()
update_icon()
/obj/machinery/computer/aifixer/update_icon()
..()
if(stat & (NOPOWER|BROKEN))
return
else
if(active)
add_overlay("ai-fixer-on")
if (occupier)
switch (occupier.stat)
if (0)
add_overlay("ai-fixer-full")
if (2)
add_overlay("ai-fixer-404")
else
add_overlay("ai-fixer-empty")
/obj/machinery/computer/aifixer/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/device/aicard/card)
if(!..())
return
//Downloading AI from card to terminal.
if(interaction == AI_TRANS_FROM_CARD)
if(stat & (NOPOWER|BROKEN))
user << "[src] is offline and cannot take an AI at this time!"
return
AI.forceMove(src)
occupier = AI
AI.control_disabled = 1
AI.radio_enabled = 0
AI << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here."
user << "<span class='boldnotice'>Transfer successful</span>: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed."
card.AI = null
update_icon()
else //Uploading AI from terminal to card
if(occupier && !active)
occupier << "You have been downloaded to a mobile storage device. Still no remote access."
user << "<span class='boldnotice'>Transfer successful</span>: [occupier.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
occupier.loc = card
card.AI = occupier
occupier = null
update_icon()
else if (active)
user << "<span class='boldannounce'>ERROR</span>: Reconstruction in progress."
else if (!occupier)
user << "<span class='boldannounce'>ERROR</span>: Unable to locate artificial intelligence."
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,85 @@
/obj/machinery/computer/atmos_alert
name = "atmospheric alert console"
desc = "Used to monitor the station's air alarms."
circuit = /obj/item/weapon/circuitboard/computer/atmos_alert
icon_screen = "alert:0"
icon_keyboard = "atmos_key"
var/list/priority_alarms = list()
var/list/minor_alarms = list()
var/receive_frequency = 1437
var/datum/radio_frequency/radio_connection
/obj/machinery/computer/atmos_alert/initialize()
..()
set_frequency(receive_frequency)
/obj/machinery/computer/atmos_alert/Destroy()
if(SSradio)
SSradio.remove_object(src, receive_frequency)
return ..()
/obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_alert", name, 350, 300, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_alert/ui_data(mob/user)
var/list/data = list()
data["priority"] = list()
for(var/zone in priority_alarms)
data["priority"] += zone
data["minor"] = list()
for(var/zone in minor_alarms)
data["minor"] += zone
return data
/obj/machinery/computer/atmos_alert/ui_act(action, params)
if(..())
return
switch(action)
if("clear")
var/zone = params["zone"]
if(zone in priority_alarms)
usr << "Priority alarm for [zone] cleared."
priority_alarms -= zone
. = TRUE
if(zone in minor_alarms)
usr << "Minor alarm for [zone] cleared."
minor_alarms -= zone
. = TRUE
update_icon()
/obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency)
SSradio.remove_object(src, receive_frequency)
receive_frequency = new_frequency
radio_connection = SSradio.add_object(src, receive_frequency, RADIO_ATMOSIA)
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
if(!signal || signal.encryption) return
var/zone = signal.data["zone"]
var/severity = signal.data["alert"]
if(!zone || !severity) return
minor_alarms -= zone
priority_alarms -= zone
if(severity == "severe")
priority_alarms += zone
else if (severity == "minor")
minor_alarms += zone
update_icon()
return
/obj/machinery/computer/atmos_alert/update_icon()
..()
if(stat & (NOPOWER|BROKEN))
return
if(priority_alarms.len)
add_overlay("alert:2")
else if(minor_alarms.len)
add_overlay("alert:1")
@@ -0,0 +1,237 @@
/////////////////////////////////////////////////////////////
// AIR SENSOR (found in gas tanks)
/////////////////////////////////////////////////////////////
/obj/machinery/air_sensor
name = "gas sensor"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "gsensor1"
anchored = 1
var/on = TRUE
var/id_tag
var/frequency = 1441
var/datum/radio_frequency/radio_connection
/obj/machinery/air_sensor/update_icon()
icon_state = "gsensor[on]"
/obj/machinery/air_sensor/process_atmos()
if(on)
var/datum/signal/signal = new
var/datum/gas_mixture/air_sample = return_air()
signal.transmission_method = 1 //radio signal
signal.data = list(
"sigtype" = "status",
"id_tag" = id_tag,
"timestamp" = world.time,
"pressure" = air_sample.return_pressure(),
"temperature" = air_sample.temperature,
"gases" = list()
)
var/total_moles = air_sample.total_moles()
for(var/gas_id in air_sample.gases)
var/gas_name = air_sample.gases[gas_id][GAS_META][META_GAS_NAME]
signal.data["gases"][gas_name] = air_sample.gases[gas_id][MOLES] / total_moles * 100
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
/obj/machinery/air_sensor/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/air_sensor/initialize()
set_frequency(frequency)
/obj/machinery/air_sensor/New()
..()
SSair.atmos_machinery += src
if(SSradio)
set_frequency(frequency)
/obj/machinery/air_sensor/Destroy()
SSair.atmos_machinery -= src
if(SSradio)
SSradio.remove_object(src, frequency)
return ..()
/////////////////////////////////////////////////////////////
// GENERAL AIR CONTROL (a.k.a atmos computer)
/////////////////////////////////////////////////////////////
/obj/machinery/computer/atmos_control
name = "Atmospherics Monitoring"
desc = "Used to monitor the station's atmospherics sensors."
icon_screen = "tank"
icon_keyboard = "atmos_key"
circuit = /obj/item/weapon/circuitboard/computer/atmos_control
var/frequency = 1441
var/list/sensors = list(
"n2_sensor" = "Nitrogen Tank",
"o2_sensor" = "Oxygen Tank",
"co2_sensor" = "Carbon Dioxide Tank",
"tox_sensor" = "Plasma Tank",
"n2o_sensor" = "Nitrous Oxide Tank",
"air_sensor" = "Mixed Air Tank",
"mix_sensor" = "Mix Tank",
"distro_meter" = "Distribution Loop",
"waste_meter" = "Waste Loop",
)
var/list/sensor_information = list()
var/datum/radio_frequency/radio_connection
/obj/machinery/computer/atmos_control/New()
..()
if(SSradio)
set_frequency(frequency)
/obj/machinery/computer/atmos_control/Destroy()
if(SSradio)
SSradio.remove_object(src, frequency)
return ..()
/obj/machinery/computer/atmos_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_control", name, 400, 925, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_control/ui_data(mob/user)
var/data = list()
data["sensors"] = list()
for(var/id_tag in sensors)
var/long_name = sensors[id_tag]
var/list/info = sensor_information[id_tag]
if(!info)
continue
data["sensors"] += list(list(
"id_tag" = id_tag,
"long_name" = sanitize(long_name),
"pressure" = info["pressure"],
"temperature" = info["temperature"],
"gases" = info["gases"]
))
return data
/obj/machinery/computer/atmos_control/receive_signal(datum/signal/signal)
if(!signal || signal.encryption)
return
var/id_tag = signal.data["id_tag"]
if(!id_tag || !sensors.Find(id_tag))
return
sensor_information[id_tag] = signal.data
/obj/machinery/computer/atmos_control/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/computer/atmos_control/initialize()
set_frequency(frequency)
/////////////////////////////////////////////////////////////
// LARGE TANK CONTROL
/////////////////////////////////////////////////////////////
/obj/machinery/computer/atmos_control/tank
var/input_tag
var/output_tag
frequency = 1441
circuit = /obj/item/weapon/circuitboard/computer/atmos_control/tank
var/list/input_info
var/list/output_info
// This hacky madness is the evidence of the fact that a lot of machines were never meant to be constructable, im so sorry you had to see this
/obj/machinery/computer/atmos_control/tank/proc/reconnect(mob/user)
var/list/IO = list()
var/datum/radio_frequency/freq = SSradio.return_frequency(1441)
var/list/devices = freq.devices["_default"]
for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in devices)
var/list/text = splittext(U.id_tag, "_")
IO |= text[1]
for(var/obj/machinery/atmospherics/components/unary/outlet_injector/U in devices)
var/list/text = splittext(U.id, "_")
IO |= text[1]
if(!IO.len)
user << "<span class='alert'>No machinery detected.</span>"
var/S = input("Select the device set: ", "Selection", IO[1]) as anything in IO
if(src)
src.input_tag = "[S]_in"
src.output_tag = "[S]_out"
name = "[uppertext(S)] Supply Control"
var/list/new_devices = freq.devices["4"]
for(var/obj/machinery/air_sensor/U in new_devices)
var/list/text = splittext(U.id_tag, "_")
if(text[1] == S)
sensors = list("[S]_sensor" = "Tank")
break
for(var/obj/machinery/atmospherics/components/unary/outlet_injector/U in devices)
U.broadcast_status()
for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in devices)
U.broadcast_status()
/obj/machinery/computer/atmos_control/tank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_control", name, 500, 305, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_control/tank/ui_data(mob/user)
var/list/data = ..()
data["tank"] = TRUE
data["inputting"] = input_info ? input_info["power"] : FALSE
data["inputRate"] = input_info ? input_info["volume_rate"] : 0
data["outputting"] = output_info ? output_info["power"] : FALSE
data["outputPressure"] = output_info ? output_info["internal"] : 0
return data
/obj/machinery/computer/atmos_control/tank/ui_act(action, params)
if(..() || !radio_connection)
return
var/datum/signal/signal = new
signal.transmission_method = 1
signal.source = src
signal.data = list("sigtype" = "command")
switch(action)
if("reconnect")
reconnect(usr)
. = TRUE
if("input")
signal.data += list("tag" = input_tag, "power_toggle" = TRUE)
. = TRUE
if("output")
signal.data += list("tag" = output_tag, "power_toggle" = TRUE)
. = TRUE
if("pressure")
var/target = input("New target pressure:", name, output_info["internal"]) as num|null
if(!isnull(target) && !..())
target = Clamp(target, 0, 50 * ONE_ATMOSPHERE)
signal.data += list("tag" = output_tag, "set_internal_pressure" = target)
. = TRUE
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
/obj/machinery/computer/atmos_control/tank/receive_signal(datum/signal/signal)
if(!signal || signal.encryption)
return
var/id_tag = signal.data["tag"]
if(input_tag == id_tag)
input_info = signal.data
else if(output_tag == id_tag)
output_info = signal.data
else
..(signal)
@@ -0,0 +1,418 @@
/obj/structure/frame/computer
name = "computer frame"
icon_state = "0"
anchored = 0
state = 0
/obj/structure/frame/computer/attackby(obj/item/P, mob/user, params)
add_fingerprint(user)
switch(state)
if(0)
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You start wrenching the frame into place...</span>"
if(do_after(user, 20/P.toolspeed, target = src))
user << "<span class='notice'>You wrench the frame into place.</span>"
anchored = 1
state = 1
if(istype(P, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = P
if(!WT.remove_fuel(0, user))
if(!WT.isOn())
user << "<span class='warning'>The welding tool must be on to complete this task!</span>"
return
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
user << "<span class='notice'>You start deconstructing the frame...</span>"
if(do_after(user, 20/P.toolspeed, target = src))
if(!src || !WT.isOn()) return
user << "<span class='notice'>You deconstruct the frame.</span>"
var/obj/item/stack/sheet/metal/M = new (loc, 5)
M.add_fingerprint(user)
qdel(src)
if(1)
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You start to unfasten the frame...</span>"
if(do_after(user, 20/P.toolspeed, target = src))
user << "<span class='notice'>You unfasten the frame.</span>"
anchored = 0
state = 0
if(istype(P, /obj/item/weapon/circuitboard/computer) && !circuit)
if(!user.drop_item())
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You place the circuit board inside the frame.</span>"
icon_state = "1"
circuit = P
circuit.add_fingerprint(user)
P.loc = null
else if(istype(P, /obj/item/weapon/circuitboard) && !circuit)
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You screw the circuit board into place.</span>"
state = 2
icon_state = "2"
if(istype(P, /obj/item/weapon/crowbar) && circuit)
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the circuit board.</span>"
state = 1
icon_state = "0"
circuit.loc = src.loc
circuit.add_fingerprint(user)
circuit = null
if(2)
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You unfasten the circuit board.</span>"
state = 1
icon_state = "1"
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() >= 5)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You start adding cables to the frame...</span>"
if(do_after(user, 20/P.toolspeed, target = src))
if(C.get_amount() >= 5 && state == 2)
C.use(5)
user << "<span class='notice'>You add cables to the frame.</span>"
state = 3
icon_state = "3"
else
user << "<span class='warning'>You need five lengths of cable to wire the frame!</span>"
if(3)
if(istype(P, /obj/item/weapon/wirecutters))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
user << "<span class='notice'>You remove the cables.</span>"
state = 2
icon_state = "2"
var/obj/item/stack/cable_coil/A = new (loc)
A.amount = 5
A.add_fingerprint(user)
if(istype(P, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = P
if(G.get_amount() < 2)
user << "<span class='warning'>You need two glass sheets to continue construction!</span>"
return
else
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You start to put in the glass panel...</span>"
if(do_after(user, 20, target = src))
if(G.get_amount() >= 2 && state == 3)
G.use(2)
user << "<span class='notice'>You put in the glass panel.</span>"
state = 4
src.icon_state = "4"
if(4)
if(istype(P, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the glass panel.</span>"
state = 3
icon_state = "3"
var/obj/item/stack/sheet/glass/G = new (loc, 2)
G.add_fingerprint(user)
if(istype(P, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You connect the monitor.</span>"
var/obj/B = new src.circuit.build_path (src.loc, circuit)
transfer_fingerprints_to(B)
qdel(src)
/obj/item/weapon/circuitboard
name = "circuit board"
icon = 'icons/obj/module.dmi'
icon_state = "id_mod"
item_state = "electronic"
origin_tech = "programming=2"
materials = list(MAT_GLASS=1000)
w_class = 2
var/build_path = null
/obj/item/weapon/circuitboard/computer/turbine_computer
name = "circuit board (Turbine Computer)"
build_path = /obj/machinery/computer/turbine_computer
origin_tech = "programming=4;engineering=4;powerstorage=4"
/obj/item/weapon/circuitboard/computer/telesci_console
name = "circuit board (Telescience Console)"
build_path = /obj/machinery/computer/telescience
origin_tech = "programming=3;bluespace=3;plasmatech=4"
/obj/item/weapon/circuitboard/computer/message_monitor
name = "circuit board (Message Monitor)"
build_path = /obj/machinery/computer/message_monitor
origin_tech = "programming=2"
/obj/item/weapon/circuitboard/computer/security
name = "circuit board (Security Cameras)"
build_path = /obj/machinery/computer/security
origin_tech = "programming=2;combat=2"
/obj/item/weapon/circuitboard/computer/aiupload
name = "circuit board (AI Upload)"
build_path = /obj/machinery/computer/upload/ai
origin_tech = "programming=4;engineering=4"
/obj/item/weapon/circuitboard/computer/borgupload
name = "circuit board (Cyborg Upload)"
build_path = /obj/machinery/computer/upload/borg
origin_tech = "programming=4;engineering=4"
/obj/item/weapon/circuitboard/computer/med_data
name = "circuit board (Medical Records Console)"
build_path = /obj/machinery/computer/med_data
origin_tech = "programming=2;biotech=2"
/obj/item/weapon/circuitboard/computer/pandemic
name = "circuit board (PanD.E.M.I.C. 2200)"
build_path = /obj/machinery/computer/pandemic
origin_tech = "programming=2;biotech=2"
/obj/item/weapon/circuitboard/computer/scan_consolenew
name = "circuit board (DNA Machine)"
build_path = /obj/machinery/computer/scan_consolenew
origin_tech = "programming=2;biotech=2"
/obj/item/weapon/circuitboard/computer/communications
name = "circuit board (Communications)"
build_path = /obj/machinery/computer/communications
origin_tech = "programming=3;magnets=3"
var/lastTimeUsed = 0
/obj/item/weapon/circuitboard/computer/card
name = "circuit board (ID Console)"
build_path = /obj/machinery/computer/card
origin_tech = "programming=3"
/obj/item/weapon/circuitboard/computer/card/centcom
name = "circuit board (Centcom ID Console)"
build_path = /obj/machinery/computer/card/centcom
/obj/item/weapon/circuitboard/computer/card/minor
name = "circuit board (Department Management Console)"
build_path = /obj/machinery/computer/card/minor
var/target_dept = 1
var/list/dept_list = list("General","Security","Medical","Science","Engineering")
/obj/item/weapon/circuitboard/computer/card/minor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/screwdriver))
target_dept = (target_dept == dept_list.len) ? 1 : (target_dept + 1)
user << "<span class='notice'>You set the board to \"[dept_list[target_dept]]\".</span>"
else
return ..()
/obj/item/weapon/circuitboard/computer/card/minor/examine(user)
..()
user << "Currently set to \"[dept_list[target_dept]]\"."
//obj/item/weapon/circuitboard/computer/shield
// name = "Circuit board (Shield Control)"
// build_path = /obj/machinery/computer/stationshield
/obj/item/weapon/circuitboard/computer/teleporter
name = "circuit board (Teleporter)"
build_path = /obj/machinery/computer/teleporter
origin_tech = "programming=3;bluespace=3;plasmatech=3"
/obj/item/weapon/circuitboard/computer/secure_data
name = "circuit board (Security Records Console)"
build_path = /obj/machinery/computer/secure_data
origin_tech = "programming=2;combat=2"
/obj/item/weapon/circuitboard/computer/stationalert
name = "circuit board (Station Alerts)"
build_path = /obj/machinery/computer/station_alert
/*/obj/item/weapon/circuitboard/computer/atmospheresiphonswitch
name = "circuit board (Atmosphere siphon control)"
build_path = /obj/machinery/computer/atmosphere/siphonswitch*/
/obj/item/weapon/circuitboard/computer/atmos_control
name = "circuit board (Atmospheric Monitor)"
build_path = /obj/machinery/computer/atmos_control
/obj/item/weapon/circuitboard/computer/atmos_control/tank
name = "circuit board (Tank Control)"
build_path = /obj/machinery/computer/atmos_control/tank
origin_tech = "programming=2;engineering=3;materials=2"
/obj/item/weapon/circuitboard/computer/atmos_alert
name = "circuit board (Atmospheric Alert)"
build_path = /obj/machinery/computer/atmos_alert
/obj/item/weapon/circuitboard/computer/pod
name = "circuit board (Massdriver control)"
build_path = /obj/machinery/computer/pod
/obj/item/weapon/circuitboard/computer/robotics
name = "circuit board (Robotics Control)"
build_path = /obj/machinery/computer/robotics
origin_tech = "programming=3"
/obj/item/weapon/circuitboard/computer/cloning
name = "circuit board (Cloning)"
build_path = /obj/machinery/computer/cloning
origin_tech = "programming=2;biotech=2"
/obj/item/weapon/circuitboard/computer/arcade/battle
name = "circuit board (Arcade Battle)"
build_path = /obj/machinery/computer/arcade/battle
origin_tech = "programming=1"
/obj/item/weapon/circuitboard/computer/arcade/orion_trail
name = "circuit board (Orion Trail)"
build_path = /obj/machinery/computer/arcade/orion_trail
origin_tech = "programming=1"
/obj/item/weapon/circuitboard/computer/turbine_control
name = "circuit board (Turbine control)"
build_path = /obj/machinery/computer/turbine_computer
/obj/item/weapon/circuitboard/computer/solar_control
name = "circuit board (Solar Control)" //name fixed 250810
build_path = /obj/machinery/power/solar_control
origin_tech = "programming=2;powerstorage=2"
/obj/item/weapon/circuitboard/computer/powermonitor
name = "circuit board (Power Monitor)" //name fixed 250810
build_path = /obj/machinery/computer/monitor
origin_tech = "programming=2;powerstorage=2"
/obj/item/weapon/circuitboard/computer/olddoor
name = "circuit board (DoorMex)"
build_path = /obj/machinery/computer/pod/old
/obj/item/weapon/circuitboard/computer/syndicatedoor
name = "circuit board (ProComp Executive)"
build_path = /obj/machinery/computer/pod/old/syndicate
/obj/item/weapon/circuitboard/computer/swfdoor
name = "circuit board (Magix)"
build_path = /obj/machinery/computer/pod/old/swf
/obj/item/weapon/circuitboard/computer/prisoner
name = "circuit board (Prisoner Management Console)"
build_path = /obj/machinery/computer/prisoner
/obj/item/weapon/circuitboard/computer/gulag_teleporter_console
name = "circuit board (Labor Camp teleporter console)"
build_path = /obj/machinery/computer/gulag_teleporter_computer
/obj/item/weapon/circuitboard/computer/rdconsole
name = "circuit board (RD Console)"
build_path = /obj/machinery/computer/rdconsole/core
/obj/item/weapon/circuitboard/computer/rdconsole/attackby(obj/item/I, mob/user, params)
if(istype(I,/obj/item/weapon/screwdriver))
if(build_path == /obj/machinery/computer/rdconsole/core)
name = "circuit board (RD Console - Robotics)"
build_path = /obj/machinery/computer/rdconsole/robotics
user << "<span class='notice'>Access protocols successfully updated.</span>"
else
name = "circuit board (RD Console)"
build_path = /obj/machinery/computer/rdconsole/core
user << "<span class='notice'>Defaulting access protocols.</span>"
else
return ..()
/obj/item/weapon/circuitboard/computer/mecha_control
name = "circuit board (Exosuit Control Console)"
build_path = /obj/machinery/computer/mecha
/obj/item/weapon/circuitboard/computer/rdservercontrol
name = "circuit board (R&D Server Control)"
build_path = /obj/machinery/computer/rdservercontrol
/obj/item/weapon/circuitboard/computer/crew
name = "circuit board (Crew Monitoring Console)"
build_path = /obj/machinery/computer/crew
origin_tech = "programming=2;biotech=2"
/obj/item/weapon/circuitboard/computer/mech_bay_power_console
name = "circuit board (Mech Bay Power Control Console)"
build_path = /obj/machinery/computer/mech_bay_power_console
origin_tech = "programming=3;powerstorage=3"
/obj/item/weapon/circuitboard/computer/cargo
name = "circuit board (Supply Console)"
build_path = /obj/machinery/computer/cargo
origin_tech = "programming=3"
var/contraband = 0
var/emagged = 0
/obj/item/weapon/circuitboard/computer/cargo/attackby(obj/item/I, mob/user, params)
if(istype(I,/obj/item/device/multitool))
if(!emagged)
contraband = !contraband
user << "<span class='notice'>Receiver spectrum set to [contraband ? "Broad" : "Standard"].</span>"
else
user << "<span class='notice'>The spectrum chip is unresponsive.</span>"
else if(istype(I,/obj/item/weapon/card/emag))
if(!emagged)
contraband = TRUE
emagged = TRUE
user << "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>"
else
return ..()
/obj/item/weapon/circuitboard/computer/cargo/request
name = "circuit board (Supply Request Console)"
build_path = /obj/machinery/computer/cargo/request
/obj/item/weapon/circuitboard/computer/operating
name = "circuit board (Operating Computer)"
build_path = /obj/machinery/computer/operating
origin_tech = "programming=2;biotech=3"
/obj/item/weapon/circuitboard/computer/mining
name = "circuit board (Outpost Status Display)"
build_path = /obj/machinery/computer/security/mining
/obj/item/weapon/circuitboard/computer/comm_monitor
name = "circuit board (Telecommunications Monitor)"
build_path = /obj/machinery/computer/telecomms/monitor
origin_tech = "programming=3;magnets=3;bluespace=2"
/obj/item/weapon/circuitboard/computer/comm_server
name = "circuit board (Telecommunications Server Monitor)"
build_path = /obj/machinery/computer/telecomms/server
origin_tech = "programming=3;magnets=3;bluespace=2"
/obj/item/weapon/circuitboard/computer/shuttle
name = "circuit board (Shuttle)"
build_path = /obj/machinery/computer/shuttle
var/shuttleId
var/possible_destinations = ""
/obj/item/weapon/circuitboard/computer/shuttle/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/multitool))
var/chosen_id = round(input(usr, "Choose an ID number (-1 for reset):", "Input an Integer", null) as num|null)
if(chosen_id >= 0)
shuttleId = chosen_id
else
shuttleId = initial(shuttleId)
else
return ..()
/obj/item/weapon/circuitboard/computer/labor_shuttle
name = "circuit board (Labor Shuttle)"
build_path = /obj/machinery/computer/shuttle/labor
/obj/item/weapon/circuitboard/computer/labor_shuttle/one_way
name = "circuit board (Prisoner Shuttle Console)"
build_path = /obj/machinery/computer/shuttle/labor/one_way
/obj/item/weapon/circuitboard/computer/ferry
name = "circuit board (Transport Ferry)"
build_path = /obj/machinery/computer/shuttle/ferry
/obj/item/weapon/circuitboard/computer/ferry/request
name = "circuit board (Transport Ferry Console)"
build_path = /obj/machinery/computer/shuttle/ferry/request
/obj/item/weapon/circuitboard/computer/mining_shuttle
name = "circuit board (Mining Shuttle)"
build_path = /obj/machinery/computer/shuttle/mining
/obj/item/weapon/circuitboard/computer/white_ship
name = "circuit board (White Ship)"
build_path = /obj/machinery/computer/shuttle/white_ship
/obj/item/weapon/circuitboard/computer/holodeck// Not going to let people get this, but it's just here for future
name = "circuit board (Holodeck Control)"
build_path = /obj/machinery/computer/holodeck
origin_tech = "programming=4"
/obj/item/weapon/circuitboard/computer/aifixer
name = "circuit board (AI Integrity Restorer)"
build_path = /obj/machinery/computer/aifixer
origin_tech = "programming=2;biotech=2"
/*/obj/item/weapon/circuitboard/computer/prison_shuttle
name = "circuit board (Prison Shuttle)"
build_path = /obj/machinery/computer/prison_shuttle*/
/obj/item/weapon/circuitboard/computer/slot_machine
name = "circuit board (Slot Machine)"
build_path = /obj/machinery/computer/slot_machine
origin_tech = "programming=1"
/obj/item/weapon/circuitboard/computer/libraryconsole
name = "circuit board (Library Visitor Console)"
build_path = /obj/machinery/computer/libraryconsole
origin_tech = "programming=1"
/obj/item/weapon/circuitboard/computer/libraryconsole/attackby(obj/item/I, mob/user, params)
if(istype(I,/obj/item/weapon/screwdriver))
if(build_path == /obj/machinery/computer/libraryconsole/bookmanagement)
name = "circuit board (Library Visitor Console)"
build_path = /obj/machinery/computer/libraryconsole
user << "<span class='notice'>Defaulting access protocols.</span>"
else
name = "circuit board (Book Inventory Management Console)"
build_path = /obj/machinery/computer/libraryconsole/bookmanagement
user << "<span class='notice'>Access protocols successfully updated.</span>"
else
return ..()
+181
View File
@@ -0,0 +1,181 @@
/obj/machinery/computer/security
name = "security camera console"
desc = "Used to access the various cameras on the station."
icon_screen = "cameras"
icon_keyboard = "security_key"
circuit = /obj/item/weapon/circuitboard/computer/security
var/last_pic = 1
var/list/network = list("SS13")
var/mapping = 0//For the overview file, interesting bit of code.
var/list/watchers = list() //who's using the console, associated with the camera they're on.
/obj/machinery/computer/security/check_eye(mob/user)
if( (stat & (NOPOWER|BROKEN)) || user.incapacitated() || user.eye_blind )
user.unset_machine()
return
if(!(user in watchers))
user.unset_machine()
return
if(!watchers[user])
user.unset_machine()
return
var/obj/machinery/camera/C = watchers[user]
if(!C.can_use())
user.unset_machine()
return
if(!issilicon(user))
if(!Adjacent(user))
user.unset_machine()
return
else if(isrobot(user))
var/list/viewing = viewers(src)
if(!viewing.Find(user))
user.unset_machine()
/obj/machinery/computer/security/on_unset_machine(mob/user)
watchers.Remove(user)
user.reset_perspective(null)
/obj/machinery/computer/security/Destroy()
if(watchers.len)
for(var/mob/M in watchers)
M.unset_machine() //to properly reset the view of the users if the console is deleted.
return ..()
/obj/machinery/computer/security/attack_hand(mob/user)
if(stat)
return
if (!network)
throw EXCEPTION("No camera network")
user.unset_machine()
return
if (!(istype(network,/list)))
throw EXCEPTION("Camera network is not a list")
user.unset_machine()
return
if(..())
user.unset_machine()
return
var/list/camera_list = get_available_cameras()
if(!(user in watchers))
for(var/Num in camera_list)
var/obj/machinery/camera/CAM = camera_list[Num]
if(istype(CAM))
if(CAM.can_use())
watchers[user] = CAM //let's give the user the first usable camera, and then let him change to the camera he wants.
break
if(!(user in watchers))
user.unset_machine() // no usable camera on the network, we disconnect the user from the computer.
return
use_camera_console(user)
/obj/machinery/computer/security/proc/use_camera_console(mob/user)
var/list/camera_list = get_available_cameras()
var/t = input(user, "Which camera should you change to?") as null|anything in camera_list
if(user.machine != src) //while we were choosing we got disconnected from our computer or are using another machine.
return
if(!t)
user.unset_machine()
return
var/obj/machinery/camera/C = camera_list[t]
if(t == "Cancel")
user.unset_machine()
return
if(C)
var/camera_fail = 0
if(!C.can_use() || user.machine != src || user.eye_blind || user.incapacitated())
camera_fail = 1
else if(isrobot(user))
var/list/viewing = viewers(src)
if(!viewing.Find(user))
camera_fail = 1
else if(!issilicon(user))
if(!Adjacent(user))
camera_fail = 1
if(camera_fail)
user.unset_machine()
return 0
if(isAI(user))
var/mob/living/silicon/ai/A = user
A.eyeobj.setLoc(get_turf(C))
A.client.eye = A.eyeobj
else
user.reset_perspective(C)
watchers[user] = C
use_power(50)
addtimer(src, "use_camera_console", 5, FALSE, user)
else
user.unset_machine()
//returns the list of cameras accessible from this computer
/obj/machinery/computer/security/proc/get_available_cameras()
var/list/L = list()
for (var/obj/machinery/camera/C in cameranet.cameras)
if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve feed from same z_level cameras
continue
L.Add(C)
camera_sort(L)
var/list/D = list()
D["Cancel"] = "Cancel"
for(var/obj/machinery/camera/C in L)
if(!C.network)
spawn(0)
throw EXCEPTION("Camera in a cameranet has no camera network")
continue
if(!(istype(C.network,/list)))
spawn(0)
throw EXCEPTION("Camera in a cameranet has a non-list camera network")
continue
var/list/tempnetwork = C.network&network
if(tempnetwork.len)
D["[C.c_tag][(C.status ? null : " (Deactivated)")]"] = C
return D
/obj/machinery/computer/security/telescreen
name = "\improper Telescreen"
desc = "Used for watching an empty arena."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "telescreen"
network = list("thunder")
density = 0
circuit = null
clockwork = TRUE //it'd look very weird
/obj/machinery/computer/security/telescreen/update_icon()
icon_state = initial(icon_state)
if(stat & BROKEN)
icon_state += "b"
return
/obj/machinery/computer/security/telescreen/entertainment
name = "entertainment monitor"
desc = "Damn, they better have the /tg/ channel on these things."
icon = 'icons/obj/status_display.dmi'
icon_state = "entertainment"
network = list("thunder")
density = 0
circuit = null
/obj/machinery/computer/security/wooden_tv
name = "security camera monitor"
desc = "An old TV hooked into the stations camera network."
icon_state = "television"
icon_keyboard = null
icon_screen = "detective_tv"
clockwork = TRUE //it'd look weird
/obj/machinery/computer/security/mining
name = "outpost camera console"
desc = "Used to access the various cameras on the outpost."
icon_screen = "mining"
icon_keyboard = "mining_key"
network = list("MINE")
circuit = /obj/item/weapon/circuitboard/computer/mining
@@ -0,0 +1,181 @@
/obj/machinery/computer/camera_advanced
name = "advanced camera console"
desc = "Used to access the various cameras on the station."
icon_screen = "cameras"
icon_keyboard = "security_key"
var/mob/camera/aiEye/remote/eyeobj
var/mob/living/carbon/human/current_user = null
var/list/networks = list("SS13")
var/datum/action/innate/camera_off/off_action = new
var/datum/action/innate/camera_jump/jump_action = new
/obj/machinery/computer/camera_advanced/proc/CreateEye()
eyeobj = new()
eyeobj.origin = src
/obj/machinery/computer/camera_advanced/proc/GrantActions(mob/living/carbon/user)
off_action.target = user
off_action.Grant(user)
jump_action.target = user
jump_action.Grant(user)
/obj/machinery/computer/camera_advanced/check_eye(mob/user)
if( (stat & (NOPOWER|BROKEN)) || !Adjacent(user) || user.eye_blind || user.incapacitated() )
user.unset_machine()
/obj/machinery/computer/camera_advanced/Destroy()
if(current_user)
current_user.unset_machine()
if(eyeobj)
qdel(eyeobj)
return ..()
/obj/machinery/computer/camera_advanced/on_unset_machine(mob/M)
if(M == current_user)
off_action.Activate()
/obj/machinery/computer/camera_advanced/attack_hand(mob/user)
if(current_user)
user << "The console is already in use!"
return
if(!iscarbon(user))
return
if(..())
return
var/mob/living/carbon/L = user
if(!eyeobj)
CreateEye()
if(!eyeobj.initialized)
var/camera_location
for(var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
if(C.network&networks)
camera_location = get_turf(C)
break
if(camera_location)
eyeobj.initialized = 1
give_eye_control(L)
eyeobj.setLoc(camera_location)
else
user.unset_machine()
else
give_eye_control(L)
eyeobj.setLoc(eyeobj.loc)
/obj/machinery/computer/camera_advanced/proc/give_eye_control(mob/user)
GrantActions(user)
current_user = user
eyeobj.eye_user = user
eyeobj.name = "Camera Eye ([user.name])"
user.remote_control = eyeobj
user.reset_perspective(eyeobj)
/mob/camera/aiEye/remote
name = "Inactive Camera Eye"
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
var/mob/living/carbon/human/eye_user = null
var/obj/machinery/computer/camera_advanced/origin
var/initialized = 0
var/visible_icon = 0
var/image/user_image = null
/mob/camera/aiEye/remote/Destroy()
eye_user = null
origin = null
return ..()
/mob/camera/aiEye/remote/GetViewerClient()
if(eye_user)
return eye_user.client
return null
/mob/camera/aiEye/remote/setLoc(T)
if(eye_user)
if(!isturf(eye_user.loc))
return
T = get_turf(T)
loc = T
cameranet.visibility(src)
if(visible_icon)
if(eye_user.client)
eye_user.client.images -= user_image
user_image = image(icon,loc,icon_state,FLY_LAYER)
eye_user.client.images += user_image
/mob/camera/aiEye/remote/relaymove(mob/user,direct)
var/initial = initial(sprint)
var/max_sprint = 50
if(cooldown && cooldown < world.timeofday) // 3 seconds
sprint = initial
for(var/i = 0; i < max(sprint, initial); i += 20)
var/turf/step = get_turf(get_step(src, direct))
if(step)
src.setLoc(step)
cooldown = world.timeofday + 5
if(acceleration)
sprint = min(sprint + 0.5, max_sprint)
else
sprint = initial
/datum/action/innate/camera_off
name = "End Camera View"
button_icon_state = "camera_off"
/datum/action/innate/camera_off/Activate()
if(!target || !iscarbon(target))
return
var/mob/living/carbon/C = target
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
remote_eye.origin.current_user = null
remote_eye.origin.jump_action.Remove(C)
remote_eye.eye_user = null
if(C.client)
C.reset_perspective(null)
if(remote_eye.visible_icon)
C.client.images -= remote_eye.user_image
for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks)
C.client.images -= chunk.obscured
C.remote_control = null
C.unset_machine()
src.Remove(C)
/datum/action/innate/camera_jump
name = "Jump To Camera"
button_icon_state = "camera_jump"
/datum/action/innate/camera_jump/Activate()
if(!target || !iscarbon(target))
return
var/mob/living/carbon/C = target
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/origin = remote_eye.origin
var/list/L = list()
for (var/obj/machinery/camera/cam in cameranet.cameras)
L.Add(cam)
camera_sort(L)
var/list/T = list()
for (var/obj/machinery/camera/netcam in L)
var/list/tempnetwork = netcam.network&origin.networks
if (tempnetwork.len)
T[text("[][]", netcam.c_tag, (netcam.can_use() ? null : " (Deactivated)"))] = netcam
var/camera = input("Choose which camera you want to view", "Cameras") as null|anything in T
var/obj/machinery/camera/final = T[camera]
if(final)
remote_eye.setLoc(get_turf(final))
+519
View File
@@ -0,0 +1,519 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
//Keeps track of the time for the ID console. Having it as a global variable prevents people from dismantling/reassembling it to
//increase the slots of many jobs.
var/time_last_changed_position = 0
/obj/machinery/computer/card
name = "identification console"
desc = "You can use this to manage jobs and ID access."
icon_screen = "id"
icon_keyboard = "id_key"
req_one_access = list(access_heads, access_change_ids)
circuit = /obj/item/weapon/circuitboard/computer/card
var/obj/item/weapon/card/id/scan = null
var/obj/item/weapon/card/id/modify = null
var/authenticated = 0
var/mode = 0
var/printing = null
var/list/region_access = null
var/list/head_subordinates = null
var/target_dept = 0 //Which department this computer has access to. 0=all departments
//Cooldown for closing positions in seconds
//if set to -1: No cooldown... probably a bad idea
//if set to 0: Not able to close "original" positions. You can only close positions that you have opened before
var/change_position_cooldown = 60
//Jobs you cannot open new positions for
var/list/blacklisted = list(
"AI",
"Assistant",
"Cyborg",
"Captain",
"Head of Personnel",
"Head of Security",
"Chief Engineer",
"Research Director",
"Chief Medical Officer",
"Chaplain")
//The scaling factor of max total positions in relation to the total amount of people on board the station in %
var/max_relative_positions = 30 //30%: Seems reasonable, limit of 6 @ 20 players
//This is used to keep track of opened positions for jobs to allow instant closing
//Assoc array: "JobName" = (int)<Opened Positions>
var/list/opened_positions = list();
/obj/machinery/computer/card/attackby(obj/O, mob/user, params)//TODO:SANITY
if(istype(O, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/idcard = O
if(check_access(idcard))
if(!scan)
if(!usr.drop_item())
return
idcard.loc = src
scan = idcard
else if(!modify)
if(!usr.drop_item())
return
idcard.loc = src
modify = idcard
else
if(!modify)
if(!usr.drop_item())
return
idcard.loc = src
modify = idcard
else
return ..()
//Check if you can't open a new position for a certain job
/obj/machinery/computer/card/proc/job_blacklisted(jobtitle)
return (jobtitle in blacklisted)
//Logic check for Topic() if you can open the job
/obj/machinery/computer/card/proc/can_open_job(datum/job/job)
if(job)
if(!job_blacklisted(job.title))
if((job.total_positions <= player_list.len * (max_relative_positions / 100)))
var/delta = (world.time / 10) - time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
return 1
return -2
return -1
return 0
//Logic check for Topic() if you can close the job
/obj/machinery/computer/card/proc/can_close_job(datum/job/job)
if(job)
if(!job_blacklisted(job.title))
if(job.total_positions > job.current_positions)
var/delta = (world.time / 10) - time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
return 1
return -2
return -1
return 0
/obj/machinery/computer/card/attack_hand(mob/user)
if(..())
return
user.set_machine(src)
var/dat
if(!ticker)
return
if (mode == 1) // accessing crew manifest
var/crew = ""
for(var/datum/data/record/t in sortRecord(data_core.general))
crew += t.fields["name"] + " - " + t.fields["rank"] + "<br>"
dat = "<tt><b>Crew Manifest:</b><br>Please use security record computer to modify entries.<br><br>[crew]<a href='?src=\ref[src];choice=print'>Print</a><br><br><a href='?src=\ref[src];choice=mode;mode_target=0'>Access ID modification console.</a><br></tt>"
else if(mode == 2)
// JOB MANAGEMENT
dat = "<a href='?src=\ref[src];choice=return'>Return</a>"
dat += " || Confirm Identity: "
var/S
if(scan)
S = html_encode(scan.name)
else
S = "--------"
dat += "<a href='?src=\ref[src];choice=scan'>[S]</a>"
dat += "<table>"
dat += "<tr><td style='width:25%'><b>Job</b></td><td style='width:25%'><b>Slots</b></td><td style='width:25%'><b>Open job</b></td><td style='width:25%'><b>Close job</b></td></tr>"
var/ID
if(scan && (access_change_ids in scan.access) && !target_dept)
ID = 1
else
ID = 0
for(var/datum/job/job in SSjob.occupations)
dat += "<tr>"
if(job.title in blacklisted)
continue
dat += "<td>[job.title]</td>"
dat += "<td>[job.current_positions]/[job.total_positions]</td>"
dat += "<td>"
switch(can_open_job(job))
if(1)
if(ID)
dat += "<a href='?src=\ref[src];choice=make_job_available;job=[job.title]'>Open Position</a><br>"
else
dat += "Open Position"
if(-1)
dat += "Denied"
if(-2)
var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1)
var/mins = round(time_to_wait / 60)
var/seconds = time_to_wait - (60*mins)
dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]"
if(0)
dat += "Denied"
dat += "</td><td>"
switch(can_close_job(job))
if(1)
if(ID)
dat += "<a href='?src=\ref[src];choice=make_job_unavailable;job=[job.title]'>Close Position</a>"
else
dat += "Close Position"
if(-1)
dat += "Denied"
if(-2)
var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1)
var/mins = round(time_to_wait / 60)
var/seconds = time_to_wait - (60*mins)
dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]"
if(0)
dat += "Denied"
dat += "</td></tr>"
dat += "</table>"
else
var/header = ""
var/target_name
var/target_owner
var/target_rank
if(modify)
target_name = html_encode(modify.name)
else
target_name = "--------"
if(modify && modify.registered_name)
target_owner = html_encode(modify.registered_name)
else
target_owner = "--------"
if(modify && modify.assignment)
target_rank = html_encode(modify.assignment)
else
target_rank = "Unassigned"
var/scan_name
if(scan)
scan_name = html_encode(scan.name)
else
scan_name = "--------"
if(!authenticated)
header += "<br><i>Please insert the cards into the slots</i><br>"
header += "Target: <a href='?src=\ref[src];choice=modify'>[target_name]</a><br>"
header += "Confirm Identity: <a href='?src=\ref[src];choice=scan'>[scan_name]</a><br>"
else
header += "<div align='center'><br>"
header += "<a href='?src=\ref[src];choice=modify'>Remove [target_name]</a> || "
header += "<a href='?src=\ref[src];choice=scan'>Remove [scan_name]</a> <br> "
header += "<a href='?src=\ref[src];choice=mode;mode_target=1'>Access Crew Manifest</a> || "
header += "<a href='?src=\ref[src];choice=logout'>Log Out</a></div>"
header += "<hr>"
var/jobs_all = ""
var/list/alljobs = list("Unassigned")
alljobs += (istype(src,/obj/machinery/computer/card/centcom)? get_all_centcom_jobs() : get_all_jobs()) + "Custom"
for(var/job in alljobs)
jobs_all += "<a href='?src=\ref[src];choice=assign;assign_target=[job]'>[replacetext(job, " ", "&nbsp")]</a> " //make sure there isn't a line break in the middle of a job
var/body
if (authenticated && modify)
var/carddesc = text("")
var/jobs = text("")
if( authenticated == 2)
carddesc += {"<script type="text/javascript">
function markRed(){
var nameField = document.getElementById('namefield');
nameField.style.backgroundColor = "#FFDDDD";
}
function markGreen(){
var nameField = document.getElementById('namefield');
nameField.style.backgroundColor = "#DDFFDD";
}
function showAll(){
var allJobsSlot = document.getElementById('alljobsslot');
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
}
function hideAll(){
var allJobsSlot = document.getElementById('alljobsslot');
allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>show</a>";
}
</script>"}
carddesc += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
carddesc += "<input type='hidden' name='src' value='\ref[src]'>"
carddesc += "<input type='hidden' name='choice' value='reg'>"
carddesc += "<b>registered name:</b> <input type='text' id='namefield' name='reg' value='[target_owner]' style='width:250px; background-color:white;' onchange='markRed()'>"
carddesc += "<input type='submit' value='Rename' onclick='markGreen()'>"
carddesc += "</form>"
carddesc += "<b>Assignment:</b> "
jobs += "<span id='alljobsslot'><a href='#' onclick='showAll()'>[target_rank]</a></span>" //CHECK THIS
else
carddesc += "<b>registered_name:</b> [target_owner]</span>"
jobs += "<b>Assignment:</b> [target_rank] (<a href='?src=\ref[src];choice=demote'>Demote</a>)</span>"
var/accesses = ""
if(istype(src,/obj/machinery/computer/card/centcom))
accesses += "<h5>Central Command:</h5>"
for(var/A in get_all_centcom_access())
if(A in modify.access)
accesses += "<a href='?src=\ref[src];choice=access;access_target=[A];allowed=0'><font color=\"red\">[replacetext(get_centcom_access_desc(A), " ", "&nbsp")]</font></a> "
else
accesses += "<a href='?src=\ref[src];choice=access;access_target=[A];allowed=1'>[replacetext(get_centcom_access_desc(A), " ", "&nbsp")]</a> "
else
accesses += "<div align='center'><b>Access</b></div>"
accesses += "<table style='width:100%'>"
accesses += "<tr>"
for(var/i = 1; i <= 7; i++)
if(authenticated == 1 && !(i in region_access))
continue
accesses += "<td style='width:14%'><b>[get_region_accesses_name(i)]:</b></td>"
accesses += "</tr><tr>"
for(var/i = 1; i <= 7; i++)
if(authenticated == 1 && !(i in region_access))
continue
accesses += "<td style='width:14%' valign='top'>"
for(var/A in get_region_accesses(i))
if(A in modify.access)
accesses += "<a href='?src=\ref[src];choice=access;access_target=[A];allowed=0'><font color=\"red\">[replacetext(get_access_desc(A), " ", "&nbsp")]</font></a> "
else
accesses += "<a href='?src=\ref[src];choice=access;access_target=[A];allowed=1'>[replacetext(get_access_desc(A), " ", "&nbsp")]</a> "
accesses += "<br>"
accesses += "</td>"
accesses += "</tr></table>"
body = "[carddesc]<br>[jobs]<br><br>[accesses]" //CHECK THIS
else
body = "<a href='?src=\ref[src];choice=auth'>{Log in}</a> <br><hr>"
body += "<a href='?src=\ref[src];choice=mode;mode_target=1'>Access Crew Manifest</a>"
if(!target_dept)
body += "<br><hr><a href = '?src=\ref[src];choice=mode;mode_target=2'>Job Management</a>"
dat = "<tt>[header][body]<hr><br></tt>"
//user << browse(dat, "window=id_com;size=900x520")
//onclose(user, "id_com")
var/datum/browser/popup = new(user, "id_com", src.name, 900, 620)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/card/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
switch(href_list["choice"])
if ("modify")
if (modify)
data_core.manifest_modify(modify.registered_name, modify.assignment)
modify.update_label()
modify.loc = loc
modify.verb_pickup()
modify = null
region_access = null
head_subordinates = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
if(!usr.drop_item())
return
I.loc = src
modify = I
authenticated = 0
if ("scan")
if (scan)
scan.loc = src.loc
scan.verb_pickup()
scan = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
if(!usr.drop_item())
return
I.loc = src
scan = I
authenticated = 0
if ("auth")
if ((!( authenticated ) && (scan || (istype(usr, /mob/living/silicon))) && (modify || mode)))
if (check_access(scan))
region_access = list()
head_subordinates = list()
if(access_change_ids in scan.access)
if(target_dept)
head_subordinates = get_all_jobs()
region_access |= target_dept
authenticated = 1
else
authenticated = 2
else
if((access_hop in scan.access) && ((target_dept==1) || !target_dept))
region_access |= 1
region_access |= 6
get_subordinates("Head of Personnel")
if((access_hos in scan.access) && ((target_dept==2) || !target_dept))
region_access |= 2
get_subordinates("Head of Security")
if((access_cmo in scan.access) && ((target_dept==3) || !target_dept))
region_access |= 3
get_subordinates("Chief Medical Officer")
if((access_rd in scan.access) && ((target_dept==4) || !target_dept))
region_access |= 4
get_subordinates("Research Director")
if((access_ce in scan.access) && ((target_dept==5) || !target_dept))
region_access |= 5
get_subordinates("Chief Engineer")
if(region_access)
authenticated = 1
else if ((!( authenticated ) && (istype(usr, /mob/living/silicon))) && (!modify))
usr << "<span class='warning'>You can't modify an ID without an ID inserted to modify! Once one is in the modify slot on the computer, you can log in.</span>"
if ("logout")
region_access = null
head_subordinates = null
authenticated = 0
if("access")
if(href_list["allowed"])
if(authenticated)
var/access_type = text2num(href_list["access_target"])
var/access_allowed = text2num(href_list["allowed"])
if(access_type in (istype(src,/obj/machinery/computer/card/centcom)?get_all_centcom_access() : get_all_accesses()))
modify.access -= access_type
if(access_allowed == 1)
modify.access += access_type
if ("assign")
if (authenticated == 2)
var/t1 = href_list["assign_target"]
if(t1 == "Custom")
var/newJob = reject_bad_text(input("Enter a custom job assignment.", "Assignment", modify ? modify.assignment : "Unassigned"), MAX_NAME_LEN)
if(newJob)
t1 = newJob
else if(t1 == "Unassigned")
modify.access -= get_all_accesses()
else
var/datum/job/jobdatum
for(var/jobtype in typesof(/datum/job))
var/datum/job/J = new jobtype
if(ckey(J.title) == ckey(t1))
jobdatum = J
break
if(!jobdatum)
usr << "<span class='error'>No log exists for this job.</span>"
return
modify.access = ( istype(src,/obj/machinery/computer/card/centcom) ? get_centcom_access(t1) : jobdatum.get_access() )
if (modify)
modify.assignment = t1
if ("demote")
if(modify.assignment in head_subordinates || modify.assignment == "Assistant")
modify.assignment = "Unassigned"
else
usr << "<span class='error'>You are not authorized to demote this position.</span>"
if ("reg")
if (authenticated)
var/t2 = modify
//var/t1 = input(usr, "What name?", "ID computer", null) as text
if ((authenticated && modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
var/newName = reject_bad_name(href_list["reg"])
if(newName)
modify.registered_name = newName
else
usr << "<span class='error'>Invalid name entered.</span>"
return
if ("mode")
mode = text2num(href_list["mode_target"])
if("return")
//DISPLAY MAIN MENU
mode = 3;
if("make_job_available")
// MAKE ANOTHER JOB POSITION AVAILABLE FOR LATE JOINERS
if(scan && (access_change_ids in scan.access) && !target_dept)
var/edit_job_target = href_list["job"]
var/datum/job/j = SSjob.GetJob(edit_job_target)
if(!j)
return 0
if(can_open_job(j) != 1)
return 0
if(opened_positions[edit_job_target] >= 0)
time_last_changed_position = world.time / 10
j.total_positions++
opened_positions[edit_job_target]++
if("make_job_unavailable")
// MAKE JOB POSITION UNAVAILABLE FOR LATE JOINERS
if(scan && (access_change_ids in scan.access) && !target_dept)
var/edit_job_target = href_list["job"]
var/datum/job/j = SSjob.GetJob(edit_job_target)
if(!j)
return 0
if(can_close_job(j) != 1)
return 0
//Allow instant closing without cooldown if a position has been opened before
if(opened_positions[edit_job_target] <= 0)
time_last_changed_position = world.time / 10
j.total_positions--
opened_positions[edit_job_target]--
if ("print")
if (!( printing ))
printing = 1
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc )
var/t1 = "<B>Crew Manifest:</B><BR>"
for(var/datum/data/record/t in sortRecord(data_core.general))
t1 += t.fields["name"] + " - " + t.fields["rank"] + "<br>"
P.info = t1
P.name = "paper- 'Crew Manifest'"
printing = null
if (modify)
modify.update_label()
updateUsrDialog()
return
/obj/machinery/computer/card/proc/get_subordinates(rank)
for(var/datum/job/job in SSjob.occupations)
if(rank in job.department_head)
head_subordinates += job.title
/obj/machinery/computer/card/centcom
name = "\improper Centcom identification console"
circuit = /obj/item/weapon/circuitboard/computer/card/centcom
req_access = list(access_cent_captain)
/obj/machinery/computer/card/minor
name = "department management console"
desc = "You can use this to change ID's for specific departments."
icon_screen = "idminor"
circuit = /obj/item/weapon/circuitboard/computer/card/minor
/obj/machinery/computer/card/minor/New()
..()
var/obj/item/weapon/circuitboard/computer/card/minor/typed_circuit = circuit
if(target_dept)
typed_circuit.target_dept = target_dept
else
target_dept = typed_circuit.target_dept
var/list/dept_list = list("general","security","medical","science","engineering")
name = "[dept_list[target_dept]] department console"
/obj/machinery/computer/card/minor/hos
target_dept = 2
icon_screen = "idhos"
/obj/machinery/computer/card/minor/cmo
target_dept = 3
icon_screen = "idcmo"
/obj/machinery/computer/card/minor/rd
target_dept = 4
icon_screen = "idrd"
/obj/machinery/computer/card/minor/ce
target_dept = 5
icon_screen = "idce"
+401
View File
@@ -0,0 +1,401 @@
/obj/machinery/computer/cloning
name = "cloning console"
desc = "Used to clone people and manage DNA."
icon_screen = "dna"
icon_keyboard = "med_key"
circuit = /obj/item/weapon/circuitboard/computer/cloning
req_access = list(access_heads) //Only used for record deletion right now.
var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
var/obj/machinery/clonepod/pod1 = null //Linked cloning pod.
var/temp = "Inactive"
var/scantemp_ckey
var/scantemp = "Ready to Scan"
var/menu = 1 //Which menu screen to display
var/list/records = list()
var/datum/data/record/active_record = null
var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything.
var/loading = 0 // Nice loading text
var/autoprocess = 0
/obj/machinery/computer/cloning/New()
..()
spawn(5)
updatemodules()
/obj/machinery/computer/cloning/process()
if(!(scanner && pod1 && autoprocess))
return
if(!pod1.is_operational())
return
if(scanner.occupant && (scanner.scan_level > 2))
scan_mob(scanner.occupant)
if(!(pod1.occupant || pod1.mess) && (pod1.efficiency > 5))
for(var/datum/data/record/R in records)
if(!(pod1.occupant || pod1.mess))
if(pod1.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"]))
records -= R
/obj/machinery/computer/cloning/proc/updatemodules()
src.scanner = findscanner()
src.pod1 = findcloner()
if (!isnull(src.pod1))
src.pod1.connected = src // Some variable the pod needs
/obj/machinery/computer/cloning/proc/findscanner()
var/obj/machinery/dna_scannernew/scannerf = null
// Loop through every direction
for(dir in list(NORTH,EAST,SOUTH,WEST))
// Try to find a scanner in that direction
scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir))
// If found and operational, return the scanner
if (!isnull(scannerf) && scannerf.is_operational())
return scannerf
// If no scanner was found, it will return null
return null
/obj/machinery/computer/cloning/proc/findcloner()
var/obj/machinery/clonepod/podf = null
for(dir in list(NORTH,EAST,SOUTH,WEST))
podf = locate(/obj/machinery/clonepod, get_step(src, dir))
if (!isnull(podf) && podf.is_operational())
return podf
/obj/machinery/computer/cloning/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES
if (!src.diskette)
if(!user.drop_item())
return
W.loc = src
src.diskette = W
user << "<span class='notice'>You insert [W].</span>"
src.updateUsrDialog()
else
return ..()
/obj/machinery/computer/cloning/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/computer/cloning/interact(mob/user)
user.set_machine(src)
add_fingerprint(user)
if(..())
return
updatemodules()
var/dat = ""
dat += "<a href='byond://?src=\ref[src];refresh=1'>Refresh</a>"
if(scanner && pod1 && ((scanner.scan_level > 2) || (pod1.efficiency > 5)))
if(!autoprocess)
dat += "<a href='byond://?src=\ref[src];task=autoprocess'>Autoprocess</a>"
else
dat += "<a href='byond://?src=\ref[src];task=stopautoprocess'>Stop autoprocess</a>"
else
dat += "<span class='linkOff'>Autoprocess</span>"
dat += "<h3>Cloning Pod Status</h3>"
dat += "<div class='statusDisplay'>[temp]&nbsp;</div>"
switch(src.menu)
if(1)
// Modules
if (isnull(src.scanner) || isnull(src.pod1))
dat += "<h3>Modules</h3>"
//dat += "<a href='byond://?src=\ref[src];relmodules=1'>Reload Modules</a>"
if (isnull(src.scanner))
dat += "<font class='bad'>ERROR: No Scanner detected!</font><br>"
if (isnull(src.pod1))
dat += "<font class='bad'>ERROR: No Pod detected</font><br>"
// Scanner
if (!isnull(src.scanner))
dat += "<h3>Scanner Functions</h3>"
dat += "<div class='statusDisplay'>"
if (!src.scanner.occupant)
dat += "Scanner Unoccupied"
else if(loading)
dat += "[src.scanner.occupant] => Scanning..."
else
if (src.scanner.occupant.ckey != scantemp_ckey)
scantemp = "Ready to Scan"
scantemp_ckey = src.scanner.occupant.ckey
dat += "[src.scanner.occupant] => [scantemp]"
dat += "</div>"
if (src.scanner.occupant)
dat += "<a href='byond://?src=\ref[src];scan=1'>Start Scan</a>"
dat += "<br><a href='byond://?src=\ref[src];lock=1'>[src.scanner.locked ? "Unlock Scanner" : "Lock Scanner"]</a>"
else
dat += "<span class='linkOff'>Start Scan</span>"
// Database
dat += "<h3>Database Functions</h3>"
if (src.records.len && src.records.len > 0)
dat += "<a href='byond://?src=\ref[src];menu=2'>View Records ([src.records.len])</a><br>"
else
dat += "<span class='linkOff'>View Records (0)</span><br>"
if (src.diskette)
dat += "<a href='byond://?src=\ref[src];disk=eject'>Eject Disk</a><br>"
if(2)
dat += "<h3>Current records</h3>"
dat += "<a href='byond://?src=\ref[src];menu=1'><< Back</a><br><br>"
for(var/datum/data/record/R in records)
dat += "<h4>[R.fields["name"]]</h4>Scan ID [R.fields["id"]] <a href='byond://?src=\ref[src];view_rec=[R.fields["id"]]'>View Record</a>"
if(3)
dat += "<h3>Selected Record</h3>"
dat += "<a href='byond://?src=\ref[src];menu=2'><< Back</a><br>"
if (!src.active_record)
dat += "<font class='bad'>Record not found.</font>"
else
dat += "<h4>[src.active_record.fields["name"]]</h4>"
dat += "Scan ID [src.active_record.fields["id"]] <a href='byond://?src=\ref[src];clone=[active_record.fields["id"]]'>Clone</a><br>"
var/obj/item/weapon/implant/health/H = locate(src.active_record.fields["imp"])
if ((H) && (istype(H)))
dat += "<b>Health Implant Data:</b><br />[H.sensehealth()]<br><br />"
else
dat += "<font class='bad'>Unable to locate Health Implant.</font><br /><br />"
dat += "<b>Unique Identifier:</b><br /><span class='highlight'>[src.active_record.fields["UI"]]</span><br>"
dat += "<b>Structural Enzymes:</b><br /><span class='highlight'>[src.active_record.fields["SE"]]</span><br>"
if(diskette && diskette.fields)
dat += "<div class='block'>"
dat += "<h4>Inserted Disk</h4>"
dat += "<b>Contents:</b> "
var/list/L = list()
if(diskette.fields["UI"])
L += "Unique Identifier"
if(diskette.fields["UE"] && diskette.fields["name"] && diskette.fields["blood_type"])
L += "Unique Enzymes"
if(diskette.fields["SE"])
L += "Structural Enzymes"
dat += english_list(L, "Empty", " + ", " + ")
dat += "<br /><a href='byond://?src=\ref[src];disk=load'>Load from Disk</a>"
dat += "<br /><a href='byond://?src=\ref[src];disk=save'>Save to Disk</a>"
dat += "</div>"
dat += "<font size=1><a href='byond://?src=\ref[src];del_rec=1'>Delete Record</a></font>"
if(4)
if (!src.active_record)
src.menu = 2
dat = "[src.temp]<br>"
dat += "<h3>Confirm Record Deletion</h3>"
dat += "<b><a href='byond://?src=\ref[src];del_rec=1'>Scan card to confirm.</a></b><br>"
dat += "<b><a href='byond://?src=\ref[src];menu=3'>Cancel</a></b>"
//user << browse(dat, "window=cloning")
//onclose(user, "cloning")
var/datum/browser/popup = new(user, "cloning", "Cloning System Control")
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
/obj/machinery/computer/cloning/Topic(href, href_list)
if(..())
return
if(loading)
return
if(href_list["task"])
switch(href_list["task"])
if("autoprocess")
autoprocess = 1
if("stopautoprocess")
autoprocess = 0
else if ((href_list["scan"]) && !isnull(scanner) && scanner.is_operational())
scantemp = ""
loading = 1
src.updateUsrDialog()
spawn(20)
src.scan_mob(scanner.occupant)
loading = 0
src.updateUsrDialog()
//No locking an open scanner.
else if ((href_list["lock"]) && !isnull(scanner) && scanner.is_operational())
if ((!scanner.locked) && (scanner.occupant))
scanner.locked = 1
else
scanner.locked = 0
else if(href_list["view_rec"])
src.active_record = find_record("id", href_list["view_rec"], records)
if(active_record)
if(!active_record.fields["ckey"])
records -= active_record
active_record = null
src.temp = "<font class='bad'>Record Corrupt</font>"
else
src.menu = 3
else
src.temp = "Record missing."
else if (href_list["del_rec"])
if ((!src.active_record) || (src.menu < 3))
return
if (src.menu == 3) //If we are viewing a record, confirm deletion
src.temp = "Delete record?"
src.menu = 4
else if (src.menu == 4)
var/obj/item/weapon/card/id/C = usr.get_active_hand()
if (istype(C)||istype(C, /obj/item/device/pda))
if(src.check_access(C))
src.temp = "[src.active_record.fields["name"]] => Record deleted."
src.records.Remove(active_record)
active_record = null
src.menu = 2
else
src.temp = "<font class='bad'>Access Denied.</font>"
else if (href_list["disk"]) //Load or eject.
switch(href_list["disk"])
if("load")
if (!diskette || !istype(diskette.fields) || !diskette.fields["name"] || !diskette.fields)
src.temp = "<font class='bad'>Load error.</font>"
src.updateUsrDialog()
return
if (!src.active_record)
src.temp = "<font class='bad'>Record error.</font>"
src.menu = 1
src.updateUsrDialog()
return
for(var/key in diskette.fields)
src.active_record.fields[key] = diskette.fields[key]
src.temp = "Load successful."
if("eject")
if(src.diskette)
src.diskette.loc = src.loc
src.diskette = null
if("save")
if(!diskette || diskette.read_only || !active_record || !active_record.fields)
src.temp = "<font class='bad'>Save error.</font>"
src.updateUsrDialog()
return
diskette.fields = active_record.fields.Copy()
diskette.name = "data disk - '[src.diskette.fields["name"]]'"
src.temp = "Save successful."
else if (href_list["refresh"])
src.updateUsrDialog()
else if (href_list["clone"])
var/datum/data/record/C = find_record("id", href_list["clone"], records)
//Look for that player! They better be dead!
if(C)
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
if(!pod1)
temp = "<font class='bad'>No Clonepod detected.</font>"
else if(pod1.occupant)
temp = "<font class='bad'>Clonepod is currently occupied.</font>"
else if(pod1.mess)
temp = "<font class='bad'>Clonepod malfunction.</font>"
else if(!config.revival_cloning)
temp = "<font class='bad'>Unable to initiate cloning cycle.</font>"
else if(pod1.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"]))
temp = "[C.fields["name"]] => <font class='good'>Cloning cycle in progress...</font>"
records.Remove(C)
if(active_record == C)
active_record = null
menu = 1
else
temp = "[C.fields["name"]] => <font class='bad'>Initialisation failure.</font>"
else
temp = "<font class='bad'>Data corruption.</font>"
else if (href_list["menu"])
src.menu = text2num(href_list["menu"])
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject)
if (!istype(subject))
scantemp = "<font class='bad'>Unable to locate valid genetic data.</font>"
return
if (!subject.getorgan(/obj/item/organ/brain))
scantemp = "<font class='bad'>No signs of intelligence detected.</font>"
return
if (subject.suiciding == 1 || subject.hellbound)
scantemp = "<font class='bad'>Subject's brain is not responding to scanning stimuli.</font>"
return
if ((subject.disabilities & NOCLONE) && (src.scanner.scan_level < 2))
scantemp = "<font class='bad'>Subject no longer contains the fundamental materials required to create a living clone.</font>"
return
if ((!subject.ckey) || (!subject.client))
scantemp = "<font class='bad'>Mental interface failure.</font>"
return
if (find_record("ckey", subject.ckey, records))
scantemp = "<font class='average'>Subject already in database.</font>"
return
var/datum/data/record/R = new()
if(subject.dna.species)
// We store the instance rather than the path, because some
// species (abductors, slimepeople) store state in their
// species datums
R.fields["mrace"] = subject.dna.species
else
var/datum/species/rando_race = pick(config.roundstart_races)
R.fields["mrace"] = rando_race.type
R.fields["ckey"] = subject.ckey
R.fields["name"] = subject.real_name
R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
R.fields["UE"] = subject.dna.unique_enzymes
R.fields["UI"] = subject.dna.uni_identity
R.fields["SE"] = subject.dna.struc_enzymes
R.fields["blood_type"] = subject.dna.blood_type
R.fields["features"] = subject.dna.features
R.fields["factions"] = subject.faction
//Add an implant if needed
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)
if(!imp)
imp = new /obj/item/weapon/implant/health(subject)
imp.implanted = subject
R.fields["imp"] = "\ref[imp]"
//Update it if needed
else
R.fields["imp"] = "\ref[imp]"
if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
R.fields["mind"] = "\ref[subject.mind]"
src.records += R
scantemp = "Subject successfully scanned."
@@ -0,0 +1,630 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
var/const/CALL_SHUTTLE_REASON_LENGTH = 12
// The communications computer
/obj/machinery/computer/communications
name = "communications console"
desc = "This can be used for various important functions. Still under developement."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(access_heads)
circuit = /obj/item/weapon/circuitboard/computer/communications
var/authenticated = 0
var/auth_id = "Unknown" //Who is currently logged in?
var/list/messagetitle = list()
var/list/messagetext = list()
var/currmsg = 0
var/aicurrmsg = 0
var/state = STATE_DEFAULT
var/aistate = STATE_DEFAULT
var/message_cooldown = 0
var/ai_message_cooldown = 0
var/tmp_alertlevel = 0
var/const/STATE_DEFAULT = 1
var/const/STATE_CALLSHUTTLE = 2
var/const/STATE_CANCELSHUTTLE = 3
var/const/STATE_MESSAGELIST = 4
var/const/STATE_VIEWMESSAGE = 5
var/const/STATE_DELMESSAGE = 6
var/const/STATE_STATUSDISPLAY = 7
var/const/STATE_ALERT_LEVEL = 8
var/const/STATE_CONFIRM_LEVEL = 9
var/const/STATE_TOGGLE_EMERGENCY = 10
var/status_display_freq = "1435"
var/stat_msg1
var/stat_msg2
/obj/machinery/computer/communications/New()
shuttle_caller_list += src
..()
/obj/machinery/computer/communications/process()
if(..())
if(state != STATE_STATUSDISPLAY)
src.updateDialog()
/obj/machinery/computer/communications/Topic(href, href_list)
if(..())
return
if (src.z > ZLEVEL_CENTCOM) //Can only use on centcom and SS13
usr << "<span class='boldannounce'>Unable to establish a connection</span>: \black You're too far away from the station!"
return
usr.set_machine(src)
if(!href_list["operation"])
return
var/obj/item/weapon/circuitboard/computer/communications/CM = circuit
switch(href_list["operation"])
// main interface
if("main")
src.state = STATE_DEFAULT
if("login")
var/mob/M = usr
var/obj/item/weapon/card/id/I = M.get_active_hand()
if (istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
if (I && istype(I))
if(src.check_access(I))
authenticated = 1
auth_id = "[I.registered_name] ([I.assignment])"
if((20 in I.access))
authenticated = 2
if(src.emagged)
authenticated = 2
auth_id = "Unknown"
if("logout")
authenticated = 0
if("swipeidseclevel")
var/mob/M = usr
var/obj/item/weapon/card/id/I = M.get_active_hand()
if (istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
if (I && istype(I))
if(access_captain in I.access)
var/old_level = security_level
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
set_security_level(tmp_alertlevel)
if(security_level != old_level)
//Only notify the admins if an actual change happened
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
switch(security_level)
if(SEC_LEVEL_GREEN)
feedback_inc("alert_comms_green",1)
if(SEC_LEVEL_BLUE)
feedback_inc("alert_comms_blue",1)
tmp_alertlevel = 0
else:
usr << "<span class='warning'>You are not authorized to do this!</span>"
tmp_alertlevel = 0
state = STATE_DEFAULT
else
usr << "<span class='warning'>You need to swipe your ID!</span>"
if("announce")
if(src.authenticated==2 && !message_cooldown)
make_announcement(usr)
else if (src.authenticated==2 && message_cooldown)
usr << "Intercomms recharging. Please stand by."
if("crossserver")
if(authenticated==2)
if(CM.lastTimeUsed + 600 > world.time)
usr << "Arrays recycling. Please stand by."
return
var/input = stripped_multiline_input(usr, "Please choose a message to transmit to an allied station. Please be aware that this process is very expensive, and abuse will lead to... termination.", "Send a message to an allied station.", "")
if(!input || !(usr in view(1,src)))
return
send2otherserver("[station_name()]", input,"Comms_Console")
minor_announce(input, title = "Outgoing message to allied station")
log_say("[key_name(usr)] has sent a message to the other server: [input]")
CM.lastTimeUsed = world.time
if("callshuttle")
src.state = STATE_DEFAULT
if(src.authenticated)
src.state = STATE_CALLSHUTTLE
if("callshuttle2")
if(src.authenticated)
SSshuttle.requestEvac(usr, href_list["call"])
if(SSshuttle.emergency.timer)
post_status("shuttle")
src.state = STATE_DEFAULT
if("cancelshuttle")
src.state = STATE_DEFAULT
if(src.authenticated)
src.state = STATE_CANCELSHUTTLE
if("cancelshuttle2")
if(src.authenticated)
SSshuttle.cancelEvac(usr)
src.state = STATE_DEFAULT
if("messagelist")
src.currmsg = 0
src.state = STATE_MESSAGELIST
if("viewmessage")
src.state = STATE_VIEWMESSAGE
if (!src.currmsg)
if(href_list["message-num"])
src.currmsg = text2num(href_list["message-num"])
else
src.state = STATE_MESSAGELIST
if("delmessage")
src.state = (src.currmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
if("delmessage2")
if(src.authenticated)
if(src.currmsg)
var/title = src.messagetitle[src.currmsg]
var/text = src.messagetext[src.currmsg]
src.messagetitle.Remove(title)
src.messagetext.Remove(text)
if(src.currmsg == src.aicurrmsg)
src.aicurrmsg = 0
src.currmsg = 0
src.state = STATE_MESSAGELIST
else
src.state = STATE_VIEWMESSAGE
if("status")
src.state = STATE_STATUSDISPLAY
if("securitylevel")
src.tmp_alertlevel = text2num( href_list["newalertlevel"] )
if(!tmp_alertlevel) tmp_alertlevel = 0
state = STATE_CONFIRM_LEVEL
if("changeseclevel")
state = STATE_ALERT_LEVEL
if("emergencyaccess")
state = STATE_TOGGLE_EMERGENCY
if("enableemergency")
make_maint_all_access()
log_game("[key_name(usr)] enabled emergency maintenance access.")
message_admins("[key_name_admin(usr)] enabled emergency maintenance access.")
src.state = STATE_DEFAULT
if("disableemergency")
revoke_maint_all_access()
log_game("[key_name(usr)] disabled emergency maintenance access.")
message_admins("[key_name_admin(usr)] disabled emergency maintenance access.")
src.state = STATE_DEFAULT
// Status display stuff
if("setstat")
switch(href_list["statdisp"])
if("message")
post_status("message", stat_msg1, stat_msg2)
if("alert")
post_status("alert", href_list["alert"])
else
post_status(href_list["statdisp"])
if("setmsg1")
stat_msg1 = reject_bad_text(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40)
src.updateDialog()
if("setmsg2")
stat_msg2 = reject_bad_text(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40)
src.updateDialog()
// OMG CENTCOM LETTERHEAD
if("MessageCentcomm")
if(src.authenticated==2)
if(CM.lastTimeUsed + 600 > world.time)
usr << "Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please choose a message to transmit to Centcom via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "Send a message to Centcomm.", "")
if(!input || !(usr in view(1,src)))
return
Centcomm_announce(input, usr)
usr << "Message transmitted."
log_say("[key_name(usr)] has made a Centcom announcement: [input]")
CM.lastTimeUsed = world.time
// OMG SYNDICATE ...LETTERHEAD
if("MessageSyndicate")
if((src.authenticated==2) && (src.emagged))
if(CM.lastTimeUsed + 600 > world.time)
usr << "Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING COORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "Send a message to /??????/.", "")
if(!input || !(usr in view(1,src)))
return
Syndicate_announce(input, usr)
usr << "Message transmitted."
log_say("[key_name(usr)] has made a Syndicate announcement: [input]")
CM.lastTimeUsed = world.time
if("RestoreBackup")
usr << "Backup routing data restored!"
src.emagged = 0
src.updateDialog()
if("nukerequest") //When there's no other way
if(src.authenticated==2)
if(CM.lastTimeUsed + 600 > world.time)
usr << "Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please enter the reason for requesting the nuclear self-destruct codes. Misuse of the nuclear request system will not be tolerated under any circumstances. Transmission does not guarantee a response.", "Self Destruct Code Request.","")
if(!input || !(usr in view(1,src)))
return
Nuke_request(input, usr)
usr << "Request sent."
log_say("[key_name(usr)] has requested the nuclear codes from Centcomm")
priority_announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg')
CM.lastTimeUsed = world.time
// AI interface
if("ai-main")
src.aicurrmsg = 0
src.aistate = STATE_DEFAULT
if("ai-callshuttle")
src.aistate = STATE_CALLSHUTTLE
if("ai-callshuttle2")
SSshuttle.requestEvac(usr, href_list["call"])
src.aistate = STATE_DEFAULT
if("ai-messagelist")
src.aicurrmsg = 0
src.aistate = STATE_MESSAGELIST
if("ai-viewmessage")
src.aistate = STATE_VIEWMESSAGE
if (!src.aicurrmsg)
if(href_list["message-num"])
src.aicurrmsg = text2num(href_list["message-num"])
else
src.aistate = STATE_MESSAGELIST
if("ai-delmessage")
src.aistate = (src.aicurrmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
if("ai-delmessage2")
if(src.aicurrmsg)
var/title = src.messagetitle[src.aicurrmsg]
var/text = src.messagetext[src.aicurrmsg]
src.messagetitle.Remove(title)
src.messagetext.Remove(text)
if(src.currmsg == src.aicurrmsg)
src.currmsg = 0
src.aicurrmsg = 0
src.aistate = STATE_MESSAGELIST
if("ai-status")
src.aistate = STATE_STATUSDISPLAY
if("ai-announce")
if(!ai_message_cooldown)
make_announcement(usr, 1)
if("ai-securitylevel")
src.tmp_alertlevel = text2num( href_list["newalertlevel"] )
if(!tmp_alertlevel) tmp_alertlevel = 0
var/old_level = security_level
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
set_security_level(tmp_alertlevel)
if(security_level != old_level)
//Only notify the admins if an actual change happened
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
switch(security_level)
if(SEC_LEVEL_GREEN)
feedback_inc("alert_comms_green",1)
if(SEC_LEVEL_BLUE)
feedback_inc("alert_comms_blue",1)
tmp_alertlevel = 0
src.aistate = STATE_DEFAULT
if("ai-changeseclevel")
src.aistate = STATE_ALERT_LEVEL
if("ai-emergencyaccess")
src.aistate = STATE_TOGGLE_EMERGENCY
if("ai-enableemergency")
make_maint_all_access()
log_game("[key_name(usr)] enabled emergency maintenance access.")
message_admins("[key_name_admin(usr)] enabled emergency maintenance access.")
src.aistate = STATE_DEFAULT
if("ai-disableemergency")
revoke_maint_all_access()
log_game("[key_name(usr)] disabled emergency maintenance access.")
message_admins("[key_name_admin(usr)] disabled emergency maintenance access.")
src.aistate = STATE_DEFAULT
src.updateUsrDialog()
/obj/machinery/computer/communications/attackby(obj/I, mob/user, params)
if(istype(I, /obj/item/weapon/card/id))
attack_hand(user)
else
return ..()
/obj/machinery/computer/communications/emag_act(mob/user)
if(!emagged)
src.emagged = 1
if(authenticated == 1)
authenticated = 2
user << "<span class='notice'>You scramble the communication routing circuits.</span>"
/obj/machinery/computer/communications/attack_hand(mob/user)
if(..())
return
if (src.z > 6)
user << "<span class='boldannounce'>Unable to establish a connection</span>: \black You're too far away from the station!"
return
user.set_machine(src)
var/dat = ""
if(SSshuttle.emergency.mode == SHUTTLE_CALL)
var/timeleft = SSshuttle.emergency.timeLeft()
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
var/datum/browser/popup = new(user, "communications", "Communications Console", 400, 500)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
if (istype(user, /mob/living/silicon))
var/dat2 = src.interact_ai(user) // give the AI a different interact proc to limit its access
if(dat2)
dat += dat2
//user << browse(dat, "window=communications;size=400x500")
//onclose(user, "communications")
popup.set_content(dat)
popup.open()
return
switch(src.state)
if(STATE_DEFAULT)
if (src.authenticated)
if(SSshuttle.emergencyLastCallLoc)
dat += "<BR>Most recent shuttle call/recall traced to: <b>[format_text(SSshuttle.emergencyLastCallLoc.name)]</b>"
else
dat += "<BR>Unable to trace most recent shuttle call/recall signal."
dat += "<BR>Logged in as: [auth_id]"
dat += "<BR>"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=logout'>Log Out</A> \]<BR>"
dat += "<BR><B>General Functions</B>"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=messagelist'>Message List</A> \]"
switch(SSshuttle.emergency.mode)
if(SHUTTLE_IDLE, SHUTTLE_RECALL)
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=callshuttle'>Call Emergency Shuttle</A> \]"
else
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=cancelshuttle'>Cancel Shuttle Call</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=status'>Set Status Display</A> \]"
if (src.authenticated==2)
dat += "<BR><BR><B>Captain Functions</B>"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=announce'>Make a Captain's Announcement</A> \]"
if(cross_allowed)
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=crossserver'>Send a message to an allied station</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=changeseclevel'>Change Alert Level</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=emergencyaccess'>Emergency Maintenance Access</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=nukerequest'>Request Nuclear Authentication Codes</A> \]"
if(src.emagged == 0)
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=MessageCentcomm'>Send Message to Centcom</A> \]"
else
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=MessageSyndicate'>Send Message to \[UNKNOWN\]</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=RestoreBackup'>Restore Backup Routing Data</A> \]"
else
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=login'>Log In</A> \]"
if(STATE_CALLSHUTTLE)
dat += get_call_shuttle_form()
if(STATE_CANCELSHUTTLE)
dat += get_cancel_shuttle_form()
if(STATE_MESSAGELIST)
dat += "Messages:"
for(var/i = 1; i<=src.messagetitle.len; i++)
dat += "<BR><A HREF='?src=\ref[src];operation=viewmessage;message-num=[i]'>[src.messagetitle[i]]</A>"
if(STATE_VIEWMESSAGE)
if (src.currmsg)
dat += "<B>[src.messagetitle[src.currmsg]]</B><BR><BR>[src.messagetext[src.currmsg]]"
if (src.authenticated)
dat += "<BR><BR>\[ <A HREF='?src=\ref[src];operation=delmessage'>Delete \]"
else
src.state = STATE_MESSAGELIST
src.attack_hand(user)
return
if(STATE_DELMESSAGE)
if (src.currmsg)
dat += "Are you sure you want to delete this message? \[ <A HREF='?src=\ref[src];operation=delmessage2'>OK</A> | <A HREF='?src=\ref[src];operation=viewmessage'>Cancel</A> \]"
else
src.state = STATE_MESSAGELIST
src.attack_hand(user)
return
if(STATE_STATUSDISPLAY)
dat += "Set Status Displays<BR>"
dat += "\[ <A HREF='?src=\ref[src];operation=setstat;statdisp=blank'>Clear</A> \]<BR>"
dat += "\[ <A HREF='?src=\ref[src];operation=setstat;statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
dat += "\[ <A HREF='?src=\ref[src];operation=setstat;statdisp=message'>Message</A> \]"
dat += "<ul><li> Line 1: <A HREF='?src=\ref[src];operation=setmsg1'>[ stat_msg1 ? stat_msg1 : "(none)"]</A>"
dat += "<li> Line 2: <A HREF='?src=\ref[src];operation=setmsg2'>[ stat_msg2 ? stat_msg2 : "(none)"]</A></ul><br>"
dat += "\[ Alert: <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=default'>None</A> |"
dat += " <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=redalert'>Red Alert</A> |"
dat += " <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=lockdown'>Lockdown</A> |"
dat += " <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
if(STATE_ALERT_LEVEL)
dat += "Current alert level: [get_security_level()]<BR>"
if(security_level == SEC_LEVEL_DELTA)
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
else
dat += "<A HREF='?src=\ref[src];operation=securitylevel;newalertlevel=[SEC_LEVEL_BLUE]'>Blue</A><BR>"
dat += "<A HREF='?src=\ref[src];operation=securitylevel;newalertlevel=[SEC_LEVEL_GREEN]'>Green</A>"
if(STATE_CONFIRM_LEVEL)
dat += "Current alert level: [get_security_level()]<BR>"
dat += "Confirm the change to: [num2seclevel(tmp_alertlevel)]<BR>"
dat += "<A HREF='?src=\ref[src];operation=swipeidseclevel'>Swipe ID</A> to confirm change.<BR>"
if(STATE_TOGGLE_EMERGENCY)
if(emergency_access == 1)
dat += "<b>Emergency Maintenance Access is currently <font color='red'>ENABLED</font></b>"
dat += "<BR>Restore maintenance access restrictions? <BR>\[ <A HREF='?src=\ref[src];operation=disableemergency'>OK</A> | <A HREF='?src=\ref[src];operation=viewmessage'>Cancel</A> \]"
else
dat += "<b>Emergency Maintenance Access is currently <font color='green'>DISABLED</font></b>"
dat += "<BR>Lift access restrictions on maintenance and external airlocks? <BR>\[ <A HREF='?src=\ref[src];operation=enableemergency'>OK</A> | <A HREF='?src=\ref[src];operation=viewmessage'>Cancel</A> \]"
dat += "<BR><BR>\[ [(src.state != STATE_DEFAULT) ? "<A HREF='?src=\ref[src];operation=main'>Main Menu</A> | " : ""]<A HREF='?src=\ref[user];mach_close=communications'>Close</A> \]"
//user << browse(dat, "window=communications;size=400x500")
//onclose(user, "communications")
popup.set_content(dat)
popup.open()
/obj/machinery/computer/communications/proc/get_javascript_header(form_id)
var/dat = {"<script type="text/javascript">
function getLength(){
var reasonField = document.getElementById('reasonfield');
if(reasonField.value.length >= [CALL_SHUTTLE_REASON_LENGTH]){
reasonField.style.backgroundColor = "#DDFFDD";
}
else {
reasonField.style.backgroundColor = "#FFDDDD";
}
}
function submit() {
document.getElementById('[form_id]').submit();
}
</script>"}
return dat
/obj/machinery/computer/communications/proc/get_call_shuttle_form(ai_interface = 0)
var/form_id = "callshuttle"
var/dat = get_javascript_header(form_id)
dat += "<form name='callshuttle' id='[form_id]' action='?src=\ref[src]' method='get' style='display: inline'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='operation' value='[ai_interface ? "ai-callshuttle2" : "callshuttle2"]'>"
dat += "<b>Nature of emergency:</b><BR> <input type='text' id='reasonfield' name='call' style='width:250px; background-color:#FFDDDD; onkeydown='getLength() onkeyup='getLength()' onkeypress='getLength()'>"
dat += "<BR>Are you sure you want to call the shuttle? \[ <a href='#' onclick='submit()'>Call</a> \]"
return dat
/obj/machinery/computer/communications/proc/get_cancel_shuttle_form()
var/form_id = "cancelshuttle"
var/dat = get_javascript_header(form_id)
dat += "<form name='cancelshuttle' id='[form_id]' action='?src=\ref[src]' method='get' style='display: inline'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>"
dat += "<input type='hidden' name='operation' value='cancelshuttle2'>"
dat += "<BR>Are you sure you want to cancel the shuttle? \[ <a href='#' onclick='submit()'>Cancel</a> \]"
return dat
/obj/machinery/computer/communications/proc/interact_ai(mob/living/silicon/ai/user)
var/dat = ""
switch(src.aistate)
if(STATE_DEFAULT)
if(SSshuttle.emergencyLastCallLoc)
dat += "<BR>Latest emergency signal trace attempt successful.<BR>Last signal origin: <b>[format_text(SSshuttle.emergencyLastCallLoc.name)]</b>.<BR>"
else
dat += "<BR>Latest emergency signal trace attempt failed.<BR>"
if(authenticated)
dat += "Current login: [auth_id]"
else
dat += "Current login: None"
dat += "<BR><BR><B>General Functions</B>"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-messagelist'>Message List</A> \]"
if(SSshuttle.emergency.mode == SHUTTLE_IDLE)
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-callshuttle'>Call Emergency Shuttle</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-status'>Set Status Display</A> \]"
dat += "<BR><BR><B>Special Functions</B>"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-announce'>Make an Announcement</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-changeseclevel'>Change Alert Level</A> \]"
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-emergencyaccess'>Emergency Maintenance Access</A> \]"
if(STATE_CALLSHUTTLE)
dat += get_call_shuttle_form(1)
if(STATE_MESSAGELIST)
dat += "Messages:"
for(var/i = 1; i<=src.messagetitle.len; i++)
dat += "<BR><A HREF='?src=\ref[src];operation=ai-viewmessage;message-num=[i]'>[src.messagetitle[i]]</A>"
if(STATE_VIEWMESSAGE)
if (src.aicurrmsg)
dat += "<B>[src.messagetitle[src.aicurrmsg]]</B><BR><BR>[src.messagetext[src.aicurrmsg]]"
dat += "<BR><BR>\[ <A HREF='?src=\ref[src];operation=ai-delmessage'>Delete</A> \]"
else
src.aistate = STATE_MESSAGELIST
src.attack_hand(user)
return null
if(STATE_DELMESSAGE)
if(src.aicurrmsg)
dat += "Are you sure you want to delete this message? \[ <A HREF='?src=\ref[src];operation=ai-delmessage2'>OK</A> | <A HREF='?src=\ref[src];operation=ai-viewmessage'>Cancel</A> \]"
else
src.aistate = STATE_MESSAGELIST
src.attack_hand(user)
return
if(STATE_STATUSDISPLAY)
dat += "Set Status Displays<BR>"
dat += "\[ <A HREF='?src=\ref[src];operation=setstat;statdisp=blank'>Clear</A> \]<BR>"
dat += "\[ <A HREF='?src=\ref[src];operation=setstat;statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
dat += "\[ <A HREF='?src=\ref[src];operation=setstat;statdisp=message'>Message</A> \]"
dat += "<ul><li> Line 1: <A HREF='?src=\ref[src];operation=setmsg1'>[ stat_msg1 ? stat_msg1 : "(none)"]</A>"
dat += "<li> Line 2: <A HREF='?src=\ref[src];operation=setmsg2'>[ stat_msg2 ? stat_msg2 : "(none)"]</A></ul><br>"
dat += "\[ Alert: <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=default'>None</A> |"
dat += " <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=redalert'>Red Alert</A> |"
dat += " <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=lockdown'>Lockdown</A> |"
dat += " <A HREF='?src=\ref[src];operation=setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
if(STATE_ALERT_LEVEL)
dat += "Current alert level: [get_security_level()]<BR>"
if(security_level == SEC_LEVEL_DELTA)
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
else
dat += "<A HREF='?src=\ref[src];operation=ai-securitylevel;newalertlevel=[SEC_LEVEL_BLUE]'>Blue</A><BR>"
dat += "<A HREF='?src=\ref[src];operation=ai-securitylevel;newalertlevel=[SEC_LEVEL_GREEN]'>Green</A>"
if(STATE_TOGGLE_EMERGENCY)
if(emergency_access == 1)
dat += "<b>Emergency Maintenance Access is currently <font color='red'>ENABLED</font></b>"
dat += "<BR>Restore maintenance access restrictions? <BR>\[ <A HREF='?src=\ref[src];operation=ai-disableemergency'>OK</A> | <A HREF='?src=\ref[src];operation=ai-viewmessage'>Cancel</A> \]"
else
dat += "<b>Emergency Maintenance Access is currently <font color='green'>DISABLED</font></b>"
dat += "<BR>Lift access restrictions on maintenance and external airlocks? <BR>\[ <A HREF='?src=\ref[src];operation=ai-enableemergency'>OK</A> | <A HREF='?src=\ref[src];operation=ai-viewmessage'>Cancel</A> \]"
dat += "<BR><BR>\[ [(src.aistate != STATE_DEFAULT) ? "<A HREF='?src=\ref[src];operation=ai-main'>Main Menu</A> | " : ""]<A HREF='?src=\ref[user];mach_close=communications'>Close</A> \]"
return dat
/obj/machinery/computer/communications/proc/make_announcement(mob/living/user, is_silicon)
var/input = stripped_input(user, "Please choose a message to announce to the station crew.", "What?")
if(!input || !user.canUseTopic(src))
return
if(is_silicon)
minor_announce(input,"[user.name] Announces:")
ai_message_cooldown = 1
spawn(600)//One minute cooldown
ai_message_cooldown = 0
else
priority_announce(html_decode(input), null, 'sound/misc/announce.ogg', "Captain")
message_cooldown = 1
spawn(600)//One minute cooldown
message_cooldown = 0
log_say("[key_name(user)] has made a priority announcement: [input]")
message_admins("[key_name_admin(user)] has made a priority announcement.")
/obj/machinery/computer/communications/proc/post_status(command, data1, data2)
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
if(!frequency) return
var/datum/signal/status_signal = new
status_signal.source = src
status_signal.transmission_method = 1
status_signal.data["command"] = command
switch(command)
if("message")
status_signal.data["msg1"] = data1
status_signal.data["msg2"] = data2
if("alert")
status_signal.data["picture_state"] = data1
frequency.post_signal(src, status_signal)
/obj/machinery/computer/communications/Destroy()
shuttle_caller_list -= src
SSshuttle.autoEvac()
return ..()
/obj/machinery/computer/communications/proc/overrideCooldown()
var/obj/item/weapon/circuitboard/computer/communications/CM = circuit
CM.lastTimeUsed = 0
+141
View File
@@ -0,0 +1,141 @@
/obj/machinery/computer
name = "computer"
icon = 'icons/obj/computer.dmi'
icon_state = "computer"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 300
active_power_usage = 300
var/obj/item/weapon/circuitboard/computer/circuit = null // if circuit==null, computer can't disassembly
var/processing = 0
var/brightness_on = 2
var/icon_keyboard = "generic_key"
var/icon_screen = "generic"
var/computer_health = 25
var/clockwork = FALSE
/obj/machinery/computer/New(location, obj/item/weapon/circuitboard/C)
..(location)
if(C && istype(C))
circuit = C
else if(circuit)
circuit = new circuit(null)
power_change()
update_icon()
/obj/machinery/computer/initialize()
power_change()
/obj/machinery/computer/process()
if(stat & (NOPOWER|BROKEN))
return 0
return 1
/obj/machinery/computer/emp_act(severity)
if(severity == 1)
take_damage(rand(15,30), BRUTE, 0)
else
take_damage(rand(15,25), BRUTE, 0)
..()
/obj/machinery/computer/ex_act(severity, target)
if(target == src)
qdel(src)
return
switch(severity)
if(1)
qdel(src)
if(2)
if(prob(25))
qdel(src)
else
take_damage(rand(20,30), BRUTE, 0)
if(3)
take_damage(rand(10,30), BRUTE, 0)
/obj/machinery/computer/ratvar_act()
if(!clockwork && prob(20))
clockwork = TRUE
icon_screen = "ratvar[rand(1, 4)]"
icon_keyboard = "ratvar_key[rand(1, 6)]"
icon_state = "ratvarcomputer[rand(1, 4)]"
update_icon()
/obj/machinery/computer/narsie_act()
if(clockwork && clockwork != initial(clockwork) && prob(20)) //if it's clockwork but isn't normally clockwork
clockwork = FALSE
icon_screen = initial(icon_screen)
icon_keyboard = initial(icon_keyboard)
icon_state = initial(icon_state)
update_icon()
/obj/machinery/computer/bullet_act(obj/item/projectile/P)
take_damage(P.damage, P.damage_type, 0)
..()
/obj/machinery/computer/update_icon()
cut_overlays()
if(stat & NOPOWER)
add_overlay("[icon_keyboard]_off")
return
add_overlay(icon_keyboard)
if(stat & BROKEN)
add_overlay("[icon_state]_broken")
else
add_overlay(icon_screen)
/obj/machinery/computer/power_change()
..()
if(stat & NOPOWER)
SetLuminosity(0)
else
SetLuminosity(brightness_on)
update_icon()
return
/obj/machinery/computer/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/screwdriver) && circuit && !(flags&NODECONSTRUCT))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'> You start to disconnect the monitor...</span>"
if(do_after(user, 20/I.toolspeed, target = src))
deconstruction()
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
A.circuit = circuit
A.anchored = 1
circuit = null
for (var/obj/C in src)
C.loc = src.loc
if (stat & BROKEN)
user << "<span class='notice'>The broken glass falls out.</span>"
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
A.state = 3
A.icon_state = "3"
else
user << "<span class='notice'>You disconnect the monitor.</span>"
A.state = 4
A.icon_state = "4"
qdel(src)
else
return ..()
/obj/machinery/computer/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
computer_health = max(computer_health - damage, 0)
if(circuit) //no circuit, no breaking
if(!computer_health && !(stat & BROKEN))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
stat |= BROKEN
update_icon()
+154
View File
@@ -0,0 +1,154 @@
body
{
padding-left: 53%;
cursor: default;
}
#ntbgcenter
{
background-position: 550px 0px !important;
}
#minimap
{
position: fixed;
top: 8px;
left: 8px;
border: 2px inset #888;
overflow: hidden;
min-width: 480px;
min-height: 480px;
width: 53%;
height: 100%;
max-width: 480px;
max-height: 480px;
}
#textbased
{
width: 100%;
padding-left: 20px;
}
#textbased table
{
min-width: 380px;
width: 100%;
table-layout: fixed;
}
#textbased td
{
vertical-align: top;
padding: 2px;
}
#textbased tbody td
{
transition: .2s all;
}
#textbased tbody tr:hover td, #textbased tbody tr.hover td
{
background-color: #515151;
}
#textarea:after
{
content: "";
clear: both;
}
.health
{
width: 16px;
height: 16px;
background-color: #FFF;
border: 1px solid #434343;
position: relative;
top: 2px;
}
.health-5 { background-color: #17d568; }
.health-4 { background-color: #2ecc71; }
.health-3 { background-color: #e67e22; }
.health-2 { background-color: #ed5100; }
.health-1 { background-color: #e74c3c; }
.health-0 { background-color: #ed2814; }
.health > div
{
margin-left: 20px;
margin-top: -4px;
}
.tt
{
position: relative;
display: inline-block;
height: 16px;
}
.tt > div
{
display: none;
}
.tt:hover > div
{
position: absolute;
bottom: -30px;
left: 50%;
margin-left: -64px;
display: block;
width: 128px;
height: 24px;
border: 1px solid #313131;
background-color: #434343;
padding: 4px;
z-index: 999;
text-align: center;
}
.tt > div > span
{
position: relative;
top: -2px;
}
.dot
{
position: absolute;
width: 3px;
height: 3px;
margin-top: 0px;
margin-left: 0px;
border: 1px solid transparent;
}
.dot.active
{
z-index: 9999 !important;
width: 8px;
height: 8px;
margin-top: -2px;
margin-left: -3px;
}
.zoom
{
position: fixed;
left: 53%;
top: 10px;
display: block;
width: 24px;
height: 24px;
text-align: center;
margin-left: 20px !important;
}
.zoom.in
{
margin-left: -3px !important;
}
+259
View File
@@ -0,0 +1,259 @@
/obj/machinery/computer/crew
name = "crew monitoring console"
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
icon_screen = "crew"
icon_keyboard = "med_key"
use_power = 1
idle_power_usage = 250
active_power_usage = 500
circuit = /obj/item/weapon/circuitboard/computer/crew
/obj/machinery/computer/crew/attack_ai(mob/user)
if(stat & (BROKEN|NOPOWER))
return
crewmonitor.show(user)
/obj/machinery/computer/crew/attack_hand(mob/user)
if(..())
return
if(stat & (BROKEN|NOPOWER))
return
crewmonitor.show(user)
var/global/datum/crewmonitor/crewmonitor = new
/datum/crewmonitor
var/list/jobs
var/list/interfaces
var/list/data
/datum/crewmonitor/New()
. = ..()
var/list/jobs = new/list()
jobs["Captain"] = 00
jobs["Head of Personnel"] = 50
jobs["Head of Security"] = 10
jobs["Warden"] = 11
jobs["Security Officer"] = 12
jobs["Detective"] = 13
jobs["Chief Medical Officer"] = 20
jobs["Chemist"] = 21
jobs["Geneticist"] = 22
jobs["Virologist"] = 23
jobs["Medical Doctor"] = 24
jobs["Research Director"] = 30
jobs["Scientist"] = 31
jobs["Roboticist"] = 32
jobs["Chief Engineer"] = 40
jobs["Station Engineer"] = 41
jobs["Atmospheric Technician"] = 42
jobs["Quartermaster"] = 51
jobs["Shaft Miner"] = 52
jobs["Cargo Technician"] = 53
jobs["Bartender"] = 61
jobs["Cook"] = 62
jobs["Botanist"] = 63
jobs["Librarian"] = 64
jobs["Chaplain"] = 65
jobs["Clown"] = 66
jobs["Mime"] = 67
jobs["Janitor"] = 68
jobs["Lawyer"] = 69
jobs["Admiral"] = 200
jobs["Centcom Commander"] = 210
jobs["Custodian"] = 211
jobs["Medical Officer"] = 212
jobs["Research Officer"] = 213
jobs["Emergency Response Team Commander"] = 220
jobs["Security Response Officer"] = 221
jobs["Engineer Response Officer"] = 222
jobs["Medical Response Officer"] = 223
jobs["Assistant"] = 999 //Unknowns/custom jobs should appear after civilians, and before assistants
src.jobs = jobs
src.interfaces = list()
src.data = list()
register_asset("crewmonitor.js",'crew.js')
register_asset("crewmonitor.css",'crew.css')
/datum/crewmonitor/Destroy()
if (src.interfaces)
for (var/datum/html_interface/hi in interfaces)
qdel(hi)
src.interfaces = null
return ..()
/datum/crewmonitor/proc/show(mob/mob, z)
if (mob.client)
sendResources(mob.client)
if (!z) z = mob.z
if (z > 0 && src.interfaces)
var/datum/html_interface/hi
if (!src.interfaces["[z]"])
src.interfaces["[z]"] = new/datum/html_interface/nanotrasen(src, "Crew Monitoring", 900, 540, "<link rel=\"stylesheet\" type=\"text/css\" href=\"crewmonitor.css\" /><script type=\"text/javascript\">var z = [z]; var tile_size = [world.icon_size]; var maxx = [world.maxx]; var maxy = [world.maxy];</script><script type=\"text/javascript\" src=\"crewmonitor.js\"></script>")
hi = src.interfaces["[z]"]
hi.updateContent("content", "<div id=\"minimap\"><a href=\"javascript:zoomIn();\" class=\"zoom in\">+</a><a href=\"javascript:zoomOut();\" class=\"zoom\">-</a></div><div id=\"textbased\"></div>")
src.update(z, TRUE)
else
hi = src.interfaces["[z]"]
// Debugging purposes
mob << browse_rsc(file("code/game/machinery/computer/crew.js"), "crew.js")
mob << browse_rsc(file("code/game/machinery/computer/crew.css"), "crew.css")
hi = src.interfaces["[z]"]
hi.show(mob)
src.updateFor(mob, hi, z)
/datum/crewmonitor/proc/updateFor(hclient_or_mob, datum/html_interface/hi, z)
// This check will succeed if updateFor is called after showing to the player, but will fail
// on regular updates. Since we only really need this once we don't care if it fails.
hi.callJavaScript("clearAll", null, hclient_or_mob)
for (var/list/L in data)
hi.callJavaScript("add", L, hclient_or_mob)
hi.callJavaScript("onAfterUpdate", null, hclient_or_mob)
/datum/crewmonitor/proc/update(z, ignore_unused = FALSE)
if (src.interfaces["[z]"])
var/datum/html_interface/hi = src.interfaces["[z]"]
if (ignore_unused || hi.isUsed())
var/list/results = list()
var/obj/item/clothing/under/U
var/obj/item/weapon/card/id/I
var/turf/pos
var/ijob
var/name
var/assignment
var/dam1
var/dam2
var/dam3
var/dam4
var/area
var/pos_x
var/pos_y
var/life_status
for(var/mob/living/carbon/human/H in mob_list)
// Check if their z-level is correct and if they are wearing a uniform.
// Accept H.z==0 as well in case the mob is inside an object.
if ((H.z == 0 || H.z == z) && istype(H.w_uniform, /obj/item/clothing/under))
U = H.w_uniform
// Are the suit sensors on?
if (U.has_sensor && U.sensor_mode)
pos = H.z == 0 || U.sensor_mode == 3 ? get_turf(H) : null
// Special case: If the mob is inside an object confirm the z-level on turf level.
if (H.z == 0 && (!pos || pos.z != z)) continue
I = H.wear_id ? H.wear_id.GetID() : null
if (I)
name = I.registered_name
assignment = I.assignment
ijob = jobs[I.assignment]
else
name = "<i>Unknown</i>"
assignment = ""
ijob = 80
if (U.sensor_mode >= 1) life_status = (!H.stat ? "true" : "false")
else life_status = null
if (U.sensor_mode >= 2)
dam1 = round(H.getOxyLoss(),1)
dam2 = round(H.getToxLoss(),1)
dam3 = round(H.getFireLoss(),1)
dam4 = round(H.getBruteLoss(),1)
else
dam1 = null
dam2 = null
dam3 = null
dam4 = null
if (U.sensor_mode >= 3)
if (!pos) pos = get_turf(H)
var/area/player_area = get_area(H)
area = format_text(player_area.name)
pos_x = pos.x
pos_y = pos.y
else
area = null
pos_x = null
pos_y = null
results[++results.len] = list(name, assignment, ijob, life_status, dam1, dam2, dam3, dam4, area, pos_x, pos_y, H.can_track(null))
src.data = results
src.updateFor(null, hi, z) // updates for everyone
/datum/crewmonitor/proc/hiIsValidClient(datum/html_interface_client/hclient, datum/html_interface/hi)
var/z = ""
for (z in src.interfaces)
if (src.interfaces[z] == hi) break
if (hclient.client.mob && hclient.client.mob.stat == 0 && hclient.client.mob.z == text2num(z))
if (isAI(hclient.client.mob)) return TRUE
else if (isrobot(hclient.client.mob))
return (locate(/obj/machinery/computer/crew, range(world.view, hclient.client.mob))) || (locate(/obj/item/device/sensor_device, hclient.client.mob.contents))
else
return (locate(/obj/machinery/computer/crew, range(1, hclient.client.mob))) || (locate(/obj/item/device/sensor_device, hclient.client.mob.contents))
else
return FALSE
/datum/crewmonitor/Topic(href, href_list[], datum/html_interface_client/hclient)
if (istype(hclient))
if (hclient && hclient.client && hclient.client.mob && isAI(hclient.client.mob))
var/mob/living/silicon/ai/AI = hclient.client.mob
switch (href_list["action"])
if ("select_person")
AI.ai_camera_track(href_list["name"])
if ("select_position")
var/x = text2num(href_list["x"])
var/y = text2num(href_list["y"])
var/turf/tile = locate(x, y, AI.z)
var/obj/machinery/camera/C = locate(/obj/machinery/camera) in range(5, tile)
if (!C) C = locate(/obj/machinery/camera) in urange(10, tile)
if (!C) C = locate(/obj/machinery/camera) in urange(15, tile)
if (C)
var/turf/current_loc = AI.eyeobj.loc
spawn(min(30, get_dist(get_turf(C), AI.eyeobj) / 4))
if (AI && AI.eyeobj && current_loc == AI.eyeobj.loc)
AI.switchCamera(C)
/mob/living/carbon/human/Move()
if (src.w_uniform)
var/old_z = src.z
. = ..()
if (old_z != src.z) crewmonitor.queueUpdate(old_z)
crewmonitor.queueUpdate(src.z)
else
return ..()
/datum/crewmonitor/proc/queueUpdate(z)
addtimer(crewmonitor, "update", 5, TRUE, z)
/datum/crewmonitor/proc/sendResources(var/client/client)
send_asset(client, "crewmonitor.js")
send_asset(client, "crewmonitor.css")
SSminimap.send(client)
+588
View File
@@ -0,0 +1,588 @@
/*!
* jQuery scrollintoview() plugin and :scrollable selector filter
*
* Version 1.8 (14 Jul 2011)
* Requires jQuery 1.4 or newer
*/
(function ($) {
var converter = {
vertical: { x: false, y: true },
horizontal: { x: true, y: false },
both: { x: true, y: true },
x: { x: true, y: false },
y: { x: false, y: true }
};
var settings = {
duration: "fast",
direction: "both"
};
var rootrx = /^(?:html)$/i;
// gets border dimensions
var borders = function (domElement, styles) {
styles = styles || (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(domElement, null) : domElement.currentStyle);
var px = document.defaultView && document.defaultView.getComputedStyle ? true : false;
var b = {
top: (parseFloat(px ? styles.borderTopWidth : $.css(domElement, "borderTopWidth")) || 0),
left: (parseFloat(px ? styles.borderLeftWidth : $.css(domElement, "borderLeftWidth")) || 0),
bottom: (parseFloat(px ? styles.borderBottomWidth : $.css(domElement, "borderBottomWidth")) || 0),
right: (parseFloat(px ? styles.borderRightWidth : $.css(domElement, "borderRightWidth")) || 0)
};
return {
top: b.top,
left: b.left,
bottom: b.bottom,
right: b.right,
vertical: b.top + b.bottom,
horizontal: b.left + b.right
};
};
var dimensions = function ($element) {
var win = $(window);
var isRoot = rootrx.test($element[0].nodeName);
return {
border: isRoot ? { top: 0, left: 0, bottom: 0, right: 0} : borders($element[0]),
scroll: {
top: (isRoot ? win : $element).scrollTop(),
left: (isRoot ? win : $element).scrollLeft()
},
scrollbar: {
right: isRoot ? 0 : $element.innerWidth() - $element[0].clientWidth,
bottom: isRoot ? 0 : $element.innerHeight() - $element[0].clientHeight
},
rect: (function () {
var r = $element[0].getBoundingClientRect();
return {
top: isRoot ? 0 : r.top,
left: isRoot ? 0 : r.left,
bottom: isRoot ? $element[0].clientHeight : r.bottom,
right: isRoot ? $element[0].clientWidth : r.right
};
})()
};
};
$.fn.extend({
scrollintoview: function (options) {
/// <summary>Scrolls the first element in the set into view by scrolling its closest scrollable parent.</summary>
/// <param name="options" type="Object">Additional options that can configure scrolling:
/// duration (default: "fast") - jQuery animation speed (can be a duration string or number of milliseconds)
/// direction (default: "both") - select possible scrollings ("vertical" or "y", "horizontal" or "x", "both")
/// complete (default: none) - a function to call when scrolling completes (called in context of the DOM element being scrolled)
/// </param>
/// <return type="jQuery">Returns the same jQuery set that this function was run on.</return>
options = $.extend({}, settings, options);
options.direction = converter[typeof (options.direction) === "string" && options.direction.toLowerCase()] || converter.both;
var dirStr = "";
if (options.direction.x === true) dirStr = "horizontal";
if (options.direction.y === true) dirStr = dirStr ? "both" : "vertical";
var el = this.eq(0);
var scroller = el.closest(":scrollable(" + dirStr + ")");
// check if there's anything to scroll in the first place
if (scroller.length > 0)
{
scroller = scroller.eq(0);
var dim = {
e: dimensions(el),
s: dimensions(scroller)
};
var rel = {
top: dim.e.rect.top - (dim.s.rect.top + dim.s.border.top),
bottom: dim.s.rect.bottom - dim.s.border.bottom - dim.s.scrollbar.bottom - dim.e.rect.bottom,
left: dim.e.rect.left - (dim.s.rect.left + dim.s.border.left),
right: dim.s.rect.right - dim.s.border.right - dim.s.scrollbar.right - dim.e.rect.right
};
var animOptions = {};
// vertical scroll
if (options.direction.y === true)
{
if (rel.top < 0)
{
animOptions.scrollTop = dim.s.scroll.top + rel.top;
}
else if (rel.top > 0 && rel.bottom < 0)
{
animOptions.scrollTop = dim.s.scroll.top + Math.min(rel.top, -rel.bottom);
}
}
// horizontal scroll
if (options.direction.x === true)
{
if (rel.left < 0)
{
animOptions.scrollLeft = dim.s.scroll.left + rel.left;
}
else if (rel.left > 0 && rel.right < 0)
{
animOptions.scrollLeft = dim.s.scroll.left + Math.min(rel.left, -rel.right);
}
}
// scroll if needed
if (!$.isEmptyObject(animOptions))
{
if (rootrx.test(scroller[0].nodeName))
{
scroller = $("html,body");
}
scroller
.animate(animOptions, options.duration)
.eq(0) // we want function to be called just once (ref. "html,body")
.queue(function (next) {
$.isFunction(options.complete) && options.complete.call(scroller[0]);
next();
});
}
else
{
// when there's nothing to scroll, just call the "complete" function
$.isFunction(options.complete) && options.complete.call(scroller[0]);
}
}
// return set back
return this;
}
});
var scrollValue = {
auto: true,
scroll: true,
visible: false,
hidden: false
};
$.extend($.expr[":"], {
scrollable: function (element, index, meta, stack) {
var direction = converter[typeof (meta[3]) === "string" && meta[3].toLowerCase()] || converter.both;
var styles = (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(element, null) : element.currentStyle);
var overflow = {
x: scrollValue[styles.overflowX.toLowerCase()] || false,
y: scrollValue[styles.overflowY.toLowerCase()] || false,
isRoot: rootrx.test(element.nodeName)
};
// check if completely unscrollable (exclude HTML element because it's special)
if (!overflow.x && !overflow.y && !overflow.isRoot)
{
return false;
}
var size = {
height: {
scroll: element.scrollHeight,
client: element.clientHeight
},
width: {
scroll: element.scrollWidth,
client: element.clientWidth
},
// check overflow.x/y because iPad (and possibly other tablets) don't dislay scrollbars
scrollableX: function () {
return (overflow.x || overflow.isRoot) && this.width.scroll > this.width.client;
},
scrollableY: function () {
return (overflow.y || overflow.isRoot) && this.height.scroll > this.height.client;
}
};
return direction.y && size.scrollableY() || direction.x && size.scrollableX();
}
});
})(jQuery);
/*!
* Crew manifest script
*/
var minimap_height = 480;
var scale_x;
var scale_y;
var zoom_factor = null;
var minimap_mousedown = false;
var minimap_mousedown_scrollLeft;
var minimap_mousedown_scrollTop;
var minimap_mousedown_clientX;
var minimap_mousedown_clientY;
var minimap_mousedown_counter = 0;
function disableSelection(){ return false; };
$(window).on("onUpdateContent", function()
{
$("#textbased").html("<table><colgroup><col /><col style=\"width: 24px;\" class=\"colhealth\" /><col style=\"width: 180px;\" /></colgroup><thead><tr><td><h3>Name</h3></td><td><h3>&nbsp;</h3></td><td><h3>Position</h3></td></tr></thead><tbody id=\"textbased-tbody\"></tbody></table>");
$("#minimap").append("<img src=\"minimap_" + z + ".png\" id=\"map\" style=\"width: auto; height: " + minimap_height + "px;\" />");
$("body")[0].onselectstart = disableSelection;
$("#minimap").on("click", function(e)
{
if (!$(e.target).is(".zoom,.dot"))
{
var x = ((((e.clientX + this.scrollLeft - 8) / scale_x) / tile_size) + 1).toFixed(0);
var y = ((maxy - (((e.clientY + this.scrollTop - 8) / scale_y) / tile_size)) + 1).toFixed(0);
window.location.href = "byond://?src=" + hSrc + "&action=select_position&x=" + x + "&y=" + y;
}
}).on("mousedown", function(e)
{
minimap_mousedown_scrollLeft = this.scrollLeft;
minimap_mousedown_scrollTop = this.scrollTop;
minimap_mousedown_clientX = e.clientX;
minimap_mousedown_clientY = e.clientY;
var c = ++minimap_mousedown_counter;
setTimeout(function()
{
if (c == minimap_mousedown_counter)
{
minimap_mousedown = true;
$("#minimap").css("cursor", "move");
}
}, 100);
});
$(document).on("mousemove", function(e)
{
if (minimap_mousedown)
{
var offsetX = minimap_mousedown_clientX - e.clientX;
var offsetY = minimap_mousedown_clientY - e.clientY;
var minimap = document.getElementById("minimap");
minimap.scrollLeft = minimap_mousedown_scrollLeft + offsetX;
minimap.scrollTop = minimap_mousedown_scrollTop + offsetY;
}
}).on("mouseup", function()
{
++minimap_mousedown_counter;
if (minimap_mousedown)
{
document.body.focus();
minimap_mousedown = false;
$("#minimap").css("cursor", "");
}
});
$(window).on("resize", onResize);
scaleMinimap(1.00);
});
function zoomIn()
{
scaleMinimap(Math.min(6.00, zoom_factor + 1.00));
}
function zoomOut()
{
scaleMinimap(Math.max(1.00, zoom_factor - 1.00));
}
function scaleMinimap(factor)
{
var $minimap = $("#minimap");
if (factor != zoom_factor)
{
zoom_factor = factor;
var old_map_width = $minimap.width();
var old_map_height = $minimap.height();
var old_canvas_size = $("#minimap > img").height(); // height is assumed to be the same
var new_canvas_size = minimap_height * factor; // ditto
var old_scrollLeft = $minimap[0].scrollLeft;
var old_scrollTop = $minimap[0].scrollTop;
var old_factor = old_canvas_size / minimap_height;
var diff_factor = factor - old_factor;
var old_centerX = ((old_map_width / 2) * diff_factor) + old_scrollLeft;
var old_centerY = ((old_map_height / 2) * diff_factor) + old_scrollTop;
$("#minimap > img").css("height", new_canvas_size + "px");
$minimap.css("max-width", new_canvas_size + "px");
var new_map_width = $minimap.width();
var new_map_height = $minimap.height();
var new_centerX = (new_map_width / 2) + old_centerX;
var new_centerY = (new_map_height / 2) + old_centerY;
var scrollLeft = new_centerX - (new_map_width / 2);
var scrollTop = new_centerY - (new_map_height / 2);
scale_x = new_canvas_size / (maxx * tile_size);
scale_y = new_canvas_size / (maxy * tile_size);
onResize();
$minimap[0].scrollLeft = scrollLeft;
$minimap[0].scrollTop = scrollTop;
$(".dot").each(function()
{
var $this = $(this);
var tx = translateX(parseInt($this.attr("data-x")));
var ty = translateY(parseInt($this.attr("data-y")));
// Workaround for IE bug where it doesn't modify the positions.
setTimeout(function(){ $this.css({ "top": ty + "px", "left": tx + "px" });}, 0);
});
}
}
function onResize()
{
if (zoom_factor == 1.00)
{
$(".zoom").css("left", "442px");
$("#minimap").css("max-height", Math.min($(window).height() - 16, 480) + "px");
}
else
{
$(".zoom").css("left", ($("#minimap").width() - 34) + "px");
$("#minimap").css("max-height", Math.min($(window).height() - 16, $("#minimap > img").height()) + "px");
}
if (expandHealth())
{
$(".colhealth").css("width", "150px");
$(".health").removeClass("tt");
}
else
{
$(".colhealth").css("width", "24px");
$(".health").addClass("tt");
}
$("body").css("padding-left", Math.min($(window).width() - 400, $("#minimap").width() - 10) + "px");
}
function expandHealth()
{
return $("#textbased").width() > 510;
}
var updateMap = true;
function switchTo(i)
{
if (i == 1)
{
$("#minimap").hide();
$("#textbased").show();
}
else
{
$("#textbased").hide();
$("#minimap").show();
}
}
var orig_scrollTop = 0;
function clearAll()
{
orig_scrollTop = $(window).scrollTop();
$("#textbased-tbody").empty();
$("#minimap .dot").remove();
}
function onAfterUpdate()
{
$(window).scrollTop(orig_scrollTop);
}
function isHead(ijob)
{
return (ijob % 10 == 0); // head roles always end in 0
}
function getColor(ijob)
{
if (ijob == 0) { return "#C06616"; } // captain
else if (ijob >= 10 && ijob < 20) { return "#E74C3C"; } // security
else if (ijob >= 20 && ijob < 30) { return "#3498DB"; } // medical
else if (ijob >= 30 && ijob < 40) { return "#9B59B6"; } // science
else if (ijob >= 40 && ijob < 50) { return "#F1C40F"; } // engineering
else if (ijob >= 50 && ijob < 60) { return "#F39C12"; } // cargo
else if (ijob >= 200 && ijob < 230) { return "#00C100"; } // Centcom
else { return "#C38312"; } // other / unknown
}
function add(name, assignment, ijob, life_status, dam1, dam2, dam3, dam4, area, pos_x, pos_y, in_range)
{
try { ijob = parseInt(ijob); }
catch (ex) { ijob = 0; }
var ls = "";
if (life_status === null) { ls = (life_status ? "<span class=\"bad\">Deceased</span>" : "<span class=\"good\">Living</span>"); }
var healthHTML = "";
if (dam1 != "" || dam2 != "" || dam3 != "" || dam4 != "")
{
var avg_dam = parseInt(dam1) + parseInt(dam2) + parseInt(dam3) + parseInt(dam4);
var i;
if (avg_dam <= 0) { i = 5; }
else if (avg_dam <= 25) { i = 4; }
else if (avg_dam <= 50) { i = 3; }
else if (avg_dam <= 75) { i = 2; }
else { i = 0; }
healthHTML = "<div class=\"health health-" + i + (expandHealth() ? "" : " tt") + "\"><div><span>(<font color=\"#3498db\">" + dam1 + "</font>/<font color=\"#2ecc71\">" + dam2 + "</font>/<font color=\"#e67e22\">" + dam3 + "</font>/<font color=\"#e74c3c\">" + dam4 + "</font>)</span></div></div>";
}
else
{
healthHTML = "<div class=\"health health-" + (life_status == "" ? -1 : (life_status == "true" ? 4 : 0)) + (expandHealth() ? "" : " tt") + "\"><div><span>Not Available</span></div></div>";
}
var trElem = $("<tr></tr>").attr("data-ijob", ijob);
var tdElem;
var spanElem;
tdElem = $("<td></td>");
var italics = false;
if (name.length >= 7 && name.substring(0, 3) == "<i>")
{
name = name.substring(3, name.length - 4);
italics = true;
}
spanElem = $("<span></span>").text(name);
if (italics)
{
spanElem.css("font-style", "italic");
}
if (isHead(ijob)) { spanElem.css("font-weight", "bold"); }
var color = getColor(ijob);
if (color) { spanElem.css("color", color); }
tdElem.append(spanElem);
if (assignment) { tdElem.append($("<span></span>").text(" (" + assignment + ")")); }
trElem.append(tdElem);
tdElem = $("<td style=\"vertical-align: top; cursor: default;\"></td>");
tdElem.html(healthHTML);
trElem.append(tdElem);
tdElem = $("<td style=\"cursor: default;\"></td>");
if (area && pos_x && pos_y)
{
tdElem.append($("<div></div>").text(area).addClass("tt").append($("<div></div>").append($("<span></span>").text("(" + pos_x + ", " + pos_y + ")"))));
tdElem.css("cursor", "pointer").on("click", function()
{
window.clipboardData.setData("Text", pos_x + ", " + pos_y);
});
}
else { tdElem.text("Not Available"); }
trElem.append(tdElem);
var item = $("#textbased-tbody > tr").filter(function(){ return parseInt($(this).attr("data-ijob")) >= ijob; }).eq(0);
if (item.length > 0) { trElem.insertBefore(item); }
else { $("#textbased-tbody").append(trElem); }
if (updateMap && pos_x && pos_y && (in_range == "1"))
{
var x = parseInt(pos_x);
var y = maxy - parseInt(pos_y);
var tx = translateX(x);
var ty = translateY(y);
var dotElem = $("<div class=\"dot\" style=\"top: " + ty + "px; left: " + tx + "px; background-color: " + color + "; z-index: " + ijob + ";\" data-x=\"" + x + "\" data-y=\"" + y + "\"></div>");
$("#minimap").append(dotElem);
var counter = 0;
function enable()
{
++counter;
dotElem.addClass("active").css({ "border-color": color });
}
function disable()
{
++counter;
dotElem.removeClass("active").css({ "border-color": "transparent" });
}
function click(e)
{
e.preventDefault();
e.stopPropagation();
window.location.href = "byond://?src=" + hSrc + "&action=select_person&name=" + encodeURIComponent(name);
}
trElem.on("mouseover", function()
{
enable();
if (zoom_factor > 1.00)
{
var c = counter;
setTimeout(function()
{
if (c == counter)
{
var minimap = document.getElementById("minimap");
var half = $(minimap).height() / 2;
var offset = $(dotElem).offset();
minimap.scrollLeft = offset.left + minimap.scrollLeft - half;
minimap.scrollTop = offset.top + minimap.scrollTop - half;
}
}, 100);
}
}).on("mouseout", disable).on("click", click);
dotElem.on("mouseover", function()
{
trElem.addClass("hover");
enable();
trElem.scrollintoview();
}).on("mouseout", function()
{
trElem.removeClass("hover");
disable();
}).on("click", click);
}
}
function translateX(n) { return (translate(n - 1.5, scale_x) ).toFixed(0); }
function translateY(n) { return (translate(n + 0.75, scale_y) ).toFixed(0); }
function translate(n, scale)
{
return (n * tile_size) * scale;
}
+602
View File
@@ -0,0 +1,602 @@
#define INJECTOR_TIMEOUT 100
#define REJUVENATORS_INJECT 15
#define REJUVENATORS_MAX 90
#define NUMBER_OF_BUFFERS 3
#define RADIATION_STRENGTH_MAX 15
#define RADIATION_STRENGTH_MULTIPLIER 1 //larger has a more range
#define RADIATION_DURATION_MAX 30
#define RADIATION_ACCURACY_MULTIPLIER 3 //larger is less accurate
#define RADIATION_IRRADIATION_MULTIPLIER 0.2 //multiplier for how much radiation a test subject recieves
#define SCANNER_ACTION_SE 1
#define SCANNER_ACTION_UI 2
#define SCANNER_ACTION_UE 3
#define SCANNER_ACTION_MIXED 4
/obj/machinery/computer/scan_consolenew
name = "\improper DNA scanner access console"
desc = "Scan DNA."
icon_screen = "dna"
icon_keyboard = "med_key"
density = 1
circuit = /obj/item/weapon/circuitboard/computer/scan_consolenew
var/radduration = 2
var/radstrength = 1
var/list/buffer[NUMBER_OF_BUFFERS]
var/injectorready = 0 //Quick fix for issue 286 (screwdriver the screen twice to restore injector) -Pete
var/current_screen = "mainmenu"
var/obj/machinery/dna_scannernew/connected = null
var/obj/item/weapon/disk/data/diskette = null
var/list/delayed_action = null
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 400
/obj/machinery/computer/scan_consolenew/attackby(obj/item/I, mob/user, params)
if (istype(I, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES
if (!src.diskette)
if(!user.drop_item())
return
I.loc = src
src.diskette = I
user << "<span class='notice'>You insert [I].</span>"
src.updateUsrDialog()
return
else
return ..()
/obj/machinery/computer/scan_consolenew/New()
..()
spawn(5)
for(dir in list(NORTH,EAST,SOUTH,WEST))
connected = locate(/obj/machinery/dna_scannernew, get_step(src, dir))
if(!isnull(connected))
break
spawn(250)
injectorready = 1
return
return
/obj/machinery/computer/scan_consolenew/attack_hand(mob/user)
if(..())
return
ShowInterface(user)
/obj/machinery/computer/scan_consolenew/proc/ShowInterface(mob/user, last_change)
if(!user) return
var/datum/browser/popup = new(user, "scannernew", "DNA Modifier Console", 800, 630) // Set up the popup browser window
if(!( in_range(src, user) || istype(user, /mob/living/silicon) ))
popup.close()
return
popup.add_stylesheet("scannernew", 'html/browser/scannernew.css')
var/mob/living/carbon/viable_occupant
var/occupant_status = "<div class='line'><div class='statusLabel'>Subject Status:</div><div class='statusValue'>"
var/scanner_status
var/temp_html
if(connected && connected.is_operational())
if(connected.occupant) //set occupant_status message
viable_occupant = connected.occupant
if(viable_occupant.has_dna() && (!(viable_occupant.disabilities & NOCLONE) || (connected.scan_level == 3))) //occupent is viable for dna modification
occupant_status += "[viable_occupant.name] => "
switch(viable_occupant.stat)
if(CONSCIOUS)
occupant_status += "<span class='good'>Conscious</span>"
if(UNCONSCIOUS)
occupant_status += "<span class='average'>Unconscious</span>"
else
occupant_status += "<span class='bad'>DEAD</span>"
occupant_status += "</div></div>"
occupant_status += "<div class='line'><div class='statusLabel'>Health:</div><div class='progressBar'><div style='width: [viable_occupant.health]%;' class='progressFill good'></div></div><div class='statusValue'>[viable_occupant.health] %</div></div>"
occupant_status += "<div class='line'><div class='statusLabel'>Radiation Level:</div><div class='progressBar'><div style='width: [viable_occupant.radiation]%;' class='progressFill bad'></div></div><div class='statusValue'>[viable_occupant.radiation] %</div></div>"
var/rejuvenators = viable_occupant.reagents.get_reagent_amount("epinephrine")
occupant_status += "<div class='line'><div class='statusLabel'>Rejuvenators:</div><div class='progressBar'><div style='width: [round((rejuvenators / REJUVENATORS_MAX) * 100)]%;' class='progressFill highlight'></div></div><div class='statusValue'>[rejuvenators] units</div></div>"
occupant_status += "<div class='line'><div class='statusLabel'>Unique Enzymes :</div><div class='statusValue'><span class='highlight'>[viable_occupant.dna.unique_enzymes]</span></div></div>"
occupant_status += "<div class='line'><div class='statusLabel'>Last Operation:</div><div class='statusValue'>[last_change ? last_change : "----"]</div></div>"
else
viable_occupant = null
occupant_status += "<span class='bad'>Invalid DNA structure</span></div></div>"
else
occupant_status += "<span class='bad'>No subject detected</span></div></div>"
if(connected.state_open)
scanner_status = "Open"
else
scanner_status = "Closed"
if(connected.locked)
scanner_status += " <span class='bad'>(Locked)</span>"
else
scanner_status += " <span class='good'>(Unlocked)</span>"
else
occupant_status += "<span class='bad'>----</span></div></div>"
scanner_status += "<span class='bad'>Error: No scanner detected</span>"
var/status = "<div class='statusDisplay'>"
status += "<div class='line'><div class='statusLabel'>Scanner:</div><div class='statusValue'>[scanner_status]</div></div>"
status += "[occupant_status]"
status += "<div class='line'><h3>Radiation Emitter Status</h3></div>"
var/stddev = radstrength*RADIATION_STRENGTH_MULTIPLIER
status += "<div class='line'><div class='statusLabel'>Output Level:</div><div class='statusValue'>[radstrength]</div></div>"
status += "<div class='line'><div class='statusLabel'>&nbsp;&nbsp;\> Mutation:</div><div class='statusValue'>(-[stddev] to +[stddev] = 68 %) (-[2*stddev] to +[2*stddev] = 95 %)</div></div>"
if(connected)
stddev = RADIATION_ACCURACY_MULTIPLIER/(radduration + (connected.precision_coeff ** 2))
else
stddev = RADIATION_ACCURACY_MULTIPLIER/radduration
var/chance_to_hit
switch(stddev) //hardcoded values from a z-table for a normal distribution
if(0 to 0.25)
chance_to_hit = ">95 %"
if(0.25 to 0.5)
chance_to_hit = "68-95 %"
if(0.5 to 0.75)
chance_to_hit = "55-68 %"
else
chance_to_hit = "<38 %"
status += "<div class='line'><div class='statusLabel'>Pulse Duration:</div><div class='statusValue'>[radduration]</div></div>"
status += "<div class='line'><div class='statusLabel'>&nbsp;&nbsp;\> Accuracy:</div><div class='statusValue'>[chance_to_hit]</div></div>"
status += "<br></div>" // Close statusDisplay div
var/buttons = "<a href='?src=\ref[src];'>Scan</a> "
if(connected)
buttons += " <a href='?src=\ref[src];task=toggleopen;'>[connected.state_open ? "Close" : "Open"] Scanner</a> "
if (connected.state_open)
buttons += "<span class='linkOff'>[connected.locked ? "Unlock" : "Lock"] Scanner</span> "
else
buttons += "<a href='?src=\ref[src];task=togglelock;'>[connected.locked ? "Unlock" : "Lock"] Scanner</a> "
else
buttons += "<span class='linkOff'>Open Scanner</span> <span class='linkOff'>Lock Scanner</span> "
if(viable_occupant)
buttons += "<a href='?src=\ref[src];task=rejuv'>Inject Rejuvenators</a> "
else
buttons += "<span class='linkOff'>Inject Rejuvenators</span> "
if(diskette)
buttons += "<a href='?src=\ref[src];task=ejectdisk'>Eject Disk</a> "
else
buttons += "<span class='linkOff'>Eject Disk</span> "
if(current_screen == "buffer")
buttons += "<a href='?src=\ref[src];task=screen;text=mainmenu;'>Radiation Emitter Menu</a> "
else
buttons += "<a href='?src=\ref[src];task=screen;text=buffer;'>Buffer Menu</a> "
switch(current_screen)
if("working")
temp_html += status
temp_html += "<h1>System Busy</h1>"
temp_html += "Working ... Please wait ([radduration] Seconds)"
if("buffer")
temp_html += status
temp_html += buttons
temp_html += "<h1>Buffer Menu</h1>"
if(istype(buffer))
for(var/i=1, i<=buffer.len, i++)
temp_html += "<br>Slot [i]: "
var/list/buffer_slot = buffer[i]
if( !buffer_slot || !buffer_slot.len || !buffer_slot["name"] || !((buffer_slot["UI"] && buffer_slot["UE"]) || buffer_slot["SE"]) )
temp_html += "<br>\tNo Data"
if(viable_occupant)
temp_html += "<br><a href='?src=\ref[src];task=setbuffer;num=[i];'>Save to Buffer</a> "
else
temp_html += "<br><span class='linkOff'>Save to Buffer</span> "
temp_html += "<span class='linkOff'>Clear Buffer</span> "
if(diskette)
temp_html += "<a href='?src=\ref[src];task=loaddisk;num=[i];'>Load from Disk</a> "
else
temp_html += "<span class='linkOff'>Load from Disk</span> "
temp_html += "<span class='linkOff'>Save to Disk</span> "
else
var/ui = buffer_slot["UI"]
var/se = buffer_slot["SE"]
var/ue = buffer_slot["UE"]
var/name = buffer_slot["name"]
var/label = buffer_slot["label"]
var/blood_type = buffer_slot["blood_type"]
temp_html += "<br>\t<a href='?src=\ref[src];task=setbufferlabel;num=[i];'>Label</a>: [label ? label : name]"
temp_html += "<br>\tSubject: [name]"
if(ue && name && blood_type)
temp_html += "<br>\tBlood Type: [blood_type]"
temp_html += "<br>\tUE: [ue] "
if(viable_occupant)
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=ue'>Occupant</a> "
else
temp_html += "<span class='linkOff'>Occupant</span>"
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_UE]'>Occupant:Delayed</a> "
if(injectorready)
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=ue'>Injector</a>"
else
temp_html += "<span class='linkOff'>Injector</span>"
else
temp_html += "<br>\tBlood Type: No Data"
temp_html += "<br>\tUE: No Data"
if(ui)
temp_html += "<br>\tUI: [ui] "
if(viable_occupant)
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=ui'>Occupant</a> "
else
temp_html += "<span class='linkOff'>Occupant</span>"
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_UI]'>Occupant:Delayed</a> "
if(injectorready)
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=ui'>Injector</a>"
else
temp_html += "<span class='linkOff'>Injector</span>"
else
temp_html += "<br>\tUI: No Data"
if(ue && name && blood_type && ui)
temp_html += "<br>\tUI+UE: [ui]/[ue] "
if(viable_occupant)
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=mixed'>Occupant</a> "
else
temp_html += "<span class='linkOff'>Occupant</span>"
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_MIXED]'>Occupant:Delayed</a> "
if(injectorready)
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=mixed'>UI+UE Injector</a>"
else
temp_html += "<span class='linkOff'>UI+UE Injector</span>"
if(se)
temp_html += "<br>\tSE: [se] "
if(viable_occupant)
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=se'>Occupant</a> "
else
temp_html += "<span class='linkOff'>Occupant</span> "
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_SE]'>Occupant:Delayed</a> "
if(injectorready)
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=se'>Injector</a>"
else
temp_html += "<span class='linkOff'>Injector</span>"
else
temp_html += "<br>\tSE: No Data"
if(viable_occupant)
temp_html += "<br><a href='?src=\ref[src];task=setbuffer;num=[i];'>Save to Buffer</a> "
else
temp_html += "<br><span class='linkOff'>Save to Buffer</span> "
temp_html += "<a href='?src=\ref[src];task=clearbuffer;num=[i];'>Clear Buffer</a> "
if(diskette)
temp_html += "<a href='?src=\ref[src];task=loaddisk;num=[i];'>Load from Disk</a> "
else
temp_html += "<span class='linkOff'>Load from Disk</span> "
if(diskette && !diskette.read_only)
temp_html += "<a href='?src=\ref[src];task=savedisk;num=[i];'>Save to Disk</a> "
else
temp_html += "<span class='linkOff'>Save to Disk</span> "
else
temp_html += status
temp_html += buttons
temp_html += "<h1>Radiation Emitter Menu</h1>"
temp_html += "<a href='?src=\ref[src];task=setstrength;num=[radstrength-1];'>--</a> <a href='?src=\ref[src];task=setstrength;'>Output Level</a> <a href='?src=\ref[src];task=setstrength;num=[radstrength+1];'>++</a>"
temp_html += "<br><a href='?src=\ref[src];task=setduration;num=[radduration-1];'>--</a> <a href='?src=\ref[src];task=setduration;'>Pulse Duration</a> <a href='?src=\ref[src];task=setduration;num=[radduration+1];'>++</a>"
temp_html += "<h3>Irradiate Subject</h3>"
temp_html += "<div class='line'><div class='statusLabel'>Unique Identifier:</div><div class='statusValue'><div class='clearBoth'>"
var/max_line_len = 7*DNA_BLOCK_SIZE
if(viable_occupant)
temp_html += "<div class='dnaBlockNumber'>1</div>"
var/len = length(viable_occupant.dna.uni_identity)
for(var/i=1, i<=len, i++)
temp_html += "<a class='dnaBlock' href='?src=\ref[src];task=pulseui;num=[i];'>[copytext(viable_occupant.dna.uni_identity,i,i+1)]</a>"
if ((i % max_line_len) == 0)
temp_html += "</div><div class='clearBoth'>"
if((i % DNA_BLOCK_SIZE) == 0 && i < len)
temp_html += "<div class='dnaBlockNumber'>[(i / DNA_BLOCK_SIZE) + 1]</div>"
else
temp_html += "----"
temp_html += "</div></div></div><br>"
temp_html += "<br><div class='line'><div class='statusLabel'>Structural Enzymes:</div><div class='statusValue'><div class='clearBoth'>"
if(viable_occupant)
temp_html += "<div class='dnaBlockNumber'>1</div>"
var/len = length(viable_occupant.dna.struc_enzymes)
for(var/i=1, i<=len, i++)
temp_html += "<a class='dnaBlock' href='?src=\ref[src];task=pulsese;num=[i];'>[copytext(viable_occupant.dna.struc_enzymes,i,i+1)]</a>"
if ((i % max_line_len) == 0)
temp_html += "</div><div class='clearBoth'>"
if((i % DNA_BLOCK_SIZE) == 0 && i < len)
temp_html += "<div class='dnaBlockNumber'>[(i / DNA_BLOCK_SIZE) + 1]</div>"
else
temp_html += "----"
temp_html += "</div></div></div>"
popup.set_content(temp_html)
popup.open()
/obj/machinery/computer/scan_consolenew/Topic(href, href_list)
if(..())
return
if(!isturf(usr.loc))
return
if(!( (isturf(loc) && in_range(src, usr)) || istype(usr, /mob/living/silicon) ))
return
if(current_screen == "working")
return
add_fingerprint(usr)
usr.set_machine(src)
var/mob/living/carbon/viable_occupant = get_viable_occupant()
//Basic Tasks///////////////////////////////////////////
var/num = round(text2num(href_list["num"]))
var/last_change
switch(href_list["task"])
if("togglelock")
if(connected)
connected.locked = !connected.locked
if("toggleopen")
if(connected)
connected.toggle_open(usr)
if("setduration")
if(!num)
num = round(input(usr, "Choose pulse duration:", "Input an Integer", null) as num|null)
if(num)
radduration = Wrap(num, 1, RADIATION_DURATION_MAX+1)
if("setstrength")
if(!num)
num = round(input(usr, "Choose pulse strength:", "Input an Integer", null) as num|null)
if(num)
radstrength = Wrap(num, 1, RADIATION_STRENGTH_MAX+1)
if("screen")
current_screen = href_list["text"]
if("rejuv")
if(viable_occupant && viable_occupant.reagents)
var/epinephrine_amount = viable_occupant.reagents.get_reagent_amount("epinephrine")
var/can_add = max(min(REJUVENATORS_MAX - epinephrine_amount, REJUVENATORS_INJECT), 0)
viable_occupant.reagents.add_reagent("epinephrine", can_add)
if("setbufferlabel")
var/text = sanitize(input(usr, "Input a new label:", "Input an Text", null) as text|null)
if(num && text)
num = Clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
buffer_slot["label"] = text
if("setbuffer")
if(num && viable_occupant)
num = Clamp(num, 1, NUMBER_OF_BUFFERS)
buffer[num] = list(
"label"="Buffer[num]:[viable_occupant.real_name]",
"UI"=viable_occupant.dna.uni_identity,
"SE"=viable_occupant.dna.struc_enzymes,
"UE"=viable_occupant.dna.unique_enzymes,
"name"=viable_occupant.real_name,
"blood_type"=viable_occupant.dna.blood_type
)
if("clearbuffer")
if(num)
num = Clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
buffer_slot.Cut()
if("transferbuffer")
if(num && viable_occupant)
switch(href_list["text"]) //Numbers are this high because other way upgrading laser is just not worth the hassle, and i cant think of anything better to inmrove
if("se")
apply_buffer(SCANNER_ACTION_SE,num)
if("ui")
apply_buffer(SCANNER_ACTION_UI,num)
if("ue")
apply_buffer(SCANNER_ACTION_UE,num)
if("mixed")
apply_buffer(SCANNER_ACTION_MIXED,num)
if("injector")
if(num && injectorready)
num = Clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
var/obj/item/weapon/dnainjector/timed/I
switch(href_list["text"])
if("se")
if(buffer_slot["SE"])
I = new /obj/item/weapon/dnainjector/timed(loc)
var/powers = 0
for(var/datum/mutation/human/HM in good_mutations + bad_mutations + not_good_mutations)
if(HM.check_block_string(buffer_slot["SE"]))
I.add_mutations.Add(HM)
if(HM in good_mutations)
powers += 1
if(HM in bad_mutations + not_good_mutations)
powers -= 1 //To prevent just unlocking everything to get all powers to a syringe for max tech
else
I.remove_mutations.Add(HM)
I.origin_tech = "biotech=2;engineering=[max(1,min(6,powers))]" //With 6 powers available this tech level will be 1-6, also safety check if new powers get added
var/time_coeff
for(var/datum/mutation/human/HM in I.add_mutations)
if(!time_coeff)
time_coeff = HM.time_coeff
continue
time_coeff = min(time_coeff,HM.time_coeff)
if(connected)
I.duration = I.duration * time_coeff * connected.damage_coeff
I.damage_coeff = connected.damage_coeff
if("ui")
if(buffer_slot["UI"])
I = new /obj/item/weapon/dnainjector/timed(loc)
I.fields = list("UI"=buffer_slot["UI"])
if(connected)
I.damage_coeff = connected.damage_coeff
if("ue")
if(buffer_slot["name"] && buffer_slot["UE"] && buffer_slot["blood_type"])
I = new /obj/item/weapon/dnainjector/timed(loc)
I.fields = list("name"=buffer_slot["name"], "UE"=buffer_slot["UE"], "blood_type"=buffer_slot["blood_type"])
if(connected)
I.damage_coeff = connected.damage_coeff
if("mixed")
if(buffer_slot["UI"] && buffer_slot["name"] && buffer_slot["UE"] && buffer_slot["blood_type"])
I = new /obj/item/weapon/dnainjector/timed(loc)
I.fields = list("UI"=buffer_slot["UI"],"name"=buffer_slot["name"], "UE"=buffer_slot["UE"], "blood_type"=buffer_slot["blood_type"])
if(connected)
I.damage_coeff = connected.damage_coeff
if(I)
injectorready = 0
spawn(INJECTOR_TIMEOUT)
injectorready = 1
if("loaddisk")
if(num && diskette && diskette.fields)
num = Clamp(num, 1, NUMBER_OF_BUFFERS)
buffer[num] = diskette.fields.Copy()
if("savedisk")
if(num && diskette && !diskette.read_only)
num = Clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
diskette.name = "data disk \[[buffer_slot["label"]]\]"
diskette.fields = buffer_slot.Copy()
if("ejectdisk")
if(diskette)
diskette.loc = get_turf(src)
diskette = null
if("setdelayed")
if(num)
delayed_action = list("action"=text2num(href_list["delayaction"]),"buffer"=num)
if("pulseui","pulsese")
if(num && viable_occupant && connected)
radduration = Wrap(radduration, 1, RADIATION_DURATION_MAX+1)
radstrength = Wrap(radstrength, 1, RADIATION_STRENGTH_MAX+1)
var/locked_state = connected.locked
connected.locked = 1
current_screen = "working"
ShowInterface(usr)
sleep(radduration*10)
current_screen = "mainmenu"
if(viable_occupant && connected && connected.occupant==viable_occupant)
viable_occupant.radiation += (RADIATION_IRRADIATION_MULTIPLIER*radduration*radstrength)/(connected.damage_coeff ** 2) //Read comment in "transferbuffer" section above for explanation
switch(href_list["task"]) //Same thing as there but values are even lower, on best part they are about 0.0*, effectively no damage
if("pulseui")
var/len = length(viable_occupant.dna.uni_identity)
num = Wrap(num, 1, len+1)
num = randomize_radiation_accuracy(num, radduration + (connected.precision_coeff ** 2), len) //Each manipulator level above 1 makes randomization as accurate as selected time + manipulator lvl^2
//Value is this high for the same reason as with laser - not worth the hassle of upgrading if the bonus is low
var/block = round((num-1)/DNA_BLOCK_SIZE)+1
var/subblock = num - block*DNA_BLOCK_SIZE
last_change = "UI #[block]-[subblock]; "
var/hex = copytext(viable_occupant.dna.uni_identity, num, num+1)
last_change += "[hex]"
hex = scramble(hex, radstrength, radduration)
last_change += "->[hex]"
viable_occupant.dna.uni_identity = copytext(viable_occupant.dna.uni_identity, 1, num) + hex + copytext(viable_occupant.dna.uni_identity, num+1, 0)
viable_occupant.updateappearance(mutations_overlay_update=1)
if("pulsese")
var/len = length(viable_occupant.dna.struc_enzymes)
num = Wrap(num, 1, len+1)
num = randomize_radiation_accuracy(num, radduration + (connected.precision_coeff ** 2), len)
var/block = round((num-1)/DNA_BLOCK_SIZE)+1
var/subblock = num - block*DNA_BLOCK_SIZE
last_change = "SE #[block]-[subblock]; "
var/hex = copytext(viable_occupant.dna.struc_enzymes, num, num+1)
last_change += "[hex]"
hex = scramble(hex, radstrength, radduration)
last_change += "->[hex]"
viable_occupant.dna.struc_enzymes = copytext(viable_occupant.dna.struc_enzymes, 1, num) + hex + copytext(viable_occupant.dna.struc_enzymes, num+1, 0)
viable_occupant.domutcheck()
else
current_screen = "mainmenu"
if(connected)
connected.locked = locked_state
ShowInterface(usr,last_change)
/obj/machinery/computer/scan_consolenew/proc/scramble(input,rs,rd)
var/length = length(input)
var/ran = gaussian(0, rs*RADIATION_STRENGTH_MULTIPLIER)
if(ran == 0)
ran = pick(-1,1) //hacky, statistically should almost never happen. 0-change makes people mad though
else if(ran < 0)
ran = round(ran) //negative, so floor it
else
ran = -round(-ran) //positive, so ceiling it
return num2hex(Wrap(hex2num(input)+ran, 0, 16**length), length)
/obj/machinery/computer/scan_consolenew/proc/randomize_radiation_accuracy(position_we_were_supposed_to_hit, radduration, number_of_blocks)
return Wrap(round(position_we_were_supposed_to_hit + gaussian(0, RADIATION_ACCURACY_MULTIPLIER/radduration), 1), 1, number_of_blocks+1)
/obj/machinery/computer/scan_consolenew/proc/get_viable_occupant()
var/mob/living/carbon/viable_occupant = null
if(connected)
viable_occupant = connected.occupant
if(!istype(viable_occupant) || !viable_occupant.dna || (viable_occupant.disabilities & NOCLONE))
viable_occupant = null
return viable_occupant
/obj/machinery/computer/scan_consolenew/proc/apply_buffer(action,buffer_num)
buffer_num = Clamp(buffer_num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[buffer_num]
var/mob/living/carbon/viable_occupant = get_viable_occupant()
if(istype(buffer_slot))
viable_occupant.radiation += rand(10/(connected.damage_coeff ** 2),25/(connected.damage_coeff ** 2))
//15 and 40 are just magic numbers that were here before so i didnt touch them, they are initial boundaries of damage
//Each laser level reduces damage by lvl^2, so no effect on 1 lvl, 4 times less damage on 2 and 9 times less damage on 3
//Numbers are this high because other way upgrading laser is just not worth the hassle, and i cant think of anything better to inmrove
switch(action)
if(SCANNER_ACTION_SE)
if(buffer_slot["SE"])
viable_occupant.dna.struc_enzymes = buffer_slot["SE"]
viable_occupant.domutcheck()
if(SCANNER_ACTION_UI)
if(buffer_slot["UI"])
viable_occupant.dna.uni_identity = buffer_slot["UI"]
viable_occupant.updateappearance(mutations_overlay_update=1)
if(SCANNER_ACTION_UE)
if(buffer_slot["name"] && buffer_slot["UE"] && buffer_slot["blood_type"])
viable_occupant.real_name = buffer_slot["name"]
viable_occupant.name = buffer_slot["name"]
viable_occupant.dna.unique_enzymes = buffer_slot["UE"]
viable_occupant.dna.blood_type = buffer_slot["blood_type"]
if(SCANNER_ACTION_MIXED)
if(buffer_slot["UI"])
viable_occupant.dna.uni_identity = buffer_slot["UI"]
viable_occupant.updateappearance(mutations_overlay_update=1)
if(buffer_slot["name"] && buffer_slot["UE"] && buffer_slot["blood_type"])
viable_occupant.real_name = buffer_slot["name"]
viable_occupant.name = buffer_slot["name"]
viable_occupant.dna.unique_enzymes = buffer_slot["UE"]
viable_occupant.dna.blood_type = buffer_slot["blood_type"]
/obj/machinery/computer/scan_consolenew/proc/on_scanner_close()
connected.occupant << "<span class='notice'>[src] activates!</span>"
if(delayed_action)
apply_buffer(delayed_action["action"],delayed_action["buffer"])
delayed_action = null //or make it stick + reset button ?
return
/////////////////////////// DNA MACHINES
#undef INJECTOR_TIMEOUT
#undef REJUVENATORS_INJECT
#undef REJUVENATORS_MAX
#undef NUMBER_OF_BUFFERS
#undef RADIATION_STRENGTH_MAX
#undef RADIATION_STRENGTH_MULTIPLIER
#undef RADIATION_DURATION_MAX
#undef RADIATION_ACCURACY_MULTIPLIER
#undef RADIATION_IRRADIATION_MULTIPLIER
#undef SCANNER_ACTION_SE
#undef SCANNER_ACTION_UI
#undef SCANNER_ACTION_UE
#undef SCANNER_ACTION_MIXED
//#undef BAD_MUTATION_DIFFICULTY
//#undef GOOD_MUTATION_DIFFICULTY
//#undef OP_MUTATION_DIFFICULTY
@@ -0,0 +1,164 @@
//computer that handle the points and teleports the prisoner
/obj/machinery/computer/gulag_teleporter_computer
name = "labor camp teleporter console"
desc = "Used to send criminals to the Labor Camp"
icon_screen = "explosive"
icon_keyboard = "security_key"
req_access = list(access_security)
circuit = /obj/item/weapon/circuitboard/computer/gulag_teleporter_console
var/default_goal = 200
var/obj/item/weapon/card/id/prisoner/id = null
var/obj/machinery/gulag_teleporter/teleporter = null
var/obj/structure/gulag_beacon/beacon = null
var/mob/living/carbon/human/prisoner = null
var/datum/data/record/temporary_record = null
/obj/machinery/computer/gulag_teleporter_computer/New()
..()
addtimer(src, "scan_machinery", 5)
/obj/machinery/computer/gulag_teleporter_computer/Destroy()
if(id)
id.forceMove(get_turf(src))
return ..()
/obj/machinery/computer/gulag_teleporter_computer/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id/prisoner))
if(!id)
if(!user.drop_item())
return
W.forceMove(src)
id = W
user << "<span class='notice'>You insert [W].</span>"
return
else
user << "<span class='notice'>There's an ID inserted already.</span>"
return ..()
/obj/machinery/computer/gulag_teleporter_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "gulag_console", name, 455, 440, master_ui, state)
ui.open()
/obj/machinery/computer/gulag_teleporter_computer/ui_data(mob/user)
var/list/data = list()
var/list/prisoner_list = list()
var/can_teleport = FALSE
if(teleporter && (teleporter.occupant && ishuman(teleporter.occupant)))
prisoner = teleporter.occupant
prisoner_list["name"] = prisoner.real_name
if(id)
can_teleport = TRUE
if(!isnull(data_core.general))
for(var/r in data_core.security)
var/datum/data/record/R = r
if(R.fields["name"] == prisoner_list["name"])
temporary_record = R
prisoner_list["crimstat"] = temporary_record.fields["criminal"]
data["prisoner"] = prisoner_list
if(teleporter)
data["teleporter"] = teleporter
data["teleporter_location"] = "([teleporter.x], [teleporter.y], [teleporter.z])"
data["teleporter_lock"] = teleporter.locked
data["teleporter_state_open"] = teleporter.state_open
if(beacon)
data["beacon"] = beacon
data["beacon_location"] = "([beacon.x], [beacon.y], [beacon.z])"
if(id)
data["id"] = id
data["id_name"] = id.registered_name
data["goal"] = id.goal
data["can_teleport"] = can_teleport
return data
/obj/machinery/computer/gulag_teleporter_computer/ui_act(action, list/params)
if(..())
return
if(!allowed(usr))
usr << "<span class='warning'>Access denied.</span>"
return
switch(action)
if("scan_teleporter")
teleporter = findteleporter()
if("scan_beacon")
beacon = findbeacon()
if("handle_id")
if(id)
if(!usr.get_active_hand())
usr.put_in_hands(id)
id = null
else
id.forceMove(get_turf(src))
id = null
else
var/obj/item/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/card/id/prisoner))
if(!usr.drop_item())
return
I.forceMove(src)
id = I
if("set_goal")
var/new_goal = input("Set the amount of points:", "Points", id.goal) as num|null
if(!isnum(new_goal))
return
if(!new_goal)
new_goal = default_goal
id.goal = Clamp(new_goal, 0, 1000) //maximum 1000 points
if("toggle_open")
if(teleporter.locked)
usr << "The teleporter is locked"
return
teleporter.toggle_open()
if("teleporter_lock")
if(teleporter.state_open)
usr << "Close the teleporter before locking!"
return
teleporter.locked = !teleporter.locked
if("teleport")
if(!teleporter || !beacon)
return
addtimer(src, "teleport", 5, FALSE, usr)
/obj/machinery/computer/gulag_teleporter_computer/proc/scan_machinery()
teleporter = findteleporter()
beacon = findbeacon()
/obj/machinery/computer/gulag_teleporter_computer/proc/findteleporter()
var/obj/machinery/gulag_teleporter/teleporterf = null
for(dir in cardinal)
teleporterf = locate(/obj/machinery/gulag_teleporter, get_step(src, dir))
if(teleporterf && teleporterf.is_operational())
return teleporterf
/obj/machinery/computer/gulag_teleporter_computer/proc/findbeacon()
return locate(/obj/structure/gulag_beacon)
/obj/machinery/computer/gulag_teleporter_computer/proc/teleport(mob/user)
log_game("[user]([user.ckey] teleported [prisoner]([prisoner.ckey]) to the Labor Camp ([beacon.x], [beacon.y], [beacon.z]) for [id.goal] points.")
teleporter.handle_prisoner(id, temporary_record)
playsound(loc, "sound/weapons/emitter.ogg", 50, 1)
prisoner.forceMove(get_turf(beacon))
prisoner.Weaken(2) // small travel dizziness
prisoner << "<span class='warning'>The teleportation makes you a little dizzy.</span>"
PoolOrNew(/obj/effect/particle_effect/sparks, prisoner.loc)
playsound(src.loc, "sparks", 50, 1)
if(teleporter.locked)
teleporter.locked = FALSE
teleporter.toggle_open()
id = null
temporary_record = null
+78
View File
@@ -0,0 +1,78 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/machinery/computer/upload
var/mob/living/silicon/current = null //The target of future law uploads
icon_screen = "command"
/obj/machinery/computer/upload/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/weapon/aiModule))
var/obj/item/weapon/aiModule/M = O
if(src.stat & (NOPOWER|BROKEN|MAINT))
return
if(!current)
user << "<span class='caution'>You haven't selected anything to transmit laws to!</span>"
return
if(!can_upload_to(current))
user << "<span class='caution'>Upload failed!</span> Check to make sure [current.name] is functioning properly."
current = null
return
var/turf/currentloc = get_turf(current)
if(currentloc && user.z != currentloc.z)
user << "<span class='caution'>Upload failed!</span> Unable to establish a connection to [current.name]. You're too far away!"
current = null
return
M.install(current.laws, user)
else
return ..()
/obj/machinery/computer/upload/proc/can_upload_to(mob/living/silicon/S)
if(S.stat == DEAD || S.syndicate)
return 0
return 1
/obj/machinery/computer/upload/ai
name = "\improper AI upload console"
desc = "Used to upload laws to the AI."
circuit = /obj/item/weapon/circuitboard/computer/aiupload
/obj/machinery/computer/upload/ai/attack_hand(mob/user)
if(..())
return
src.current = select_active_ai(user)
if (!src.current)
user << "<span class='caution'>No active AIs detected!</span>"
else
user << "[src.current.name] selected for law changes."
/obj/machinery/computer/upload/ai/can_upload_to(mob/living/silicon/ai/A)
if(!A || !isAI(A))
return 0
if(A.control_disabled)
return 0
return ..()
/obj/machinery/computer/upload/borg
name = "cyborg upload console"
desc = "Used to upload laws to Cyborgs."
circuit = /obj/item/weapon/circuitboard/computer/borgupload
/obj/machinery/computer/upload/borg/attack_hand(mob/user)
if(..())
return
src.current = select_active_free_borg(user)
if(!src.current)
user << "<span class='caution'>No active unslaved cyborgs detected!</span>"
else
user << "[src.current.name] selected for law changes."
/obj/machinery/computer/upload/borg/can_upload_to(mob/living/silicon/robot/B)
if(!B || !isrobot(B))
return 0
if(B.scrambledcodes || B.emagged)
return 0
return ..()
+608
View File
@@ -0,0 +1,608 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/machinery/computer/med_data//TODO:SANITY
name = "medical records console"
desc = "This can be used to check medical records."
icon_screen = "medcomp"
icon_keyboard = "med_key"
req_one_access = list(access_medical, access_forensics_lockers)
circuit = /obj/item/weapon/circuitboard/computer/med_data
var/obj/item/weapon/card/id/scan = null
var/authenticated = null
var/rank = null
var/screen = null
var/datum/data/record/active1
var/datum/data/record/active2
var/a_id = null
var/temp = null
var/printing = null
//Sorting Variables
var/sortBy = "name"
var/order = 1 // -1 = Descending - 1 = Ascending
/obj/machinery/computer/med_data/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/weapon/card/id) && !scan)
if(!user.drop_item())
return
O.loc = src
scan = O
user << "<span class='notice'>You insert [O].</span>"
else
return ..()
/obj/machinery/computer/med_data/attack_hand(mob/user)
if(..())
return
var/dat
if(src.temp)
dat = text("<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>")
else
dat = text("Confirm Identity: <A href='?src=\ref[];scan=1'>[]</A><HR>", src, (src.scan ? text("[]", src.scan.name) : "----------"))
if(src.authenticated)
switch(src.screen)
if(1)
dat += {"
<A href='?src=\ref[src];search=1'>Search Records</A>
<BR><A href='?src=\ref[src];screen=2'>List Records</A>
<BR>
<BR><A href='?src=\ref[src];screen=5'>Virus Database</A>
<BR><A href='?src=\ref[src];screen=6'>Medbot Tracking</A>
<BR>
<BR><A href='?src=\ref[src];screen=3'>Record Maintenance</A>
<BR><A href='?src=\ref[src];logout=1'>{Log Out}</A><BR>
"}
if(2)
dat += {"
</p>
<table style="text-align:center;" cellspacing="0" width="100%">
<tr>
<th>Records:</th>
</tr>
</table>
<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th><A href='?src=\ref[src];choice=Sorting;sort=name'>Name</A></th>
<th><A href='?src=\ref[src];choice=Sorting;sort=id'>ID</A></th>
<th>Fingerprints (F) | DNA (D)</th>
<th><A href='?src=\ref[src];choice=Sorting;sort=bloodtype'>Blood Type</A></th>
<th>Physical Status</th>
<th>Mental Status</th>
</tr>"}
if(!isnull(data_core.general))
for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order))
var/blood_type = ""
var/b_dna = ""
for(var/datum/data/record/E in data_core.medical)
if((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]))
blood_type = E.fields["blood_type"]
b_dna = E.fields["b_dna"]
var/background
if(R.fields["m_stat"] == "*Insane*" || R.fields["p_stat"] == "*Deceased*")
background = "'background-color:#990000;'"
else if(R.fields["p_stat"] == "*Unconscious*" || R.fields["m_stat"] == "*Unstable*")
background = "'background-color:#CD6500;'"
else if(R.fields["p_stat"] == "Physically Unfit" || R.fields["m_stat"] == "*Watch*")
background = "'background-color:#3BB9FF;'"
else
background = "'background-color:#4F7529;'"
dat += text("<tr style=[]><td><A href='?src=\ref[];d_rec=[]'>[]</a></td>", background, src, R.fields["id"], R.fields["name"])
dat += text("<td>[]</td>", R.fields["id"])
dat += text("<td><b>F:</b> []<BR><b>D:</b> []</td>", R.fields["fingerprint"], b_dna)
dat += text("<td>[]</td>", blood_type)
dat += text("<td>[]</td>", R.fields["p_stat"])
dat += text("<td>[]</td></tr>", R.fields["m_stat"])
dat += "</table><hr width='75%' />"
// if(data_core.general)
// for(var/datum/data/record/R in sortRecord(data_core.general))
// dat += "<A href='?src=\ref[src];d_rec=[R.fields["id"]]'>[R.fields["id"]]: [R.fields["name"]]<BR>"
// //Foreach goto(132)
dat += text("<HR><A href='?src=\ref[];screen=1'>Back</A>", src)
if(3)
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From Disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];screen=1'>Back</A>", src, src, src, src)
if(4)
dat += "<table><tr><td><b><font size='4'>Medical Record</font></b></td></tr>"
if(active1 in data_core.general)
if(istype(active1.fields["photo_front"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P1 = active1.fields["photo_front"]
user << browse_rsc(P1.img, "photo_front")
if(istype(active1.fields["photo_side"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P2 = active1.fields["photo_side"]
user << browse_rsc(P2.img, "photo_side")
dat += "<tr><td>Name:</td><td>[active1.fields["name"]]</td>"
dat += "<td><a href='?src=\ref[src];field=show_photo_front'><img src=photo_front height=80 width=80 border=4></a></td>"
dat += "<td><a href='?src=\ref[src];field=show_photo_side'><img src=photo_side height=80 width=80 border=4></a></td></tr>"
dat += "<tr><td>ID:</td><td>[active1.fields["id"]]</td></tr>"
dat += "<tr><td>Sex:</td><td><A href='?src=\ref[src];field=sex'>&nbsp;[active1.fields["sex"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Age:</td><td><A href='?src=\ref[src];field=age'>&nbsp;[active1.fields["age"]]&nbsp;</A></td></tr>"
if(config.mutant_races)
dat += "<tr><td>Species:</td><td><A href='?src=\ref[src];field=species'>&nbsp;[active1.fields["species"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Fingerprint:</td><td><A href='?src=\ref[src];field=fingerprint'>&nbsp;[active1.fields["fingerprint"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Physical Status:</td><td><A href='?src=\ref[src];field=p_stat'>&nbsp;[active1.fields["p_stat"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Mental Status:</td><td><A href='?src=\ref[src];field=m_stat'>&nbsp;[active1.fields["m_stat"]]&nbsp;</A></td></tr>"
else
dat += "<tr><td>General Record Lost!</td></tr>"
dat += "<tr><td><br><b><font size='4'>Medical Data</font></b></td></tr>"
if(active2 in data_core.medical)
dat += "<tr><td>Blood Type:</td><td><A href='?src=\ref[src];field=blood_type'>&nbsp;[active2.fields["blood_type"]]&nbsp;</A></td></tr>"
dat += "<tr><td>DNA:</td><td><A href='?src=\ref[src];field=b_dna'>&nbsp;[active2.fields["b_dna"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br>Minor Disabilities:</td><td><br><A href='?src=\ref[src];field=mi_dis'>&nbsp;[active2.fields["mi_dis"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Details:</td><td><A href='?src=\ref[src];field=mi_dis_d'>&nbsp;[active2.fields["mi_dis_d"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br>Major Disabilities:</td><td><br><A href='?src=\ref[src];field=ma_dis'>&nbsp;[active2.fields["ma_dis"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Details:</td><td><A href='?src=\ref[src];field=ma_dis_d'>&nbsp;[active2.fields["ma_dis_d"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br>Allergies:</td><td><br><A href='?src=\ref[src];field=alg'>&nbsp;[active2.fields["alg"]]&nbsp;</A></td></tr>"
dat += "<tr><td>Details:</td><td><A href='?src=\ref[src];field=alg_d'>&nbsp;[active2.fields["alg_d"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br>Current Diseases:</td><td><br><A href='?src=\ref[src];field=cdi'>&nbsp;[active2.fields["cdi"]]&nbsp;</A></td></tr>" //(per disease info placed in log/comment section)
dat += "<tr><td>Details:</td><td><A href='?src=\ref[src];field=cdi_d'>&nbsp;[active2.fields["cdi_d"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br>Important Notes:</td><td><br><A href='?src=\ref[src];field=notes'>&nbsp;[active2.fields["notes"]]&nbsp;</A></td></tr>"
dat += "<tr><td><br><b><font size='4'>Comments/Log</font></b></td></tr>"
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
dat += "<tr><td>[active2.fields[text("com_[]", counter)]]</td></tr><tr><td><A href='?src=\ref[src];del_c=[counter]'>Delete Entry</A></td></tr>"
counter++
dat += "<tr><td><A href='?src=\ref[src];add_c=1'>Add Entry</A></td></tr>"
dat += "<tr><td><br><A href='?src=\ref[src];del_r=1'>Delete Record (Medical Only)</A></td></tr>"
else
dat += "<tr><td>Medical Record Lost!</tr>"
dat += "<tr><td><br><A href='?src=\ref[src];new=1'>New Record</A></td></tr>"
dat += "<tr><td><A href='?src=\ref[src];print_p=1'>Print Record</A></td></tr>"
dat += "<tr><td><A href='?src=\ref[src];screen=2'>Back</A></td></tr>"
dat += "</table>"
if(5)
dat += "<CENTER><B>Virus Database</B></CENTER>"
for(var/Dt in typesof(/datum/disease/))
var/datum/disease/Dis = new Dt(0)
if(istype(Dis, /datum/disease/advance))
continue // TODO (tm): Add advance diseases to the virus database which no one uses.
if(!Dis.desc)
continue
dat += "<br><a href='?src=\ref[src];vir=[Dt]'>[Dis.name]</a>"
dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>"
if(6)
dat += "<center><b>Medical Robot Monitor</b></center>"
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
dat += "<br><b>Medical Robots:</b>"
var/bdat = null
for(var/mob/living/simple_animal/bot/medbot/M in living_mob_list)
if(M.z != src.z)
continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M)
if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up
bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
if((!isnull(M.reagent_glass)) && M.use_beaker)
bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]<br>"
else
bdat += "Using Internal Synthesizer.<br>"
if(!bdat)
dat += "<br><center>None detected</center>"
else
dat += "<br>[bdat]"
else
else
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
//user << browse(text("<HEAD><TITLE>Medical Records</TITLE></HEAD><TT>[]</TT>", dat), "window=med_rec")
//onclose(user, "med_rec")
var/datum/browser/popup = new(user, "med_rec", "Medical Records Console", 600, 400)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/med_data/Topic(href, href_list)
. = ..()
if(.)
return .
if(!(active1 in data_core.general))
src.active1 = null
if(!(active2 in data_core.medical))
src.active2 = null
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)) || IsAdminGhost(usr))
usr.set_machine(src)
if(href_list["temp"])
src.temp = null
if(href_list["scan"])
if(src.scan)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
usr.put_in_hands(scan)
else
scan.loc = get_turf(src)
src.scan = null
else
var/obj/item/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/card/id))
if(!usr.drop_item())
return
I.loc = src
src.scan = I
else if(href_list["logout"])
src.authenticated = null
src.screen = null
src.active1 = null
src.active2 = null
else if(href_list["choice"])
// SORTING!
if(href_list["choice"] == "Sorting")
// Reverse the order if clicked twice
if(sortBy == href_list["sort"])
if(order == 1)
order = -1
else
order = 1
else
// New sorting order!
sortBy = href_list["sort"]
order = initial(order)
else if(href_list["login"])
if(istype(usr, /mob/living/silicon))
src.active1 = null
src.active2 = null
src.authenticated = 1
src.rank = "AI"
src.screen = 1
else if(IsAdminGhost(usr))
src.active1 = null
src.active2 = null
src.authenticated = 1
src.rank = "Central Command"
src.screen = 1
else if(istype(src.scan, /obj/item/weapon/card/id))
src.active1 = null
src.active2 = null
if(src.check_access(src.scan))
src.authenticated = src.scan.registered_name
src.rank = src.scan.assignment
src.screen = 1
if(src.authenticated)
if(href_list["screen"])
src.screen = text2num(href_list["screen"])
if(src.screen < 1)
src.screen = 1
src.active1 = null
src.active2 = null
else if(href_list["vir"])
var/type = href_list["vir"]
var/datum/disease/Dis = new type(0)
var/AfS = ""
for(var/mob/M in Dis.viable_mobtypes)
AfS += " [initial(M.name)];"
src.temp = {"<b>Name:</b> [Dis.name]
<BR><b>Number of stages:</b> [Dis.max_stages]
<BR><b>Spread:</b> [Dis.spread_text] Transmission
<BR><b>Possible Cure:</b> [(Dis.cure_text||"none")]
<BR><b>Affected Lifeforms:</b>[AfS]
<BR>
<BR><b>Notes:</b> [Dis.desc]
<BR>
<BR><b>Severity:</b> [Dis.severity]"}
else if(href_list["del_all"])
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
else if(href_list["del_all2"])
investigate_log("[usr.name] ([usr.key]) has deleted all medical records.", "records")
data_core.medical.Cut()
src.temp = "All records deleted."
else if(href_list["field"])
var/a1 = src.active1
var/a2 = src.active2
switch(href_list["field"])
if("fingerprint")
if(active1)
var/t1 = stripped_input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null)
if(!canUseMedicalRecordsConsole(usr, t1, a1))
return
src.active1.fields["fingerprint"] = t1
if("sex")
if(active1)
if(src.active1.fields["sex"] == "Male")
src.active1.fields["sex"] = "Female"
else
src.active1.fields["sex"] = "Male"
if("age")
if(active1)
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
if(!canUseMedicalRecordsConsole(usr, t1, a1))
return
src.active1.fields["age"] = t1
if("species")
if(active1)
var/t1 = stripped_input("Please input species name", "Med. records", src.active1.fields["species"], null)
if(!canUseMedicalRecordsConsole(usr, t1, a1))
return
active1.fields["species"] = t1
if("mi_dis")
if(active2)
var/t1 = stripped_input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["mi_dis"] = t1
if("mi_dis_d")
if(active2)
var/t1 = stripped_multiline_input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["mi_dis_d"] = t1
if("ma_dis")
if(active2)
var/t1 = stripped_input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["ma_dis"] = t1
if("ma_dis_d")
if(active2)
var/t1 = stripped_multiline_input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["ma_dis_d"] = t1
if("alg")
if(active2)
var/t1 = stripped_input("Please state allergies:", "Med. records", src.active2.fields["alg"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["alg"] = t1
if("alg_d")
if(active2)
var/t1 = stripped_multiline_input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["alg_d"] = t1
if("cdi")
if(active2)
var/t1 = stripped_input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["cdi"] = t1
if("cdi_d")
if(active2)
var/t1 = stripped_multiline_input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["cdi_d"] = t1
if("notes")
if(active2)
var/t1 = stripped_multiline_input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["notes"] = t1
if("p_stat")
if(active1)
src.temp = text("<B>Physical Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=deceased'>*Deceased*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unconscious'>*Unconscious*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=active'>Active</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unfit'>Physically Unfit</A><BR>", src, src, src, src)
if("m_stat")
if(active1)
src.temp = text("<B>Mental Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=insane'>*Insane*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=unstable'>*Unstable*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=watch'>*Watch*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=stable'>Stable</A><BR>", src, src, src, src)
if("blood_type")
if(active2)
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;blood_type=an'>A-</A> <A href='?src=\ref[];temp=1;blood_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;blood_type=bn'>B-</A> <A href='?src=\ref[];temp=1;blood_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;blood_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;blood_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;blood_type=on'>O-</A> <A href='?src=\ref[];temp=1;blood_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
if("b_dna")
if(active2)
var/t1 = stripped_input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
src.active2.fields["b_dna"] = t1
if("show_photo_front")
if(active1)
if(active1.fields["photo_front"])
if(istype(active1.fields["photo_front"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P = active1.fields["photo_front"]
P.show(usr)
if("show_photo_side")
if(active1)
if(active1.fields["photo_side"])
if(istype(active1.fields["photo_side"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P = active1.fields["photo_side"]
P.show(usr)
else
else if(href_list["p_stat"])
if(active1)
switch(href_list["p_stat"])
if("deceased")
src.active1.fields["p_stat"] = "*Deceased*"
if("unconscious")
src.active1.fields["p_stat"] = "*Unconscious*"
if("active")
src.active1.fields["p_stat"] = "Active"
if("unfit")
src.active1.fields["p_stat"] = "Physically Unfit"
else if(href_list["m_stat"])
if(active1)
switch(href_list["m_stat"])
if("insane")
src.active1.fields["m_stat"] = "*Insane*"
if("unstable")
src.active1.fields["m_stat"] = "*Unstable*"
if("watch")
src.active1.fields["m_stat"] = "*Watch*"
if("stable")
src.active1.fields["m_stat"] = "Stable"
else if(href_list["blood_type"])
if(active2)
switch(href_list["blood_type"])
if("an")
src.active2.fields["blood_type"] = "A-"
if("bn")
src.active2.fields["blood_type"] = "B-"
if("abn")
src.active2.fields["blood_type"] = "AB-"
if("on")
src.active2.fields["blood_type"] = "O-"
if("ap")
src.active2.fields["blood_type"] = "A+"
if("bp")
src.active2.fields["blood_type"] = "B+"
if("abp")
src.active2.fields["blood_type"] = "AB+"
if("op")
src.active2.fields["blood_type"] = "O+"
else if(href_list["del_r"])
if(active2)
src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
else if(href_list["del_r2"])
investigate_log("[usr.name] ([usr.key]) has deleted the medical records for [active1.fields["name"]].", "records")
if(active2)
data_core.medical -= active2
active2 = null
else if(href_list["d_rec"])
active1 = find_record("id", href_list["d_rec"], data_core.general)
if(active1)
active2 = find_record("id", href_list["d_rec"], data_core.medical)
if(!active2)
active1 = null
screen = 4
else if(href_list["new"])
if((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
var/datum/data/record/R = new /datum/data/record( )
R.fields["name"] = src.active1.fields["name"]
R.fields["id"] = src.active1.fields["id"]
R.name = text("Medical Record #[]", R.fields["id"])
R.fields["blood_type"] = "Unknown"
R.fields["b_dna"] = "Unknown"
R.fields["mi_dis"] = "None"
R.fields["mi_dis_d"] = "No minor disabilities have been diagnosed."
R.fields["ma_dis"] = "None"
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
R.fields["alg"] = "None"
R.fields["alg_d"] = "No allergies have been detected in this patient."
R.fields["cdi"] = "None"
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
R.fields["notes"] = "No notes."
data_core.medical += R
src.active2 = R
src.screen = 4
else if(href_list["add_c"])
if(!(active2 in data_core.medical))
return
var/a2 = src.active2
var/t1 = stripped_multiline_input("Add Comment:", "Med. records", null, null)
if(!canUseMedicalRecordsConsole(usr, t1, null, a2))
return
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
counter++
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []<BR>[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), year_integer+540, t1,)
else if(href_list["del_c"])
if((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
else if(href_list["search"])
var/t1 = stripped_input(usr, "Search String: (Name, DNA, or ID)", "Med. records")
if(!canUseMedicalRecordsConsole(usr, t1))
return
src.active1 = null
src.active2 = null
t1 = lowertext(t1)
for(var/datum/data/record/R in data_core.medical)
if((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"])))
src.active2 = R
else
//Foreach continue //goto(3229)
if(!( src.active2 ))
src.temp = text("Could not locate record [].", sanitize(t1))
else
for(var/datum/data/record/E in data_core.general)
if((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"]))
src.active1 = E
else
//Foreach continue //goto(3334)
src.screen = 4
else if(href_list["print_p"])
if(!( src.printing ))
src.printing = 1
data_core.medicalPrintCount++
playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1)
sleep(30)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
P.info = "<CENTER><B>Medical Record - (MR-[data_core.medicalPrintCount])</B></CENTER><BR>"
if(active1 in data_core.general)
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"])
if(config.mutant_races)
P.info += "\nSpecies: [active1.fields["species"]]<BR>"
P.info += text("\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
else
P.info += "<B>General Record Lost!</B><BR>"
if(active2 in data_core.medical)
P.info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src.active2.fields["blood_type"], src.active2.fields["b_dna"], src.active2.fields["mi_dis"], src.active2.fields["mi_dis_d"], src.active2.fields["ma_dis"], src.active2.fields["ma_dis_d"], src.active2.fields["alg"], src.active2.fields["alg_d"], src.active2.fields["cdi"], src.active2.fields["cdi_d"], src.active2.fields["notes"])
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", src.active2.fields[text("com_[]", counter)])
counter++
P.name = text("MR-[] '[]'", data_core.medicalPrintCount, src.active1.fields["name"])
else
P.info += "<B>Medical Record Lost!</B><BR>"
P.name = text("MR-[] '[]'", data_core.medicalPrintCount, "Record Lost")
P.info += "</TT>"
src.printing = null
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/obj/machinery/computer/med_data/emp_act(severity)
if(!(stat & (BROKEN|NOPOWER)))
for(var/datum/data/record/R in data_core.medical)
if(prob(10/severity))
switch(rand(1,6))
if(1)
if(prob(10))
R.fields["name"] = random_unique_lizard_name(R.fields["sex"],1)
else
R.fields["name"] = random_unique_name(R.fields["sex"],1)
if(2)
R.fields["sex"] = pick("Male", "Female")
if(3)
R.fields["age"] = rand(AGE_MIN, AGE_MAX)
if(4)
R.fields["blood_type"] = random_blood_type()
if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
if(6)
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
continue
else if(prob(1))
qdel(R)
continue
..()
/obj/machinery/computer/med_data/proc/canUseMedicalRecordsConsole(mob/user, message = 1, record1, record2)
if(user)
if(message)
if(authenticated)
if(user.canUseTopic(src))
if(!record1 || record1 == active1)
if(!record2 || record2 == active2)
return 1
return 0
/obj/machinery/computer/med_data/laptop
name = "medical laptop"
desc = "A cheap Nanotrasen medical laptop, it functions as a medical records computer. It's bolted to the table."
icon_state = "laptop"
icon_screen = "medlaptop"
icon_keyboard = "laptop_key"
clockwork = TRUE //it'd look weird
+468
View File
@@ -0,0 +1,468 @@
// Allows you to monitor messages that passes the server.
/obj/machinery/computer/message_monitor
name = "message monitor console"
desc = "Used to Monitor the crew's messages, that are sent via PDA. Can also be used to view Request Console messages."
icon_screen = "comm_logs"
circuit = /obj/item/weapon/circuitboard/computer/message_monitor
//Server linked to.
var/obj/machinery/message_server/linkedServer = null
//Sparks effect - For emag
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
//Messages - Saves me time if I want to change something.
var/noserver = "<span class='alert'>ALERT: No server detected.</span>"
var/incorrectkey = "<span class='warning'>ALERT: Incorrect decryption key!</span>"
var/defaultmsg = "<span class='notice'>Welcome. Please select an option.</span>"
var/rebootmsg = "<span class='warning'>%$&(£: Critical %$$@ Error // !RestArting! <lOadiNg backUp iNput ouTput> - ?pLeaSe wAit!</span>"
//Computer properties
var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message
var/hacking = 0 // Is it being hacked into by the AI/Cyborg
var/message = "<span class='notice'>System bootup complete. Please select an option.</span>" // The message that shows on the main menu.
var/auth = 0 // Are they authenticated?
var/optioncount = 7
// Custom Message Properties
var/customsender = "System Administrator"
var/obj/item/device/pda/customrecepient = null
var/customjob = "Admin"
var/custommessage = "This is a test, please ignore."
/obj/machinery/computer/message_monitor/attackby(obj/item/weapon/O, mob/living/user, params)
if(istype(O, /obj/item/weapon/screwdriver) && emagged)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
user << "<span class='warning'>It is too hot to mess with!</span>"
else
return ..()
/obj/machinery/computer/message_monitor/emag_act(mob/user)
if(!emagged)
if(!isnull(src.linkedServer))
emagged = 1
screen = 2
spark_system.set_up(5, 0, src)
src.spark_system.start()
var/obj/item/weapon/paper/monitorkey/MK = new/obj/item/weapon/paper/monitorkey
MK.loc = src.loc
// Will help make emagging the console not so easy to get away with.
MK.info += "<br><br><font color='red'>£%@%(*$%&(£&?*(%&£/{}</font>"
var/time = 100 * length(src.linkedServer.decryptkey)
addtimer(src, "UnmagConsole", time)
message = rebootmsg
else
user << "<span class='notice'>A no server error appears on the screen.</span>"
/obj/machinery/computer/message_monitor/initialize()
//Is the server isn't linked to a server, and there's a server available, default it to the first one in the list.
if(!linkedServer)
if(message_servers && message_servers.len > 0)
linkedServer = message_servers[1]
return
/obj/machinery/computer/message_monitor/attack_hand(mob/living/user)
if(..())
return
//If the computer is being hacked or is emagged, display the reboot message.
if(hacking || emagged)
message = rebootmsg
var/dat = "<center><font color='blue'[message]</font>/</center>"
if(auth)
dat += "<h4><dd><A href='?src=\ref[src];auth=1'>&#09;<font color='green'>\[Authenticated\]</font></a>&#09;/"
dat += " Server Power: <A href='?src=\ref[src];active=1'>[src.linkedServer && src.linkedServer.active ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</a></h4>"
else
dat += "<h4><dd><A href='?src=\ref[src];auth=1'>&#09;<font color='red'>\[Unauthenticated\]</font></a>&#09;/"
dat += " Server Power: <u>[src.linkedServer && src.linkedServer.active ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</u></h4>"
if(hacking || emagged)
screen = 2
else if(!auth || !linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)))
if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) message = noserver
screen = 0
switch(screen)
//Main menu
if(0)
//&#09; = TAB
var/i = 0
dat += "<dd><A href='?src=\ref[src];find=1'>&#09;[++i]. Link To A Server</a></dd>"
if(auth)
if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)))
dat += "<dd><A>&#09;ERROR: Server not found!</A><br></dd>"
else
dat += "<dd><A href='?src=\ref[src];view=1'>&#09;[++i]. View Message Logs </a><br></dd>"
dat += "<dd><A href='?src=\ref[src];viewr=1'>&#09;[++i]. View Request Console Logs </a></br></dd>"
dat += "<dd><A href='?src=\ref[src];clear=1'>&#09;[++i]. Clear Message Logs</a><br></dd>"
dat += "<dd><A href='?src=\ref[src];clearr=1'>&#09;[++i]. Clear Request Console Logs</a><br></dd>"
dat += "<dd><A href='?src=\ref[src];pass=1'>&#09;[++i]. Set Custom Key</a><br></dd>"
dat += "<dd><A href='?src=\ref[src];msg=1'>&#09;[++i]. Send Admin Message</a><br></dd>"
else
for(var/n = ++i; n <= optioncount; n++)
dat += "<dd><font color='blue'>&#09;[n]. ---------------</font><br></dd>"
if(issilicon(usr) && is_special_character(usr))
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
dat += "<dd><A href='?src=\ref[src];hack=1'><i><font color='Red'>*&@#. Bruteforce Key</font></i></font></a><br></dd>"
else
dat += "<br>"
//Bottom message
if(!auth)
dat += "<br><hr><dd><span class='notice'>Please authenticate with the server in order to show additional options.</span>"
else
dat += "<br><hr><dd><span class='warning'>Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties.</span>"
//Message Logs
if(1)
var/index = 0
//var/recipient = "Unspecified" //name of the person
//var/sender = "Unspecified" //name of the sender
//var/message = "Blank" //transferred message
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
dat += "<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sender</th><th width='15%'>Recipient</th><th width='300px' word-wrap: break-word>Message</th></tr>"
for(var/datum/data_pda_msg/pda in src.linkedServer.pda_msgs)
index++
if(index > 3000)
break
// Del - Sender - Recepient - Message
// X - Al Green - Your Mom - WHAT UP!?
dat += "<tr><td width = '5%'><center><A href='?src=\ref[src];delete=\ref[pda]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[pda.sender]</td><td width='15%'>[pda.recipient]</td><td width='300px'>[pda.message][pda.photo ? "<a href='byond://?src=\ref[pda];photo=1'>(Photo)</a>":""]</td></tr>"
dat += "</table>"
//Hacking screen.
if(2)
if(istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot))
dat += "Brute-forcing for server key.<br> It will take 20 seconds for every character that the password has."
dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time."
else
//It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever.
dat += {"01000010011100100111010101110100011001010010110<br>
10110011001101111011100100110001101101001011011100110011<br>
10010000001100110011011110111001000100000011100110110010<br>
10111001001110110011001010111001000100000011010110110010<br>
10111100100101110001000000100100101110100001000000111011<br>
10110100101101100011011000010000001110100011000010110101<br>
10110010100100000001100100011000000100000011100110110010<br>
10110001101101111011011100110010001110011001000000110011<br>
00110111101110010001000000110010101110110011001010111001<br>
00111100100100000011000110110100001100001011100100110000<br>
10110001101110100011001010111001000100000011101000110100<br>
00110000101110100001000000111010001101000011001010010000<br>
00111000001100001011100110111001101110111011011110111001<br>
00110010000100000011010000110000101110011001011100010000<br>
00100100101101110001000000111010001101000011001010010000<br>
00110110101100101011000010110111001110100011010010110110<br>
10110010100101100001000000111010001101000011010010111001<br>
10010000001100011011011110110111001110011011011110110110<br>
00110010100100000011000110110000101101110001000000111001<br>
00110010101110110011001010110000101101100001000000111100<br>
10110111101110101011100100010000001110100011100100111010<br>
10110010100100000011010010110111001110100011001010110111<br>
00111010001101001011011110110111001110011001000000110100<br>
10110011000100000011110010110111101110101001000000110110<br>
00110010101110100001000000111001101101111011011010110010<br>
10110111101101110011001010010000001100001011000110110001<br>
10110010101110011011100110010000001101001011101000010111<br>
00010000001001101011000010110101101100101001000000111001<br>
10111010101110010011001010010000001101110011011110010000<br>
00110100001110101011011010110000101101110011100110010000<br>
00110010101101110011101000110010101110010001000000111010<br>
00110100001100101001000000111001001101111011011110110110<br>
10010000001100100011101010111001001101001011011100110011<br>
10010000001110100011010000110000101110100001000000111010<br>
001101001011011010110010100101110"}
//Fake messages
if(3)
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];Reset=1'>Reset</a></center><hr>"
dat += {"<table border='1' width='100%'>
<tr><td width='20%'><A href='?src=\ref[src];select=Sender'>Sender</a></td>
<td width='20%'><A href='?src=\ref[src];select=RecJob'>Sender's Job</a></td>
<td width='20%'><A href='?src=\ref[src];select=Recepient'>Recipient</a></td>
<td width='300px' word-wrap: break-word><A href='?src=\ref[src];select=Message'>Message</a></td></tr>"}
//Sender - Sender's Job - Recepient - Message
//Al Green- Your Dad - Your Mom - WHAT UP!?
dat += {"<tr><td width='20%'>[customsender]</td>
<td width='20%'>[customjob]</td>
<td width='20%'>[customrecepient ? customrecepient.owner : "NONE"]</td>
<td width='300px'>[custommessage]</td></tr>"}
dat += "</table><br><center><A href='?src=\ref[src];select=Send'>Send</a>"
//Request Console Logs
if(4)
var/index = 0
/* data_rc_msg
X - 5%
var/rec_dpt = "Unspecified" //name of the person - 15%
var/send_dpt = "Unspecified" //name of the sender- 15%
var/message = "Blank" //transferred message - 300px
var/stamp = "Unstamped" - 15%
var/id_auth = "Unauthenticated" - 15%
var/priority = "Normal" - 10%
*/
dat += "<center><A href='?src=\ref[src];back=1'>Back</a> - <A href='?src=\ref[src];refresh=1'>Refresh</center><hr>"
dat += {"<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sending Dep.</th><th width='15%'>Receiving Dep.</th>
<th width='300px' word-wrap: break-word>Message</th><th width='15%'>Stamp</th><th width='15%'>ID Auth.</th><th width='15%'>Priority.</th></tr>"}
for(var/datum/data_rc_msg/rc in src.linkedServer.rc_msgs)
index++
if(index > 3000)
break
// Del - Sender - Recepient - Message
// X - Al Green - Your Mom - WHAT UP!?
dat += {"<tr><td width = '5%'><center><A href='?src=\ref[src];deleter=\ref[rc]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[rc.send_dpt]</td>
<td width='15%'>[rc.rec_dpt]</td><td width='300px'>[rc.message]</td><td width='15%'>[rc.stamp]</td><td width='15%'>[rc.id_auth]</td><td width='15%'>[rc.priority]</td></tr>"}
dat += "</table>"
message = defaultmsg
//user << browse(dat, "window=message;size=700x700")
//onclose(user, "message")
var/datum/browser/popup = new(user, "hologram_console", name, 700, 700)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/message_monitor/proc/BruteForce(mob/user)
if(isnull(linkedServer))
user << "<span class='warning'>Could not complete brute-force: Linked Server Disconnected!</span>"
else
var/currentKey = src.linkedServer.decryptkey
user << "<span class='warning'>Brute-force completed! The key is '[currentKey]'.</span>"
src.hacking = 0
src.screen = 0 // Return the screen back to normal
/obj/machinery/computer/message_monitor/proc/UnmagConsole()
src.emagged = 0
/obj/machinery/computer/message_monitor/proc/ResetMessage()
customsender = "System Administrator"
customrecepient = null
custommessage = "This is a test, please ignore."
customjob = "Admin"
/obj/machinery/computer/message_monitor/Topic(href, href_list)
if(..())
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
//Authenticate
if (href_list["auth"])
if(!linkedServer || linkedServer.stat & (NOPOWER|BROKEN))
message = noserver
else
if(auth)
auth = 0
screen = 0
else
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
if(dkey && dkey != "")
if(src.linkedServer.decryptkey == dkey)
auth = 1
else
message = incorrectkey
//Turn the server on/off.
if (href_list["active"])
if(auth) linkedServer.active = !linkedServer.active
//Find a server
if (href_list["find"])
if(message_servers && message_servers.len > 1)
src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers
message = "<span class='alert'>NOTICE: Server selected.</span>"
else if(message_servers && message_servers.len > 0)
linkedServer = message_servers[1]
message = "<span class='notice'>NOTICE: Only Single Server Detected - Server selected.</span>"
else
message = noserver
//View the logs - KEY REQUIRED
if (href_list["view"])
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.screen = 1
//Clears the logs - KEY REQUIRED
if (href_list["clear"])
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.linkedServer.pda_msgs = list()
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
//Clears the request console logs - KEY REQUIRED
if (href_list["clearr"])
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.linkedServer.rc_msgs = list()
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
//Change the password - KEY REQUIRED
if (href_list["pass"])
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
if(dkey && dkey != "")
if(src.linkedServer.decryptkey == dkey)
var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):"))
if(length(newkey) <= 3)
message = "<span class='notice'>NOTICE: Decryption key too short!</span>"
else if(length(newkey) > 16)
message = "<span class='notice'>NOTICE: Decryption key too long!</span>"
else if(newkey && newkey != "")
src.linkedServer.decryptkey = newkey
message = "<span class='notice'>NOTICE: Decryption key set.</span>"
else
message = incorrectkey
//Hack the Console to get the password
if (href_list["hack"])
if(issilicon(usr) && is_special_character(usr))
src.hacking = 1
src.screen = 2
//Time it takes to bruteforce is dependant on the password length.
spawn(100*length(src.linkedServer.decryptkey))
if(src && src.linkedServer && usr)
BruteForce(usr)
//Delete the log.
if (href_list["delete"])
//Are they on the view logs screen?
if(screen == 1)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else //if(istype(href_list["delete"], /datum/data_pda_msg))
src.linkedServer.pda_msgs -= locate(href_list["delete"])
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
//Delete the request console log.
if (href_list["deleter"])
//Are they on the view logs screen?
if(screen == 4)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else //if(istype(href_list["delete"], /datum/data_pda_msg))
src.linkedServer.rc_msgs -= locate(href_list["deleter"])
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
//Create a custom message
if (href_list["msg"])
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.screen = 3
//Fake messaging selection - KEY REQUIRED
if (href_list["select"])
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
screen = 0
else
switch(href_list["select"])
//Reset
if("Reset")
ResetMessage()
//Select Your Name
if("Sender")
customsender = stripped_input(usr, "Please enter the sender's name.")
//Select Receiver
if("Recepient")
//Get out list of viable PDAs
var/list/obj/item/device/pda/sendPDAs = get_viewable_pdas()
if(PDAs && PDAs.len > 0)
customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs)
else
customrecepient = null
//Enter custom job
if("RecJob")
customjob = stripped_input(usr, "Please enter the sender's job.")
//Enter message
if("Message")
custommessage = stripped_input(usr, "Please enter your message.")
//Send message
if("Send")
if(isnull(customsender) || customsender == "")
customsender = "UNKNOWN"
if(isnull(customrecepient))
message = "<span class='notice'>NOTICE: No recepient selected!</span>"
return src.attack_hand(usr)
if(isnull(custommessage) || custommessage == "")
message = "<span class='notice'>NOTICE: No message entered!</span>"
return src.attack_hand(usr)
var/obj/item/device/pda/PDARec = null
for (var/obj/item/device/pda/P in get_viewable_pdas())
if(P.owner == customsender)
PDARec = P
//Sender isn't faking as someone who exists
if(isnull(PDARec))
src.linkedServer.send_pda_message("[customrecepient.owner]", "[customsender]","[custommessage]")
customrecepient.tnote += "<i><b>&larr; From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[src]'>[customsender]</a> ([customjob]):</b></i><br>[custommessage]<br>"
if (!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
customrecepient.audible_message("\icon[customrecepient] *[customrecepient.ttone]*", null, 3)
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
H << "\icon[customrecepient] <b>Message from [customsender] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[src];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
log_pda("[usr]/([usr.ckey]) (PDA: [customsender]) sent \"[custommessage]\" to [customrecepient.owner]")
customrecepient.cut_overlays()
customrecepient.add_overlay(image('icons/obj/pda.dmi', "pda-r"))
//Sender is faking as someone who exists
else
src.linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]")
customrecepient.tnote += "<i><b>&larr; From <a href='byond://?src=\ref[customrecepient];choice=Message;target=\ref[PDARec]'>[PDARec.owner]</a> ([customjob]):</b></i><br>[custommessage]<br>"
if (!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
customrecepient.audible_message("\icon[customrecepient] *[customrecepient.ttone]*", null, 3)
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
H << "\icon[customrecepient] <b>Message from [PDARec.owner] ([customjob]), </b>\"[custommessage]\" (<a href='byond://?src=\ref[customrecepient];choice=Message;skiprefresh=1;target=\ref[PDARec]'>Reply</a>)"
log_pda("[usr]/([usr.ckey]) (PDA: [PDARec.owner]) sent \"[custommessage]\" to [customrecepient.owner]")
customrecepient.cut_overlays()
customrecepient.add_overlay(image('icons/obj/pda.dmi', "pda-r"))
//Finally..
ResetMessage()
//Request Console Logs - KEY REQUIRED
if(href_list["viewr"])
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.screen = 4
if (href_list["back"])
src.screen = 0
return src.attack_hand(usr)
/obj/item/weapon/paper/monitorkey
//..()
name = "monitor decryption key"
var/obj/machinery/message_server/server = null
/obj/item/weapon/paper/monitorkey/New()
..()
spawn(10)
if(message_servers)
for(var/obj/machinery/message_server/server in message_servers)
if(!isnull(server))
if(!isnull(server.decryptkey))
info = "<center><h2>Daily Key Reset</h2></center><br>The new message monitor key is '[server.decryptkey]'.<br>Please keep this a secret and away from the clown.<br>If necessary, change the password to a more secure one."
info_links = info
add_overlay("paper_words")
break
+145
View File
@@ -0,0 +1,145 @@
/obj/machinery/computer/pod
name = "mass driver launch control"
desc = "A combined blastdoor and mass driver control unit."
var/obj/machinery/mass_driver/connected = null
var/title = "Mass Driver Controls"
var/id = 1
var/timing = 0
var/time = 30
var/range = 4
/obj/machinery/computer/pod/initialize()
for(var/obj/machinery/mass_driver/M in range(range, src))
if(M.id == id)
connected = M
..()
/obj/machinery/computer/pod/proc/alarm()
if(stat & (NOPOWER|BROKEN))
return
if(!connected)
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
return
for(var/obj/machinery/door/poddoor/M in range(range, src))
if(M.id == id)
M.open()
sleep(20)
for(var/obj/machinery/mass_driver/M in range(range, src))
if(M.id == id)
M.power = connected.power
M.drive()
sleep(50)
for(var/obj/machinery/door/poddoor/M in range(range, src))
if(M.id == id)
M.close()
/obj/machinery/computer/pod/attack_hand(mob/user)
if(..())
return
var/dat = ""
user.set_machine(src)
if(connected)
var/d2
if(timing) //door controls do not need timers.
d2 = "<A href='?src=\ref[src];time=0'>Stop Time Launch</A>"
else
d2 = "<A href='?src=\ref[src];time=1'>Initiate Time Launch</A>"
var/second = time % 60
var/minute = (time - second) / 60
dat += "<HR>\nTimer System: [d2]\nTime Left: [minute ? "[minute]:" : null][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>"
var/temp = ""
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
for(var/t in L)
if(t == connected.power)
temp += "[t] "
else
temp += "<A href = '?src=\ref[src];power=[t]'>[t]</A> "
dat += "<HR>\nPower Level: [temp]<BR>\n<A href = '?src=\ref[src];alarm=1'>Firing Sequence</A><BR>\n<A href = '?src=\ref[src];drive=1'>Test Fire Driver</A><BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
else
dat += "<BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
dat += "<BR><BR><A href='?src=\ref[user];mach_close=computer'>Close</A>"
add_fingerprint(usr)
var/datum/browser/popup = new(user, "computer", title, 400, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
popup.open()
/obj/machinery/computer/pod/process()
if(!..())
return
if(timing)
if(time > 0)
time = round(time) - 1
else
alarm()
time = 0
timing = 0
updateDialog()
/obj/machinery/computer/pod/Topic(href, href_list)
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["power"])
var/t = text2num(href_list["power"])
t = min(max(0.25, t), 16)
if(connected)
connected.power = t
if(href_list["alarm"])
alarm()
if(href_list["time"])
timing = text2num(href_list["time"])
if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
if(href_list["door"])
for(var/obj/machinery/door/poddoor/M in range(range, src))
if(M.id == id)
if(M.density)
M.open()
else
M.close()
if(href_list["drive"])
for(var/obj/machinery/mass_driver/M in range(range, src))
if(M.id == id)
M.power = connected.power
M.drive()
updateUsrDialog()
/obj/machinery/computer/pod/old
name = "\improper DoorMex control console"
title = "Door Controls"
icon_state = "oldcomp"
icon_screen = "library"
icon_keyboard = null
/obj/machinery/computer/pod/old/syndicate
name = "\improper ProComp Executive IIc"
desc = "The Syndicate operate on a tight budget. Operates external airlocks."
title = "External Airlock Controls"
req_access = list(access_syndicate)
/obj/machinery/computer/pod/old/syndicate/attack_hand(mob/user)
if(!allowed(user))
user << "<span class='notice'>Access denied.</span>"
return
else
..()
/obj/machinery/computer/pod/old/swf
name = "\improper Magix System IV"
desc = "An arcane artifact that holds much magic. Running E-Knock 2.2: Sorceror's Edition"
+149
View File
@@ -0,0 +1,149 @@
/obj/machinery/computer/prisoner
name = "prisoner management console"
desc = "Used to manage tracking implants placed inside criminals."
icon_screen = "explosive"
icon_keyboard = "security_key"
req_access = list(access_brig)
var/id = 0
var/temp = null
var/status = 0
var/timeleft = 60
var/stop = 0
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed
var/obj/item/weapon/card/id/prisoner/inserted_id
circuit = /obj/item/weapon/circuitboard/computer/prisoner
/obj/machinery/computer/prisoner/attack_hand(mob/user)
if(..())
return
user.set_machine(src)
var/dat = ""
if(screen == 0)
dat += "<HR><A href='?src=\ref[src];lock=1'>Unlock Console</A>"
else if(screen == 1)
dat += "<H3>Prisoner ID Management</H3>"
if(inserted_id)
dat += text("<A href='?src=\ref[src];id=eject'>[inserted_id]</A><br>")
dat += text("Collected Points: [inserted_id.points]. <A href='?src=\ref[src];id=reset'>Reset.</A><br>")
dat += text("Card goal: [inserted_id.goal]. <A href='?src=\ref[src];id=setgoal'>Set </A><br>")
dat += text("Space Law recommends quotas of 100 points per minute they would normally serve in the brig.<BR>")
else
dat += text("<A href='?src=\ref[src];id=insert'>Insert Prisoner ID.</A><br>")
dat += "<H3>Prisoner Implant Management</H3>"
dat += "<HR>Chemical Implants<BR>"
var/turf/Tr = null
for(var/obj/item/weapon/implant/chem/C in tracked_implants)
Tr = get_turf(C)
if((Tr) && (Tr.z != src.z))
continue//Out of range
if(!C.implanted)
continue
dat += "ID: [C.imp_in.name] | Remaining Units: [C.reagents.total_volume] <BR>"
dat += "| Inject: "
dat += "<A href='?src=\ref[src];inject1=\ref[C]'>(<font class='bad'>(1)</font>)</A>"
dat += "<A href='?src=\ref[src];inject5=\ref[C]'>(<font class='bad'>(5)</font>)</A>"
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font class='bad'>(10)</font>)</A><BR>"
dat += "********************************<BR>"
dat += "<HR>Tracking Implants<BR>"
for(var/obj/item/weapon/implant/tracking/T in tracked_implants)
if(!iscarbon(T.imp_in))
continue
if(!T.implanted)
continue
Tr = get_turf(T)
if((Tr) && (Tr.z != src.z))
continue//Out of range
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
if(Tr.z == ZLEVEL_STATION && !istype(M.loc, /turf/open/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
dat += "ID: [T.imp_in.name] | Location: [loc_display]<BR>"
dat += "<A href='?src=\ref[src];warn=\ref[T]'>(<font class='bad'><i>Message Holder</i></font>)</A> |<BR>"
dat += "********************************<BR>"
dat += "<HR><A href='?src=\ref[src];lock=1'>Lock Console</A>"
//user << browse(dat, "window=computer;size=400x500")
//onclose(user, "computer")
var/datum/browser/popup = new(user, "computer", "Prisoner Management Console", 400, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/prisoner/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/card/id))
return attack_hand(user)
else
return ..()
/obj/machinery/computer/prisoner/process()
if(!..())
src.updateDialog()
return
/obj/machinery/computer/prisoner/Topic(href, href_list)
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["id"])
if(href_list["id"] =="insert" && !inserted_id)
var/obj/item/weapon/card/id/prisoner/I = usr.get_active_hand()
if(istype(I))
if(!usr.drop_item())
return
I.loc = src
inserted_id = I
else usr << "<span class='danger'>No valid ID.</span>"
else if(inserted_id)
switch(href_list["id"])
if("eject")
inserted_id.loc = get_turf(src)
inserted_id.verb_pickup()
inserted_id = null
if("reset")
inserted_id.points = 0
if("setgoal")
var/num = round(input(usr, "Choose prisoner's goal:", "Input an Integer", null) as num|null)
if(num >= 0)
num = min(num,1000) //Cap the quota to the equivilent of 10 minutes.
inserted_id.goal = num
else if(href_list["inject1"])
var/obj/item/weapon/implant/I = locate(href_list["inject1"])
if(I)
I.activate(1)
else if(href_list["inject5"])
var/obj/item/weapon/implant/I = locate(href_list["inject5"])
if(I)
I.activate(5)
else if(href_list["inject10"])
var/obj/item/weapon/implant/I = locate(href_list["inject10"])
if(I)
I.activate(10)
else if(href_list["lock"])
if(src.allowed(usr))
screen = !screen
else
usr << "Unauthorized Access."
else if(href_list["warn"])
var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
if(!warning) return
var/obj/item/weapon/implant/I = locate(href_list["warn"])
if((I)&&(I.imp_in))
var/mob/living/carbon/R = I.imp_in
R << "<span class='italics'>You hear a voice in your head saying: '[warning]'</span>"
log_say("[usr]/[usr.ckey] sent an implant message to [R]/[R.ckey]: '[warning]'")
src.add_fingerprint(usr)
src.updateUsrDialog()
return
+132
View File
@@ -0,0 +1,132 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/machinery/computer/robotics
name = "robotics control console"
desc = "Used to remotely lockdown or detonate linked Cyborgs."
icon_screen = "robot"
icon_keyboard = "rd_key"
req_access = list(access_robotics)
circuit = /obj/item/weapon/circuitboard/computer/robotics
var/temp = null
/obj/machinery/computer/robotics/proc/can_control(mob/user, mob/living/silicon/robot/R)
if(!istype(R))
return 0
if(istype(user, /mob/living/silicon/ai))
if (R.connected_ai != user)
return 0
if(istype(user, /mob/living/silicon/robot))
if (R != user)
return 0
if(R.scrambledcodes)
return 0
return 1
/obj/machinery/computer/robotics/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/computer/robotics/interact(mob/user)
if (src.z > 6)
user << "<span class='boldannounce'>Unable to establish a connection</span>: \black You're too far away from the station!"
return
user.set_machine(src)
var/dat
var/robots = 0
for(var/mob/living/silicon/robot/R in mob_list)
if(!can_control(user, R))
continue
robots++
dat += "[R.name] |"
if(R.stat)
dat += " Not Responding |"
else if (!R.canmove)
dat += " Locked Down |"
else
dat += " Operating Normally |"
if (!R.canmove)
else if(R.cell)
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
else
dat += " No Cell Installed |"
if(R.module)
dat += " Module Installed ([R.module.name]) |"
else
dat += " No Module Installed |"
if(R.connected_ai)
dat += " Slaved to [R.connected_ai.name] |"
else
dat += " Independent from AI |"
if (istype(user, /mob/living/silicon) || IsAdminGhost(user))
if(((issilicon(user) && is_special_character(user)) || IsAdminGhost(user)) && !R.emagged && (user != R || R.syndicate))
dat += "<A href='?src=\ref[src];magbot=\ref[R]'>(<font color=blue><i>Hack</i></font>)</A> "
dat += "<A href='?src=\ref[src];stopbot=\ref[R]'>(<font color=green><i>[R.canmove ? "Lockdown" : "Release"]</i></font>)</A> "
dat += "<A href='?src=\ref[src];killbot=\ref[R]'>(<font color=red><i>Destroy</i></font>)</A>"
dat += "<BR>"
if(!robots)
dat += "No Cyborg Units detected within access parameters."
var/datum/browser/popup = new(user, "computer", "Cyborg Control Console", 400, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/robotics/Topic(href, href_list)
if(..())
return
if (href_list["temp"])
src.temp = null
else if (href_list["killbot"])
if(src.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["killbot"])
if(can_control(usr, R))
var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
if(choice == "Confirm" && can_control(usr, R) && !..())
if(R.syndicate && R.emagged)
R << "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered."
if(R.connected_ai)
R.connected_ai << "<br><br><span class='alert'>ALERT - Cyborg detonation detected: [R.name]</span><br>"
R.ResetSecurityCodes()
else
message_admins("<span class='notice'>[key_name_admin(usr)] (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) detonated [key_name(R, R.client)](<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[R.x];Y=[R.y];Z=[R.z]'>JMP</a>)!</span>")
log_game("\<span class='notice'>[key_name(usr)] detonated [key_name(R)]!</span>")
if(R.connected_ai)
R.connected_ai << "<br><br><span class='alert'>ALERT - Cyborg detonation detected: [R.name]</span><br>"
R.self_destruct()
else
usr << "<span class='danger'>Access Denied.</span>"
else if (href_list["stopbot"])
if(src.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["stopbot"])
if(can_control(usr, R))
var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
if(choice == "Confirm" && can_control(usr, R) && !..())
message_admins("<span class='notice'>[key_name_admin(usr)] (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) [R.canmove ? "locked down" : "released"] [key_name(R, R.client)](<A HREF='?_src_=holder;adminplayerobservefollow=\ref[R]'>FLW</A>)!</span>")
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R)]!")
R.SetLockdown(!R.lockcharge)
R << "[!R.lockcharge ? "<span class='notice'>Your lockdown has been lifted!" : "<span class='alert'>You have been locked down!"]</span>"
if(R.connected_ai)
R.connected_ai << "[!R.lockcharge ? "<span class='notice'>NOTICE - Cyborg lockdown lifted" : "<span class='alert'>ALERT - Cyborg lockdown detected"]: <a href='?src=\ref[R.connected_ai];track=[html_encode(R.name)]'>[R.name]</a></span><br>"
else
usr << "<span class='danger'>Access Denied.</span>"
else if (href_list["magbot"])
if((issilicon(usr) && is_special_character(usr)) || IsAdminGhost(usr))
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
if(istype(R) && !R.emagged && ((R.syndicate && R == usr)|| R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R))
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
message_admins("[key_name_admin(usr)] emagged cyborg [key_name_admin(R)]. using robotic console!")
R.SetEmagged(1)
if(is_special_character(R))
R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes
src.updateUsrDialog()
return
+793
View File
@@ -0,0 +1,793 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/machinery/computer/secure_data//TODO:SANITY
name = "security records console"
desc = "Used to view and edit personnel's security records"
icon_screen = "security"
icon_keyboard = "security_key"
req_one_access = list(access_security, access_forensics_lockers)
circuit = /obj/item/weapon/circuitboard/computer/secure_data
var/obj/item/weapon/card/id/scan = null
var/authenticated = null
var/rank = null
var/screen = null
var/datum/data/record/active1 = null
var/datum/data/record/active2 = null
var/a_id = null
var/temp = null
var/printing = null
var/can_change_id = 0
var/list/Perp
var/tempname = null
//Sorting Variables
var/sortBy = "name"
var/order = 1 // -1 = Descending - 1 = Ascending
/obj/machinery/computer/secure_data/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/weapon/card/id))
if(!scan)
if(!user.drop_item())
return
O.loc = src
scan = O
user << "<span class='notice'>You insert [O].</span>"
else
user << "<span class='warning'>There's already an ID card in the console.</span>"
else
return ..()
//Someone needs to break down the dat += into chunks instead of long ass lines.
/obj/machinery/computer/secure_data/attack_hand(mob/user)
if(..())
return
if(src.z > 6)
user << "<span class='boldannounce'>Unable to establish a connection</span>: \black You're too far away from the station!"
return
var/dat
if(temp)
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];choice=Clear Screen'>Clear Screen</A>", temp, src)
else
dat = text("Confirm Identity: <A href='?src=\ref[];choice=Confirm Identity'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
if(authenticated)
switch(screen)
if(1)
//body tag start + onload and onkeypress (onkeyup) javascript event calls
dat += "<body onload='selectTextField(); updateSearch();' onkeyup='updateSearch();'>"
//search bar javascript
dat += {"
<head>
<script src="libraries.min.js"></script>
<script type='text/javascript'>
function updateSearch(){
var filter_text = document.getElementById('filter');
var filter = filter_text.value.toLowerCase();
if(complete_list != null && complete_list != ""){
var mtbl = document.getElementById("maintable_data_archive");
mtbl.innerHTML = complete_list;
}
if(filter.value == ""){
return;
}else{
$("#maintable_data").children("tbody").children("tr").children("td").children("input").filter(function(index)
{
return $(this)\[0\].value.toLowerCase().indexOf(filter) == -1
}).parent("td").parent("tr").hide()
}
}
function selectTextField(){
var filter_text = document.getElementById('filter');
filter_text.focus();
filter_text.select();
}
</script>
</head>
"}
dat += {"
<p style='text-align:center;'>"}
dat += text("<A href='?src=\ref[];choice=New Record (General)'>New Record</A><BR>", src)
//search bar
dat += {"
<table width='560' align='center' cellspacing='0' cellpadding='5' id='maintable'>
<tr id='search_tr'>
<td align='center'>
<b>Search:</b> <input type='text' id='filter' value='' style='width:300px;'>
</td>
</tr>
</table>
"}
dat += {"
</p>
<table style="text-align:center;" cellspacing="0" width="100%">
<tr>
<th>Records:</th>
</tr>
</table>
<span id='maintable_data_archive'>
<table id='maintable_data' style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th><A href='?src=\ref[src];choice=Sorting;sort=name'>Name</A></th>
<th><A href='?src=\ref[src];choice=Sorting;sort=id'>ID</A></th>
<th><A href='?src=\ref[src];choice=Sorting;sort=rank'>Rank</A></th>
<th><A href='?src=\ref[src];choice=Sorting;sort=fingerprint'>Fingerprints</A></th>
<th>Criminal Status</th>
</tr>"}
if(!isnull(data_core.general))
for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order))
var/crimstat = ""
for(var/datum/data/record/E in data_core.security)
if((E.fields["name"] == R.fields["name"]) && (E.fields["id"] == R.fields["id"]))
crimstat = E.fields["criminal"]
var/background
switch(crimstat)
if("*Arrest*")
background = "'background-color:#990000;'"
if("Incarcerated")
background = "'background-color:#CD6500;'"
if("Parolled")
background = "'background-color:#CD6500;'"
if("Discharged")
background = "'background-color:#006699;'"
if("None")
background = "'background-color:#4F7529;'"
if("")
background = "''" //"'background-color:#FFFFFF;'"
crimstat = "No Record."
dat += "<tr style=[background]>"
dat += text("<td><input type='hidden' value='[] [] [] []'></input><A href='?src=\ref[];choice=Browse Record;d_rec=\ref[]'>[]</a></td>", R.fields["name"], R.fields["id"], R.fields["rank"], R.fields["fingerprint"], src, R, R.fields["name"])
dat += text("<td>[]</td>", R.fields["id"])
dat += text("<td>[]</td>", R.fields["rank"])
dat += text("<td>[]</td>", R.fields["fingerprint"])
dat += text("<td>[]</td></tr>", crimstat)
dat += {"
</table></span>
<script type='text/javascript'>
var maintable = document.getElementById("maintable_data_archive");
var complete_list = maintable.innerHTML;
</script>
<hr width='75%' />"}
dat += text("<A href='?src=\ref[];choice=Record Maintenance'>Record Maintenance</A><br><br>", src)
dat += text("<A href='?src=\ref[];choice=Log Out'>{Log Out}</A>",src)
if(2)
dat += "<B>Records Maintenance</B><HR>"
dat += "<BR><A href='?src=\ref[src];choice=Delete All Records'>Delete All Records</A><BR><BR><A href='?src=\ref[src];choice=Return'>Back</A>"
if(3)
dat += "<font size='4'><b>Security Record</b></font><br>"
if(istype(active1, /datum/data/record) && data_core.general.Find(active1))
if(istype(active1.fields["photo_front"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P1 = active1.fields["photo_front"]
user << browse_rsc(P1.img, "photo_front")
if(istype(active1.fields["photo_side"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P2 = active1.fields["photo_side"]
user << browse_rsc(P2.img, "photo_side")
dat += {"<table><tr><td><table>
<tr><td>Name:</td><td><A href='?src=\ref[src];choice=Edit Field;field=name'>&nbsp;[active1.fields["name"]]&nbsp;</A></td></tr>
<tr><td>ID:</td><td><A href='?src=\ref[src];choice=Edit Field;field=id'>&nbsp;[active1.fields["id"]]&nbsp;</A></td></tr>
<tr><td>Sex:</td><td><A href='?src=\ref[src];choice=Edit Field;field=sex'>&nbsp;[active1.fields["sex"]]&nbsp;</A></td></tr>
<tr><td>Age:</td><td><A href='?src=\ref[src];choice=Edit Field;field=age'>&nbsp;[active1.fields["age"]]&nbsp;</A></td></tr>"}
if(config.mutant_races)
dat += "<tr><td>Species:</td><td><A href ='?src=\ref[src];choice=Edit Field;field=species'>&nbsp;[active1.fields["species"]]&nbsp;</A></td></tr>"
dat += {"<tr><td>Rank:</td><td><A href='?src=\ref[src];choice=Edit Field;field=rank'>&nbsp;[active1.fields["rank"]]&nbsp;</A></td></tr>
<tr><td>Fingerprint:</td><td><A href='?src=\ref[src];choice=Edit Field;field=fingerprint'>&nbsp;[active1.fields["fingerprint"]]&nbsp;</A></td></tr>
<tr><td>Physical Status:</td><td>&nbsp;[active1.fields["p_stat"]]&nbsp;</td></tr>
<tr><td>Mental Status:</td><td>&nbsp;[active1.fields["m_stat"]]&nbsp;</td></tr>
</table></td>
<td><table><td align = center><a href='?src=\ref[src];choice=Edit Field;field=show_photo_front'><img src=photo_front height=80 width=80 border=4></a><br>
<a href='?src=\ref[src];choice=Edit Field;field=upd_photo_front'>Update front photo</a></td>
<td align = center><a href='?src=\ref[src];choice=Edit Field;field=show_photo_side'><img src=photo_side height=80 width=80 border=4></a><br>
<a href='?src=\ref[src];choice=Edit Field;field=upd_photo_side'>Update side photo</a></td></table>
</td></tr></table></td></tr></table>"}
else
dat += "<br>General Record Lost!<br>"
if((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
dat += "<font size='4'><b>Security Data</b></font>"
dat += "<br>Criminal Status: <A href='?src=\ref[src];choice=Edit Field;field=criminal'>[active2.fields["criminal"]]</A>"
dat += "<br><br>Minor Crimes: <A href='?src=\ref[src];choice=Edit Field;field=mi_crim_add'>Add New</A>"
dat +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
<th>Del</th>
</tr>"}
for(var/datum/data/crime/c in active2.fields["mi_crim"])
dat += "<tr><td>[c.crimeName]</td>"
dat += "<td>[c.crimeDetails]</td>"
dat += "<td>[c.author]</td>"
dat += "<td>[c.time]</td>"
dat += "<td><A href='?src=\ref[src];choice=Edit Field;field=mi_crim_delete;cdataid=[c.dataId]'>\[X\]</A></td>"
dat += "</tr>"
dat += "</table>"
dat += "<br>Major Crimes: <A href='?src=\ref[src];choice=Edit Field;field=ma_crim_add'>Add New</A>"
dat +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
<th>Del</th>
</tr>"}
for(var/datum/data/crime/c in active2.fields["ma_crim"])
dat += "<tr><td>[c.crimeName]</td>"
dat += "<td>[c.crimeDetails]</td>"
dat += "<td>[c.author]</td>"
dat += "<td>[c.time]</td>"
dat += "<td><A href='?src=\ref[src];choice=Edit Field;field=ma_crim_delete;cdataid=[c.dataId]'>\[X\]</A></td>"
dat += "</tr>"
dat += "</table>"
dat += "<br>\nImportant Notes:<br>\n\t<A href='?src=\ref[src];choice=Edit Field;field=notes'>&nbsp;[active2.fields["notes"]]&nbsp;</A>"
dat += "<br><br><font size='4'><b>Comments/Log</b></font><br>"
var/counter = 1
while(active2.fields[text("com_[]", counter)])
dat += (active2.fields[text("com_[]", counter)] + "<BR>")
if(active2.fields[text("com_[]", counter)] != "<B>Deleted</B>")
dat += text("<A href='?src=\ref[];choice=Delete Entry;del_c=[]'>Delete Entry</A><BR><BR>", src, counter)
counter++
dat += text("<A href='?src=\ref[];choice=Add Entry'>Add Entry</A><br><br>", src)
dat += text("<A href='?src=\ref[];choice=Delete Record (Security)'>Delete Record (Security Only)</A><br>", src)
else
dat += "Security Record Lost!<br>"
dat += text("<A href='?src=\ref[];choice=New Record (Security)'>New Security Record</A><br><br>", src)
dat += text("<A href='?src=\ref[];choice=Delete Record (ALL)'>Delete Record (ALL)</A><br><A href='?src=\ref[];choice=Print Record'>Print Record</A><BR><A href='?src=\ref[];choice=Print Poster'>Print Wanted Poster</A><BR><A href='?src=\ref[];choice=Return'>Back</A><BR>", src, src, src, src)
else
else
dat += text("<A href='?src=\ref[];choice=Log In'>{Log In}</A>", src)
//user << browse(text("<HEAD><TITLE>Security Records</TITLE></HEAD><TT>[]</TT>", dat), "window=secure_rec;size=600x400")
//onclose(user, "secure_rec")
var/datum/browser/popup = new(user, "secure_rec", "Security Records Console", 600, 400)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/*Revised /N
I can't be bothered to look more of the actual code outside of switch but that probably needs revising too.
What a mess.*/
/obj/machinery/computer/secure_data/Topic(href, href_list)
. = ..()
if(.)
return .
if(!( data_core.general.Find(active1) ))
active1 = null
if(!( data_core.security.Find(active2) ))
active2 = null
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)) || IsAdminGhost(usr))
usr.set_machine(src)
switch(href_list["choice"])
// SORTING!
if("Sorting")
// Reverse the order if clicked twice
if(sortBy == href_list["sort"])
if(order == 1)
order = -1
else
order = 1
else
// New sorting order!
sortBy = href_list["sort"]
order = initial(order)
//BASIC FUNCTIONS
if("Clear Screen")
temp = null
if("Return")
screen = 1
active1 = null
active2 = null
if("Confirm Identity")
if(scan)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
usr.put_in_hands(scan)
else
scan.loc = get_turf(src)
scan = null
else
var/obj/item/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/card/id))
if(!usr.drop_item())
return
I.loc = src
scan = I
if("Log Out")
authenticated = null
screen = null
active1 = null
active2 = null
if("Log In")
if(istype(usr, /mob/living/silicon))
var/mob/living/silicon/borg = usr
active1 = null
active2 = null
authenticated = borg.name
rank = "AI"
screen = 1
else if(IsAdminGhost(usr))
active1 = null
active2 = null
authenticated = usr.client.holder.admin_signature
rank = "Central Command"
screen = 1
else if(istype(scan, /obj/item/weapon/card/id))
active1 = null
active2 = null
if(check_access(scan))
authenticated = scan.registered_name
rank = scan.assignment
screen = 1
//RECORD FUNCTIONS
if("Record Maintenance")
screen = 2
active1 = null
active2 = null
if("Browse Record")
var/datum/data/record/R = locate(href_list["d_rec"])
var/S = locate(href_list["d_rec"])
if(!( data_core.general.Find(R) ))
temp = "Record Not Found!"
else
for(var/datum/data/record/E in data_core.security)
if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
S = E
active1 = R
active2 = S
screen = 3
if("Print Record")
if(!( printing ))
printing = 1
data_core.securityPrintCount++
playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1)
sleep(30)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc )
P.info = "<CENTER><B>Security Record - (SR-[data_core.securityPrintCount])</B></CENTER><BR>"
if((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>", active1.fields["name"], active1.fields["id"], active1.fields["sex"], active1.fields["age"])
if(config.mutant_races)
P.info += "\nSpecies: [active1.fields["species"]]<BR>"
P.info += text("\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"])
else
P.info += "<B>General Record Lost!</B><BR>"
if((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
P.info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []", active2.fields["criminal"])
P.info += "<BR>\n<BR>\nMinor Crimes:<BR>\n"
P.info +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>"}
for(var/datum/data/crime/c in active2.fields["mi_crim"])
P.info += "<tr><td>[c.crimeName]</td>"
P.info += "<td>[c.crimeDetails]</td>"
P.info += "<td>[c.author]</td>"
P.info += "<td>[c.time]</td>"
P.info += "</tr>"
P.info += "</table>"
P.info += "<BR>\nMajor Crimes: <BR>\n"
P.info +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>"}
for(var/datum/data/crime/c in active2.fields["ma_crim"])
P.info += "<tr><td>[c.crimeName]</td>"
P.info += "<td>[c.crimeDetails]</td>"
P.info += "<td>[c.author]</td>"
P.info += "<td>[c.time]</td>"
P.info += "</tr>"
P.info += "</table>"
P.info += text("<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", active2.fields["notes"])
var/counter = 1
while(active2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", active2.fields[text("com_[]", counter)])
counter++
P.name = text("SR-[] '[]'", data_core.securityPrintCount, active1.fields["name"])
else
P.info += "<B>Security Record Lost!</B><BR>"
P.name = text("SR-[] '[]'", data_core.securityPrintCount, "Record Lost")
P.info += "</TT>"
printing = null
if("Print Poster")
if(!( printing ))
var/wanted_name = stripped_input(usr, "Please enter an alias for the criminal:", "Print Wanted Poster", active1.fields["name"])
if(wanted_name)
var/default_description = "A poster declaring [wanted_name] to be a dangerous individual, wanted by Nanotrasen. Report any sightings to security immediately."
var/list/major_crimes = active2.fields["ma_crim"]
var/list/minor_crimes = active2.fields["mi_crim"]
if(major_crimes.len + minor_crimes.len)
default_description += "\n[wanted_name] is wanted for the following crimes:\n"
if(minor_crimes.len)
default_description += "\nMinor Crimes:"
for(var/datum/data/crime/c in active2.fields["mi_crim"])
default_description += "\n[c.crimeName]\n"
default_description += "[c.crimeDetails]\n"
if(major_crimes.len)
default_description += "\nMajor Crimes:"
for(var/datum/data/crime/c in active2.fields["ma_crim"])
default_description += "\n[c.crimeName]\n"
default_description += "[c.crimeDetails]\n"
var/info = stripped_multiline_input(usr, "Please input a description for the poster:", "Print Wanted Poster", default_description, null)
if(info)
playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1)
printing = 1
sleep(30)
if((istype(active1, /datum/data/record) && data_core.general.Find(active1)))//make sure the record still exists.
var/obj/item/weapon/photo/photo = active1.fields["photo_front"]
new /obj/item/weapon/poster/legit/wanted(src.loc, photo.img, wanted_name, info)
printing = 0
//RECORD DELETE
if("Delete All Records")
temp = ""
temp += "Are you sure you wish to delete all Security records?<br>"
temp += "<a href='?src=\ref[src];choice=Purge All Records'>Yes</a><br>"
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if("Purge All Records")
investigate_log("[usr.name] ([usr.key]) has purged all the security records.", "records")
for(var/datum/data/record/R in data_core.security)
qdel(R)
data_core.security.Cut()
temp = "All Security records deleted."
if("Add Entry")
if(!( istype(active2, /datum/data/record) ))
return
var/a2 = active2
var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null)
if(!canUseSecurityRecordsConsole(usr, t1, null, a2))
return
var/counter = 1
while(active2.fields[text("com_[]", counter)])
counter++
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []<BR>[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), year_integer+540, t1,)
if("Delete Record (ALL)")
if(active1)
temp = "<h5>Are you sure you wish to delete the record (ALL)?</h5>"
temp += "<a href='?src=\ref[src];choice=Delete Record (ALL) Execute'>Yes</a><br>"
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if("Delete Record (Security)")
if(active2)
temp = "<h5>Are you sure you wish to delete the record (Security Portion Only)?</h5>"
temp += "<a href='?src=\ref[src];choice=Delete Record (Security) Execute'>Yes</a><br>"
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if("Delete Entry")
if((istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])]))
active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
//RECORD CREATE
if("New Record (Security)")
if((istype(active1, /datum/data/record) && !( istype(active2, /datum/data/record) )))
var/datum/data/record/R = new /datum/data/record()
R.fields["name"] = active1.fields["name"]
R.fields["id"] = active1.fields["id"]
R.name = text("Security Record #[]", R.fields["id"])
R.fields["criminal"] = "None"
R.fields["mi_crim"] = list()
R.fields["ma_crim"] = list()
R.fields["notes"] = "No notes."
data_core.security += R
active2 = R
screen = 3
if("New Record (General)")
//General Record
var/datum/data/record/G = new /datum/data/record()
G.fields["name"] = "New Record"
G.fields["id"] = "[num2hex(rand(1, 1.6777215E7), 6)]"
G.fields["rank"] = "Unassigned"
G.fields["sex"] = "Male"
G.fields["age"] = "Unknown"
if(config.mutant_races)
G.fields["species"] = "Human"
G.fields["photo_front"] = new /icon()
G.fields["photo_side"] = new /icon()
G.fields["fingerprint"] = "?????"
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
data_core.general += G
active1 = G
//Security Record
var/datum/data/record/R = new /datum/data/record()
R.fields["name"] = active1.fields["name"]
R.fields["id"] = active1.fields["id"]
R.name = text("Security Record #[]", R.fields["id"])
R.fields["criminal"] = "None"
R.fields["mi_crim"] = list()
R.fields["ma_crim"] = list()
R.fields["notes"] = "No notes."
data_core.security += R
active2 = R
//Medical Record
var/datum/data/record/M = new /datum/data/record()
M.fields["id"] = active1.fields["id"]
M.fields["name"] = active1.fields["name"]
M.fields["blood_type"] = "?"
M.fields["b_dna"] = "?????"
M.fields["mi_dis"] = "None"
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
M.fields["ma_dis"] = "None"
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
M.fields["alg"] = "None"
M.fields["alg_d"] = "No allergies have been detected in this patient."
M.fields["cdi"] = "None"
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
M.fields["notes"] = "No notes."
data_core.medical += M
//FIELD FUNCTIONS
if("Edit Field")
var/a1 = active1
var/a2 = active2
switch(href_list["field"])
if("name")
if(istype(active1, /datum/data/record) || istype(active2, /datum/data/record))
var/t1 = copytext(sanitize(input("Please input name:", "Secure. records", active1.fields["name"], null) as text),1,MAX_MESSAGE_LEN)
if(!canUseSecurityRecordsConsole(usr, t1, a1))
return
if(istype(active1, /datum/data/record))
active1.fields["name"] = t1
if(istype(active2, /datum/data/record))
active2.fields["name"] = t1
if("id")
if(istype(active2,/datum/data/record) || istype(active1,/datum/data/record))
var/t1 = stripped_input(usr, "Please input id:", "Secure. records", active1.fields["id"], null)
if(!canUseSecurityRecordsConsole(usr, t1, a1))
return
if(istype(active1,/datum/data/record))
active1.fields["id"] = t1
if(istype(active2,/datum/data/record))
active2.fields["id"] = t1
if("fingerprint")
if(istype(active1, /datum/data/record))
var/t1 = stripped_input(usr, "Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null)
if(!canUseSecurityRecordsConsole(usr, t1, a1))
return
active1.fields["fingerprint"] = t1
if("sex")
if(istype(active1, /datum/data/record))
if(active1.fields["sex"] == "Male")
active1.fields["sex"] = "Female"
else
active1.fields["sex"] = "Male"
if("age")
if(istype(active1, /datum/data/record))
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
if(!canUseSecurityRecordsConsole(usr, "age", a1))
return
active1.fields["age"] = t1
if("species")
if(istype(active1, /datum/data/record))
var/t1 = input("Select a species", "Species Selection") as null|anything in roundstart_species
if(!canUseSecurityRecordsConsole(usr, t1, a1))
return
active1.fields["species"] = t1
if("show_photo_front")
if(active1.fields["photo_front"])
if(istype(active1.fields["photo_front"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P = active1.fields["photo_front"]
P.show(usr)
if("upd_photo_front")
var/icon/photo = get_photo(usr)
if(photo)
qdel(active1.fields["photo_front"])
active1.fields["photo_front"] = photo
if("show_photo_side")
if(active1.fields["photo_side"])
if(istype(active1.fields["photo_side"], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P = active1.fields["photo_side"]
P.show(usr)
if("upd_photo_side")
var/icon/photo = get_photo(usr)
if(photo)
qdel(active1.fields["photo_side"])
active1.fields["photo_side"] = photo
if("mi_crim_add")
if(istype(active1, /datum/data/record))
var/t1 = stripped_input(usr, "Please input minor crime names:", "Secure. records", "", null)
var/t2 = stripped_multiline_input(usr, "Please input minor crime details:", "Secure. records", "", null)
if(!canUseSecurityRecordsConsole(usr, t1, null, a2))
return
var/crime = data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text())
data_core.addMinorCrime(active1.fields["id"], crime)
if("mi_crim_delete")
if(istype(active1, /datum/data/record))
if(href_list["cdataid"])
if(!canUseSecurityRecordsConsole(usr, "delete", null, a2))
return
data_core.removeMinorCrime(active1.fields["id"], href_list["cdataid"])
if("ma_crim_add")
if(istype(active1, /datum/data/record))
var/t1 = stripped_input(usr, "Please input major crime names:", "Secure. records", "", null)
var/t2 = stripped_multiline_input(usr, "Please input major crime details:", "Secure. records", "", null)
if(!canUseSecurityRecordsConsole(usr, t1, null, a2))
return
var/crime = data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text())
data_core.addMajorCrime(active1.fields["id"], crime)
if("ma_crim_delete")
if(istype(active1, /datum/data/record))
if(href_list["cdataid"])
if(!canUseSecurityRecordsConsole(usr, "delete", null, a2))
return
data_core.removeMajorCrime(active1.fields["id"], href_list["cdataid"])
if("notes")
if(istype(active2, /datum/data/record))
var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active2.fields["notes"], null)
if(!canUseSecurityRecordsConsole(usr, t1, null, a2))
return
active2.fields["notes"] = t1
if("criminal")
if(istype(active2, /datum/data/record))
temp = "<h5>Criminal Status:</h5>"
temp += "<ul>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=none'>None</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=arrest'>*Arrest*</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=incarcerated'>Incarcerated</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=parolled'>Parolled</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=released'>Discharged</a></li>"
temp += "</ul>"
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI", "Central Command" )
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
if((istype(active1, /datum/data/record) && L.Find(rank)))
temp = "<h5>Rank:</h5>"
temp += "<ul>"
for(var/rank in get_all_jobs())
temp += "<li><a href='?src=\ref[src];choice=Change Rank;rank=[rank]'>[rank]</a></li>"
temp += "</ul>"
else
alert(usr, "You do not have the required rank to do this!")
//TEMPORARY MENU FUNCTIONS
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
if("Change Rank")
if(active1)
active1.fields["rank"] = href_list["rank"]
if(href_list["rank"] in get_all_jobs())
active1.fields["real_rank"] = href_list["real_rank"]
if("Change Criminal Status")
if(active2)
var/old_field = active2.fields["criminal"]
switch(href_list["criminal2"])
if("none")
active2.fields["criminal"] = "None"
if("arrest")
active2.fields["criminal"] = "*Arrest*"
if("incarcerated")
active2.fields["criminal"] = "Incarcerated"
if("parolled")
active2.fields["criminal"] = "Parolled"
if("released")
active2.fields["criminal"] = "Discharged"
investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [usr.name] ([usr.key]).", "records")
for(var/mob/living/carbon/human/H in mob_list) //thanks for forcing me to do this, whoever wrote this shitty records system
H.sec_hud_set_security_status()
if("Delete Record (Security) Execute")
investigate_log("[usr.name] ([usr.key]) has deleted the security records for [active1.fields["name"]].", "records")
if(active2)
data_core.security -= active2
qdel(active2)
active2 = null
if("Delete Record (ALL) Execute")
if(active1)
investigate_log("[usr.name] ([usr.key]) has deleted all records for [active1.fields["name"]].", "records")
for(var/datum/data/record/R in data_core.medical)
if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
data_core.medical -= R
qdel(R)
break
data_core.general -= active1
qdel(active1)
active1 = null
if(active2)
data_core.security -= active2
qdel(active2)
active2 = null
else
temp = "This function does not appear to be working at the moment. Our apologies."
add_fingerprint(usr)
updateUsrDialog()
return
/obj/machinery/computer/secure_data/proc/get_photo(mob/user)
var/obj/item/weapon/photo/P = null
if(istype(user, /mob/living/silicon))
var/mob/living/silicon/tempAI = user
var/datum/picture/selection = tempAI.GetPhoto()
if(selection)
P = new()
P.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"])
else if(istype(user.get_active_hand(), /obj/item/weapon/photo))
P = user.get_active_hand()
return P
/obj/machinery/computer/secure_data/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
for(var/datum/data/record/R in data_core.security)
if(prob(10/severity))
switch(rand(1,8))
if(1)
if(prob(10))
R.fields["name"] = "[pick(lizard_name(MALE),lizard_name(FEMALE))]"
else
R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]"
if(2)
R.fields["sex"] = pick("Male", "Female")
if(3)
R.fields["age"] = rand(5, 85)
if(4)
R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Discharged")
if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
if(6)
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
if(7)
R.fields["species"] = pick(roundstart_species)
if(8)
var/datum/data/record/G = pick(data_core.general)
R.fields["photo_front"] = G.fields["photo_front"]
R.fields["photo_side"] = G.fields["photo_side"]
continue
else if(prob(1))
qdel(R)
continue
..(severity)
/obj/machinery/computer/secure_data/proc/canUseSecurityRecordsConsole(mob/user, message1 = 0, record1, record2)
if(user)
if(authenticated)
if(user.canUseTopic(src))
if(!trim(message1))
return 0
if(!record1 || record1 == active1)
if(!record2 || record2 == active2)
return 1
return 0
@@ -0,0 +1,83 @@
/obj/machinery/computer/station_alert
name = "station alert console"
desc = "Used to access the station's automated alert system."
icon_screen = "alert:0"
icon_keyboard = "atmos_key"
circuit = /obj/item/weapon/circuitboard/computer/stationalert
var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list())
/obj/machinery/computer/station_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "station_alert", name, 300, 500, master_ui, state)
ui.open()
/obj/machinery/computer/station_alert/ui_data(mob/user)
var/list/data = list()
data["alarms"] = list()
for(var/class in alarms)
data["alarms"][class] = list()
for(var/area in alarms[class])
data["alarms"][class] += area
return data
/obj/machinery/computer/station_alert/proc/triggerAlarm(class, area/A, O, obj/source)
if(source.z != z)
return
if(stat & (BROKEN))
return
var/list/L = alarms[class]
for(var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[3]
if (!(source in sources))
sources += source
return 1
var/obj/machinery/camera/C = null
var/list/CL = null
if(O && istype(O, /list))
CL = O
if (CL.len == 1)
C = CL[1]
else if(O && istype(O, /obj/machinery/camera))
C = O
L[A.name] = list(A, (C ? C : O), list(source))
return 1
/obj/machinery/computer/station_alert/proc/cancelAlarm(class, area/A, obj/origin)
if(stat & (BROKEN))
return
var/list/L = alarms[class]
var/cleared = 0
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[3]
if (origin in srcs)
srcs -= origin
if (srcs.len == 0)
cleared = 1
L -= I
return !cleared
/obj/machinery/computer/station_alert/process()
..()
/obj/machinery/computer/station_alert/update_icon()
..()
if(stat & (NOPOWER|BROKEN))
return
var/active_alarms = FALSE
for(var/cat in alarms)
var/list/L = alarms[cat]
if(L.len)
active_alarms = TRUE
if(active_alarms)
add_overlay("alert:2")
@@ -0,0 +1,218 @@
#define NUKESCALINGMODIFIER 1
var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","Foxtrot","Zero", "Niner")
/obj/machinery/computer/telecrystals
name = "\improper Telecrystal assignment station"
desc = "A device used to manage telecrystals during group operations. You shouldn't be looking at this particular one..."
icon_state = "tcstation"
icon_keyboard = "tcstation_key"
icon_screen = "syndie"
clockwork = TRUE //it'd look weird, at least if ratvar ever got there
/////////////////////////////////////////////
/obj/machinery/computer/telecrystals/uplinker
name = "\improper Telecrystal upload/receive station"
desc = "A device used to manage telecrystals during group operations. To use, simply insert your uplink. With your uplink installed \
you can upload your telecrystals to the group's pool using the console, or be assigned additional telecrystals by your lieutenant."
var/obj/item/uplinkholder = null
var/obj/machinery/computer/telecrystals/boss/linkedboss = null
/obj/machinery/computer/telecrystals/uplinker/New()
..()
var/ID
if(possible_uplinker_IDs.len)
ID = pick(possible_uplinker_IDs)
possible_uplinker_IDs -= ID
name = "[name] [ID]"
else
name = "[name] [rand(1,999)]"
/obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/O, mob/user, params)
if(uplinkholder)
user << "<span class='notice'>The [src] already has an uplink in it.</span>"
return
if(O.hidden_uplink)
var/obj/item/I = user.get_active_hand()
if(!user.drop_item())
return
uplinkholder = I
I.loc = src
I.add_fingerprint(user)
update_icon()
updateUsrDialog()
else
user << "<span class='notice'>The [O] doesn't appear to be an uplink...</span>"
/obj/machinery/computer/telecrystals/uplinker/update_icon()
..()
if(uplinkholder)
add_overlay("[initial(icon_state)]-closed")
/obj/machinery/computer/telecrystals/uplinker/proc/ejectuplink()
if(uplinkholder)
uplinkholder.loc = get_turf(src.loc)
uplinkholder = null
update_icon()
/obj/machinery/computer/telecrystals/uplinker/proc/donateTC(amt, addLog = 1)
if(uplinkholder && linkedboss)
if(amt <= uplinkholder.hidden_uplink.telecrystals)
uplinkholder.hidden_uplink.telecrystals -= amt
linkedboss.storedcrystals += amt
if(addLog)
linkedboss.logTransfer("[src] donated [amt] telecrystals to [linkedboss].")
/obj/machinery/computer/telecrystals/uplinker/proc/giveTC(amt, addLog = 1)
if(uplinkholder && linkedboss)
if(amt <= linkedboss.storedcrystals)
uplinkholder.hidden_uplink.telecrystals += amt
linkedboss.storedcrystals -= amt
if(addLog)
linkedboss.logTransfer("[src] received [amt] telecrystals from [linkedboss].")
///////
/obj/machinery/computer/telecrystals/uplinker/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(user)
user.set_machine(src)
var/dat = ""
if(linkedboss)
dat += "[linkedboss] has [linkedboss.storedcrystals] telecrystals available for distribution. <BR><BR>"
else
dat += "No linked management consoles detected. Scan for uplink stations using the management console.<BR><BR>"
if(uplinkholder)
dat += "[uplinkholder.hidden_uplink.telecrystals] telecrystals remain in this uplink.<BR>"
if(linkedboss)
dat += "Donate TC: <a href='byond://?src=\ref[src];donate1=1'>1</a> | <a href='byond://?src=\ref[src];donate5=1'>5</a>"
dat += "<br><a href='byond://?src=\ref[src];eject=1'>Eject Uplink</a>"
var/datum/browser/popup = new(user, "computer", "Telecrystal Upload/Receive Station", 700, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/telecrystals/uplinker/Topic(href, href_list)
if(..())
return
if(href_list["donate1"])
donateTC(1)
if(href_list["donate5"])
donateTC(5)
if(href_list["eject"])
ejectuplink()
src.updateUsrDialog()
/////////////////////////////////////////
/obj/machinery/computer/telecrystals/boss
name = "team Telecrystal management console"
desc = "A device used to manage telecrystals during group operations. To use, simply initialize the machine by scanning for nearby uplink stations. \
Once the consoles are linked up, you can assign any telecrystals amongst your operatives; be they donated by your agents or rationed to the squad \
based on the danger rating of the mission."
icon_state = "computer"
icon_screen = "tcboss"
icon_keyboard = "syndie_key"
var/virgin = 1
var/scanrange = 10
var/storedcrystals = 0
var/list/TCstations = list()
var/list/transferlog = list()
/obj/machinery/computer/telecrystals/boss/proc/logTransfer(logmessage)
transferlog += ("<b>[worldtime2text()]</b> [logmessage]")
/obj/machinery/computer/telecrystals/boss/proc/scanUplinkers()
for(var/obj/machinery/computer/telecrystals/uplinker/A in urange(scanrange, src.loc))
if(!A.linkedboss)
TCstations += A
A.linkedboss = src
if(virgin)
getDangerous()
virgin = 0
/obj/machinery/computer/telecrystals/boss/proc/getDangerous()//This scales the TC assigned with the round population.
..()
var/danger
danger = joined_player_list.len - ticker.mode.syndicates.len
danger = Ceiling(danger, 10)
scaleTC(danger)
/obj/machinery/computer/telecrystals/boss/proc/scaleTC(amt)//Its own proc, since it'll probably need a lot of tweaks for balance, use a fancier algorhithm, etc.
storedcrystals += amt * NUKESCALINGMODIFIER
/////////
/obj/machinery/computer/telecrystals/boss/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(user)
user.set_machine(src)
var/dat = ""
dat += "<a href='byond://?src=\ref[src];scan=1'>Scan for TC stations.</a><BR>"
dat += "This [src] has [storedcrystals] telecrystals available for distribution. <BR>"
dat += "<BR><BR>"
for(var/obj/machinery/computer/telecrystals/uplinker/A in TCstations)
dat += "[A.name] | "
if(A.uplinkholder)
dat += "[A.uplinkholder.hidden_uplink.telecrystals] telecrystals."
if(storedcrystals)
dat+= "<BR>Add TC: <a href ='?src=\ref[src];give1=\ref[A]'>1</a> | <a href ='?src=\ref[src];give5=\ref[A]'>5</a>"
dat += "<BR>"
if(TCstations.len)
dat += "<BR><BR><a href='byond://?src=\ref[src];distrib=1'>Evenly distribute remaining TC.</a><BR><BR>"
for(var/entry in transferlog)
dat += "<small>[entry]</small><BR>"
var/datum/browser/popup = new(user, "computer", "Team Telecrystal Management Console", 700, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer/telecrystals/boss/Topic(href, href_list)
if(..())
return
if(href_list["scan"])
scanUplinkers()
if(href_list["give1"])
var/obj/machinery/computer/telecrystals/uplinker/A = locate(href_list["give1"])
A.giveTC(1)
if(href_list["give5"])
var/obj/machinery/computer/telecrystals/uplinker/A = locate(href_list["give5"])
A.giveTC(5)
if(href_list["distrib"])
var/sanity = 0
while(storedcrystals && sanity < 100)
for(var/obj/machinery/computer/telecrystals/uplinker/A in TCstations)
A.giveTC(1,0)
sanity++
logTransfer("[src] evenly distributed telecrystals.")
src.updateUsrDialog()
return
#undef NUKESCALINGMODIFIER