mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-26 01:52:15 +00:00
a small addition
This commit is contained in:
@@ -12,31 +12,31 @@
|
||||
var/power_usage_occupied = 2 KILOWATTS
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/proc/update_power_usage()
|
||||
if(!stored_card || !stored_card.carded_ai)
|
||||
if(!stored_card?.carded_ai)
|
||||
power_usage = power_usage_idle
|
||||
return
|
||||
power_usage = power_usage_occupied
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
/obj/item/computer_hardware/ai_slot/attackby(obj/item/W, mob/user)
|
||||
if(..())
|
||||
return 1
|
||||
return TRUE
|
||||
if(istype(W, /obj/item/aicard))
|
||||
if(stored_card)
|
||||
to_chat(user, "\The [src] is already occupied.")
|
||||
to_chat(user, SPAN_WARNING("\The [src] is already occupied."))
|
||||
return
|
||||
user.drop_from_inventory(W,src)
|
||||
user.drop_from_inventory(W, src)
|
||||
stored_card = W
|
||||
update_power_usage()
|
||||
if(W.isscrewdriver())
|
||||
to_chat(user, "You manually remove \the [stored_card] from \the [src].")
|
||||
to_chat(user, SPAN_NOTICE("You manually remove \the [stored_card] from \the [src]."))
|
||||
stored_card.forceMove(get_turf(src))
|
||||
stored_card = null
|
||||
update_power_usage()
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/Destroy()
|
||||
if(holder2 && (holder2.ai_slot == src))
|
||||
holder2.ai_slot = null
|
||||
if(parent_computer?.ai_slot == src)
|
||||
parent_computer.ai_slot = null
|
||||
if(stored_card)
|
||||
stored_card.forceMove(get_turf(holder2))
|
||||
holder2 = null
|
||||
return ..()
|
||||
stored_card.forceMove(get_turf(parent_computer))
|
||||
parent_computer = null
|
||||
return ..()
|
||||
@@ -2,9 +2,9 @@
|
||||
// have tremendeous capacity in comparsion. Higher tier cells would provide your device with nearly infinite battery life, which is something i want to avoid.
|
||||
/obj/item/computer_hardware/battery_module
|
||||
name = "standard battery"
|
||||
desc = "A standard power cell, commonly seen in high-end portable microcomputers or low-end laptops. It's rating is 750."
|
||||
desc = "A standard power cell, commonly seen in high-end portable microcomputers or low-end laptops. Its rating is 750."
|
||||
icon_state = "battery_normal"
|
||||
critical = 1
|
||||
critical = TRUE
|
||||
malfunction_probability = 1
|
||||
origin_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
|
||||
var/battery_rating = 750
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/obj/item/computer_hardware/battery_module/advanced
|
||||
name = "advanced battery"
|
||||
desc = "An advanced power cell, often used in most laptops. It is too large to be fitted into smaller devices. It's rating is 1100."
|
||||
desc = "An advanced power cell, often used in most laptops. It is too large to be fitted into smaller devices. Its rating is 1100."
|
||||
icon_state = "battery_advanced"
|
||||
origin_tech = list(TECH_POWER = 2, TECH_ENGINEERING = 2)
|
||||
battery_rating = 1100
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
/obj/item/computer_hardware/battery_module/super
|
||||
name = "super battery"
|
||||
desc = "A very advanced power cell, often used in high-end devices, or as uninterruptable power supply for important consoles or servers. It's rating is 1500."
|
||||
desc = "A very advanced power cell, often used in high-end devices, or as uninterruptable power supply for important consoles or servers. Its rating is 1500."
|
||||
icon_state = "battery_super"
|
||||
origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 3)
|
||||
hardware_size = 3
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/obj/item/computer_hardware/battery_module/ultra
|
||||
name = "ultra battery"
|
||||
desc = "A very advanced large power cell. It's often used as uninterruptable power supply for critical consoles or servers. It's rating is 2000."
|
||||
desc = "A very advanced large power cell. Its often used as uninterruptable power supply for critical consoles or servers. Its rating is 2000."
|
||||
icon_state = "battery_ultra"
|
||||
origin_tech = list(TECH_POWER = 5, TECH_ENGINEERING = 4)
|
||||
hardware_size = 3
|
||||
@@ -36,14 +36,14 @@
|
||||
|
||||
/obj/item/computer_hardware/battery_module/micro
|
||||
name = "micro battery"
|
||||
desc = "A small power cell, commonly seen in most portable microcomputers. It's rating is 500."
|
||||
desc = "A small power cell, commonly seen in most portable microcomputers. Its rating is 500."
|
||||
icon_state = "battery_micro"
|
||||
origin_tech = list(TECH_POWER = 2, TECH_ENGINEERING = 2)
|
||||
battery_rating = 500
|
||||
|
||||
/obj/item/computer_hardware/battery_module/nano
|
||||
name = "nano battery"
|
||||
desc = "A tiny power cell, commonly seen in low-end portable microcomputers. It's rating is 300."
|
||||
desc = "A tiny power cell, commonly seen in low-end portable microcomputers. Its rating is 300."
|
||||
icon_state = "battery_nano"
|
||||
origin_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
|
||||
battery_rating = 300
|
||||
@@ -58,15 +58,15 @@
|
||||
|
||||
/obj/item/computer_hardware/battery_module/lambda/Initialize()
|
||||
. = ..()
|
||||
battery = new/obj/item/cell/infinite(src)
|
||||
battery = new /obj/item/cell/infinite(src)
|
||||
|
||||
/obj/item/computer_hardware/battery_module/diagnostics(var/mob/user)
|
||||
..()
|
||||
to_chat(user, "Internal battery charge: [battery.charge]/[battery.maxcharge] mAh")
|
||||
to_chat(user, SPAN_NOTICE("Internal battery charge: [battery.charge]/[battery.maxcharge] mAh"))
|
||||
|
||||
/obj/item/computer_hardware/battery_module/Initialize()
|
||||
. = ..()
|
||||
battery = new/obj/item/cell/device/variable(src, battery_rating)
|
||||
battery = new /obj/item/cell/device/variable(src, battery_rating)
|
||||
battery.charge = 0
|
||||
|
||||
/obj/item/computer_hardware/battery_module/proc/charge_to_full()
|
||||
@@ -74,4 +74,4 @@
|
||||
battery.charge = battery.maxcharge
|
||||
|
||||
/obj/item/computer_hardware/battery_module/get_cell()
|
||||
return battery
|
||||
return battery
|
||||
@@ -2,17 +2,17 @@
|
||||
name = "RFID card slot"
|
||||
desc = "Slot that allows this computer to write data on RFID cards. Necessary for some programs to run properly."
|
||||
power_usage = 10 //W
|
||||
critical = 0
|
||||
critical = FALSE
|
||||
icon_state = "cardreader"
|
||||
hardware_size = 1
|
||||
origin_tech = list(TECH_DATA = 2)
|
||||
|
||||
var/obj/item/card/id/stored_card = null
|
||||
var/obj/item/card/id/stored_card
|
||||
|
||||
/obj/item/computer_hardware/card_slot/Destroy()
|
||||
if(holder2 && (holder2.card_slot == src))
|
||||
holder2.card_slot = null
|
||||
if(parent_computer?.card_slot == src)
|
||||
parent_computer.card_slot = null
|
||||
if(stored_card)
|
||||
stored_card.forceMove(get_turf(holder2))
|
||||
holder2 = null
|
||||
return ..()
|
||||
stored_card.forceMove(get_turf(parent_computer))
|
||||
parent_computer = null
|
||||
return ..()
|
||||
@@ -7,7 +7,7 @@
|
||||
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
|
||||
var/max_capacity = 128
|
||||
var/used_capacity = 0
|
||||
var/read_only = 0 // If the HDD is read only
|
||||
var/read_only = FALSE // If the HDD is read only
|
||||
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/advanced
|
||||
@@ -15,7 +15,7 @@
|
||||
desc = "A small hybrid hard drive with 256GQ of storage capacity for use in higher grade computers where balance between power efficiency and capacity is desired."
|
||||
max_capacity = 256
|
||||
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
|
||||
power_usage = 50 // Hybrid, medium capacity and medium power storage
|
||||
power_usage = 50 // Hybrid, medium capacity and medium power storage
|
||||
icon_state = "hdd_advanced"
|
||||
hardware_size = 3
|
||||
|
||||
@@ -59,108 +59,94 @@
|
||||
/obj/item/computer_hardware/hard_drive/diagnostics(var/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")
|
||||
to_chat(user, SPAN_NOTICE("NT-NFS File Table Status: [stored_files.len]/999"))
|
||||
to_chat(user, SPAN_NOTICE("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(var/datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
if(!can_store_file(F.size))
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
if(!stored_files)
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
// This file is already stored. Don't store it again.
|
||||
if(F in stored_files)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
F.holder = src
|
||||
F.hard_drive = src
|
||||
stored_files.Add(F)
|
||||
recalculate_size()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
// 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/install_default_programs()
|
||||
store_file(new/datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
|
||||
store_file(new/datum/computer_file/program/clientmanager(src)) // Client Manager to Enroll the Device
|
||||
|
||||
store_file(new /datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
|
||||
store_file(new /datum/computer_file/program/clientmanager(src)) // Client Manager to Enroll the Device
|
||||
|
||||
// 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(var/datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
if(!stored_files || read_only)
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
return FALSE
|
||||
if(F in stored_files)
|
||||
stored_files -= F
|
||||
recalculate_size()
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
return 0
|
||||
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.
|
||||
/obj/item/computer_hardware/hard_drive/proc/can_store_file(var/size = 1)
|
||||
/obj/item/computer_hardware/hard_drive/proc/can_store_file(var/size = TRUE)
|
||||
// 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(read_only)
|
||||
return 0
|
||||
return FALSE
|
||||
if(stored_files.len >= 999)
|
||||
return 0
|
||||
return FALSE
|
||||
if(used_capacity + size > max_capacity)
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
// Checks whether we can store the file. 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/try_store_file(var/datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
return 0
|
||||
return FALSE
|
||||
var/name = F.filename + "." + F.filetype
|
||||
for(var/datum/computer_file/file in stored_files)
|
||||
if((file.filename + "." + file.filetype) == name)
|
||||
return 0
|
||||
return FALSE
|
||||
return can_store_file(F.size)
|
||||
|
||||
|
||||
|
||||
// Tries to find the file by filename. Returns null on failure
|
||||
/obj/item/computer_hardware/hard_drive/proc/find_file_by_name(var/filename)
|
||||
if(!check_functionality())
|
||||
return null
|
||||
|
||||
if(!filename)
|
||||
return null
|
||||
|
||||
if(!stored_files)
|
||||
return null
|
||||
|
||||
for(var/datum/computer_file/F in stored_files)
|
||||
if(F.filename == filename)
|
||||
return F
|
||||
return null
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/Destroy()
|
||||
if(holder2 && (holder2.hard_drive == src))
|
||||
holder2.hard_drive = null
|
||||
if(parent_computer?.hard_drive == src)
|
||||
parent_computer.hard_drive = null
|
||||
stored_files = null
|
||||
return ..()
|
||||
|
||||
@@ -183,6 +169,6 @@
|
||||
/obj/item/computer_hardware/hard_drive/attackby(obj/item/W, mob/living/user)
|
||||
if(istype(W, /obj/item/card/tech_support))
|
||||
reset_drive()
|
||||
to_chat(user, span("notice", "Drive successfully reset."))
|
||||
to_chat(user, SPAN_NOTICE("Drive successfully reset."))
|
||||
else
|
||||
..()
|
||||
@@ -2,87 +2,85 @@
|
||||
name = "Hardware"
|
||||
desc = "Unknown Hardware."
|
||||
icon = 'icons/obj/modular_components.dmi'
|
||||
var/obj/item/modular_computer/holder2 = null
|
||||
var/power_usage = 0 // If the hardware uses extra power, change this.
|
||||
var/enabled = 1 // If the hardware is turned off set this to 0.
|
||||
var/critical = 1 // Prevent disabling for important component, like the HDD.
|
||||
var/hardware_size = 1 // Limits which devices can contain this component. 1: Tablets/Laptops/Consoles, 2: Laptops/Consoles, 3: Consoles only
|
||||
var/damage = 0 // Current damage level
|
||||
var/max_damage = 100 // Maximal damage level.
|
||||
var/damage_malfunction = 20 // "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
|
||||
var/damage_failure = 50 // "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
|
||||
var/malfunction_probability = 10// Chance of malfunction when the component is damaged
|
||||
var/obj/item/modular_computer/parent_computer
|
||||
var/power_usage = 0 // If the hardware uses extra power, change this.
|
||||
var/enabled = TRUE // If the hardware is turned off set this to 0.
|
||||
var/critical = TRUE // Prevent disabling for important component, like the HDD.
|
||||
var/hardware_size = 1 // Limits which devices can contain this component. 1: Tablets/Laptops/Consoles, 2: Laptops/Consoles, 3: Consoles only
|
||||
var/damage = 0 // Current damage level
|
||||
var/max_damage = 100 // Maximal damage level.
|
||||
var/damage_malfunction = 20 // "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
|
||||
var/damage_failure = 50 // "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
|
||||
var/malfunction_probability = 10 // Chance of malfunction when the component is damaged
|
||||
|
||||
/obj/item/computer_hardware/attackby(var/obj/item/W as obj, var/mob/living/user as mob)
|
||||
/obj/item/computer_hardware/attackby(obj/item/W, mob/living/user)
|
||||
// Multitool. Runs diagnostics
|
||||
if(W.ismultitool())
|
||||
to_chat(user, "***** DIAGNOSTICS REPORT *****")
|
||||
to_chat(user, SPAN_NOTICE("***** DIAGNOSTICS REPORT *****"))
|
||||
diagnostics(user)
|
||||
to_chat(user, "******************************")
|
||||
to_chat(user, SPAN_NOTICE("******************************"))
|
||||
return 1
|
||||
// Nanopaste. Repair all damage if present for a single unit.
|
||||
var/obj/item/stack/S = W
|
||||
if(istype(S, /obj/item/stack/nanopaste))
|
||||
if(!damage)
|
||||
to_chat(user, "\The [src] doesn't seem to require repairs.")
|
||||
return 1
|
||||
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
|
||||
return TRUE
|
||||
if(S.use(1))
|
||||
to_chat(user, "You apply a bit of \the [W] to \the [src]. It immediately repairs all damage.")
|
||||
to_chat(user, SPAN_NOTICE("You apply a bit of \the [W] to \the [src], repairing it fully."))
|
||||
damage = 0
|
||||
return 1
|
||||
return TRUE
|
||||
// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
|
||||
if(S.iscoil())
|
||||
if(!damage)
|
||||
to_chat(user, "\The [src] doesn't seem to require repairs.")
|
||||
return 1
|
||||
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
|
||||
return TRUE
|
||||
if(S.use(1))
|
||||
to_chat(user, "You patch up \the [src] with a bit of \the [W].")
|
||||
to_chat(user, SPAN_NOTICE("You patch up \the [src] with a bit of \the [W]."))
|
||||
take_damage(-10)
|
||||
return 1
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
|
||||
// Called on multitool click, prints diagnostic information to the user.
|
||||
/obj/item/computer_hardware/proc/diagnostics(var/mob/user)
|
||||
to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]")
|
||||
to_chat(user, SPAN_NOTICE("Hardware Integrity Test... (Physical Damage: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]"))
|
||||
|
||||
/obj/item/computer_hardware/Initialize()
|
||||
. = ..()
|
||||
w_class = hardware_size
|
||||
if(istype(loc, /obj/item/modular_computer))
|
||||
holder2 = loc
|
||||
return .
|
||||
. = ..()
|
||||
w_class = hardware_size
|
||||
if(istype(loc, /obj/item/modular_computer))
|
||||
parent_computer = loc
|
||||
return .
|
||||
|
||||
/obj/item/computer_hardware/Destroy()
|
||||
holder2 = null
|
||||
parent_computer = null
|
||||
return ..()
|
||||
|
||||
// Handles damage checks
|
||||
/obj/item/computer_hardware/proc/check_functionality()
|
||||
// Turned off
|
||||
if(!enabled)
|
||||
return 0
|
||||
return FALSE
|
||||
// Too damaged to work at all.
|
||||
if(damage > damage_failure)
|
||||
return 0
|
||||
return FALSE
|
||||
// Still working. Well, sometimes...
|
||||
if(damage > damage_malfunction)
|
||||
if(prob(malfunction_probability))
|
||||
return 0
|
||||
return FALSE
|
||||
// Good to go.
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/computer_hardware/examine(var/mob/user)
|
||||
. = ..()
|
||||
if(damage > damage_failure)
|
||||
to_chat(user, "<span class='danger'>It seems to be severely damaged!</span>")
|
||||
to_chat(user, SPAN_DANGER("It seems to be severely damaged!"))
|
||||
else if(damage > damage_malfunction)
|
||||
to_chat(user, "<span class='notice'>It seems to be damaged!</span>")
|
||||
to_chat(user, SPAN_WARNING("It seems to be damaged!"))
|
||||
else if(damage)
|
||||
to_chat(user, "It seems to be slightly damaged.")
|
||||
to_chat(user, SPAN_WARNING("It seems to be slightly damaged."))
|
||||
|
||||
// Damages the component. Contains necessary checks. Negative damage "heals" the component.
|
||||
/obj/item/computer_hardware/proc/take_damage(var/amount)
|
||||
damage += round(amount) // We want nice rounded numbers here.
|
||||
damage = between(0, damage, max_damage) // Clamp the value.
|
||||
|
||||
damage += round(amount) // We want nice rounded numbers here.
|
||||
damage = between(0, damage, max_damage) // Clamp the value.
|
||||
@@ -3,7 +3,7 @@
|
||||
desc = "Small integrated printer with paper recycling module."
|
||||
power_usage = 50
|
||||
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2)
|
||||
critical = 0
|
||||
critical = FALSE
|
||||
icon_state = "printer"
|
||||
hardware_size = 1
|
||||
var/stored_paper = 5
|
||||
@@ -11,20 +11,20 @@
|
||||
|
||||
/obj/item/computer_hardware/nano_printer/diagnostics(var/mob/user)
|
||||
..()
|
||||
to_chat(user, "Paper buffer level: [stored_paper]/[max_paper]")
|
||||
to_chat(user, SPAN_NOTICE("Paper Buffer Level: [stored_paper]/[max_paper]"))
|
||||
|
||||
/obj/item/computer_hardware/nano_printer/proc/print_text(var/text_to_print, var/paper_title = null, var/paper_color = null)
|
||||
if(!stored_paper)
|
||||
return 0
|
||||
return FALSE
|
||||
if(!enabled)
|
||||
return 0
|
||||
return FALSE
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
// Damaged printer causes the resulting paper to be somewhat harder to read.
|
||||
if(damage > damage_malfunction)
|
||||
text_to_print = stars(text_to_print, 100-malfunction_probability)
|
||||
var/obj/item/paper/P = new /obj/item/paper(get_turf(holder2),text_to_print, paper_title)
|
||||
var/obj/item/paper/P = new /obj/item/paper(get_turf(parent_computer),text_to_print, paper_title)
|
||||
P.info = text_to_print
|
||||
if (paper_color)
|
||||
P.color = paper_color
|
||||
@@ -32,18 +32,19 @@
|
||||
stored_paper--
|
||||
return P
|
||||
|
||||
/obj/item/computer_hardware/nano_printer/attackby(obj/item/W as obj, mob/user as mob)
|
||||
/obj/item/computer_hardware/nano_printer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/paper))
|
||||
if(stored_paper >= max_paper)
|
||||
to_chat(user, "You try to add \the [W] into [src], but it's paper bin is full")
|
||||
to_chat(user, SPAN_WARNING("You try to add \the [W] to the [src], but its paper bin is full."))
|
||||
return
|
||||
|
||||
to_chat(user, "You insert \the [W] into [src].")
|
||||
to_chat(user, SPAN_NOTICE("You insert \the [W] into [src]."))
|
||||
qdel(W)
|
||||
stored_paper++
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/computer_hardware/nano_printer/Destroy()
|
||||
if(holder2 && (holder2.nano_printer == src))
|
||||
holder2.nano_printer = null
|
||||
holder2 = null
|
||||
return ..()
|
||||
if(parent_computer?.nano_printer == src)
|
||||
parent_computer.nano_printer = null
|
||||
parent_computer = null
|
||||
return ..()
|
||||
@@ -1,29 +1,29 @@
|
||||
var/global/ntnet_card_uid = 1
|
||||
|
||||
/obj/item/computer_hardware/network_card/
|
||||
/obj/item/computer_hardware/network_card
|
||||
name = "basic NTNet network card"
|
||||
desc = "A basic network card for usage with standard NTNet frequencies."
|
||||
power_usage = 50
|
||||
origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 1)
|
||||
critical = 0
|
||||
critical = FALSE
|
||||
icon_state = "netcard_basic"
|
||||
hardware_size = 1
|
||||
var/identification_id = null // Identification ID. Technically MAC address of this device. Can't be changed by user.
|
||||
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
|
||||
var/long_range = 0
|
||||
var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks.
|
||||
var/identification_id // Identification ID. Technically MAC address of this device. Can't be changed by user.
|
||||
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
|
||||
var/long_range = FALSE
|
||||
var/ethernet = FALSE // Hard-wired, therefore always on, ignores NTNet wireless checks.
|
||||
malfunction_probability = 1
|
||||
|
||||
/obj/item/computer_hardware/network_card/diagnostics(var/mob/user)
|
||||
/obj/item/computer_hardware/network_card/diagnostics(mob/user)
|
||||
..()
|
||||
to_chat(user, "NIX Unique ID: [identification_id]")
|
||||
to_chat(user, "NIX User Tag: [identification_string]")
|
||||
to_chat(user, "Supported protocols:")
|
||||
to_chat(user, "511.m SFS (Subspace) - Standard Frequency Spread")
|
||||
to_chat(user, SPAN_NOTICE("NIX Unique ID: [identification_id]"))
|
||||
to_chat(user, SPAN_NOTICE("NIX User Tag: [identification_string]"))
|
||||
to_chat(user, SPAN_NOTICE("Supported protocols:"))
|
||||
to_chat(user, SPAN_NOTICE("511.m SFS (Subspace) - Standard Frequency Spread"))
|
||||
if(long_range)
|
||||
to_chat(user, "511.n WFS/HB (Subspace) - Wide Frequency Spread/High Bandiwdth")
|
||||
to_chat(user, SPAN_NOTICE("511.n WFS/HB (Subspace) - Wide Frequency Spread/High Bandwidth"))
|
||||
if(ethernet)
|
||||
to_chat(user, "OpenEth (Physical Connection) - Physical network connection port")
|
||||
to_chat(user, SPAN_NOTICE("OpenEth (Physical Connection) - Physical Network Connection Port"))
|
||||
|
||||
/obj/item/computer_hardware/network_card/Initialize()
|
||||
. = ..()
|
||||
@@ -32,8 +32,8 @@ var/global/ntnet_card_uid = 1
|
||||
|
||||
/obj/item/computer_hardware/network_card/advanced
|
||||
name = "advanced NTNet network card"
|
||||
desc = "An advanced network card for usage with standard NTNet frequencies. It's transmitter is strong enough to connect even off-station."
|
||||
long_range = 1
|
||||
desc = "An advanced network card for usage with standard NTNet frequencies. Its transmitter is strong enough to connect even off-station."
|
||||
long_range = TRUE
|
||||
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 2)
|
||||
power_usage = 150 // Better range but higher power usage.
|
||||
icon_state = "netcard_advanced"
|
||||
@@ -42,41 +42,31 @@ var/global/ntnet_card_uid = 1
|
||||
/obj/item/computer_hardware/network_card/wired
|
||||
name = "wired NTNet network card"
|
||||
desc = "An advanced network card for usage with standard NTNet frequencies. This one also supports wired connection."
|
||||
ethernet = 1
|
||||
ethernet = TRUE
|
||||
origin_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 3)
|
||||
power_usage = 150 // Better range but higher power usage.
|
||||
icon_state = "netcard_ethernet"
|
||||
hardware_size = 3
|
||||
|
||||
/obj/item/computer_hardware/network_card/Destroy()
|
||||
if(holder2 && (holder2.network_card == src))
|
||||
holder2.network_card = null
|
||||
holder2 = null
|
||||
return ..()
|
||||
|
||||
// Returns a string identifier of this network card
|
||||
/obj/item/computer_hardware/network_card/proc/get_network_tag()
|
||||
return "[identification_string] (NID [identification_id])"
|
||||
|
||||
// 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection
|
||||
/obj/item/computer_hardware/network_card/proc/get_signal(var/specific_action = 0)
|
||||
if(!holder2) // Hardware is not installed in anything. No signal. How did this even get called?
|
||||
if(!parent_computer) // Hardware is not installed in anything. No signal. How did this even get called?
|
||||
return 0
|
||||
|
||||
if(!enabled)
|
||||
return 0
|
||||
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
if(ethernet) // Computer is connected via wired connection.
|
||||
return 3
|
||||
|
||||
if(!ntnet_global || !ntnet_global.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal.
|
||||
return 0
|
||||
|
||||
if(holder2)
|
||||
var/turf/T = get_turf(holder2)
|
||||
if(parent_computer)
|
||||
var/turf/T = get_turf(parent_computer)
|
||||
if((T && istype(T)) && isStationLevel(T.z))
|
||||
// Computer is on station. Low/High signal depending on what type of network card you have
|
||||
if(long_range)
|
||||
@@ -90,6 +80,7 @@ var/global/ntnet_card_uid = 1
|
||||
return 0 // Computer is not on station and does not have upgraded network card. No signal.
|
||||
|
||||
/obj/item/computer_hardware/network_card/Destroy()
|
||||
if(holder2 && (holder2.network_card == src))
|
||||
holder2.network_card = null
|
||||
return ..()
|
||||
if(parent_computer?.network_card == src)
|
||||
parent_computer.network_card = null
|
||||
parent_computer = null
|
||||
return ..()
|
||||
@@ -1,5 +1,5 @@
|
||||
// These are basically USB data sticks and may be used to transfer files between devices
|
||||
/obj/item/computer_hardware/hard_drive/portable/
|
||||
/obj/item/computer_hardware/hard_drive/portable
|
||||
name = "basic data crystal"
|
||||
desc = "Small crystal with imprinted photonic circuits that can be used to store data. Its capacity is 16 GQ."
|
||||
power_usage = 10
|
||||
@@ -29,4 +29,4 @@
|
||||
/obj/item/computer_hardware/hard_drive/portable/New()
|
||||
..()
|
||||
stored_files = list()
|
||||
recalculate_size()
|
||||
recalculate_size()
|
||||
@@ -1,54 +1,51 @@
|
||||
/obj/item/computer_hardware/hard_drive/portable/super/preset/all/Initialize()
|
||||
. = ..()
|
||||
add_programs()
|
||||
. = ..()
|
||||
add_programs()
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/portable/super/preset/all/proc/add_programs()
|
||||
for(var/F in typesof(/datum/computer_file/program))
|
||||
var/datum/computer_file/program/prog = new F
|
||||
// Invalid type (shouldn't be possible but just in case), invalid filetype (not executable program) or invalid filename (unset program)
|
||||
if(!prog || !istype(prog) || prog.filename == "UnknownProgram" || prog.filetype != "PRG")
|
||||
continue
|
||||
// Check whether the program should be available for station/antag download, if yes, add it to lists.
|
||||
if(prog.available_on_ntnet)
|
||||
store_file(prog)
|
||||
|
||||
|
||||
for(var/F in typesof(/datum/computer_file/program))
|
||||
var/datum/computer_file/program/prog = new F
|
||||
// Invalid type (shouldn't be possible but just in case), invalid filetype (not executable program) or invalid filename (unset program)
|
||||
if(!prog || !istype(prog) || prog.filename == "UnknownProgram" || prog.filetype != "PRG")
|
||||
continue
|
||||
// Check whether the program should be available for station/antag download, if yes, add it to lists.
|
||||
if(prog.available_on_ntnet)
|
||||
store_file(prog)
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/portable/backup
|
||||
var/_program = null //Change that far to the file name of the backup program you would like to spawn
|
||||
origin_tech = list() //Nope, no research levels from backup disks
|
||||
var/_program //Change that far to the file name of the backup program you would like to spawn
|
||||
origin_tech = list() //Nope, no research levels from backup disks
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/portable/backup/New(loc, var/prog_name)
|
||||
. = ..()
|
||||
_program = prog_name
|
||||
add_program()
|
||||
. = ..()
|
||||
_program = prog_name
|
||||
add_program()
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/portable/backup/proc/add_program()
|
||||
if(_program == null)
|
||||
qdel(src) //Delete itself if no program is set
|
||||
return
|
||||
var/datum/computer_file/program/PRG = ntnet_global.find_ntnet_file_by_name(_program)
|
||||
if(!PRG)
|
||||
qdel(src) //Delete itself it no matching program is found
|
||||
return
|
||||
max_capacity = PRG.size // Set the capacity of the backup disk to the capacity of the program
|
||||
store_file(PRG)
|
||||
read_only = 1
|
||||
desc = "A read-only backup storage crystal containing a backup of the following software: [PRG.filename]"
|
||||
name = "[PRG.filename] backup crystal"
|
||||
|
||||
if(_program == null)
|
||||
qdel(src) //Delete itself if no program is set
|
||||
return
|
||||
var/datum/computer_file/program/PRG = ntnet_global.find_ntnet_file_by_name(_program)
|
||||
if(!PRG)
|
||||
qdel(src) //Delete itself it no matching program is found
|
||||
return
|
||||
max_capacity = PRG.size // Set the capacity of the backup disk to the capacity of the program
|
||||
store_file(PRG)
|
||||
read_only = TRUE
|
||||
desc = "A read-only backup storage crystal containing a backup of the following software: [PRG.filename]"
|
||||
name = "[PRG.filename] backup crystal"
|
||||
|
||||
/obj/structure/closet/crate/software_backup
|
||||
desc = "A crate containing a backup of all the NT Software available"
|
||||
name = "Backup Software Crate"
|
||||
desc = "A crate containing a backup of all the NT Software available."
|
||||
name = "Backup Software Crate"
|
||||
|
||||
/obj/structure/closet/crate/software_backup/Initialize()
|
||||
. = ..()
|
||||
for(var/F in typesof(/datum/computer_file/program))
|
||||
var/datum/computer_file/program/prog = new F
|
||||
// Invalid type (shouldn't be possible but just in case), invalid filetype (not executable program) or invalid filename (unset program)
|
||||
if(!prog || !istype(prog) || prog.filename == "UnknownProgram" || prog.filetype != "PRG")
|
||||
continue
|
||||
// Check whether the program should be available for station/antag download, if yes, add it to lists.
|
||||
if(prog.available_on_ntnet)
|
||||
new /obj/item/computer_hardware/hard_drive/portable/backup(src, prog.filename)
|
||||
. = ..()
|
||||
for(var/F in subtypesof(/datum/computer_file/program))
|
||||
var/datum/computer_file/program/prog = new F
|
||||
// Invalid type (shouldn't be possible but just in case), invalid filetype (not executable program) or invalid filename (unset program)
|
||||
if(!prog || !istype(prog) || prog.filename == "UnknownProgram" || prog.filetype != "PRG")
|
||||
continue
|
||||
// Check whether the program should be available for station/antag download, if yes, add it to lists.
|
||||
if(prog.available_on_ntnet)
|
||||
new /obj/item/computer_hardware/hard_drive/portable/backup(src, prog.filename)
|
||||
@@ -7,7 +7,6 @@
|
||||
icon_state = "cpu_normal"
|
||||
hardware_size = 2
|
||||
power_usage = 75
|
||||
critical = 1
|
||||
malfunction_probability = 1
|
||||
origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 2)
|
||||
|
||||
@@ -38,4 +37,4 @@
|
||||
hardware_size = 1
|
||||
power_usage = 100
|
||||
max_idle_programs = 2
|
||||
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 3)
|
||||
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 3)
|
||||
@@ -1,15 +1,13 @@
|
||||
/obj/item/computer_hardware/tesla_link
|
||||
name = "tesla link"
|
||||
desc = "An advanced tesla link that wirelessly recharges connected device from nearby area power controller."
|
||||
critical = 0
|
||||
enabled = 1
|
||||
critical = FALSE
|
||||
icon_state = "teslalink"
|
||||
hardware_size = 3
|
||||
origin_tech = list(TECH_DATA = 2, TECH_POWER = 3, TECH_ENGINEERING = 2)
|
||||
var/obj/machinery/modular_computer/holder
|
||||
var/passive_charging_rate = 250 // W
|
||||
var/passive_charging_rate = 250 // W
|
||||
|
||||
/obj/item/computer_hardware/tesla_link/Destroy()
|
||||
if(holder2 && (holder2.tesla_link == src))
|
||||
holder2.tesla_link = null
|
||||
return ..()
|
||||
if(parent_computer?.tesla_link == src)
|
||||
parent_computer.tesla_link = null
|
||||
return ..()
|
||||
Reference in New Issue
Block a user