Finishes id computer

adds designs for computer parts to rnd and cases to the autolathe.
This commit is contained in:
Shadowlight213
2016-08-09 22:55:07 -07:00
parent 6bb69d760e
commit 8035651400
37 changed files with 744 additions and 251 deletions
@@ -41,6 +41,7 @@
var/obj/item/weapon/computer_hardware/battery_module/battery_module // An internal power source for this computer. Can be recharged.
// Optional hardware (improves functionality, but is not critical for computer to work)
var/obj/item/weapon/computer_hardware/card_slot/card_slot // ID Card slot component of this computer. Mostly for HoP modification console that needs ID slot for modification.
var/obj/item/weapon/computer_hardware/card_slot/card_slot2 // second slot. popular demand requested the hop need to insert 2 ids.
var/obj/item/weapon/computer_hardware/nano_printer/nano_printer // Nano Printer component of this computer, for your everyday paperwork needs.
var/obj/item/weapon/computer_hardware/hard_drive/portable/portable_drive // Portable data storage
@@ -81,7 +82,7 @@
proc_eject_usb(usr)
/obj/item/modular_computer/proc/proc_eject_id(mob/user)
/obj/item/modular_computer/proc/proc_eject_id(mob/user, slot)
if(!user)
user = usr
@@ -89,21 +90,23 @@
user << "\The [src] does not have an ID card slot"
return
if(!card_slot.stored_card)
if(!card_slot.stored_card && !card_slot.stored_card2)
user << "There is no card in \the [src]"
return
if(active_program)
active_program.event_idremoved(0)
active_program.event_idremoved(0, slot)
for(var/I in idle_threads)
var/datum/computer_file/program/P = I
P.event_idremoved(1)
card_slot.stored_card.forceMove(get_turf(src))
card_slot.stored_card = null
// update_uis()
user << "You remove the card from \the [src]"
P.event_idremoved(1, slot)
if(card_slot.stored_card && (!slot || slot == 1))
card_slot.stored_card.forceMove(get_turf(src))
card_slot.stored_card = null
if(card_slot.stored_card2 && (!slot || slot == 2))
card_slot.stored_card2.forceMove(get_turf(src))
card_slot.stored_card2 = null
user << "You remove the card[card_slot.stored_card && card_slot.stored_card2 && !slot ? "s" : ""] from \the [src]"
/obj/item/modular_computer/proc/proc_eject_usb(mob/user)
if(!user)
@@ -114,7 +117,6 @@
return
uninstall_component(user, portable_drive)
// update_uis()
/obj/item/modular_computer/attack_ghost(mob/dead/observer/user)
if(enabled)
@@ -158,14 +160,13 @@
/obj/item/modular_computer/update_icon()
icon_state = icon_state_unpowered
overlays.Cut()
cut_overlays()
if(!enabled)
return
if(active_program)
overlays.Add(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
add_overlay(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
else
overlays.Add(icon_state_menu)
add_overlay(icon_state_menu)
// Used by child types if they have other power source than battery
/obj/item/modular_computer/proc/check_power_override()
@@ -209,14 +210,9 @@
/obj/item/modular_computer/ui_data(mob/user)
// var/list/data = list()
// data["active_program_template"] = active_program
// return data
var/list/data = get_header_data()
data["programs"] = list()
// var/list/programs = list()
for(var/datum/computer_file/program/P in hard_drive.stored_files)
var/running = 0
if(P in idle_threads)
@@ -224,13 +220,6 @@
data["programs"] += list(list("name" = P.filename, "desc" = P.filedesc, "running" = running))
// var/list/program = list()
// program["name"] = P.filename
// program["desc"] = P.filedesc
// if(P in idle_threads)
// program["running"] = 1
// programs.Add(list(program))
return data
@@ -467,7 +456,7 @@
if(P.requires_ntnet && !get_ntnet_status(P.requires_ntnet_feature)) // The program requires NTNet connection, but we are not connected to NTNet.
user << "<span class='danger'>\The [src]'s screen shows \"NETWORK ERROR - Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.</span>"
return
P.computer_emagged = computer_emagged
if(P.run_program(user))
active_program = P
update_icon()
@@ -513,12 +502,15 @@
user << "You try to insert \the [I] into \the [src], but it does not have an ID card slot installed."
return
if(card_slot.stored_card)
user << "You try to insert \the [I] into \the [src], but it's ID card slot is occupied."
if(card_slot.stored_card && card_slot.stored_card2)
user << "You try to insert \the [I] into \the [src], but it's ID card slots are occupied."
return
if(!user.drop_item(I))
return
card_slot.stored_card = I
if(!card_slot.stored_card)
card_slot.stored_card = I
else
card_slot.stored_card2 = I
I.forceMove(src)
// update_uis()
user << "You insert \the [I] into \the [src]."
@@ -717,53 +709,6 @@
all_components.Add(processor_unit)
return all_components
/*
/obj/item/modular_computer/proc/update_uis()
if(active_program) //Should we update program ui or computer ui?
nanomanager.update_uis(active_program)
if(active_program.NM)
nanomanager.update_uis(active_program.NM)
else
nanomanager.update_uis(src)
/obj/item/modular_computer/proc/check_update_ui_need()
var/ui_update_needed = 0
if(battery_module)
var/batery_percent = battery_module.battery.percent()
if(last_battery_percent != batery_percent) //Let's update UI on percent change
ui_update_needed = 1
last_battery_percent = batery_percent
if(stationtime2text() != last_world_time)
last_world_time = stationtime2text()
ui_update_needed = 1
if(idle_threads.len)
var/list/current_header_icons = list()
for(var/datum/computer_file/program/P in idle_threads)
if(!P.ui_header)
continue
current_header_icons[P.type] = P.ui_header
if(!last_header_icons)
last_header_icons = current_header_icons
else if(!listequal(last_header_icons, current_header_icons))
last_header_icons = current_header_icons
ui_update_needed = 1
else
for(var/x in last_header_icons|current_header_icons)
if(last_header_icons[x]!=current_header_icons[x])
last_header_icons = current_header_icons
ui_update_needed = 1
break
if(ui_update_needed)
update_uis()
*/
/obj/item/modular_computer/proc/take_damage(amount, component_probability, damage_casing = 1, randomize = 1)
if(randomize)
// 75%-125%, rand() works with integers, apparently.
@@ -772,7 +717,6 @@
if(damage_casing)
damage += amount
damage = max(0,min(max_damage,damage))
// damage = between(0, damage, max_damage)
if(component_probability)
for(var/I in get_all_components())
@@ -799,8 +743,6 @@
switch(Proj.damage_type)
if(BRUTE)
take_damage(Proj.damage, Proj.damage / 2)
//if(HALLOSS)
// take_damage(Proj.damage, Proj.damage / 3, 0)
if(BURN)
take_damage(Proj.damage, Proj.damage / 1.5)
@@ -4,7 +4,7 @@
. = ..()
desc = "A low-end tablet often seen among low ranked station personnel."
processor_unit = new/obj/item/weapon/computer_hardware/processor_unit/small(src)
battery_module = new/obj/item/weapon/computer_hardware/battery_module/super(src)
battery_module = new/obj/item/weapon/computer_hardware/battery_module/micro(src)
battery_module.charge_to_full()
hard_drive = new/obj/item/weapon/computer_hardware/hard_drive/micro(src)
network_card = new/obj/item/weapon/computer_hardware/network_card(src)
@@ -13,7 +13,7 @@
/obj/item/modular_computer/tablet/preset/advanced/New()
. = ..()
processor_unit = new/obj/item/weapon/computer_hardware/processor_unit/small(src)
battery_module = new/obj/item/weapon/computer_hardware/battery_module/super(src)
battery_module = new/obj/item/weapon/computer_hardware/battery_module(src)
battery_module.charge_to_full()
hard_drive = new/obj/item/weapon/computer_hardware/hard_drive/small(src)
network_card = new/obj/item/weapon/computer_hardware/network_card(src)
@@ -43,16 +43,16 @@ var/list/global_modular_computers = list()
/obj/machinery/modular_computer/update_icon()
icon_state = icon_state_unpowered
overlays.Cut()
cut_overlays()
if(!cpu || !cpu.enabled)
if (!(stat & NOPOWER) || battery_powered)
overlays.Add(screen_icon_screensaver)
// set_light(0)
add_overlay(screen_icon_screensaver)
SetLuminosity(0)
return
// set_light(light_strength)
SetLuminosity(light_strength)
if(cpu.active_program)
overlays.Add(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu)
add_overlay(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu)
else
overlays.Add(screen_icon_state_menu)
@@ -14,7 +14,7 @@
base_active_power_usage = 500
max_hardware_size = 3
steel_sheet_cost = 20
light_strength = 4
light_strength = 2
_max_damage = 300
_break_damage = 150
@@ -3,8 +3,7 @@
filetype = "PRG"
filename = "UnknownProgram" // File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET!
var/required_access = null // List of required accesses to *run* the program.
var/datum/nano_module/NM = null // If the program uses NanoModule, put it here and it will be automagically opened. Otherwise implement ui_interact.
var/nanomodule_path = null // Path to nanomodule, make sure to set this if implementing new program.
var/transfer_access = null // List of required access to download or file host the program
var/program_state = PROGRAM_STATE_KILLED// PROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running.
var/obj/item/modular_computer/computer // Device that runs this program.
var/filedesc = "Unknown Program" // User-friendly name of this program.
@@ -18,7 +17,7 @@
var/available_on_ntnet = 1 // Whether the program can be downloaded from NTNet. Set to 0 to disable.
var/available_on_syndinet = 0 // Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
var/computer_emagged = 0 // Set to 1 if computer that's running us was emagged. Computer updates this every Process() tick
var/ui_header = null // Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /nano/images/status_icons. Be careful not to use too large images!
var/ui_header = null // Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images!
/datum/computer_file/program/New(obj/item/modular_computer/comp = null)
..()
@@ -32,7 +31,6 @@
/datum/computer_file/program/clone()
var/datum/computer_file/program/temp = ..()
temp.required_access = required_access
temp.nanomodule_path = nanomodule_path
temp.filedesc = filedesc
temp.program_icon_state = program_icon_state
temp.requires_ntnet = requires_ntnet
@@ -70,27 +68,44 @@
// Check if the user can run program. Only humans can operate computer. Automatically called in run_program()
// User has to wear their ID for ID Scan to work.
// Can also be called manually, with optional parameter being access_to_check to scan the user's ID
/datum/computer_file/program/proc/can_run(mob/living/user, loud = 0, access_to_check)
/datum/computer_file/program/proc/can_run(mob/living/user, loud = 0, access_to_check, transfer = 0)
// Defaults to required_access
if(!access_to_check)
access_to_check = required_access
if(transfer && transfer_access)
access_to_check = transfer_access
else
access_to_check = required_access
if(!access_to_check) // No required_access, allow it.
return 1
if(computer_emagged && !transfer) //emags can bypass the execution locks but not the download ones.
return 1
if(issilicon(user))
return 1
if(ishuman(user))
var/mob/living/carbon/human/h = user
var/obj/item/weapon/card/id/I = h.get_idcard()
if(!I)
var/obj/item/weapon/card/id/C = h.get_active_hand()
if (istype(C, /obj/item/device/pda))
var/obj/item/device/pda/pda = C
C = pda.id
if(!(C && istype(C)))
C = null
if(!I && !C)
if(loud)
user << "<span class='danger'>\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.</span>"
return 0
if(access_to_check in I.GetAccess())
return 1
else if(loud)
if(I)
if(access_to_check in I.GetAccess())
return 1
else if(C)
if(access_to_check in C.GetAccess())
return 1
if(loud)
user << "<span class='danger'>\The [computer] flashes an \"Access Denied\" warning.</span>"
return 0
@@ -2,7 +2,7 @@
// Always include a parent call when overriding an event.
// Called when the ID card is removed from computer. ID is removed AFTER this proc.
/datum/computer_file/program/proc/event_idremoved(background)
/datum/computer_file/program/proc/event_idremoved(background, slot)
return
// Called when the computer fails due to power loss. Override when program wants to specifically react to power loss.
@@ -20,6 +20,7 @@
computer.enabled = 0
computer.update_icon()
qdel(computer.hard_drive)
computer.take_damage(25, 10, 1, 1)
if(computer.battery_module && prob(25))
qdel(computer.battery_module)
computer.visible_message("<span class='notice'>\The [computer]'s battery explodes in rain of sparks.</span>")
@@ -3,12 +3,14 @@
filedesc = "ID card modification program"
program_icon_state = "id"
extended_desc = "Program for programming employee ID cards to access parts of the station."
required_access = access_change_ids
transfer_access = access_change_ids
requires_ntnet = 0
size = 8
var/mod_mode = 1
var/is_centcom = 0
var/show_assignments = 0
var/minor = 0
var/authenticated = 0
var/list/region_access = null
var/list/head_subordinates = null
var/target_dept = 0 //Which department this computer has access to. 0=all departments
@@ -34,6 +36,43 @@
var/list/opened_positions = list();
/datum/computer_file/program/card_mod/event_idremoved(background, slot)
if(slot == 2)
minor = 0
authenticated = 0
head_subordinates = null
region_access = null
/datum/computer_file/program/card_mod/proc/job_blacklisted(jobtitle)
return (jobtitle in blacklisted)
//Logic check for if you can open the job
/datum/computer_file/program/card_mod/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 0
return 0
//Logic check for if you can close the job
/datum/computer_file/program/card_mod/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 0
return 0
/datum/computer_file/program/card_mod/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)
@@ -65,17 +104,24 @@
var/obj/item/weapon/card/id/user_id_card = null
var/mob/user = usr
if(ishuman(user))
var/mob/living/carbon/human/h = user
user_id_card = h.get_idcard()
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
var/obj/item/weapon/card/id/auth_card = computer.card_slot.stored_card2
if(auth_card)
user_id_card = auth_card
else
if(ishuman(user))
var/mob/living/carbon/human/h = user
user_id_card = h.get_idcard()
switch(action)
if("PRG_switchm")
if(params["target"] == "mod")
mod_mode = 1
else if (params["target"] == "manifest")
mod_mode = 0
else if (params["target"] == "manage")
mod_mode = 2
if("PRG_togglea")
if(show_assignments)
show_assignments = 0
@@ -84,9 +130,9 @@
if("PRG_print")
if(computer && computer.nano_printer) //This option should never be called if there is no printer
if(mod_mode)
if(can_run(user, 1))
if(authorized())
var/contents = {"<h4>Access Report</h4>
<u>Prepared By:</u> [user_id_card.registered_name ? user_id_card.registered_name : "Unknown"]<br>
<u>Prepared By:</u> [user_id_card && user_id_card.registered_name ? user_id_card.registered_name : "Unknown"]<br>
<u>For:</u> [id_card.registered_name ? id_card.registered_name : "Unregistered"]<br>
<hr>
<u>Assignment:</u> [id_card.assignment]<br>
@@ -115,16 +161,42 @@
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
if("PRG_eject")
if(computer && computer.card_slot)
if(id_card)
data_core.manifest_modify(id_card.registered_name, id_card.assignment)
computer.proc_eject_id(user)
var/select = params["target"]
switch(select)
if("id")
if(id_card)
data_core.manifest_modify(id_card.registered_name, id_card.assignment)
computer.proc_eject_id(user, 1)
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
if(!usr.drop_item())
return
I.forceMove(computer)
computer.card_slot.stored_card = I
if("auth")
if(auth_card)
if(id_card)
data_core.manifest_modify(id_card.registered_name, id_card.assignment)
head_subordinates = null
region_access = null
authenticated = 0
minor = 0
computer.proc_eject_id(user, 2)
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
if(!usr.drop_item())
return
I.forceMove(computer)
computer.card_slot.stored_card2 = I
if("PRG_terminate")
if(computer && can_run(user, 1))
id_card.assignment = "Terminated"
if(computer && ((id_card.assignment in head_subordinates) || id_card.assignment == "Assistant"))
id_card.assignment = "Unassigned"
remove_nt_access(id_card)
if("PRG_edit")
if(computer && can_run(user, 1))
if(computer && authorized())
if(params["name"])
var/temp_name = reject_bad_name(input("Enter name.", "Name", id_card.registered_name))
if(temp_name)
@@ -135,7 +207,7 @@
// var/account_num = text2num(input("Enter account number.", "Account", id_card.associated_account_number))
// id_card.associated_account_number = account_num
if("PRG_assign")
if(computer && can_run(user, 1) && id_card)
if(computer && authorized() && id_card)
var/t1 = params["assign_target"]
if(t1 == "Custom")
var/temp_t = reject_bad_text(input("Enter a custom job assignment.","Assignment", id_card.assignment), 45)
@@ -164,89 +236,221 @@
id_card.assignment = t1
if("PRG_access")
if(params["allowed"] && computer && can_run(user, 1))
if(params["allowed"] && computer && authorized())
var/access_type = text2num(params["access_target"])
var/access_allowed = text2num(params["allowed"])
world << "type [access_type]"
world << "allow [access_allowed]"
if(access_type in (is_centcom ? get_all_centcom_access() : get_all_accesses()))
world << "yes"
id_card.access -= access_type
if(!access_allowed)
world << "check"
id_card.access += access_type
if("PRG_open_job")
var/edit_job_target = params["target"]
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("PRG_close_job")
var/edit_job_target = params["target"]
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(id_card)
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
return 1
/datum/computer_file/program/card_mod/proc/remove_nt_access(var/obj/item/weapon/card/id/id_card)
/datum/computer_file/program/card_mod/proc/remove_nt_access(obj/item/weapon/card/id/id_card)
id_card.access -= get_all_accesses()
id_card.access -= get_all_centcom_access()
/datum/computer_file/program/card_mod/proc/apply_access(var/obj/item/weapon/card/id/id_card, var/list/accesses)
/datum/computer_file/program/card_mod/proc/apply_access(obj/item/weapon/card/id/id_card, list/accesses)
id_card.access |= accesses
/datum/computer_file/program/card_mod/ui_data(mob/user)
var/list/data = get_header_data()
data["mmode"] = mod_mode
var/authed = 0
if(computer && computer.card_slot)
var/obj/item/weapon/card/id/auth_card = computer.card_slot.stored_card2
data["auth_name"] = auth_card ? strip_html_simple(auth_card.name) : "-----"
authed = authorized()
if(mod_mode == 2)
data["slots"] = list()
var/list/pos = list()
for(var/datum/job/job in SSjob.occupations)
if(job.title in blacklisted)
continue
var/list/status_open = build_manage(job,1)
var/list/status_close = build_manage(job,0)
pos.Add(list(list(
"title" = job.title,
"current" = job.current_positions,
"total" = job.total_positions,
"status_open" = authed ? status_open["enable"]: 0,
"status_close" = authed ? status_close["enable"] : 0,
"desc_open" = status_open["desc"],
"desc_close" = status_close["desc"])))
data["slots"] = pos
data["src"] = "\ref[src]"
data["station_name"] = station_name()
data["manifest"] = data_core ? data_core.get_manifest(0) : null
if(!mod_mode)
data["manifest"] = list()
var/list/crew = list()
for(var/datum/data/record/t in sortRecord(data_core.general))
crew.Add(list(list(
"name" = t.fields["name"],
"rank" = t.fields["rank"])))
data["manifest"] = crew
data["assignments"] = show_assignments
if(computer)
data["have_id_slot"] = !!computer.card_slot
data["have_printer"] = !!computer.nano_printer
data["authenticated"] = can_run(user)
if(!computer.card_slot)
if(!computer.card_slot && mod_mode == 1)
mod_mode = 0 //We can't modify IDs when there is no card reader
else
data["have_id_slot"] = 0
data["have_printer"] = 0
data["authenticated"] = 0
data["mmode"] = mod_mode
data["centcom_access"] = is_centcom
if(computer && computer.card_slot)
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
data["has_id"] = !!id_card
data["id_rank"] = id_card && id_card.assignment ? html_encode(id_card.assignment) : "Unassigned"
data["id_owner"] = id_card && id_card.registered_name ? html_encode(id_card.registered_name) : "-----"
data["id_name"] = id_card ? strip_html_simple(id_card.name) : "-----"
data["authenticated"] = authed
data["engineering_jobs"] = format_jobs(engineering_positions)
data["medical_jobs"] = format_jobs(medical_positions)
data["science_jobs"] = format_jobs(science_positions)
data["security_jobs"] = format_jobs(security_positions)
data["cargo_jobs"] = format_jobs(supply_positions)
data["civilian_jobs"] = format_jobs(supply_positions)
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
if(mod_mode == 1)
if(computer.card_slot.stored_card)
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
if(is_centcom)
var/list/all_centcom_access = list()
for(var/access in get_all_centcom_access())
all_centcom_access.Add(list(list(
"desc" = replacetext(get_centcom_access_desc(access), "&nbsp", " "),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0)))
data["all_centcom_access"] = all_centcom_access
else
var/list/regions = list()
for(var/i = 1; i <= 7; i++)
var/list/accesses = list()
for(var/access in get_region_accesses(i))
if (get_access_desc(access))
accesses.Add(list(list(
"desc" = replacetext(get_access_desc(access), "&nbsp", " "),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0)))
if(computer && computer.card_slot)
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
regions.Add(list(list(
"name" = get_region_accesses_name(i),
"accesses" = accesses)))
data["regions"] = regions
data["has_id"] = !!id_card
data["id_rank"] = id_card && id_card.assignment ? html_encode(id_card.assignment) : "Unassigned"
data["id_owner"] = id_card && id_card.registered_name ? html_encode(id_card.registered_name) : "-----"
data["id_name"] = id_card ? strip_html_simple(id_card.name) : "-----"
return data
data["engineering_jobs"] = format_jobs(engineering_positions)
data["medical_jobs"] = format_jobs(medical_positions)
data["science_jobs"] = format_jobs(science_positions)
data["security_jobs"] = format_jobs(security_positions)
data["cargo_jobs"] = format_jobs(supply_positions)
data["civilian_jobs"] = format_jobs(civilian_positions)
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
if(computer.card_slot.stored_card)
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
if(is_centcom)
var/list/all_centcom_access = list()
for(var/access in get_all_centcom_access())
all_centcom_access.Add(list(list(
"desc" = replacetext(get_centcom_access_desc(access), "&nbsp", " "),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0)))
data["all_centcom_access"] = all_centcom_access
else
var/list/regions = list()
for(var/i = 1; i <= 7; i++)
if((minor || target_dept) && !(i in region_access))
continue
var/list/accesses = list()
for(var/access in get_region_accesses(i))
if (get_access_desc(access))
accesses.Add(list(list(
"desc" = replacetext(get_access_desc(access), "&nbsp", " "),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0)))
regions.Add(list(list(
"name" = get_region_accesses_name(i),
"accesses" = accesses)))
data["regions"] = regions
data["minor"] = target_dept || minor ? 1 : 0
return data
/datum/computer_file/program/card_mod/proc/build_manage(datum/job,open = 0)
var/out = "Denied"
var/can_change= 0
if(open)
can_change = can_open_job(job)
else
can_change = can_close_job(job)
var/enable = 0
if(can_change == 1)
out = "[open ? "Open Position" : "Close Position"]"
enable = 1
else if(can_change == -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)
out = "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]"
else
out = "Denied"
return list("enable" = enable, "desc" = out)
/datum/computer_file/program/card_mod/proc/authorized()
if(!authenticated)
if(computer && computer.card_slot)
var/obj/item/weapon/card/id/auth_card = computer.card_slot.stored_card2
if(auth_card)
region_access = list()
if(transfer_access in auth_card.GetAccess())
minor = 0
authenticated = 1
return 1
else
if((access_hop in auth_card.access) && ((target_dept==1) || !target_dept))
region_access |= 1
region_access |= 6
get_subordinates("Head of Personnel")
if((access_hos in auth_card.access) && ((target_dept==2) || !target_dept))
region_access |= 2
get_subordinates("Head of Security")
if((access_cmo in auth_card.access) && ((target_dept==3) || !target_dept))
region_access |= 3
get_subordinates("Chief Medical Officer")
if((access_rd in auth_card.access) && ((target_dept==4) || !target_dept))
region_access |= 4
get_subordinates("Research Director")
if((access_ce in auth_card.access) && ((target_dept==5) || !target_dept))
region_access |= 5
get_subordinates("Chief Engineer")
if(region_access)
minor = 1
authenticated = 1
return 1
else
return authenticated
/datum/computer_file/program/card_mod/proc/get_subordinates(rank)
head_subordinates = list()
for(var/datum/job/job in SSjob.occupations)
if(rank in job.department_head)
head_subordinates += job.title
@@ -137,7 +137,7 @@
for(var/A in ntnet_global.available_station_software)
var/datum/computer_file/program/P = A
// Only those programs our user can run will show in the list
if(!P.can_run(user))
if(!P.can_run(user,transfer = 1))
continue
all_entries.Add(list(list(
"filename" = P.filename,
@@ -5,7 +5,7 @@
extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes"
size = 12
requires_ntnet = 1
required_access = access_network
required_access = access_network //Network control is a more secure program.
available_on_ntnet = 1
/datum/computer_file/program/ntnetmonitor/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)
@@ -141,6 +141,10 @@ var/global/nttransfer_uid = 0
if(F.unsendable)
error = "I/O Error: File locked."
return
if(istype(F, /datum/computer_file/program))
var/datum/computer_file/program/P = F
if(!P.can_run(usr,transfer = 1))
error = "Access Error: Insufficient rights to upload file."
provided_file = F
ntnet_global.fileservers.Add(src)
return
@@ -6,7 +6,7 @@
program_icon_state = "power_monitor"
extended_desc = "This program connects to sensors around the station to provide information about electrical systems"
ui_header = "power_norm.gif"
required_access = access_engine
transfer_access = access_engine
usage_flags = PROGRAM_CONSOLE
requires_ntnet = 0
network_destination = "power monitoring system"
@@ -6,7 +6,7 @@
icon_state = "battery_normal"
critical = 1
malfunction_probability = 1
origin_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
origin_tech = list("powerstorage" = 1, "engineering" = 1)
var/battery_rating = 750
var/obj/item/weapon/stock_parts/cell/battery = null
@@ -14,7 +14,7 @@
name = "advanced battery"
desc = "An advanced power cell, often used in most laptops. It is too large to be fitted into smaller devices. It's rating is 1100."
icon_state = "battery_advanced"
origin_tech = list(TECH_POWER = 2, TECH_ENGINEERING = 2)
origin_tech = list("powerstorage" = 2, "engineering" = 2)
hardware_size = 2
battery_rating = 1100
@@ -22,15 +22,15 @@
name = "super battery"
desc = "A very advanced power cell, often used in high-end devices, or as uninterruptable power supply for important consoles or servers. It's rating is 1500."
icon_state = "battery_super"
origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 3)
hardware_size = 1 //temp for testmerge
origin_tech = list("powerstorage" = 3, "engineering" = 3)
hardware_size = 2
battery_rating = 1500
/obj/item/weapon/computer_hardware/battery_module/ultra
name = "ultra battery"
desc = "A very advanced large power cell. It's often used as uninterruptable power supply for critical consoles or servers. It's rating is 2000."
icon_state = "battery_ultra"
origin_tech = list(TECH_POWER = 5, TECH_ENGINEERING = 4)
origin_tech = list("powerstorage" = 5, "engineering" = 4)
hardware_size = 3
battery_rating = 2000
@@ -38,14 +38,14 @@
name = "micro battery"
desc = "A small power cell, commonly seen in most portable microcomputers. It's rating is 500."
icon_state = "battery_micro"
origin_tech = list(TECH_POWER = 2, TECH_ENGINEERING = 2)
origin_tech = list("powerstorage" = 2, "engineering" = 2)
battery_rating = 500
/obj/item/weapon/computer_hardware/battery_module/nano
name = "nano battery"
desc = "A tiny power cell, commonly seen in low-end portable microcomputers. It's rating is 300."
icon_state = "battery_nano"
origin_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
origin_tech = list("powerstorage" = 1, "engineering" = 1)
battery_rating = 300
// This is not intended to be obtainable in-game. Intended for adminbus and debugging purposes.
@@ -5,14 +5,17 @@
critical = 0
icon_state = "cardreader"
hardware_size = 1
origin_tech = list(TECH_DATA = 2)
origin_tech = list("programming" = 2)
var/obj/item/weapon/card/id/stored_card = null
var/obj/item/weapon/card/id/stored_card2 = null
/obj/item/weapon/computer_hardware/card_slot/Destroy()
if(holder2 && (holder2.card_slot == src))
holder2.card_slot = null
if(stored_card)
stored_card.forceMove(get_turf(holder2))
if(stored_card2)
stored_card2.forceMove(get_turf(holder2))
holder2 = null
..()
@@ -4,7 +4,7 @@
power_usage = 25 // SSD or something with low power usage
icon_state = "hdd_normal"
hardware_size = 1
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
origin_tech = list("programming" = 1, "engineering" = 1)
var/max_capacity = 128
var/used_capacity = 0
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
@@ -13,7 +13,7 @@
name = "advanced hard drive"
desc = "A small hybrid hard drive with 256GQ of storage capacity for use in higher grade computers where balance between power efficiency and capacity is desired."
max_capacity = 256
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 2, "engineering" = 2)
power_usage = 50 // Hybrid, medium capacity and medium power storage
icon_state = "hdd_advanced"
hardware_size = 2
@@ -22,7 +22,7 @@
name = "super hard drive"
desc = "A small hard drive with 512GQ of storage capacity for use in cluster storage solutions where capacity is more important than power efficiency."
max_capacity = 512
origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3)
origin_tech = list("programming" = 3, "engineering" = 3)
power_usage = 100 // High-capacity but uses lots of power, shortening battery life. Best used with APC link.
icon_state = "hdd_super"
hardware_size = 2
@@ -31,7 +31,7 @@
name = "cluster hard drive"
desc = "A large storage cluster consisting of multiple hard drives for usage in high capacity storage systems. Has capacity of 2048 GQ."
power_usage = 500
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4)
origin_tech = list("programming" = 4, "engineering" = 4)
max_capacity = 2048
icon_state = "hdd_cluster"
hardware_size = 3
@@ -41,7 +41,7 @@
name = "small hard drive"
desc = "A small highly efficient solid state drive for portable devices."
power_usage = 10
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 2, "engineering" = 2)
max_capacity = 64
icon_state = "hdd_small"
hardware_size = 1
@@ -50,7 +50,7 @@
name = "micro hard drive"
desc = "A small micro hard drive for portable devices."
power_usage = 2
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
origin_tech = list("programming" = 1, "engineering" = 1)
max_capacity = 32
icon_state = "hdd_micro"
hardware_size = 1
@@ -2,7 +2,7 @@
name = "nano printer"
desc = "Small integrated printer with paper recycling module."
power_usage = 50
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 2, "engineering" = 2)
critical = 0
icon_state = "printer"
hardware_size = 1
@@ -4,7 +4,7 @@ var/global/ntnet_card_uid = 1
name = "basic NTNet network card"
desc = "A basic network card for usage with standard NTNet frequencies."
power_usage = 50
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 1)
origin_tech = list("programming" = 2, TECH_ENGINEERING = 1)
critical = 0
icon_state = "netcard_basic"
hardware_size = 1
@@ -34,7 +34,7 @@ var/global/ntnet_card_uid = 1
name = "advanced NTNet network card"
desc = "An advanced network card for usage with standard NTNet frequencies. It's transmitter is strong enough to connect even off-station."
long_range = 1
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 4, "engineering" = 2)
power_usage = 100 // Better range but higher power usage.
icon_state = "netcard_advanced"
hardware_size = 1
@@ -43,7 +43,7 @@ var/global/ntnet_card_uid = 1
name = "wired NTNet network card"
desc = "An advanced network card for usage with standard NTNet frequencies. This one also supports wired connection."
ethernet = 1
origin_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 3)
origin_tech = list("programming" = 5, "engineering" = 3)
power_usage = 100 // Better range but higher power usage.
icon_state = "netcard_ethernet"
hardware_size = 3
@@ -6,7 +6,7 @@
icon_state = "flashdrive_basic"
hardware_size = 1
max_capacity = 16
origin_tech = list(TECH_DATA = 1)
origin_tech = list("programming" = 1)
/obj/item/weapon/computer_hardware/hard_drive/portable/advanced
name = "advanced data crystal"
@@ -15,7 +15,7 @@
icon_state = "flashdrive_advanced"
hardware_size = 1
max_capacity = 64
origin_tech = list(TECH_DATA = 2)
origin_tech = list("programming" = 2)
/obj/item/weapon/computer_hardware/hard_drive/portable/super
name = "super data crystal"
@@ -24,7 +24,7 @@
icon_state = "flashdrive_super"
hardware_size = 1
max_capacity = 256
origin_tech = list(TECH_DATA = 4)
origin_tech = list("programming" = 4)
/obj/item/weapon/computer_hardware/hard_drive/portable/New()
..()
@@ -9,7 +9,7 @@
power_usage = 50
critical = 1
malfunction_probability = 1
origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 3, "engineering" = 2)
var/max_idle_programs = 2 // 2 idle, + 1 active = 3 as said in description.
@@ -20,7 +20,7 @@
hardware_size = 1
power_usage = 25
max_idle_programs = 1
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 2, "engineering" = 2)
/obj/item/weapon/computer_hardware/processor_unit/photonic
name = "photonic processor"
@@ -29,7 +29,7 @@
hardware_size = 2
power_usage = 250
max_idle_programs = 4
origin_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 4)
origin_tech = list("programming" = 5, "engineering" = 4)
/obj/item/weapon/computer_hardware/processor_unit/photonic/small
name = "photonic microprocessor"
@@ -38,4 +38,4 @@
hardware_size = 1
power_usage = 75
max_idle_programs = 2
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 3)
origin_tech = list("programming" = 4, "engineering" = 3)
@@ -5,7 +5,7 @@
enabled = 1
icon_state = "teslalink"
hardware_size = 2 // Can't be installed into tablets
origin_tech = list(TECH_DATA = 2, TECH_POWER = 3, TECH_ENGINEERING = 2)
origin_tech = list("programming" = 2, "powerstorage" = 3, "engineering" = 2)
var/obj/machinery/modular_computer/holder
/obj/item/weapon/computer_hardware/tesla_link/New(var/obj/L)