the unexpected paperwork update. paperwork rp? And also includes ntnet upgrade because fuck it.
This commit is contained in:
@@ -10,9 +10,11 @@
|
||||
// Computer that holds this hardware, if any.
|
||||
|
||||
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 = 0 // Prevent disabling for important component, like the CPU.
|
||||
var/can_install = 1 // Prevents direct installation of removable media.
|
||||
var/enabled = TRUE // If the hardware is turned off set this to 0.
|
||||
var/critical = FALSE // Prevent disabling for important component, like the CPU.
|
||||
var/can_install = TRUE // Prevents direct installation of removable media.
|
||||
var/expansion_hw = FALSE // Hardware that fits into expansion bays.
|
||||
var/removable = TRUE // Whether the hardware is removable or not.
|
||||
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
|
||||
@@ -20,7 +22,7 @@
|
||||
var/malfunction_probability = 10// Chance of malfunction when the component is damaged
|
||||
var/device_type
|
||||
|
||||
/obj/item/computer_hardware/New(var/obj/L)
|
||||
/obj/item/computer_hardware/New(obj/L)
|
||||
..()
|
||||
pixel_x = rand(-8, 8)
|
||||
pixel_y = rand(-8, 8)
|
||||
@@ -56,7 +58,7 @@
|
||||
return TRUE
|
||||
|
||||
// Called on multitool click, prints diagnostic information to the user.
|
||||
/obj/item/computer_hardware/proc/diagnostics(var/mob/user)
|
||||
/obj/item/computer_hardware/proc/diagnostics(mob/user)
|
||||
to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]")
|
||||
|
||||
// Handles damage checks
|
||||
@@ -73,7 +75,7 @@
|
||||
|
||||
return TRUE // Good to go.
|
||||
|
||||
/obj/item/computer_hardware/examine(var/mob/user)
|
||||
/obj/item/computer_hardware/examine(mob/user)
|
||||
. = ..()
|
||||
if(damage > damage_failure)
|
||||
. += "<span class='danger'>It seems to be severely damaged!</span>"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "card_mini"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
device_type = MC_AI
|
||||
expansion_hw = TRUE
|
||||
|
||||
var/obj/item/aicard/stored_card = null
|
||||
var/locked = FALSE
|
||||
@@ -19,12 +20,6 @@
|
||||
if(stored_card)
|
||||
. += "There appears to be an intelliCard loaded. There appears to be a pinhole protecting a manual eject button. A screwdriver could probably press it."
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/on_install(obj/item/modular_computer/M, mob/living/user = null)
|
||||
M.add_verb(device_type)
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/on_remove(obj/item/modular_computer/M, mob/living/user = null)
|
||||
M.remove_verb(device_type)
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/try_insert(obj/item/I, mob/living/user = null)
|
||||
if(!holder)
|
||||
return FALSE
|
||||
@@ -44,7 +39,7 @@
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/try_eject(slot=0,mob/living/user = null,forced = 0)
|
||||
/obj/item/computer_hardware/ai_slot/try_eject(mob/living/user = null,forced = FALSE)
|
||||
if(!stored_card)
|
||||
to_chat(user, "<span class='warning'>There is no card in \the [src].</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/obj/item/computer_hardware/battery/handle_atom_del(atom/A)
|
||||
if(A == battery)
|
||||
try_eject(0, null, TRUE)
|
||||
try_eject(forced = TRUE)
|
||||
. = ..()
|
||||
|
||||
/obj/item/computer_hardware/battery/try_insert(obj/item/I, mob/living/user = null)
|
||||
@@ -48,7 +48,7 @@
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/computer_hardware/battery/try_eject(slot=0, mob/living/user = null, forced = 0)
|
||||
/obj/item/computer_hardware/battery/try_eject(mob/living/user = null, forced = FALSE)
|
||||
if(!battery)
|
||||
to_chat(user, "<span class='warning'>There is no power cell connected to \the [src].</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
device_type = MC_CARD
|
||||
|
||||
var/obj/item/card/id/stored_card = null
|
||||
var/obj/item/card/id/stored_card2 = null
|
||||
|
||||
/obj/item/computer_hardware/card_slot/handle_atom_del(atom/A)
|
||||
if(A == stored_card)
|
||||
try_eject(1, null, TRUE)
|
||||
if(A == stored_card2)
|
||||
try_eject(2, null, TRUE)
|
||||
try_eject(null, TRUE)
|
||||
. = ..()
|
||||
|
||||
/obj/item/computer_hardware/card_slot/Destroy()
|
||||
@@ -21,37 +18,25 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/computer_hardware/card_slot/GetAccess()
|
||||
if(stored_card && stored_card2) // Best of both worlds
|
||||
return (stored_card.GetAccess() | stored_card2.GetAccess())
|
||||
else if(stored_card)
|
||||
return stored_card.GetAccess()
|
||||
else if(stored_card2)
|
||||
return stored_card2.GetAccess()
|
||||
return ..()
|
||||
var/list/total_access
|
||||
if(stored_card)
|
||||
total_access = stored_card.GetAccess()
|
||||
var/obj/item/computer_hardware/card_slot/card_slot2 = holder?.all_components[MC_CARD2] //Best of both worlds
|
||||
if(card_slot2?.stored_card)
|
||||
total_access |= card_slot2.stored_card.GetAccess()
|
||||
return total_access
|
||||
|
||||
/obj/item/computer_hardware/card_slot/GetID()
|
||||
if(stored_card)
|
||||
return stored_card
|
||||
else if(stored_card2)
|
||||
return stored_card2
|
||||
return ..()
|
||||
|
||||
/obj/item/computer_hardware/card_slot/RemoveID()
|
||||
if(stored_card)
|
||||
. = stored_card
|
||||
if(!try_eject(1))
|
||||
if(!try_eject())
|
||||
return null
|
||||
return
|
||||
if(stored_card2)
|
||||
. = stored_card2
|
||||
if(!try_eject(2))
|
||||
return null
|
||||
|
||||
/obj/item/computer_hardware/card_slot/on_install(obj/item/modular_computer/M, mob/living/user = null)
|
||||
M.add_verb(device_type)
|
||||
|
||||
/obj/item/computer_hardware/card_slot/on_remove(obj/item/modular_computer/M, mob/living/user = null)
|
||||
M.remove_verb(device_type)
|
||||
|
||||
/obj/item/computer_hardware/card_slot/try_insert(obj/item/I, mob/living/user = null)
|
||||
if(!holder)
|
||||
@@ -60,8 +45,7 @@
|
||||
if(!istype(I, /obj/item/card/id))
|
||||
return FALSE
|
||||
|
||||
if(stored_card && stored_card2)
|
||||
to_chat(user, "<span class='warning'>You try to insert \the [I] into \the [src], but its slots are occupied.</span>")
|
||||
if(stored_card)
|
||||
return FALSE
|
||||
if(user)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
@@ -69,11 +53,8 @@
|
||||
else
|
||||
I.forceMove(src)
|
||||
|
||||
if(!stored_card)
|
||||
stored_card = I
|
||||
else
|
||||
stored_card2 = I
|
||||
to_chat(user, "<span class='notice'>You insert \the [I] into \the [src].</span>")
|
||||
stored_card = I
|
||||
to_chat(user, "<span class='notice'>You insert \the [I] into \the [expansion_hw ? "secondary":"primary"] [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
@@ -82,53 +63,58 @@
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/computer_hardware/card_slot/try_eject(slot=0, mob/living/user = null, forced = 0)
|
||||
if(!stored_card && !stored_card2)
|
||||
/obj/item/computer_hardware/card_slot/try_eject(mob/living/user = null, forced = FALSE)
|
||||
if(!stored_card)
|
||||
to_chat(user, "<span class='warning'>There are no cards in \the [src].</span>")
|
||||
return FALSE
|
||||
|
||||
var/ejected = 0
|
||||
if(stored_card && (!slot || slot == 1))
|
||||
if(user)
|
||||
user.put_in_hands(stored_card)
|
||||
else
|
||||
stored_card.forceMove(drop_location())
|
||||
stored_card = null
|
||||
ejected++
|
||||
if(user)
|
||||
user.put_in_hands(stored_card)
|
||||
else
|
||||
stored_card.forceMove(drop_location())
|
||||
stored_card = null
|
||||
|
||||
if(stored_card2 && (!slot || slot == 2))
|
||||
if(user)
|
||||
user.put_in_hands(stored_card2)
|
||||
else
|
||||
stored_card2.forceMove(drop_location())
|
||||
stored_card2 = null
|
||||
ejected++
|
||||
if(holder)
|
||||
if(holder.active_program)
|
||||
holder.active_program.event_idremoved(0)
|
||||
|
||||
if(ejected)
|
||||
if(holder)
|
||||
if(holder.active_program)
|
||||
holder.active_program.event_idremoved(0, slot)
|
||||
|
||||
for(var/I in holder.idle_threads)
|
||||
var/datum/computer_file/program/P = I
|
||||
P.event_idremoved(1, slot)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.sec_hud_set_ID()
|
||||
to_chat(user, "<span class='notice'>You remove the card[ejected>1 ? "s" : ""] from \the [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
return FALSE
|
||||
for(var/p in holder.idle_threads)
|
||||
var/datum/computer_file/program/computer_program = p
|
||||
computer_program.event_idremoved(1)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
human_user.sec_hud_set_ID()
|
||||
to_chat(user, "<span class='notice'>You remove the card from \the [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
|
||||
/obj/item/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user)
|
||||
if(..())
|
||||
return
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
|
||||
try_eject(0,user)
|
||||
return
|
||||
if(stored_card)
|
||||
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
|
||||
try_eject(user)
|
||||
return
|
||||
swap_slot()
|
||||
to_chat(user, "<span class='notice'>You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"].</span>")
|
||||
|
||||
/**
|
||||
*Swaps the card_slot hardware between using the dedicated card slot bay on a computer, and using an expansion bay.
|
||||
*/
|
||||
/obj/item/computer_hardware/card_slot/proc/swap_slot()
|
||||
expansion_hw = !expansion_hw
|
||||
if(expansion_hw)
|
||||
device_type = MC_CARD2
|
||||
else
|
||||
device_type = MC_CARD
|
||||
|
||||
/obj/item/computer_hardware/card_slot/examine(mob/user)
|
||||
. = ..()
|
||||
if(stored_card || stored_card2)
|
||||
. += "The connector is set to fit into [expansion_hw ? "an expansion bay" : "a computer's primary ID bay"], but can be adjusted with a screwdriver."
|
||||
if(stored_card)
|
||||
. += "There appears to be something loaded in the card slots."
|
||||
|
||||
/obj/item/computer_hardware/card_slot/secondary
|
||||
device_type = MC_CARD2
|
||||
expansion_hw = TRUE
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
. = ..()
|
||||
. += "<span class='notice'>It has [max_capacity] GQ of storage capacity.</span>"
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/diagnostics(var/mob/user)
|
||||
/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(var/datum/computer_file/F)
|
||||
/obj/item/computer_hardware/hard_drive/proc/store_file(datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
return 0
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
return 1
|
||||
|
||||
// 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)
|
||||
/obj/item/computer_hardware/hard_drive/proc/remove_file(datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
return 0
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
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(var/datum/computer_file/F)
|
||||
/obj/item/computer_hardware/hard_drive/proc/can_store_file(datum/computer_file/F)
|
||||
if(!F || !istype(F))
|
||||
return 0
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
|
||||
// Tries to find the file by filename. Returns null on failure
|
||||
/obj/item/computer_hardware/hard_drive/proc/find_file_by_name(var/filename)
|
||||
/obj/item/computer_hardware/hard_drive/proc/find_file_by_name(filename)
|
||||
if(!check_functionality())
|
||||
return null
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
device_type = MC_NET
|
||||
var/static/ntnet_card_uid = 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]")
|
||||
@@ -22,7 +22,7 @@
|
||||
if(ethernet)
|
||||
to_chat(user, "OpenEth (Physical Connection) - Physical network connection port")
|
||||
|
||||
/obj/item/computer_hardware/network_card/New(var/l)
|
||||
/obj/item/computer_hardware/network_card/New(l)
|
||||
..()
|
||||
identification_id = ntnet_card_uid++
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
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)
|
||||
/obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0)
|
||||
if(!holder) // Hardware is not installed in anything. No signal. How did this even get called?
|
||||
return 0
|
||||
|
||||
|
||||
@@ -8,12 +8,8 @@
|
||||
max_capacity = 16
|
||||
device_type = MC_SDD
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/portable/on_install(obj/item/modular_computer/M, mob/living/user = null)
|
||||
M.add_verb(device_type)
|
||||
|
||||
/obj/item/computer_hardware/hard_drive/portable/on_remove(obj/item/modular_computer/M, mob/living/user = null)
|
||||
..()
|
||||
M.remove_verb(device_type)
|
||||
/obj/item/computer_hardware/hard_drive/portable/on_remove(obj/item/modular_computer/MC, 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
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "printer"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
device_type = MC_PRINT
|
||||
expansion_hw = TRUE
|
||||
var/stored_paper = 20
|
||||
var/max_paper = 30
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//This item doesn't do much on its own, but is required by apps such as AtmoZphere.
|
||||
/obj/item/computer_hardware/sensorpackage
|
||||
name = "sensor package"
|
||||
desc = "An integrated sensor package allowing a computer to take readings from the environment. Required by certain programs."
|
||||
icon_state = "servo"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
device_type = MC_SENSORS
|
||||
expansion_hw = TRUE
|
||||
Reference in New Issue
Block a user