[MIRROR] Removes tablet hard drives entirely (HDD & SSD) [MDB IGNORE] (#17164)

* Removes tablet hard drives entirely (HDD & SSD)

* map updates

* changes

* contractor uplink theme

* uplink improvements

* tab

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2022-10-26 20:09:16 +02:00
committed by GitHub
parent 9b4fb5848a
commit 097e913e4b
80 changed files with 1080 additions and 1390 deletions
@@ -14,6 +14,25 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
armor = list(MELEE = 0, BULLET = 20, LASER = 20, ENERGY = 100, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0)
light_system = MOVABLE_LIGHT_DIRECTIONAL
///The disk in this PDA. If set, this will be inserted on Initialize.
var/obj/item/computer_disk/inserted_disk
///The amount of storage space the computer starts with.
var/max_capacity = 128
///The amount of storage space we've got filled
var/used_capacity = 0
///List of stored files on this drive. DO NOT MODIFY DIRECTLY!
var/list/datum/computer_file/stored_files = list()
///Non-static list of programs the computer should recieve on Initialize.
var/list/datum/computer_file/starting_programs = list()
///Static list of default programs that come with ALL computers, here so computers don't have to repeat this.
var/static/list/datum/computer_file/default_programs = list(
/datum/computer_file/program/computerconfig,
/datum/computer_file/program/ntnetdownload,
/datum/computer_file/program/filemanager,
)
///Flag of the type of device the modular computer is, deciding what types of apps it can run.
var/hardware_flag = NONE
// Options: PROGRAM_ALL | PROGRAM_CONSOLE | PROGRAM_LAPTOP | PROGRAM_TABLET
@@ -73,7 +92,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
///The program currently active on the tablet.
var/datum/computer_file/program/active_program
///Idle programs on background. They still receive process calls but can't be interacted with.
var/list/idle_threads
var/list/idle_threads = list()
/// Amount of programs that can be ran at once
var/max_idle_programs = 2
@@ -105,32 +124,42 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
physical = src
set_light_color(comp_light_color)
set_light_range(comp_light_luminosity)
idle_threads = list()
if(looping_sound)
soundloop = new(src, enabled)
UpdateDisplay()
if(has_light)
add_item_action(/datum/action/item_action/toggle_computer_light)
if(inserted_disk)
inserted_disk = new inserted_disk(src)
update_appearance()
register_context()
init_network_id(NETWORK_TABLETS)
Add_Messenger()
install_default_programs()
/obj/item/modular_computer/proc/install_default_programs()
SHOULD_CALL_PARENT(FALSE)
for(var/programs in default_programs + starting_programs)
var/datum/computer_file/program/program_type = new programs
store_file(program_type)
/obj/item/modular_computer/Destroy()
STOP_PROCESSING(SSobj, src)
wipe_program(forced = TRUE)
for(var/datum/computer_file/program/idle as anything in idle_threads)
idle.kill_program(TRUE)
idle_threads?.Cut()
STOP_PROCESSING(SSobj, src)
for(var/port in all_components)
var/obj/item/computer_hardware/component = all_components[port]
qdel(component)
all_components?.Cut()
//Some components will actually try and interact with this, so let's do it later
QDEL_NULL(soundloop)
QDEL_LIST(stored_files)
Remove_Messenger()
if(istype(inserted_disk))
QDEL_NULL(inserted_disk)
if(istype(inserted_pai))
QDEL_NULL(inserted_pai)
@@ -317,8 +346,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
return FALSE
obj_flags |= EMAGGED //Mostly for consistancy purposes; the programs will do their own emag handling
var/newemag = FALSE
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
for(var/datum/computer_file/program/app in drive.stored_files)
for(var/datum/computer_file/program/app in stored_files)
if(!istype(app))
continue
if(app.run_emag())
@@ -342,6 +370,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
if(long_ranged)
. += "It is upgraded with an experimental long-ranged network capabilities, picking up NTNet frequencies while further away."
. += span_notice("It has [max_capacity] GQ of storage capacity.")
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
@@ -361,11 +390,11 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
/obj/item/modular_computer/examine_more(mob/user)
. = ..()
var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD]
if(hdd)
for(var/datum/computer_file/app_examine as anything in hdd.stored_files)
if(app_examine.on_examine(src, user))
. += app_examine.on_examine(src, user)
. += "Storage capacity: [used_capacity]/[max_capacity]GQ"
for(var/datum/computer_file/app_examine as anything in stored_files)
if(app_examine.on_examine(src, user))
. += app_examine.on_examine(src, user)
if(Adjacent(user))
. += span_notice("Paper level: [stored_paper] / [max_paper].")
@@ -383,7 +412,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
context[SCREENTIP_CONTEXT_ALT_LMB] = "Remove pAI"
. = CONTEXTUAL_SCREENTIP_SET
if(all_components[MC_SDD])
if(inserted_disk)
context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB] = "Remove SSD"
. = CONTEXTUAL_SCREENTIP_SET
@@ -421,13 +450,11 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
. = ..()
if(.)
return
var/obj/item/computer_hardware/hard_drive/ssd = all_components[MC_SDD]
if(!ssd)
if(!inserted_disk)
return
if(uninstall_component(ssd, usr))
user.put_in_hands(ssd)
playsound(src, 'sound/machines/card_slide.ogg', 50)
user.put_in_hands(inserted_disk)
inserted_disk = null
playsound(src, 'sound/machines/card_slide.ogg', 50)
/obj/item/modular_computer/proc/turn_on(mob/user, open_ui = TRUE)
var/issynth = issilicon(user) // Robots and AIs get different activation messages.
@@ -654,7 +681,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
kill_program(forced = TRUE)
for(var/datum/computer_file/program/P in idle_threads)
P.kill_program(forced = TRUE)
idle_threads.Remove(P)
if(looping_sound)
soundloop.stop()
if(physical && loud)
@@ -726,11 +752,9 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
return
// Check if any Applications need it
var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD]
if(hdd)
for(var/datum/computer_file/item_holding_app as anything in hdd.stored_files)
if(item_holding_app.try_insert(attacking_item, user))
return
for(var/datum/computer_file/item_holding_app as anything in stored_files)
if(item_holding_app.try_insert(attacking_item, user))
return
if(istype(attacking_item, /obj/item/paper))
if(stored_paper >= max_paper)
@@ -766,6 +790,14 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
if(H.try_insert(attacking_item, user))
return
// Insert a data disk
if(istype(attacking_item, /obj/item/computer_disk))
if(!user.transferItemToLoc(attacking_item, src))
return
inserted_disk = attacking_item
playsound(src, 'sound/machines/card_slide.ogg', 50)
return
// Insert new hardware
if(istype(attacking_item, /obj/item/computer_hardware))
if(install_component(attacking_item, user))
@@ -12,9 +12,9 @@
if(prob(component_probability))
H.take_damage(round(damage_amount*0.5), damage_type, damage_flag, 0)
/obj/item/modular_computer/deconstruct(disassembled = TRUE)
break_apart()
return ..()
/obj/item/modular_computer/proc/break_apart()
if(!(flags_1 & NODECONSTRUCT_1))
@@ -30,4 +30,3 @@
if(prob(25))
H.take_damage(rand(10,30), BRUTE, 0, 0)
relay_qdel()
qdel(src)
@@ -0,0 +1,89 @@
/**
* store_file
*
* Adds an already initialized file to the computer, checking if one already exists.
* Returns TRUE if successfully stored, FALSE otherwise.
*/
/obj/item/modular_computer/proc/store_file(datum/computer_file/file_storing)
if(!file_storing || !istype(file_storing))
return FALSE
if(!can_store_file(file_storing))
return FALSE
// This file is already stored. Don't store it again.
if(file_storing in stored_files)
return FALSE
SEND_SIGNAL(file_storing, COMSIG_MODULAR_COMPUTER_FILE_ADDING)
file_storing.computer = src
stored_files.Add(file_storing)
used_capacity += file_storing.size
SEND_SIGNAL(file_storing, COMSIG_MODULAR_COMPUTER_FILE_ADDED)
return TRUE
/**
* remove_file
*
* Removes a given file from the computer, if possible.
* Properly checking if the file even exists and is in the computer.
* Returns TRUE if successfully completed, FALSE otherwise
*/
/obj/item/modular_computer/proc/remove_file(datum/computer_file/file_removing)
if(!file_removing || !istype(file_removing))
return FALSE
if(!(file_removing in stored_files))
return FALSE
if(istype(file_removing, /datum/computer_file/program))
var/datum/computer_file/program/program_file = file_removing
if(program_file.program_state != PROGRAM_STATE_KILLED)
program_file.kill_program(TRUE)
if(program_file.program_state == PROGRAM_STATE_ACTIVE)
active_program = null
SEND_SIGNAL(file_removing, COMSIG_MODULAR_COMPUTER_FILE_DELETING)
stored_files.Remove(file_removing)
used_capacity -= file_removing.size
SEND_SIGNAL(file_removing, COMSIG_MODULAR_COMPUTER_FILE_DELETED)
return TRUE
/**
* can_store_file
*
* Checks if a computer can store a file, as computers can only store unique files.
* returns TRUE if possible, FALSE otherwise.
*/
/obj/item/modular_computer/proc/can_store_file(datum/computer_file/file)
if(!file || !istype(file))
return FALSE
if(file in stored_files)
return FALSE
if(find_file_by_name(file.filename))
return FALSE
// In the unlikely event someone manages to create that many files.
// BYOND is acting weird with numbers above 999 in loops (infinite loop prevention)
if(stored_files.len >= 999)
return FALSE
if((used_capacity + file.size) > max_capacity)
return FALSE
return TRUE
/**
* find_file_by_name
*
* Will check all applications in a tablet for files and, if they have \
* the same filename (disregarding extension), will return it.
* If a computer disk is passed instead, it will check the disk over the computer.
*/
/obj/item/modular_computer/proc/find_file_by_name(filename, obj/item/computer_disk/target_disk)
if(!filename)
return null
if(target_disk)
for(var/datum/computer_file/file as anything in target_disk.stored_files)
if(file.filename == filename)
return file
else
for(var/datum/computer_file/file as anything in stored_files)
if(file.filename == filename)
return file
return null
@@ -34,9 +34,8 @@
if(enabled) // Shut down the computer
if(active_program)
active_program.event_powerfailure(0)
for(var/I in idle_threads)
var/datum/computer_file/program/PRG = I
PRG.event_powerfailure(1)
for(var/datum/computer_file/program/programs as anything in idle_threads)
programs.event_powerfailure(background = TRUE)
shutdown_computer(0)
// Handles power-related things, such as battery interaction, recharging, shutdown when it's discharged
@@ -33,13 +33,6 @@
active_program.ui_interact(user)
return
// We are still here, that means there is no program loaded. Load the BIOS/ROM/OS/whatever you want to call it.
// This screen simply lists available programs and user may select them.
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
if(!hard_drive || !hard_drive.stored_files || !hard_drive.stored_files.len)
to_chat(user, span_danger("\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning."))
return // No HDD, No HDD files list or no stored files. Something is very broken.
if(honkvirus_amount > 0) // EXTRA annoying, huh!
honkvirus_amount--
playsound(src, 'sound/items/bikehorn.ogg', 30, TRUE)
@@ -55,7 +48,7 @@
. = ..()
var/list/data = list()
data["show_imprint"] = istype(src, /obj/item/modular_computer/tablet/)
data["show_imprint"] = istype(src, /obj/item/modular_computer/tablet)
return data
@@ -83,12 +76,10 @@
IDJob = cardholder.current_job,
)
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
data["removable_media"] = list()
if(all_components[MC_SDD])
if(inserted_disk)
data["removable_media"] += "Eject Disk"
var/datum/computer_file/program/ai_restorer/airestore_app = locate() in hard_drive.stored_files
var/datum/computer_file/program/ai_restorer/airestore_app = locate() in stored_files
if(airestore_app?.stored_card)
data["removable_media"] += "intelliCard"
var/obj/item/computer_hardware/card_slot/secondarycardholder = all_components[MC_CARD2]
@@ -96,7 +87,7 @@
data["removable_media"] += "secondary RFID card"
data["programs"] = list()
for(var/datum/computer_file/program/P in hard_drive.stored_files)
for(var/datum/computer_file/program/P in stored_files)
var/running = FALSE
if(P in idle_threads)
running = TRUE
@@ -122,7 +113,6 @@
if(.)
return
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
switch(action)
if("PC_exit")
kill_program()
@@ -147,8 +137,7 @@
var/prog = params["name"]
var/datum/computer_file/program/P = null
var/mob/user = usr
if(hard_drive)
P = hard_drive.find_file_by_name(prog)
P = find_file_by_name(prog)
if(!istype(P) || P.program_state == PROGRAM_STATE_KILLED)
return
@@ -157,7 +146,7 @@
to_chat(user, span_notice("Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed."))
if("PC_runprogram")
open_program(usr, hard_drive.find_file_by_name(params["name"]))
open_program(usr, find_file_by_name(params["name"]))
if("PC_toggle_light")
return toggle_flashlight()
@@ -179,14 +168,13 @@
var/mob/user = usr
switch(param)
if("Eject Disk")
var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD]
if(!portable_drive)
if(!inserted_disk)
return
if(uninstall_component(portable_drive, usr))
user.put_in_hands(portable_drive)
playsound(src, 'sound/machines/card_slide.ogg', 50)
user.put_in_hands(inserted_disk)
inserted_disk = null
playsound(src, 'sound/machines/card_slide.ogg', 50)
if("intelliCard")
var/datum/computer_file/program/ai_restorer/airestore_app = locate() in hard_drive.stored_files
var/datum/computer_file/program/ai_restorer/airestore_app = locate() in stored_files
if(!airestore_app)
return
if(airestore_app.try_eject(user))
@@ -0,0 +1,56 @@
/obj/item/computer_disk
name = "data disk"
desc = "Removable disk used to store data."
icon = 'icons/obj/module.dmi'
icon_state = "datadisk6"
w_class = WEIGHT_CLASS_TINY
///The amount of storage space is on the disk
var/max_capacity = 16
///The amount of storage space we've got filled
var/used_capacity = 0
///List of stored files on this drive. DO NOT MODIFY DIRECTLY!
var/list/datum/computer_file/stored_files = list()
///List of all programs that the disk should start with.
var/list/datum/computer_file/starting_programs = list()
/obj/item/computer_disk/Initialize(mapload)
. = ..()
for(var/programs in starting_programs)
var/datum/computer_file/program/program_type = new programs
add_file(program_type)
/**
* add_file
*
* Attempts to add an already existing file to the computer disk, then adds that capacity to the used capicity.
*/
/obj/item/computer_disk/proc/add_file(datum/computer_file/file)
if((file.size + used_capacity) > max_capacity)
return FALSE
stored_files.Add(file)
used_capacity += file.size
return TRUE
/**
* remove_file
*
* Removes an app from the stored_files list, then removes their size from the capacity.
*/
/obj/item/computer_disk/proc/remove_file(datum/computer_file/file)
if(!(file in stored_files))
return FALSE
stored_files.Remove(file)
used_capacity -= file.size
return TRUE
/obj/item/computer_disk/advanced
name = "advanced data disk"
icon_state = "datadisk5"
max_capacity = 64
/obj/item/computer_disk/super
name = "super data disk"
desc = "Removable disk used to store large amounts of data."
icon_state = "datadisk3"
max_capacity = 256
@@ -0,0 +1,145 @@
/**
* Command
*/
/obj/item/computer_disk/command
icon_state = "datadisk7"
max_capacity = 32
///Static list of programss ALL command tablets have.
var/static/list/datum/computer_file/command_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/science,
/datum/computer_file/program/status,
)
/obj/item/computer_disk/command/Initialize(mapload)
. = ..()
for(var/programs in command_programs)
var/datum/computer_file/program/program_type = new programs
add_file(program_type)
/obj/item/computer_disk/command/captain
name = "captain data disk"
desc = "Removable disk used to download essential Captain tablet apps."
icon_state = "datadisk10"
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/records/medical,
/datum/computer_file/program/phys_scanner/all,
)
/obj/item/computer_disk/command/cmo
name = "chief medical officer data disk"
desc = "Removable disk used to download essential CMO tablet apps."
starting_programs = list(
/datum/computer_file/program/phys_scanner/all,
/datum/computer_file/program/records/medical,
)
/obj/item/computer_disk/command/rd
name = "research director data disk"
desc = "Removable disk used to download essential RD tablet apps."
starting_programs = list(
/datum/computer_file/program/phys_scanner/chemistry,
/datum/computer_file/program/signal_commander,
)
/obj/item/computer_disk/command/hos
name = "head of security data disk"
desc = "Removable disk used to download essential HoS tablet apps."
icon_state = "datadisk9"
starting_programs = list(
/datum/computer_file/program/records/security,
)
/obj/item/computer_disk/command/hop
name = "head of personnel data disk"
desc = "Removable disk used to download essential HoP tablet apps."
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/job_management,
)
/obj/item/computer_disk/command/ce
name = "chief engineer data disk"
desc = "Removable disk used to download essential CE tablet apps."
starting_programs = list(
/datum/computer_file/program/supermatter_monitor,
/datum/computer_file/program/atmosscan,
/datum/computer_file/program/alarm_monitor,
)
/**
* Security
*/
/obj/item/computer_disk/security
name = "security officer data disk"
desc = "Removable disk used to download security-related tablet apps."
icon_state = "datadisk9"
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/crew_manifest,
)
/**
* Medical
*/
/obj/item/computer_disk/medical
name = "medical doctor data disk"
desc = "Removable disk used to download medical-related tablet apps."
icon_state = "datadisk7"
starting_programs = list(
/datum/computer_file/program/phys_scanner/medical,
/datum/computer_file/program/records/medical,
)
/obj/item/computer_disk/chemistry
name = "chemistry data disk"
desc = "Removable disk used to download chemistry-related tablet apps."
icon_state = "datadisk5"
starting_programs = list(
/datum/computer_file/program/phys_scanner/chemistry,
)
/**
* Supply
*/
/obj/item/computer_disk/quartermaster
name = "cargo data disk"
desc = "Removable disk used to download cargo-related tablet apps."
icon_state = "cargodisk"
starting_programs = list(
/datum/computer_file/program/shipping,
/datum/computer_file/program/budgetorders,
)
/**
* Science
*/
/obj/item/computer_disk/ordnance
name = "ordnance data disk"
desc = "Removable disk used to download ordnance-related tablet apps."
icon_state = "datadisk5"
starting_programs = list(
/datum/computer_file/program/signal_commander,
/datum/computer_file/program/scipaper_program,
)
/**
* Engineering
*/
/obj/item/computer_disk/engineering
name = "station engineer data disk"
desc = "Removable disk used to download engineering-related tablet apps."
icon_state = "datadisk6"
starting_programs = list(
/datum/computer_file/program/supermatter_monitor,
)
/obj/item/computer_disk/atmos
name = "atmospheric technician data disk"
desc = "Removable disk used to download atmos-related tablet apps."
icon_state = "datadisk6"
starting_programs = list(
/datum/computer_file/program/atmosscan,
/datum/computer_file/program/alarm_monitor,
)
@@ -0,0 +1,157 @@
/**
* Virus disk
* Can't hold apps, instead does unique actions.
*/
/obj/item/computer_disk/virus
name = "\improper generic virus disk"
icon_state = "virusdisk"
max_capacity = 0
///How many charges the virus has left
var/charges = 5
/obj/item/computer_disk/virus/proc/send_virus(obj/item/modular_computer/tablet/source, obj/item/modular_computer/tablet/target, mob/living/user)
if(charges <= 0)
to_chat(user, span_notice("ERROR: Out of charges."))
return FALSE
if(!target)
to_chat(user, span_notice("ERROR: Could not find device."))
return FALSE
return TRUE
/**
* Clown virus
* Makes people's PDA honk
* Can also be used on open panel airlocks to make them honk on opening.
*/
/obj/item/computer_disk/virus/clown
name = "\improper H.O.N.K. disk"
/obj/item/computer_disk/virus/clown/send_virus(obj/item/modular_computer/tablet/source, obj/item/modular_computer/tablet/target, mob/living/user)
. = ..()
if(!.)
return FALSE
user.show_message(span_notice("Success!"))
charges--
target.honkvirus_amount = rand(15, 25)
return TRUE
/**
* Mime virus
* Makes PDA's silent, removing their ringtone.
*/
/obj/item/computer_disk/virus/mime
name = "\improper sound of silence disk"
/obj/item/computer_disk/virus/mime/send_virus(obj/item/modular_computer/tablet/source, obj/item/modular_computer/tablet/target, mob/living/user)
. = ..()
if(!.)
return FALSE
var/datum/computer_file/program/messenger/app = locate() in target.stored_files
if(!app)
return FALSE
user.show_message(span_notice("Success!"))
charges--
app.ringer_status = FALSE
app.ringtone = ""
/**
* Detomatix virus
* Sends a false message, and blows the PDA up if the target responds to it (or opens their messenger before a timer)
*/
/obj/item/computer_disk/virus/detomatix
name = "\improper D.E.T.O.M.A.T.attacking_item.X. disk"
charges = 6
/obj/item/computer_disk/virus/detomatix/send_virus(obj/item/modular_computer/tablet/source, obj/item/modular_computer/tablet/target, mob/living/user)
. = ..()
if(!.)
return FALSE
var/difficulty = target.get_detomatix_difficulty()
if(SEND_SIGNAL(target, COMSIG_TABLET_CHECK_DETONATE) & COMPONENT_TABLET_NO_DETONATE || prob(difficulty * 15))
user.show_message(span_danger("ERROR: Target could not be bombed."), MSG_VISUAL)
charges--
return
var/original_host = source
var/fakename = sanitize_name(tgui_input_text(user, "Enter a name for the rigged message.", "Forge Message", max_length = MAX_NAME_LEN), allow_numbers = TRUE)
if(!fakename || source != original_host || !user.canUseTopic(source, be_close = TRUE))
return
var/fakejob = sanitize_name(tgui_input_text(user, "Enter a job for the rigged message.", "Forge Message", max_length = MAX_NAME_LEN), allow_numbers = TRUE)
if(!fakejob || source != original_host || !user.canUseTopic(source, be_close = TRUE))
return
var/datum/computer_file/program/messenger/app = locate() in source.stored_files
if(!app || charges <= 0 || !app.send_message(user, list(target), rigged = REF(user), fake_name = fakename, fake_job = fakejob))
return FALSE
charges--
user.show_message(span_notice("Success!"))
var/reference = REF(src)
ADD_TRAIT(target, TRAIT_PDA_CAN_EXPLODE, reference)
ADD_TRAIT(target, TRAIT_PDA_MESSAGE_MENU_RIGGED, reference)
addtimer(TRAIT_CALLBACK_REMOVE(target, TRAIT_PDA_MESSAGE_MENU_RIGGED, reference), 10 SECONDS)
return TRUE
/**
* Frame cartridge
* Creates and opens a false uplink on someone's PDA
* Can be loaded with TC to show up on the false uplink.
*/
/obj/item/computer_disk/virus/frame
name = "\improper F.R.A.M.E. disk"
///How many telecrystals the uplink should have
var/telecrystals = 0
///How much progression should be shown in the uplink, set on purchase of the item.
var/current_progression = 0
/obj/item/computer_disk/virus/frame/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
if(!istype(attacking_item, /obj/item/stack/telecrystal))
return
if(!charges)
to_chat(user, span_notice("[src] is out of charges, it's refusing to accept [attacking_item]."))
return
var/obj/item/stack/telecrystal/telecrystal_stack = attacking_item
telecrystals += telecrystal_stack.amount
to_chat(user, span_notice("You slot [telecrystal_stack] into [src]. The next time it's used, it will also give telecrystals."))
telecrystal_stack.use(telecrystal_stack.amount)
/obj/item/computer_disk/virus/frame/send_virus(obj/item/modular_computer/tablet/target, mob/living/user)
. = ..()
if(!.)
return FALSE
charges--
var/lock_code = "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]"
to_chat(user, span_notice("Success! The unlock code to the target is: [lock_code]"))
var/datum/component/uplink/hidden_uplink = target.GetComponent(/datum/component/uplink)
if(!hidden_uplink)
var/datum/mind/target_mind
var/list/backup_players = list()
for(var/datum/mind/player as anything in get_crewmember_minds())
if(player.assigned_role?.title == target.saved_job)
backup_players += player
if(player.name == target.saved_identification)
target_mind = player
break
if(!target_mind)
if(!length(backup_players))
target_mind = user.mind
else
target_mind = pick(backup_players)
hidden_uplink = target.AddComponent(/datum/component/uplink, target_mind, enabled = TRUE, starting_tc = telecrystals, has_progression = TRUE)
hidden_uplink.uplink_handler.has_objectives = TRUE
hidden_uplink.uplink_handler.owner = target_mind
hidden_uplink.uplink_handler.can_take_objectives = FALSE
hidden_uplink.uplink_handler.progression_points = min(SStraitor.current_global_progression, current_progression)
hidden_uplink.uplink_handler.generate_objectives()
SStraitor.register_uplink_handler(hidden_uplink.uplink_handler)
else
hidden_uplink.add_telecrystals(telecrystals)
telecrystals = 0
hidden_uplink.locked = FALSE
hidden_uplink.active = TRUE
@@ -1,16 +1,9 @@
/obj/item/modular_computer/laptop/preset/Initialize(mapload)
. = ..()
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
install_component(new /obj/item/computer_hardware/hard_drive)
install_programs()
/obj/item/modular_computer/laptop/preset/proc/install_programs()
return
/obj/item/modular_computer/laptop/preset/civilian
desc = "A low-end laptop often used for personal recreation."
/obj/item/modular_computer/laptop/preset/civilian/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/chatclient())
starting_programs = list(
/datum/computer_file/program/chatclient,
)
@@ -5,7 +5,7 @@
/obj/item/modular_computer/tablet/pda/heads
greyscale_config = /datum/greyscale_config/tablet/head
greyscale_colors = "#67A364#a92323"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -26,17 +26,14 @@
/obj/item/modular_computer/tablet/pda/heads/captain/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_TABLET_CHECK_DETONATE, .proc/tab_no_detonate)
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
if(!drive)
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
for(var/datum/computer_file/program/messenger/messenger_app in stored_files)
messenger_app.spam_mode = TRUE
/obj/item/modular_computer/tablet/pda/heads/hop
name = "head of personnel PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick/head
greyscale_colors = "#374f7e#a52f29#a52f29"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -50,7 +47,7 @@
name = "head of security PDA"
greyscale_config = /datum/greyscale_config/tablet/head
greyscale_colors = "#EA3232#0000CC"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -63,7 +60,7 @@
name = "chief engineer PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick/head
greyscale_colors = "#D99A2E#69DBF3#FAFAFA"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -78,7 +75,7 @@
name = "chief medical officer PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick/head
greyscale_colors = "#FAFAFA#000099#3F96CC"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -93,7 +90,7 @@
greyscale_config = /datum/greyscale_config/tablet/stripe_thick/head
greyscale_colors = "#FAFAFA#000099#B347BC"
inserted_item = /obj/item/pen/fountain
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -102,13 +99,14 @@
/datum/computer_file/program/phys_scanner/chemistry,
/datum/computer_file/program/signal_commander,
)
/obj/item/modular_computer/tablet/pda/heads/quartermaster
name = "quartermaster PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#D6B328#6506CA#927444"
inserted_item = /obj/item/pen/survival
stored_paper = 20
default_applications = list(
starting_programs = list(
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/status,
/datum/computer_file/program/science,
@@ -125,7 +123,7 @@
/obj/item/modular_computer/tablet/pda/security
name = "security PDA"
greyscale_colors = "#EA3232#0000cc"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/robocontrol,
@@ -134,7 +132,7 @@
/obj/item/modular_computer/tablet/pda/detective
name = "detective PDA"
greyscale_colors = "#805A2F#990202"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/robocontrol,
@@ -145,7 +143,7 @@
name = "warden PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_split
greyscale_colors = "#EA3232#0000CC#363636"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/crew_manifest,
/datum/computer_file/program/robocontrol,
@@ -159,17 +157,19 @@
name = "engineering PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#D99A2E#69DBF3#E3DF3D"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/supermatter_monitor,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/atmos
name = "atmospherics PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#EEDC43#00E5DA#727272"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/atmosscan,
/datum/computer_file/program/alarm_monitor,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/**
@@ -180,26 +180,29 @@
name = "scientist PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#FAFAFA#000099#B347BC"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/atmosscan,
/datum/computer_file/program/signal_commander,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/roboticist
name = "roboticist PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_split
greyscale_colors = "#484848#0099CC#D94927"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/robocontrol,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/geneticist
name = "geneticist PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_split
greyscale_colors = "#FAFAFA#000099#0097CA"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/phys_scanner/medical,
/datum/computer_file/program/records/medical,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/**
@@ -210,36 +213,40 @@
name = "medical PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#FAFAFA#000099#3F96CC"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/phys_scanner/medical,
/datum/computer_file/program/records/medical,
/datum/computer_file/program/robocontrol,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/medical/paramedic
name = "paramedic PDA"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/phys_scanner/medical,
/datum/computer_file/program/records/medical,
/datum/computer_file/program/radar/lifeline,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/viro
name = "virology PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_split
greyscale_colors = "#FAFAFA#355FAC#57C451"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/phys_scanner/medical,
/datum/computer_file/program/records/medical,
/datum/computer_file/program/robocontrol,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/chemist
name = "chemist PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick
greyscale_colors = "#FAFAFA#355FAC#EA6400"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/phys_scanner/chemistry,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/**
@@ -250,10 +257,11 @@
name = "cargo technician PDA"
greyscale_colors = "#D6B328#6506CA"
stored_paper = 20
default_applications = list(
starting_programs = list(
/datum/computer_file/program/shipping,
/datum/computer_file/program/budgetorders,
/datum/computer_file/program/robocontrol,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/shaftminer
@@ -268,8 +276,9 @@
/obj/item/modular_computer/tablet/pda/janitor
name = "janitor PDA"
greyscale_colors = "#933ea8#235AB2"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/radar/custodial_locator,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/chaplain
@@ -281,16 +290,14 @@
name = "lawyer PDA"
greyscale_colors = "#4C76C8#FFE243"
inserted_item = /obj/item/pen/fountain
default_applications = list(
starting_programs = list(
/datum/computer_file/program/records/security,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/lawyer/Initialize(mapload)
. = ..()
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
if(!drive)
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
for(var/datum/computer_file/program/messenger/messenger_app in stored_files)
messenger_app.spam_mode = TRUE
/obj/item/modular_computer/tablet/pda/botanist
@@ -308,7 +315,7 @@
/obj/item/modular_computer/tablet/pda/clown
name = "clown PDA"
loaded_cartridge = /obj/item/computer_hardware/hard_drive/portable/virus/clown
inserted_disk = /obj/item/computer_disk/virus/clown
icon_state = "pda-clown"
greyscale_config = null
greyscale_colors = null
@@ -325,7 +332,7 @@
/obj/item/modular_computer/tablet/pda/clown/proc/AfterSlip(mob/living/carbon/human/M)
if (istype(M) && (M.real_name != saved_identification))
var/obj/item/computer_hardware/hard_drive/portable/virus/clown/cart = all_components[MC_SDD]
var/obj/item/computer_disk/virus/clown/cart = inserted_disk
if(istype(cart) && cart.charges < 5)
cart.charges++
playsound(src,'sound/machines/ping.ogg',30,TRUE)
@@ -335,20 +342,17 @@
/obj/item/modular_computer/tablet/pda/mime
name = "mime PDA"
loaded_cartridge = /obj/item/computer_hardware/hard_drive/portable/virus/mime
inserted_disk = /obj/item/computer_disk/virus/mime
greyscale_config = /datum/greyscale_config/tablet/mime
greyscale_colors = "#FAFAFA#EA3232"
inserted_item = /obj/item/toy/crayon/mime
/obj/item/modular_computer/tablet/pda/mime/Initialize(mapload)
. = ..()
var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD]
if(hdd)
for(var/datum/computer_file/program/messenger/msg in hdd.stored_files)
msg.mime_mode = TRUE
msg.allow_emojis = TRUE
msg.ringer_status = FALSE
for(var/datum/computer_file/program/messenger/msg in stored_files)
msg.mime_mode = TRUE
msg.allow_emojis = TRUE
msg.ringer_status = FALSE
/obj/item/modular_computer/tablet/pda/curator
name = "curator PDA"
@@ -358,18 +362,16 @@
icon_state = "pda-library"
inserted_item = /obj/item/pen/fountain
long_ranged = TRUE
default_applications = list(
starting_programs = list(
/datum/computer_file/program/newscaster,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/obj/item/modular_computer/tablet/pda/curator/Initialize(mapload)
. = ..()
var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD]
if(hdd)
for(var/datum/computer_file/program/messenger/msg in hdd.stored_files)
msg.allow_emojis = TRUE
msg.ringer_status = FALSE
for(var/datum/computer_file/program/messenger/msg in stored_files)
msg.allow_emojis = TRUE
msg.ringer_status = FALSE
/**
* No Department
@@ -377,8 +379,9 @@
/obj/item/modular_computer/tablet/pda/assistant
name = "assistant PDA"
default_applications = list(
starting_programs = list(
/datum/computer_file/program/bounty_board,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for all crew
)
/**
@@ -394,11 +397,9 @@
/obj/item/modular_computer/tablet/pda/syndicate/Initialize(mapload)
. = ..()
var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD]
if(hdd)
for(var/datum/computer_file/program/messenger/msg in hdd.stored_files)
msg.invisible = TRUE
var/datum/computer_file/program/messenger/msg = locate() in stored_files
if(msg)
msg.invisible = TRUE
/obj/item/modular_computer/tablet/pda/clear
name = "clear PDA"
@@ -37,6 +37,16 @@
/obj/item/clothing/mask/cigarette,
)
/obj/item/modular_computer/tablet/Initialize(mapload)
. = ..()
if(inserted_item)
inserted_item = new inserted_item(src)
/obj/item/modular_computer/tablet/Destroy()
if(istype(inserted_item))
QDEL_NULL(inserted_item)
return ..()
/obj/item/modular_computer/tablet/update_icon_state()
if(has_variants && !bypass_state)
if(!finish_color)
@@ -108,10 +118,8 @@
/obj/item/modular_computer/tablet/proc/get_detomatix_difficulty()
var/detomatix_difficulty
var/obj/item/computer_hardware/hard_drive/hdd = all_components[MC_HDD]
if(hdd)
for(var/datum/computer_file/program/downloaded_apps as anything in hdd.stored_files)
detomatix_difficulty += downloaded_apps.detomatix_resistance
for(var/datum/computer_file/program/downloaded_apps as anything in stored_files)
detomatix_difficulty += downloaded_apps.detomatix_resistance
return detomatix_difficulty
@@ -153,7 +161,7 @@
if(T)
T.hotspot_expose(700,125)
if(istype(all_components[MC_SDD], /obj/item/computer_hardware/hard_drive/portable/virus/deto))
if(istype(inserted_disk, /obj/item/computer_disk/virus/detomatix))
explosion(src, devastation_range = -1, heavy_impact_range = 1, light_impact_range = 3, flash_range = 4)
else
explosion(src, devastation_range = -1, heavy_impact_range = -1, light_impact_range = 2, flash_range = 3)
@@ -176,12 +184,7 @@
if(!new_ringtone || new_ringtone == MESSENGER_RINGTONE_DEFAULT)
return
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
if(!drive)
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
for(var/datum/computer_file/program/messenger/messenger_app in stored_files)
messenger_app.ringtone = new_ringtone
@@ -226,12 +229,26 @@
has_light = FALSE //tablet light button actually enables/disables the borg lamp
comp_light_luminosity = 0
has_variants = FALSE
///Ref to the silicon we're installed in. Set by the silicon itself during its creation.
var/mob/living/silicon/silicon_owner
inserted_item = null
starting_programs = list(
/datum/computer_file/program/messenger,
)
///Ref to the RoboTact app. Important enough to borgs to deserve a ref.
var/datum/computer_file/program/robotact/robotact
///IC log that borgs can view in their personal management app
var/list/borglog = list()
///Ref to the silicon we're installed in. Set by the silicon itself during its creation.
var/mob/living/silicon/silicon_owner
/obj/item/modular_computer/tablet/integrated/cyborg
starting_programs = list(
/datum/computer_file/program/computerconfig,
/datum/computer_file/program/filemanager,
/datum/computer_file/program/robotact,
/datum/computer_file/program/crew_manifest, // SKYRAT EDIT ADDITION - Manifests for borgs
/datum/computer_file/program/messenger, // SKYRAT EDIT ADDITION - Messenger for borgs
)
/obj/item/modular_computer/tablet/integrated/Initialize(mapload)
. = ..()
@@ -239,9 +256,14 @@
silicon_owner = loc
if(!istype(silicon_owner))
silicon_owner = null
stack_trace("[type] initialized outside of a borg, deleting.")
stack_trace("[type] initialized outside of a silicon, deleting.")
return INITIALIZE_HINT_QDEL
/obj/item/modular_computer/tablet/integrated/install_default_programs()
for(var/programs in starting_programs)
var/datum/computer_file/program/program_type = new programs
store_file(program_type)
/obj/item/modular_computer/tablet/integrated/Destroy()
silicon_owner = null
return ..()
@@ -279,22 +301,21 @@
* RoboTact is supposed to be undeletable, so these will create runtime messages.
*/
/obj/item/modular_computer/tablet/integrated/proc/get_robotact()
if(!silicon_owner)
return null
if(!robotact)
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
robotact = hard_drive.find_file_by_name("robotact")
if(!robotact)
stack_trace("Cyborg [silicon_owner] ( [silicon_owner.type] ) was somehow missing their self-manage app in their tablet. A new copy has been created.")
robotact = new(hard_drive)
if(!hard_drive.store_file(robotact))
qdel(robotact)
robotact = null
CRASH("Cyborg [silicon_owner]'s tablet hard drive rejected recieving a new copy of the self-manage app. To fix, check the hard drive's space remaining. Please make a bug report about this.")
return robotact
if(robotact)
return robotact
robotact = find_file_by_name("robotact")
if(robotact)
return robotact
stack_trace("Cyborg [silicon_owner] ( [silicon_owner.type] ) was somehow missing their self-manage app in their tablet. A new copy has been created.")
robotact = new(src)
if(store_file(robotact))
return robotact
qdel(robotact)
robotact = null
CRASH("Cyborg [silicon_owner]'s tablet hard drive rejected recieving a new copy of the self-manage app. To fix, check the hard drive's space remaining. Please make a bug report about this.")
//Makes the light settings reflect the borg's headlamp settings
/obj/item/modular_computer/tablet/integrated/ui_data(mob/user)
/obj/item/modular_computer/tablet/integrated/cyborg/ui_data(mob/user)
. = ..()
.["has_light"] = TRUE
if(iscyborg(silicon_owner))
@@ -346,25 +367,29 @@
greyscale_config = /datum/greyscale_config/tablet
greyscale_colors = "#999875#a92323"
max_capacity = 64
bypass_state = TRUE
allow_chunky = TRUE
///All applications this tablet has pre-installed
var/list/default_applications = list()
///The pre-installed cartridge that comes with the tablet
var/loaded_cartridge
///Static list of default PDA apps to install on Initialize.
var/static/list/datum/computer_file/pda_programs = list(
/datum/computer_file/program/messenger,
/datum/computer_file/program/nt_pay,
/datum/computer_file/program/notepad,
)
/obj/item/modular_computer/tablet/pda/install_default_programs()
for(var/programs as anything in (default_programs + pda_programs + starting_programs))
var/datum/computer_file/program/program_type = new programs
store_file(program_type)
/obj/item/modular_computer/tablet/pda/update_overlays()
. = ..()
var/init_icon = initial(icon)
var/obj/item/computer_hardware/card_slot/card = all_components[MC_CARD]
if(!init_icon)
return
if(card)
if(card.stored_card)
. += mutable_appearance(init_icon, "id_overlay")
if(card?.stored_card)
. += mutable_appearance(initial(icon), "id_overlay")
if(light_on)
. += mutable_appearance(init_icon, "light_overlay")
. += mutable_appearance(initial(icon), "light_overlay")
/obj/item/modular_computer/tablet/pda/attack_ai(mob/user)
to_chat(user, span_notice("It doesn't feel right to snoop around like that..."))
@@ -372,18 +397,5 @@
/obj/item/modular_computer/tablet/pda/Initialize(mapload)
. = ..()
install_component(new /obj/item/computer_hardware/hard_drive/small)
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
install_component(new /obj/item/computer_hardware/card_slot)
if(!isnull(default_applications))
var/obj/item/computer_hardware/hard_drive/small/hard_drive = find_hardware_by_name("solid state drive")
for(var/datum/computer_file/program/default_programs as anything in default_applications)
hard_drive.store_file(new default_programs)
if(loaded_cartridge)
var/obj/item/computer_hardware/hard_drive/portable/disk = new loaded_cartridge(src)
install_component(disk)
if(inserted_item)
inserted_item = new inserted_item(src)
@@ -1,5 +1,10 @@
/// Given to Nuke Ops members.
/obj/item/modular_computer/tablet/nukeops
starting_programs = list(
/datum/computer_file/program/ntnetdownload/syndicate,
/datum/computer_file/program/radar/fission360,
)
/obj/item/modular_computer/tablet/nukeops/Initialize(mapload)
. = ..()
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
install_component(new /obj/item/computer_hardware/hard_drive/small/nukeops)
@@ -2,6 +2,8 @@
// Can be changed to give devices specific hardware
var/_has_second_id_slot = FALSE
var/_has_battery = FALSE
///List of programs the computer starts with, given on Initialize.
var/list/datum/computer_file/starting_programs = list()
/obj/machinery/modular_computer/console/preset/Initialize(mapload)
. = ..()
@@ -13,23 +15,20 @@
cpu.install_component(new /obj/item/computer_hardware/card_slot/secondary)
if(_has_battery)
cpu.install_component(new /obj/item/computer_hardware/battery(cpu, /obj/item/stock_parts/cell/computer/super))
install_programs()
// Override in child types to install preset-specific programs.
/obj/machinery/modular_computer/console/preset/proc/install_programs()
return
for(var/programs in starting_programs)
var/datum/computer_file/program/program_type = new programs
cpu.store_file(program_type)
// ===== ENGINEERING CONSOLE =====
/obj/machinery/modular_computer/console/preset/engineering
console_department = "Engineering"
name = "engineering console"
desc = "A stationary computer. This one comes preloaded with engineering programs."
/obj/machinery/modular_computer/console/preset/engineering/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/power_monitor())
hard_drive.store_file(new/datum/computer_file/program/alarm_monitor())
hard_drive.store_file(new/datum/computer_file/program/supermatter_monitor())
starting_programs = list(
/datum/computer_file/program/power_monitor,
/datum/computer_file/program/alarm_monitor,
/datum/computer_file/program/supermatter_monitor,
)
// ===== RESEARCH CONSOLE =====
/obj/machinery/modular_computer/console/preset/research
@@ -37,14 +36,13 @@
name = "research director's console"
desc = "A stationary computer. This one comes preloaded with research programs."
_has_second_id_slot = TRUE
/obj/machinery/modular_computer/console/preset/research/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/ntnetmonitor())
hard_drive.store_file(new/datum/computer_file/program/chatclient())
hard_drive.store_file(new/datum/computer_file/program/ai_restorer())
hard_drive.store_file(new/datum/computer_file/program/robocontrol())
hard_drive.store_file(new/datum/computer_file/program/scipaper_program())
starting_programs = list(
/datum/computer_file/program/ntnetmonitor,
/datum/computer_file/program/chatclient,
/datum/computer_file/program/ai_restorer,
/datum/computer_file/program/robocontrol,
/datum/computer_file/program/scipaper_program,
)
// ===== COMMAND CONSOLE =====
/obj/machinery/modular_computer/console/preset/command
@@ -52,12 +50,10 @@
name = "command console"
desc = "A stationary computer. This one comes preloaded with command programs."
_has_second_id_slot = TRUE
/obj/machinery/modular_computer/console/preset/command/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/chatclient())
hard_drive.store_file(new/datum/computer_file/program/card_mod())
starting_programs = list(
/datum/computer_file/program/chatclient,
/datum/computer_file/program/card_mod,
)
// ===== IDENTIFICATION CONSOLE =====
/obj/machinery/modular_computer/console/preset/id
@@ -65,59 +61,51 @@
name = "identification console"
desc = "A stationary computer. This one comes preloaded with identification modification programs."
_has_second_id_slot = TRUE
/obj/machinery/modular_computer/console/preset/id/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/chatclient())
hard_drive.store_file(new/datum/computer_file/program/card_mod())
hard_drive.store_file(new/datum/computer_file/program/job_management())
hard_drive.store_file(new/datum/computer_file/program/crew_manifest())
starting_programs = list(
/datum/computer_file/program/chatclient,
/datum/computer_file/program/card_mod,
/datum/computer_file/program/job_management,
/datum/computer_file/program/crew_manifest,
)
/obj/machinery/modular_computer/console/preset/id/centcom
desc = "A stationary computer. This one comes preloaded with CentCom identification modification programs."
/obj/machinery/modular_computer/console/preset/id/centcom/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
var/datum/computer_file/program/card_mod/card_mod_centcom = new /datum/computer_file/program/card_mod()
/obj/machinery/modular_computer/console/preset/id/centcom/Initialize(mapload)
. = ..()
var/datum/computer_file/program/card_mod/card_mod_centcom = cpu.find_file_by_name("plexagonidwriter")
card_mod_centcom.is_centcom = TRUE
hard_drive.store_file(new /datum/computer_file/program/chatclient())
hard_drive.store_file(card_mod_centcom)
hard_drive.store_file(new /datum/computer_file/program/job_management())
hard_drive.store_file(new /datum/computer_file/program/crew_manifest())
// ===== CIVILIAN CONSOLE =====
/obj/machinery/modular_computer/console/preset/civilian
console_department = "Civilian"
name = "civilian console"
desc = "A stationary computer. This one comes preloaded with generic programs."
/obj/machinery/modular_computer/console/preset/civilian/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/chatclient())
hard_drive.store_file(new/datum/computer_file/program/arcade())
starting_programs = list(
/datum/computer_file/program/chatclient,
/datum/computer_file/program/arcade,
)
// curator
/obj/machinery/modular_computer/console/preset/curator
console_department = "Civilian"
name = "curator console"
desc = "A stationary computer. This one comes preloaded with art programs."
/obj/machinery/modular_computer/console/preset/curator/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/portrait_printer())
starting_programs = list(
/datum/computer_file/program/portrait_printer,
)
// ===== CARGO CHAT CONSOLES =====
/obj/machinery/modular_computer/console/preset/cargochat
name = "cargo chatroom console"
desc = "A stationary computer. This one comes preloaded with a chatroom for your cargo requests."
///chat client installed on this computer, just helpful for linking all the computers
var/datum/computer_file/program/chatclient/chatprogram
starting_programs = list(
/datum/computer_file/program/chatclient,
)
/obj/machinery/modular_computer/console/preset/cargochat/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
chatprogram = new
chatprogram.computer = cpu
hard_drive.store_file(chatprogram)
/obj/machinery/modular_computer/console/preset/cargochat/Initialize(mapload)
. = ..()
var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client")
chatprogram.username = "[lowertext(console_department)]_department"
chatprogram.program_state = PROGRAM_STATE_ACTIVE
cpu.active_program = chatprogram
@@ -128,16 +116,9 @@
name = "department chatroom console"
desc = "A stationary computer. This one comes preloaded with a chatroom for incoming cargo requests. You may moderate it from this computer."
/obj/machinery/modular_computer/console/preset/cargochat/cargo/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
//adding chat, setting it as the active window immediately
chatprogram = new
chatprogram.computer = cpu
hard_drive.store_file(chatprogram)
chatprogram.program_state = PROGRAM_STATE_ACTIVE
cpu.active_program = chatprogram
/obj/machinery/modular_computer/console/preset/cargochat/cargo/Initialize(mapload)
. = ..()
var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client")
//setting up chat
chatprogram.username = "cargo_requests_operator"
var/datum/ntnet_conversation/cargochat = new
@@ -149,12 +130,14 @@
/obj/machinery/modular_computer/console/preset/cargochat/cargo/LateInitialize()
. = ..()
var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client")
var/datum/ntnet_conversation/cargochat = SSnetworks.station_network.get_chat_channel_by_id(chatprogram.active_channel)
for(var/obj/machinery/modular_computer/console/preset/cargochat/cargochat_console in GLOB.machines)
if(cargochat_console == src)
continue
cargochat_console.chatprogram.active_channel = chatprogram.active_channel
cargochat.add_client(cargochat_console.chatprogram, silent = TRUE)
var/datum/computer_file/program/chatclient/other_chatprograms = cargochat_console.cpu.find_file_by_name("ntnrc_client")
other_chatprograms.active_channel = chatprogram.active_channel
cargochat.add_client(chatprogram, silent = TRUE)
/obj/machinery/modular_computer/console/preset/cargochat/service
console_department = "Service"
@@ -18,20 +18,12 @@
///Used in New() to set network tag according to our area.
var/console_department = ""
/obj/machinery/modular_computer/console/buildable/Initialize(mapload)
. = ..()
// User-built consoles start as empty frames.
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
qdel(hard_drive)
/obj/machinery/modular_computer/console/Initialize(mapload)
. = ..()
var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL]
if(battery_module)
qdel(battery_module)
cpu.install_component(new /obj/item/computer_hardware/hard_drive/super) // Consoles generally have better HDDs due to lower space limitations
if(cpu)
cpu.screen_on = TRUE
update_appearance()
@@ -56,21 +56,3 @@ This is how the base program is setup. the rest is mostly tgui stuff. I'll use t
/// for an example.
var/ui_header = "downloader_finished.gif"
```
## Preinstalls
Now. for pre-installing stuff.
Primarily done for consoles, there's an install_programs() proc in the console presets file in the machines folder.
for example, the command console one.
```DM
/obj/machinery/modular_computer/console/preset/command/install_programs()
cpu.hard_drive.store_file(new/datum/computer_file/program/chatclient())
cpu.hard_drive.store_file(new/datum/computer_file/program/card_mod())
```
Basically, you want to do cpu.hard_drive.store_file(new/*program path here*()) and put it in the subtype's install_programs().
Probably pretty self explanatory, but just in case.
Will probably be expanded when new features come around or I get asked to mention something.
@@ -11,8 +11,6 @@
var/uid
///Static ID to ensure all IDs are unique.
var/static/file_uid = 0
///The hard drive that has this computer file stored.
var/obj/item/computer_hardware/hard_drive/holder
///The modular computer hosting the file.
var/obj/item/modular_computer/computer
@@ -21,15 +19,9 @@
uid = file_uid++
/datum/computer_file/Destroy(force)
if(!holder)
return ..()
holder.remove_file(src)
// holder.holder is the computer that has drive installed. If we are Destroy()ing program that's currently running kill it.
if(computer && computer.active_program == src)
computer.kill_program(forced = TRUE)
holder = null
computer = null
if(computer)
computer.remove_file(src)
computer = null
return ..()
// Returns independent copy of this file.
@@ -198,6 +198,8 @@
/datum/computer_file/program/proc/kill_program(forced = FALSE)
SHOULD_CALL_PARENT(TRUE)
program_state = PROGRAM_STATE_KILLED
if(src in computer.idle_threads)
computer.idle_threads.Remove(src)
if(requires_ntnet)
var/obj/item/card/id/ID
var/obj/item/computer_hardware/card_slot/card_holder = computer.all_components[MC_CARD]
@@ -28,9 +28,7 @@
computer.visible_message(span_notice("\The [computer]'s screen brightly flashes and loud electrical buzzing is heard."))
computer.enabled = FALSE
computer.update_appearance()
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/battery/battery_module = computer.all_components[MC_CELL]
qdel(hard_drive)
computer.take_damage(25, BRUTE, 0, 0)
if(battery_module && prob(25))
qdel(battery_module)
@@ -284,10 +284,10 @@
. = TRUE
//SKYRAT EDIT START
if("gun_window")
var/datum/component/armament/cargo_gun/gun_comp = holder.holder.GetComponent(/datum/component/armament/cargo_gun)
var/datum/component/armament/cargo_gun/gun_comp = computer.GetComponent(/datum/component/armament/cargo_gun)
if(!gun_comp)
holder.holder.AddComponent(/datum/component/armament/cargo_gun, subtypesof(/datum/armament_entry/cargo_gun), 0)
gun_comp = holder.holder.GetComponent(/datum/component/armament/cargo_gun)
computer.AddComponent(/datum/component/armament/cargo_gun, subtypesof(/datum/armament_entry/cargo_gun), 0)
gun_comp = computer.GetComponent(/datum/component/armament/cargo_gun)
gun_comp.parent_prog ||= src
gun_comp.ui_interact(usr)
. = TRUE
@@ -19,13 +19,12 @@
if(!computer)
return 0
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/battery/battery_module = computer.all_components[MC_CELL]
var/list/data = get_header_data()
data["disk_size"] = hard_drive.max_capacity
data["disk_used"] = hard_drive.used_capacity
data["disk_size"] = computer.max_capacity
data["disk_used"] = computer.used_capacity
data["power_usage"] = computer.last_power_usage
data["battery_exists"] = battery_module ? 1 : 0
if(battery_module?.battery)
@@ -18,30 +18,23 @@
if(.)
return
var/obj/item/computer_hardware/hard_drive/HDD = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/hard_drive/RHDD = computer.all_components[MC_SDD]
switch(action)
if("PRG_deletefile")
if(!HDD)
return
var/datum/computer_file/file = HDD.find_file_by_name(params["name"])
var/datum/computer_file/file = computer.find_file_by_name(params["name"])
if(!file || file.undeletable)
return
HDD.remove_file(file)
computer.remove_file(file)
return TRUE
if("PRG_usbdeletefile")
if(!RHDD)
if(!computer.inserted_disk)
return
var/datum/computer_file/file = RHDD.find_file_by_name(params["name"])
var/datum/computer_file/file = computer.find_file_by_name(params["name"], computer.inserted_disk)
if(!file || file.undeletable)
return
RHDD.remove_file(file)
computer.inserted_disk.remove_file(file)
return TRUE
if("PRG_renamefile")
if(!HDD)
return
var/datum/computer_file/file = HDD.find_file_by_name(params["name"])
var/datum/computer_file/file = computer.find_file_by_name(params["name"])
if(!file)
return
var/newname = reject_bad_name(params["new_name"])
@@ -51,9 +44,9 @@
file.filename = newname
return TRUE
if("PRG_usbrenamefile")
if(!RHDD)
if(!computer.inserted_disk)
return
var/datum/computer_file/file = RHDD.find_file_by_name(params["name"])
var/datum/computer_file/file = computer.find_file_by_name(params["name"], computer.inserted_disk)
if(!file)
return
var/newname = reject_bad_name(params["new_name"])
@@ -63,43 +56,38 @@
file.filename = newname
return TRUE
if("PRG_copytousb")
if(!HDD || !RHDD)
if(!computer.inserted_disk)
return
var/datum/computer_file/F = HDD.find_file_by_name(params["name"])
var/datum/computer_file/F = computer.find_file_by_name(params["name"])
if(!F)
return
var/datum/computer_file/C = F.clone(FALSE)
RHDD.store_file(C)
computer.inserted_disk.add_file(C)
return TRUE
if("PRG_copyfromusb")
if(!HDD || !RHDD)
if(!computer.inserted_disk)
return
var/datum/computer_file/F = RHDD.find_file_by_name(params["name"])
var/datum/computer_file/F = computer.find_file_by_name(params["name"], computer.inserted_disk)
if(!F || !istype(F))
return
var/datum/computer_file/C = F.clone(FALSE)
HDD.store_file(C)
computer.store_file(C)
return TRUE
if("PRG_togglesilence")
if(!HDD)
return
var/datum/computer_file/program/binary = HDD.find_file_by_name(params["name"])
var/datum/computer_file/program/binary = computer.find_file_by_name(params["name"])
if(!binary || !istype(binary))
return
binary.alert_silenced = !binary.alert_silenced
/datum/computer_file/program/filemanager/ui_data(mob/user)
var/list/data = get_header_data()
var/obj/item/computer_hardware/hard_drive/HDD = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/hard_drive/portable/RHDD = computer.all_components[MC_SDD]
if(error)
data["error"] = error
if(!computer || !HDD)
if(!computer)
data["error"] = "I/O ERROR: Unable to access hard drive."
else
var/list/files = list()
for(var/datum/computer_file/F in HDD.stored_files)
for(var/datum/computer_file/F as anything in computer.stored_files)
var/noisy = FALSE
var/silenced = FALSE
var/datum/computer_file/program/binary = F
@@ -112,18 +100,18 @@
"size" = F.size,
"undeletable" = F.undeletable,
"alert_able" = noisy,
"alert_silenced" = silenced
"alert_silenced" = silenced,
))
data["files"] = files
if(RHDD)
if(computer.inserted_disk)
data["usbconnected"] = TRUE
var/list/usbfiles = list()
for(var/datum/computer_file/F in RHDD.stored_files)
for(var/datum/computer_file/F as anything in computer.inserted_disk.stored_files)
usbfiles += list(list(
"name" = F.filename,
"type" = F.filetype,
"size" = F.size,
"undeletable" = F.undeletable
"undeletable" = F.undeletable,
))
data["usbfiles"] = usbfiles
@@ -27,7 +27,7 @@
linked_techweb = SSresearch.science_tech
/datum/computer_file/program/scipaper_program/proc/recheck_file_presence()
if(selected_file in holder.stored_files)
if(selected_file in computer.stored_files)
return FALSE
UnregisterSignal(selected_file, COMSIG_MODULAR_COMPUTER_FILE_DELETED)
selected_file = null
@@ -84,7 +84,7 @@
data["allowedTiers"] = list()
data["allowedPartners"] = list()
// Both the file and experiment list are assoc lists. ID as value, display name as keys.
for(var/datum/computer_file/data/ordnance/ordnance_file in holder.stored_files)
for(var/datum/computer_file/data/ordnance/ordnance_file in computer.stored_files)
data["fileList"] += list(ordnance_file.filename = ordnance_file.uid)
if(selected_file)
for (var/possible_experiment in selected_file.possible_experiments)
@@ -180,7 +180,7 @@
if(selected_file)
UnregisterSignal(selected_file, COMSIG_MODULAR_COMPUTER_FILE_DELETED)
paper_to_be.set_experiment() // Clears the paper info.
for(var/datum/computer_file/data/ordnance/ordnance_data in holder.stored_files)
for(var/datum/computer_file/data/ordnance/ordnance_data in computer.stored_files)
if(ordnance_data.uid == params["selected_uid"])
selected_file = ordnance_data
RegisterSignal(selected_file, COMSIG_MODULAR_COMPUTER_FILE_DELETED, .proc/recheck_file_presence)
@@ -53,9 +53,7 @@
if(PRG.available_on_syndinet && !emagged)
return FALSE
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
if(!computer || !hard_drive || !hard_drive.can_store_file(PRG))
if(!computer || !computer.can_store_file(PRG))
return FALSE
ui_header = "downloader_running.gif"
@@ -84,8 +82,7 @@
if(!downloaded_file)
return
generate_network_log("Completed download of file [hacked_download ? "**ENCRYPTED**" : "[downloaded_file.filename].[downloaded_file.filetype]"].")
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
if(!computer || !hard_drive || !hard_drive.store_file(downloaded_file))
if(!computer || !computer.store_file(downloaded_file))
// The download failed
downloaderror = "I/O ERROR - Unable to save file. Check whether you have enough free space on your hard drive and whether your hard drive is properly connected. If the issue persists contact your system administrator for assistance."
downloaded_file = null
@@ -146,29 +143,27 @@
data["downloadspeed"] = download_netspeed
data["downloadcompletion"] = round(download_completion, 0.1)
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
data["disk_size"] = hard_drive.max_capacity
data["disk_used"] = hard_drive.used_capacity
data["disk_size"] = computer.max_capacity
data["disk_used"] = computer.used_capacity
data["emagged"] = emagged
var/list/repo = antag_repo | main_repo
var/list/program_categories = list()
for(var/I in repo)
var/datum/computer_file/program/P = I
if(!(P.category in program_categories))
program_categories.Add(P.category)
for(var/datum/computer_file/program/programs as anything in repo)
if(!(programs.category in program_categories))
program_categories.Add(programs.category)
data["programs"] += list(list(
"icon" = P.program_icon,
"filename" = P.filename,
"filedesc" = P.filedesc,
"fileinfo" = P.extended_desc,
"category" = P.category,
"installed" = !!hard_drive.find_file_by_name(P.filename),
"compatible" = check_compatibility(P),
"size" = P.size,
"access" = emagged && P.available_on_syndinet ? TRUE : P.can_run(user,transfer = 1, access = access),
"verifiedsource" = P.available_on_ntnet,
"icon" = programs.program_icon,
"filename" = programs.filename,
"filedesc" = programs.filedesc,
"fileinfo" = programs.extended_desc,
"category" = programs.category,
"installed" = !!computer.find_file_by_name(programs.filename),
"compatible" = check_compatibility(programs),
"size" = programs.size,
"access" = emagged && programs.available_on_syndinet ? TRUE : programs.can_run(user,transfer = 1, access = access),
"verifiedsource" = programs.available_on_ntnet,
))
data["categories"] = show_categories & program_categories
@@ -44,8 +44,6 @@
/// The path for the current loaded image in rsc
var/photo_path
/// Whether or not this app is loaded on a silicon's tablet.
var/is_silicon = FALSE
/// Whether or not we're in a mime PDA.
var/mime_mode = FALSE
/// Whether this app can send messages to all.
@@ -84,10 +82,7 @@
sortmode = /proc/cmp_pdaname_asc
for(var/obj/item/modular_computer/P in sort_list(GLOB.TabletMessengers, sortmode))
var/obj/item/computer_hardware/hard_drive/drive = P.all_components[MC_HDD]
if(!drive)
continue
for(var/datum/computer_file/program/messenger/app in drive.stored_files)
for(var/datum/computer_file/program/messenger/app in P.stored_files)
if(!P.saved_identification || !P.saved_job || app.invisible || app.monitor_hidden)
continue
dictionary += P
@@ -179,17 +174,15 @@
to_chat(usr, span_notice("ERROR: User no longer exists."))
return
var/obj/item/computer_hardware/hard_drive/drive = target.all_components[MC_HDD]
for(var/datum/computer_file/program/messenger/app in drive.stored_files)
for(var/datum/computer_file/program/messenger/app in computer.stored_files)
if(!app.sending_and_receiving && !sending_virus)
to_chat(usr, span_notice("ERROR: Device has receiving disabled."))
return
if(sending_virus)
var/obj/item/computer_hardware/hard_drive/portable/virus/disk = computer.all_components[MC_SDD]
var/obj/item/computer_disk/virus/disk = computer.inserted_disk
if(istype(disk))
disk.send_virus(target, usr)
disk.send_virus(src, target, usr)
return UI_UPDATE
send_message(usr, list(target))
@@ -204,24 +197,29 @@
sending_virus = !sending_virus
return UI_UPDATE
/datum/computer_file/program/messenger/ui_static_data(mob/user)
var/list/data = ..()
data["owner"] = computer.saved_identification
data["ringer_status"] = ringer_status
data["sending_and_receiving"] = sending_and_receiving
data["sortByJob"] = sort_by_job
data["isSilicon"] = issilicon(user)
data["viewing_messages"] = viewing_messages
return data
/datum/computer_file/program/messenger/ui_data(mob/user)
var/list/data = get_header_data()
data["owner"] = computer.saved_identification
data["messages"] = messages
data["ringer_status"] = ringer_status
data["sending_and_receiving"] = sending_and_receiving
data["messengers"] = ScrubMessengerList()
data["viewing_messages"] = viewing_messages
data["sortByJob"] = sort_by_job
data["isSilicon"] = is_silicon
data["photo"] = photo_path
data["canSpam"] = spam_mode
var/obj/item/computer_hardware/hard_drive/portable/virus/disk = computer.all_components[MC_SDD]
if(disk)
data["virus_attach"] = istype(disk, /obj/item/computer_hardware/hard_drive/portable/virus)
var/obj/item/computer_disk/virus/disk = computer.inserted_disk
if(disk && istype(disk))
data["virus_attach"] = TRUE
data["sending_virus"] = sending_virus
return data
@@ -366,11 +364,11 @@
messages += list(message_data)
var/mob/living/L = null
if(holder.holder.loc && isliving(holder.holder.loc))
L = holder.holder.loc
if(computer.loc && isliving(computer.loc))
L = computer.loc
//Maybe they are a pAI!
else
L = get(holder.holder, /mob/living/silicon)
L = get(computer, /mob/living/silicon)
if(L && (L.stat == CONSCIOUS || L.stat == SOFT_CRIT))
var/reply = "(<a href='byond://?src=[REF(src)];choice=[signal.data["rigged"] ? "mess_us_up" : "Message"];skiprefresh=1;target=[signal.data["ref"]]'>Reply</a>)"
@@ -124,15 +124,11 @@
logfile.stored_text = "[logfile.stored_text][logstring]\[BR\]"
logfile.stored_text = "[logfile.stored_text]\[b\]Logfile dump completed.\[/b\]"
logfile.calculate_size()
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
if(!computer || !hard_drive || !hard_drive.store_file(logfile))
if(!computer || !computer.store_file(logfile))
if(!computer)
// This program shouldn't even be runnable without computer.
CRASH("Var computer is null!")
if(!hard_drive)
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive connection error\" warning."))
else // In 99.9% cases this will mean our HDD is full
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning."))
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning."))
return TRUE
if("PRG_renamechannel")
if(!authed)
@@ -52,16 +52,11 @@
if("toggle_mass_pda")
if(!SSnetworks.station_network)
return
var/mob/user = ui.user
var/obj/item/modular_computer/target_tablet = locate(params["ref"]) in GLOB.TabletMessengers
if(!istype(target_tablet))
return
var/obj/item/computer_hardware/hard_drive/drive = target_tablet.all_components[MC_HDD]
if(!drive)
to_chat(user, span_boldnotice("Target tablet somehow is lacking a hard drive."))
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
for(var/datum/computer_file/program/messenger/messenger_app in computer.stored_files)
messenger_app.spam_mode = !messenger_app.spam_mode
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
@@ -91,10 +86,7 @@
for(var/obj/item/modular_computer/messenger in GetViewableDevices())
var/list/tablet_data = list()
if(messenger.saved_identification)
var/obj/item/computer_hardware/hard_drive/drive = messenger.all_components[MC_HDD]
if(!drive)
continue
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
for(var/datum/computer_file/program/messenger/messenger_app in computer.stored_files)
tablet_data["enabled_spam"] += messenger_app.spam_mode
tablet_data["name"] += messenger.saved_identification
@@ -1,241 +0,0 @@
/obj/item/computer_hardware/hard_drive
name = "hard disk drive"
desc = "A small HDD, for use in basic computers where power efficiency is desired."
power_usage = 25
icon_state = "harddisk_mini"
critical = 1
w_class = WEIGHT_CLASS_TINY
device_type = MC_HDD
var/max_capacity = 128
var/used_capacity = 0
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
var/default_installs = TRUE // install the default progs
/obj/item/computer_hardware/hard_drive/Initialize(mapload)
. = ..()
if(default_installs)
install_default_programs()
/obj/item/computer_hardware/hard_drive/Destroy()
QDEL_LIST(stored_files)
return ..()
/obj/item/computer_hardware/hard_drive/on_install(obj/item/modular_computer/install_into, mob/living/user)
. = ..()
// whoever tried to set the ref to the computer in new, is it okay if i could come to your house someday, yeah?
for(var/datum/computer_file/file as anything in stored_files)
file.computer = holder
/obj/item/computer_hardware/hard_drive/on_remove(obj/item/modular_computer/remove_from, mob/user)
remove_from.shutdown_computer()
for(var/datum/computer_file/program in stored_files)
program.computer = null
return ..()
/obj/item/computer_hardware/hard_drive/proc/install_default_programs()
store_file(new /datum/computer_file/program/computerconfig) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new /datum/computer_file/program/ntnetdownload) // NTNet Downloader Utility, allows users to download more software from NTNet repository
store_file(new /datum/computer_file/program/filemanager) // File manager, allows text editor functions and basic file manipulation.
/obj/item/computer_hardware/hard_drive/examine(user)
. = ..()
. += span_notice("It has [max_capacity] GQ of storage capacity.")
/obj/item/computer_hardware/hard_drive/diagnostics(mob/user)
..()
// 999 is a byond limit that is in place. It's unlikely someone will reach that many files anyway, since you would sooner run out of space.
to_chat(user, "NT-NFS File Table Status: [stored_files.len]/999")
to_chat(user, "Storage capacity: [used_capacity]/[max_capacity]GQ")
// Use this proc to add file to the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/computer_hardware/hard_drive/proc/store_file(datum/computer_file/F)
if(!F || !istype(F))
return FALSE
if(!can_store_file(F))
return FALSE
if(!check_functionality())
return FALSE
if(!stored_files)
return FALSE
// This file is already stored. Don't store it again.
if(F in stored_files)
return FALSE
SEND_SIGNAL(F, COMSIG_MODULAR_COMPUTER_FILE_ADDING)
F.holder = src
F.computer = holder
stored_files.Add(F)
recalculate_size()
SEND_SIGNAL(F, COMSIG_MODULAR_COMPUTER_FILE_ADDED)
return TRUE
// Use this proc to remove file from the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/computer_hardware/hard_drive/proc/remove_file(datum/computer_file/F)
if(!F || !istype(F))
return FALSE
if(!stored_files)
return FALSE
if(!check_functionality())
return FALSE
if(F in stored_files)
if(istype(F, /datum/computer_file/program))
var/datum/computer_file/program/program_file = F
if(program_file.program_state != PROGRAM_STATE_KILLED)
program_file.kill_program(TRUE)
SEND_SIGNAL(F, COMSIG_MODULAR_COMPUTER_FILE_DELETING)
stored_files -= F
recalculate_size()
SEND_SIGNAL(F, COMSIG_MODULAR_COMPUTER_FILE_DELETED)
return TRUE
else
return FALSE
// Loops through all stored files and recalculates used_capacity of this drive
/obj/item/computer_hardware/hard_drive/proc/recalculate_size()
var/total_size = 0
for(var/datum/computer_file/F in stored_files)
total_size += F.size
used_capacity = total_size
// Checks whether file can be stored on the hard drive. We can only store unique files, so this checks whether we wouldn't get a duplicity by adding a file.
/obj/item/computer_hardware/hard_drive/proc/can_store_file(datum/computer_file/F)
if(!F || !istype(F))
return FALSE
if(F in stored_files)
return FALSE
var/name = F.filename + "." + F.filetype
for(var/datum/computer_file/file in stored_files)
if((file.filename + "." + file.filetype) == name)
return FALSE
// In the unlikely event someone manages to create that many files.
// BYOND is acting weird with numbers above 999 in loops (infinite loop prevention)
if(stored_files.len >= 999)
return FALSE
if((used_capacity + F.size) > max_capacity)
return FALSE
else
return TRUE
// Tries to find the file by filename. Returns null on failure
/obj/item/computer_hardware/hard_drive/proc/find_file_by_name(filename)
if(!check_functionality())
return null
if(!filename)
return null
if(!stored_files)
return null
for(var/datum/computer_file/F as anything in stored_files)
if(F.filename == filename)
return F
return null
/obj/item/computer_hardware/hard_drive/advanced
name = "advanced hard disk drive"
desc = "A hybrid HDD, for use in higher grade computers where balance between power efficiency and capacity is desired."
max_capacity = 256
power_usage = 50 // Hybrid, medium capacity and medium power storage
icon_state = "harddisk_mini"
w_class = WEIGHT_CLASS_SMALL
/obj/item/computer_hardware/hard_drive/super
name = "super hard disk drive"
desc = "A high capacity HDD, for use in cluster storage solutions where capacity is more important than power efficiency."
max_capacity = 512
power_usage = 100 // High-capacity but uses lots of power, shortening battery life. Best used with APC link.
icon_state = "harddisk_mini"
w_class = WEIGHT_CLASS_SMALL
/obj/item/computer_hardware/hard_drive/cluster
name = "cluster hard disk drive"
desc = "A large storage cluster consisting of multiple HDDs for usage in dedicated storage systems."
power_usage = 500
max_capacity = 2048
icon_state = "harddisk"
w_class = WEIGHT_CLASS_NORMAL
// For tablets, etc. - highly power efficient.
/obj/item/computer_hardware/hard_drive/small
name = "solid state drive"
desc = "An efficient SSD for portable devices."
power_usage = 10
max_capacity = 64
icon_state = "ssd_mini"
w_class = WEIGHT_CLASS_TINY
custom_price = PAYCHECK_CREW * 2
/obj/item/computer_hardware/hard_drive/small/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/messenger)
store_file(new /datum/computer_file/program/nt_pay)
store_file(new /datum/computer_file/program/notepad)
store_file(new /datum/computer_file/program/crew_manifest) // SKYRAT EDIT ADD
// For borg integrated tablets. No downloader.
/obj/item/computer_hardware/hard_drive/small/ai/install_default_programs()
var/datum/computer_file/program/messenger/messenger = new
messenger.is_silicon = TRUE
store_file(messenger)
/obj/item/computer_hardware/hard_drive/small/robot/install_default_programs()
store_file(new /datum/computer_file/program/computerconfig) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new /datum/computer_file/program/filemanager) // File manager, allows text editor functions and basic file manipulation.
store_file(new /datum/computer_file/program/robotact)
store_file(new /datum/computer_file/program/crew_manifest) // SKYRAT EDIT ADDITION - Manifests for cyborgs
/* SKYRAT EDIT ADDITION Start- Returns Messenger to borgs */
var/datum/computer_file/program/messenger/messenger = new
messenger.is_silicon = TRUE
store_file(messenger)
/* SKYRAT EDIT ADDITION End- Returns Messenger to borgs */
// Syndicate variant - very slight better
/obj/item/computer_hardware/hard_drive/portable/syndicate
desc = "An efficient SSD for portable devices developed by a rival organisation."
power_usage = 8
max_capacity = 70
device_type = MC_HDD // SKYRAT EDIT
var/datum/opposing_force/opfor_data // Syndicate hard drive has the user's data baked directly into it on creation //SKYRAT EDIT - OPFOR, NOT TRAITOR
/obj/item/computer_hardware/hard_drive/portable/syndicate/install_default_programs()
. = ..()
store_file(new/datum/computer_file/program/computerconfig(src))
store_file(new/datum/computer_file/program/ntnetdownload/syndicate(src))
store_file(new/datum/computer_file/program/filemanager(src))
store_file(new/datum/computer_file/program/radar/fission360(src))
/// For tablets given to nuke ops
/obj/item/computer_hardware/hard_drive/small/nukeops
power_usage = 8
max_capacity = 70
/obj/item/computer_hardware/hard_drive/small/nukeops/install_default_programs()
store_file(new/datum/computer_file/program/computerconfig)
store_file(new/datum/computer_file/program/ntnetdownload/syndicate) // Syndicate version; automatic access to syndicate apps and no NT apps
store_file(new/datum/computer_file/program/filemanager)
store_file(new/datum/computer_file/program/radar/fission360) //I am legitimately afraid if I don't do this, Ops players will think they just don't get a pinpointer anymore.
/obj/item/computer_hardware/hard_drive/micro
name = "micro solid state drive"
desc = "A highly efficient SSD chip for portable devices."
power_usage = 2
max_capacity = 32
icon_state = "ssd_micro"
w_class = WEIGHT_CLASS_TINY
@@ -1,28 +0,0 @@
/obj/item/computer_hardware/hard_drive/portable
name = "data disk"
desc = "Removable disk used to store data."
power_usage = 10
icon_state = "datadisk6"
w_class = WEIGHT_CLASS_TINY
critical = FALSE
max_capacity = 16
device_type = MC_SDD
/obj/item/computer_hardware/hard_drive/portable/on_remove(obj/item/modular_computer/remove_from, mob/user)
return //this is a floppy disk, let's not shut the computer down when it gets pulled out.
/obj/item/computer_hardware/hard_drive/portable/install_default_programs()
return // Empty by default
/obj/item/computer_hardware/hard_drive/portable/advanced
name = "advanced data disk"
power_usage = 20
icon_state = "datadisk5"
max_capacity = 64
/obj/item/computer_hardware/hard_drive/portable/super
name = "super data disk"
desc = "Removable disk used to store large amounts of data."
power_usage = 40
icon_state = "datadisk3"
max_capacity = 256
@@ -1,154 +0,0 @@
/**
* Command
*/
/obj/item/computer_hardware/hard_drive/portable/command
icon_state = "datadisk7"
max_capacity = 32
/obj/item/computer_hardware/hard_drive/portable/command/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/crew_manifest)
store_file(new /datum/computer_file/program/science)
store_file(new /datum/computer_file/program/status)
/obj/item/computer_hardware/hard_drive/portable/command/captain
name = "captain data disk"
desc = "Removable disk used to download essential Captain tablet apps."
icon_state = "datadisk10"
/obj/item/computer_hardware/hard_drive/portable/command/captain/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/records/security)
store_file(new /datum/computer_file/program/records/medical)
store_file(new /datum/computer_file/program/phys_scanner/all)
/obj/item/computer_hardware/hard_drive/portable/command/cmo
name = "chief medical officer data disk"
desc = "Removable disk used to download essential CMO tablet apps."
/obj/item/computer_hardware/hard_drive/portable/command/cmo/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/phys_scanner/all)
store_file(new /datum/computer_file/program/records/medical)
/obj/item/computer_hardware/hard_drive/portable/command/rd
name = "research director data disk"
desc = "Removable disk used to download essential RD tablet apps."
/obj/item/computer_hardware/hard_drive/portable/command/rd/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/signal_commander)
store_file(new /datum/computer_file/program/phys_scanner/chemistry)
/obj/item/computer_hardware/hard_drive/portable/command/hos
name = "head of security data disk"
desc = "Removable disk used to download essential HoS tablet apps."
icon_state = "datadisk9"
/obj/item/computer_hardware/hard_drive/portable/command/hos/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/records/security)
/obj/item/computer_hardware/hard_drive/portable/command/hop
name = "head of personnel data disk"
desc = "Removable disk used to download essential HoP tablet apps."
/obj/item/computer_hardware/hard_drive/portable/command/hop/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/records/security)
store_file(new /datum/computer_file/program/job_management)
/obj/item/computer_hardware/hard_drive/portable/command/ce
name = "chief engineer data disk"
desc = "Removable disk used to download essential CE tablet apps."
/obj/item/computer_hardware/hard_drive/portable/command/ce/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/supermatter_monitor)
store_file(new /datum/computer_file/program/atmosscan)
store_file(new /datum/computer_file/program/alarm_monitor)
/**
* Security
*/
/obj/item/computer_hardware/hard_drive/portable/security
name = "security officer data disk"
desc = "Removable disk used to download security-related tablet apps."
icon_state = "datadisk9"
/obj/item/computer_hardware/hard_drive/portable/security/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/records/security)
store_file(new /datum/computer_file/program/crew_manifest)
/**
* Medical
*/
/obj/item/computer_hardware/hard_drive/portable/medical
name = "medical doctor data disk"
desc = "Removable disk used to download medical-related tablet apps."
icon_state = "datadisk7"
/obj/item/computer_hardware/hard_drive/portable/medical/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/phys_scanner/medical)
store_file(new /datum/computer_file/program/records/medical)
/obj/item/computer_hardware/hard_drive/portable/chemistry
name = "chemistry data disk"
desc = "Removable disk used to download chemistry-related tablet apps."
icon_state = "datadisk5"
/obj/item/computer_hardware/hard_drive/portable/chemistry/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/phys_scanner/chemistry)
/**
* Supply
*/
/obj/item/computer_hardware/hard_drive/portable/quartermaster
name = "cargo data disk"
desc = "Removable disk used to download cargo-related tablet apps."
icon_state = "cargodisk"
/obj/item/computer_hardware/hard_drive/portable/quartermaster/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/shipping)
store_file(new /datum/computer_file/program/budgetorders)
/**
* Science
*/
/obj/item/computer_hardware/hard_drive/portable/ordnance
name = "ordnance data disk"
desc = "Removable disk used to download ordnance-related tablet apps."
icon_state = "datadisk5"
/obj/item/computer_hardware/hard_drive/portable/ordnance/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/signal_commander)
store_file(new /datum/computer_file/program/scipaper_program)
/**
* Engineering
*/
/obj/item/computer_hardware/hard_drive/portable/engineering
name = "station engineer data disk"
desc = "Removable disk used to download engineering-related tablet apps."
icon_state = "datadisk6"
/obj/item/computer_hardware/hard_drive/portable/engineering/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/supermatter_monitor)
/obj/item/computer_hardware/hard_drive/portable/atmos
name = "atmospheric technician data disk"
desc = "Removable disk used to download atmos-related tablet apps."
icon_state = "datadisk6"
/obj/item/computer_hardware/hard_drive/portable/atmos/install_default_programs()
. = ..()
store_file(new /datum/computer_file/program/atmosscan)
store_file(new /datum/computer_file/program/alarm_monitor)
@@ -1,134 +0,0 @@
/obj/item/computer_hardware/hard_drive/portable/virus
name = "\improper generic virus disk"
icon_state = "virusdisk"
var/charges = 5
/obj/item/computer_hardware/hard_drive/portable/virus/proc/send_virus(obj/item/modular_computer/tablet/target, mob/living/user)
return
/obj/item/computer_hardware/hard_drive/portable/virus/clown
name = "\improper H.O.N.K. disk"
/obj/item/computer_hardware/hard_drive/portable/virus/clown/send_virus(obj/item/modular_computer/tablet/target, mob/living/user)
if(charges <= 0)
to_chat(user, span_notice("ERROR: Out of charges."))
return
if(target)
user.show_message(span_notice("Success!"))
charges--
target.honkvirus_amount = rand(15, 25)
else
to_chat(user, span_notice("ERROR: Could not find device."))
/obj/item/computer_hardware/hard_drive/portable/virus/mime
name = "\improper sound of silence disk"
/obj/item/computer_hardware/hard_drive/portable/virus/mime/send_virus(obj/item/modular_computer/tablet/target, mob/living/user)
if(charges <= 0)
to_chat(user, span_notice("ERROR: Out of charges."))
return
if(target)
user.show_message(span_notice("Success!"))
charges--
var/obj/item/computer_hardware/hard_drive/drive = target.all_components[MC_HDD]
for(var/datum/computer_file/program/messenger/app in drive.stored_files)
app.ringer_status = FALSE
app.ringtone = ""
else
to_chat(user, span_notice("ERROR: Could not find device."))
/obj/item/computer_hardware/hard_drive/portable/virus/deto
name = "\improper D.E.T.O.M.A.T.I.X. disk"
charges = 6
/obj/item/computer_hardware/hard_drive/portable/virus/deto/send_virus(obj/item/modular_computer/tablet/target, mob/living/user)
if(charges <= 0)
to_chat(user, span_notice("ERROR: Out of charges."))
return
var/difficulty = target.get_detomatix_difficulty()
if(SEND_SIGNAL(target, COMSIG_TABLET_CHECK_DETONATE) & COMPONENT_TABLET_NO_DETONATE || prob(difficulty * 15))
user.show_message(span_danger("ERROR: Target could not be bombed."), MSG_VISUAL)
charges--
return
var/original_host = holder
var/fakename = sanitize_name(tgui_input_text(user, "Enter a name for the rigged message.", "Forge Message", max_length = MAX_NAME_LEN), allow_numbers = TRUE)
if(!fakename || holder != original_host || !user.canUseTopic(holder, be_close = TRUE))
return
var/fakejob = sanitize_name(tgui_input_text(user, "Enter a job for the rigged message.", "Forge Message", max_length = MAX_NAME_LEN), allow_numbers = TRUE)
if(!fakejob || holder != original_host || !user.canUseTopic(holder, be_close = TRUE))
return
var/obj/item/computer_hardware/hard_drive/drive = holder.all_components[MC_HDD]
for(var/datum/computer_file/program/messenger/app in drive.stored_files)
if(charges > 0 && app.send_message(user, list(target), rigged = REF(user), fake_name = fakename, fake_job = fakejob))
charges--
user.show_message(span_notice("Success!"))
var/reference = REF(src)
ADD_TRAIT(target, TRAIT_PDA_CAN_EXPLODE, reference)
ADD_TRAIT(target, TRAIT_PDA_MESSAGE_MENU_RIGGED, reference)
addtimer(TRAIT_CALLBACK_REMOVE(target, TRAIT_PDA_MESSAGE_MENU_RIGGED, reference), 10 SECONDS)
/obj/item/computer_hardware/hard_drive/portable/virus/frame
name = "\improper F.R.A.M.E. disk"
var/telecrystals = 0
var/current_progression = 0
/obj/item/computer_hardware/hard_drive/portable/virus/frame/send_virus(obj/item/modular_computer/tablet/target, mob/living/user)
if(charges <= 0)
to_chat(user, span_notice("ERROR: Out of charges."))
return
if(target)
charges--
var/lock_code = "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]"
to_chat(user, span_notice("Success! The unlock code to the target is: [lock_code]"))
var/datum/component/uplink/hidden_uplink = target.GetComponent(/datum/component/uplink)
if(!hidden_uplink)
var/datum/mind/target_mind
var/list/backup_players = list()
for(var/datum/mind/player as anything in get_crewmember_minds())
if(player.assigned_role?.title == target.saved_job)
backup_players += player
if(player.name == target.saved_identification)
target_mind = player
break
if(!target_mind)
if(!length(backup_players))
target_mind = user.mind
else
target_mind = pick(backup_players)
hidden_uplink = target.AddComponent(/datum/component/uplink, target_mind, enabled = TRUE, starting_tc = telecrystals, has_progression = TRUE)
hidden_uplink.uplink_handler.has_objectives = TRUE
hidden_uplink.uplink_handler.owner = target_mind
hidden_uplink.uplink_handler.can_take_objectives = FALSE
hidden_uplink.uplink_handler.progression_points = min(SStraitor.current_global_progression, current_progression)
hidden_uplink.uplink_handler.generate_objectives()
SStraitor.register_uplink_handler(hidden_uplink.uplink_handler)
else
hidden_uplink.add_telecrystals(telecrystals)
telecrystals = 0
hidden_uplink.locked = FALSE
hidden_uplink.active = TRUE
else
to_chat(user, span_notice("ERROR: Could not find device."))
/obj/item/computer_hardware/hard_drive/portable/virus/frame/attackby(obj/item/I, mob/user, params)
. = ..()
if(istype(I, /obj/item/stack/telecrystal))
if(!charges)
to_chat(user, span_notice("[src] is out of charges, it's refusing to accept [I]."))
return
var/obj/item/stack/telecrystal/telecrystalStack = I
telecrystals += telecrystalStack.amount
to_chat(user, span_notice("You slot [telecrystalStack] into [src]. The next time it's used, it will also give telecrystals."))
telecrystalStack.use(telecrystalStack.amount)
@@ -20,7 +20,6 @@
// Device loadout
var/dev_battery = 1 // 1: Default, 2: Upgraded, 3: Advanced
var/dev_disk = 1 // 1: Default, 2: Upgraded, 3: Advanced
var/dev_card = 0 // 0: None, 1: Standard
// Removes all traces of old order and allows you to begin configuration from scratch.
@@ -34,7 +33,6 @@
qdel(fabricated_tablet)
fabricated_tablet = null
dev_battery = 1
dev_disk = 1
dev_card = 0
// Recalculates the price and optionally even fabricates the device.
@@ -60,18 +58,6 @@
if(fabricate)
battery_module.try_insert(new /obj/item/stock_parts/cell/computer/super)
total_price += 499
switch(dev_disk)
if(1) // Basic(128GQ)
if(fabricate)
fabricated_laptop.install_component(new /obj/item/computer_hardware/hard_drive)
if(2) // Upgraded(256GQ)
if(fabricate)
fabricated_laptop.install_component(new /obj/item/computer_hardware/hard_drive/advanced)
total_price += 99
if(3) // Advanced(512GQ)
if(fabricate)
fabricated_laptop.install_component(new /obj/item/computer_hardware/hard_drive/super)
total_price += 299
if(dev_card)
total_price += 199
if(fabricate)
@@ -98,18 +84,6 @@
if(fabricate)
battery_module.try_insert(new /obj/item/stock_parts/cell/computer)
total_price += 499
switch(dev_disk)
if(1) // Basic(32GQ)
if(fabricate)
fabricated_tablet.install_component(new /obj/item/computer_hardware/hard_drive/micro)
if(2) // Upgraded(64GQ)
if(fabricate)
fabricated_tablet.install_component(new /obj/item/computer_hardware/hard_drive/small)
total_price += 99
if(3) // Advanced(128GQ)
if(fabricate)
fabricated_tablet.install_component(new /obj/item/computer_hardware/hard_drive)
total_price += 299
if(dev_card)
total_price += 199
if(fabricate)
@@ -151,10 +125,6 @@
dev_battery = text2num(params["battery"])
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_disk")
dev_disk = text2num(params["disk"])
fabricate_and_recalc_price(FALSE)
return TRUE
if("hw_card")
dev_card = text2num(params["card"])
fabricate_and_recalc_price(FALSE)
@@ -216,7 +186,6 @@
if(state == 1)
data["devtype"] = devtype
data["hw_battery"] = dev_battery
data["hw_disk"] = dev_disk
data["hw_card"] = dev_card
if(state == 1 || state == 2)
data["totalprice"] = total_price