mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 09:31:30 +00:00
Updates Part Five
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
desc = "A standard power cell, commonly seen in high-end portable microcomputers or low-end laptops. It's rating is 750."
|
||||
icon_state = "battery_normal"
|
||||
critical = 1
|
||||
|
||||
malfunction_probability = 1
|
||||
var/battery_rating = 750
|
||||
var/obj/item/weapon/cell/battery = null
|
||||
|
||||
@@ -50,7 +50,9 @@
|
||||
hardware_size = 1
|
||||
battery_rating = 1000000
|
||||
|
||||
|
||||
/obj/item/weapon/computer_hardware/battery_module/diagnostics(var/mob/user)
|
||||
..()
|
||||
user << "Internal battery charge: [battery.charge]/[battery.maxcharge] CU"
|
||||
|
||||
/obj/item/weapon/computer_hardware/battery_module/New()
|
||||
battery = new/obj/item/weapon/cell(src)
|
||||
|
||||
@@ -49,6 +49,12 @@
|
||||
icon_state = "hdd_micro"
|
||||
hardware_size = 1
|
||||
|
||||
/obj/item/weapon/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.
|
||||
user << "NT-NFS File Table Status: [stored_files.len]/999"
|
||||
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/weapon/computer_hardware/hard_drive/proc/store_file(var/datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
@@ -57,6 +63,9 @@
|
||||
if(!can_store_file(F.size))
|
||||
return 0
|
||||
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
if(!stored_files)
|
||||
return 0
|
||||
|
||||
@@ -84,6 +93,9 @@
|
||||
if(!stored_files)
|
||||
return 0
|
||||
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
if(F in stored_files)
|
||||
stored_files -= F
|
||||
recalculate_size()
|
||||
@@ -124,6 +136,9 @@
|
||||
|
||||
// Tries to find the file by filename. Returns null on failure
|
||||
/obj/item/weapon/computer_hardware/hard_drive/proc/find_file_by_name(var/filename)
|
||||
if(!check_functionality())
|
||||
return null
|
||||
|
||||
if(!filename)
|
||||
return null
|
||||
|
||||
|
||||
@@ -3,12 +3,51 @@
|
||||
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/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
|
||||
|
||||
/obj/item/weapon/computer_hardware/attackby(var/obj/item/W as obj, var/mob/living/user as mob)
|
||||
// Multitool. Runs diagnostics
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
user << "***** DIAGNOSTICS REPORT *****"
|
||||
diagnostics(user)
|
||||
user << "******************************"
|
||||
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)
|
||||
user << "\The [src] doesn't seem to require repairs."
|
||||
return 1
|
||||
if(S.use(1))
|
||||
user << "You apply a bit of \the [W] to \the [src]. It immediately repairs all damage."
|
||||
damage = 0
|
||||
return 1
|
||||
// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
|
||||
if(istype(S, /obj/item/stack/cable_coil))
|
||||
if(!damage)
|
||||
user << "\The [src] doesn't seem to require repairs."
|
||||
return 1
|
||||
if(S.use(1))
|
||||
user << "You patch up \the [src] with a bit of \the [W]."
|
||||
take_damage(-10)
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
|
||||
// Called on multitool click, prints diagnostic information to the user.
|
||||
/obj/item/weapon/computer_hardware/proc/diagnostics(var/mob/user)
|
||||
user << "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]"
|
||||
|
||||
/obj/item/weapon/computer_hardware/New(var/obj/L)
|
||||
w_class = hardware_size
|
||||
if(istype(L, /obj/machinery/modular_computer))
|
||||
var/obj/machinery/modular_computer/C = L
|
||||
if(C.cpu)
|
||||
@@ -20,4 +59,30 @@
|
||||
|
||||
/obj/item/weapon/computer_hardware/Destroy()
|
||||
holder2 = null
|
||||
..()
|
||||
return ..()
|
||||
|
||||
// Handles damage checks
|
||||
/obj/item/weapon/computer_hardware/proc/check_functionality()
|
||||
// Too damaged to work at all.
|
||||
if(damage > damage_failure)
|
||||
return 0
|
||||
// Still working. Well, sometimes...
|
||||
if(damage > damage_malfunction)
|
||||
if(prob(malfunction_probability))
|
||||
return 0
|
||||
// Good to go.
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/computer_hardware/examine(var/mob/user)
|
||||
. = ..()
|
||||
if(damage > damage_failure)
|
||||
user << "<span class='danger'>It seems to be severely damaged!</span>"
|
||||
else if(damage > damage_malfunction)
|
||||
user << "<span class='notice'>It seems to be damaged!</span>"
|
||||
else if(damage)
|
||||
user << "It seems to be slightly damaged."
|
||||
|
||||
// Damages the component. Contains necessary checks. Negative damage "heals" the component.
|
||||
/obj/item/weapon/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.
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
/obj/item/weapon/computer_hardware/nano_printer
|
||||
name = "nano printer"
|
||||
desc = "Small integrated printer with scanner and paper recycling module."
|
||||
desc = "Small integrated printer with paper recycling module."
|
||||
power_usage = 50
|
||||
critical = 0
|
||||
icon_state = "printer"
|
||||
hardware_size = 1
|
||||
var/stored_paper = 5
|
||||
var/max_paper = 10
|
||||
var/obj/item/weapon/paper/P = null // Currently stored paper for scanning.
|
||||
|
||||
/obj/item/weapon/computer_hardware/nano_printer/diagnostics(var/mob/user)
|
||||
..()
|
||||
user << "Paper buffer level: [stored_paper]/[max_paper]"
|
||||
|
||||
/obj/item/weapon/computer_hardware/nano_printer/proc/print_text(var/text_to_print, var/paper_title = null)
|
||||
if(!stored_paper)
|
||||
return 0
|
||||
if(!enabled)
|
||||
return 0
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
// Recycle stored paper
|
||||
if(P)
|
||||
stored_paper++
|
||||
qdel(P)
|
||||
P = null
|
||||
var/obj/item/weapon/paper/P = new/obj/item/weapon/paper(get_turf(holder2))
|
||||
|
||||
P = new/obj/item/weapon/paper(get_turf(holder2))
|
||||
P.info = text_to_print
|
||||
// Damaged printer causes the resulting paper to be somewhat harder to read.
|
||||
if(damage > damage_malfunction)
|
||||
P.info = stars(text_to_print, 100-malfunction_probability)
|
||||
else
|
||||
P.info = text_to_print
|
||||
if(paper_title)
|
||||
P.name = paper_title
|
||||
P.update_icon()
|
||||
@@ -29,34 +34,18 @@
|
||||
P = null
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/computer_hardware/nano_printer/proc/load_paper(var/obj/item/weapon/paper/paper)
|
||||
if(!paper || !istype(paper))
|
||||
return 0
|
||||
/obj/item/weapon/computer_hardware/nano_printer/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/paper))
|
||||
if(stored_paper >= max_paper)
|
||||
user << "You try to add \the [W] into [src], but it's paper bin is full"
|
||||
return
|
||||
|
||||
// We already have paper loaded, recycle it.
|
||||
if(P && try_recycle_paper())
|
||||
P = paper
|
||||
P.forceMove(holder2)
|
||||
|
||||
/obj/item/weapon/computer_hardware/nano_printer/proc/try_recycle_paper()
|
||||
if(!P)
|
||||
return 0
|
||||
|
||||
if(stored_paper >= max_paper)
|
||||
return 0
|
||||
|
||||
qdel(P)
|
||||
P = null
|
||||
return 1
|
||||
user << "You insert \the [W] into [src]."
|
||||
qdel(W)
|
||||
stored_paper++
|
||||
|
||||
/obj/item/weapon/computer_hardware/nano_printer/Destroy()
|
||||
if(holder2 && (holder2.nano_printer == src))
|
||||
holder2.nano_printer = null
|
||||
if(P)
|
||||
if(holder2)
|
||||
P.forceMove(get_turf(holder2))
|
||||
else
|
||||
qdel(P)
|
||||
P = null
|
||||
holder2 = null
|
||||
..()
|
||||
@@ -11,6 +11,18 @@ var/global/ntnet_card_uid = 1
|
||||
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.
|
||||
malfunction_probability = 1
|
||||
|
||||
/obj/item/weapon/computer_hardware/network_card/diagnostics(var/mob/user)
|
||||
..()
|
||||
user << "NIX Unique ID: [identification_id]"
|
||||
user << "NIX User Tag: [identification_string]"
|
||||
user << "Supported protocols:"
|
||||
user << "511.m SFS (Subspace) - Standard Frequency Spread"
|
||||
if(long_range)
|
||||
user << "511.n WFS/HB (Subspace) - Wide Frequency Spread/High Bandiwdth"
|
||||
if(ethernet)
|
||||
user << "OpenEth (Physical Connection) - Physical network connection port"
|
||||
|
||||
/obj/item/weapon/computer_hardware/network_card/New(var/l)
|
||||
..(l)
|
||||
@@ -27,7 +39,7 @@ var/global/ntnet_card_uid = 1
|
||||
|
||||
/obj/item/weapon/computer_hardware/network_card/wired
|
||||
name = "wired NTNet network card"
|
||||
desc = "An advanced network card for usage with NTNet. This one uses wired connection."
|
||||
desc = "An advanced network card for usage with standard NTNet frequencies. This one also supports wired connection."
|
||||
ethernet = 1
|
||||
power_usage = 100 // Better range but higher power usage.
|
||||
icon_state = "netcard_ethernet"
|
||||
@@ -51,6 +63,9 @@ var/global/ntnet_card_uid = 1
|
||||
if(!enabled)
|
||||
return 0
|
||||
|
||||
if(!check_functionality())
|
||||
return 0
|
||||
|
||||
if(ethernet) // Computer is connected via wired connection.
|
||||
return 3
|
||||
|
||||
@@ -60,7 +75,11 @@ var/global/ntnet_card_uid = 1
|
||||
if(holder2)
|
||||
var/turf/T = get_turf(holder2)
|
||||
if((T && istype(T)) && T.z in using_map.station_levels)
|
||||
return 2
|
||||
// Computer is on station. Low/High signal depending on what type of network card you have
|
||||
if(long_range)
|
||||
return 2
|
||||
else
|
||||
return 1
|
||||
|
||||
if(long_range) // Computer is not on station, but it has upgraded network card. Low signal.
|
||||
return 1
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
hardware_size = 2
|
||||
power_usage = 50
|
||||
critical = 1
|
||||
malfunction_probability = 1
|
||||
|
||||
var/max_idle_programs = 2 // 2 idle, + 1 active = 3 as said in description.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user