[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

View File

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

View File

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

View File

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