the unexpected paperwork update. paperwork rp? And also includes ntnet upgrade because fuck it.

This commit is contained in:
Letter N
2020-08-20 19:40:47 +08:00
parent 2dd3d71b19
commit 8d70e21239
80 changed files with 1080 additions and 727 deletions
@@ -44,18 +44,20 @@
. += "It has a slot installed for an intelliCard."
var/obj/item/computer_hardware/card_slot/card_slot = get_modular_computer_part(MC_CARD)
var/obj/item/computer_hardware/card_slot/card_slot2 = get_modular_computer_part(MC_CARD2)
var/multiple_slots = istype(card_slot) && istype(card_slot2)
if(card_slot)
if(card_slot.stored_card || card_slot.stored_card2)
if(card_slot.stored_card || card_slot2.stored_card)
var/obj/item/card/id/first_ID = card_slot.stored_card
var/obj/item/card/id/second_ID = card_slot.stored_card2
var/obj/item/card/id/second_ID = card_slot2.stored_card
var/multiple_cards = istype(first_ID) && istype(second_ID)
if(user_is_adjacent)
. += "It has two slots for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
else
. += "It has two slots for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
. += "<span class='info'>Alt-click [src] to eject the identification card[multiple_cards ? "s":""].</span>"
else
. += "It has two slots installed for identification cards."
. += "It has [multiple_slots ? "two slots" : "a slot"] installed for identification cards."
var/obj/item/computer_hardware/printer/printer_slot = get_modular_computer_part(MC_PRINT)
if(printer_slot)
@@ -4,6 +4,12 @@
/obj/item/modular_computer
name = "modular microcomputer"
desc = "A small portable microcomputer."
icon = 'icons/obj/computer.dmi'
icon_state = "laptop-open"
light_on = FALSE
integrity_failure = 0.5
max_integrity = 100
armor = list("melee" = 0, "bullet" = 20, "laser" = 20, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
var/enabled = 0 // Whether the computer is turned on.
var/screen_on = 1 // Whether the computer is active/opened/it's screen is on.
@@ -22,8 +28,6 @@
// must have it's own DMI file. Icon states must be called exactly the same in all files, but may look differently
// If you create a program which is limited to Laptops and Consoles you don't have to add it's icon_state overlay for Tablets too, for example.
icon = 'icons/obj/computer.dmi'
icon_state = "laptop-open"
var/icon_state_unpowered = null // Icon state when the computer is turned off.
var/icon_state_powered = null // Icon state when the computer is turned on.
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
@@ -31,20 +35,16 @@
var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4.
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
integrity_failure = 0.5
max_integrity = 100
armor = list("melee" = 0, "bullet" = 20, "laser" = 20, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
// Important hardware (must be installed for computer to work)
// Optional hardware (improves functionality, but is not critical for computer to work)
var/list/all_components = list() // List of "connection ports" in this computer and the components with which they are plugged
/// List of "connection ports" in this computer and the components with which they are plugged
var/list/all_components = list()
/// Lazy List of extra hardware slots that can be used modularly.
var/list/expansion_bays
/// Number of total expansion bays this computer has available.
var/max_bays = 0
var/list/idle_threads // Idle programs on background. They still receive process calls but can't be interacted with.
var/obj/physical = null // Object that represents our computer. It's used for Adjacent() and UI visibility checks.
var/has_light = FALSE //If the computer has a flashlight/LED light/what-have-you installed
var/light_on = FALSE //If that light is enabled
var/comp_light_luminosity = 3 //The brightness of that light
var/comp_light_color //The color of that light
@@ -71,80 +71,15 @@
physical = null
return ..()
/obj/item/modular_computer/proc/add_verb(var/path)
switch(path)
if(MC_CARD)
verbs += /obj/item/modular_computer/proc/eject_id
if(MC_SDD)
verbs += /obj/item/modular_computer/proc/eject_disk
if(MC_AI)
verbs += /obj/item/modular_computer/proc/eject_card
/obj/item/modular_computer/proc/remove_verb(path)
switch(path)
if(MC_CARD)
verbs -= /obj/item/modular_computer/proc/eject_id
if(MC_SDD)
verbs -= /obj/item/modular_computer/proc/eject_disk
if(MC_AI)
verbs -= /obj/item/modular_computer/proc/eject_card
// Eject ID card from computer, if it has ID slot with card inside.
/obj/item/modular_computer/proc/eject_id()
set name = "Eject ID"
set category = "Object"
set src in view(1)
if(issilicon(usr))
return
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
if(usr.canUseTopic(src, BE_CLOSE))
card_slot.try_eject(null, usr)
// Eject ID card from computer, if it has ID slot with card inside.
/obj/item/modular_computer/proc/eject_card()
set name = "Eject Intellicard"
set category = "Object"
if(issilicon(usr))
return
var/obj/item/computer_hardware/ai_slot/ai_slot = all_components[MC_AI]
if(usr.canUseTopic(src, BE_CLOSE))
ai_slot.try_eject(null, usr,1)
// Eject ID card from computer, if it has ID slot with card inside.
/obj/item/modular_computer/proc/eject_disk()
set name = "Eject Data Disk"
set category = "Object"
if(issilicon(usr))
return
if(usr.canUseTopic(src, BE_CLOSE))
var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD]
if(uninstall_component(portable_drive, usr))
portable_drive.verb_pickup()
/obj/item/modular_computer/AltClick(mob/user)
..()
if(issilicon(user))
return
if(user.canUseTopic(src, BE_CLOSE))
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
var/obj/item/computer_hardware/ai_slot/ai_slot = all_components[MC_AI]
var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD]
if(portable_drive)
if(uninstall_component(portable_drive, user))
portable_drive.verb_pickup()
else
if(card_slot && card_slot.try_eject(null, user))
return
if(ai_slot)
ai_slot.try_eject(null, user)
return (card_slot2?.try_eject(user) || card_slot?.try_eject(user)) //Try the secondary one first.
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs.
/obj/item/modular_computer/GetAccess()
@@ -160,19 +95,25 @@
return ..()
/obj/item/modular_computer/RemoveID()
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
if(!card_slot)
return
return card_slot.RemoveID()
return (card_slot2?.try_eject() || card_slot?.try_eject()) //Try the secondary one first.
/obj/item/modular_computer/InsertID(obj/item/inserting_item)
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
if(!card_slot)
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
if(!(card_slot || card_slot2))
//to_chat(user, "<span class='warning'>There isn't anywhere you can fit a card into on this computer.</span>")
return FALSE
var/obj/item/card/inserting_id = inserting_item.RemoveID()
if(!inserting_id)
return FALSE
return card_slot.try_insert(inserting_id)
if((card_slot?.try_insert(inserting_id)) || (card_slot2?.try_insert(inserting_id)))
return TRUE
//to_chat(user, "<span class='warning'>This computer doesn't have an open card slot.</span>")
return FALSE
/obj/item/modular_computer/MouseDrop(obj/over_object, src_location, over_location)
var/mob/M = usr
@@ -189,7 +130,7 @@
return
if(enabled)
ui_interact(user)
else if(IsAdminGhost(user))
else if(isAdminGhostAI(user))
var/response = alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", "Yes", "No")
if(response == "Yes")
turn_on(user)
@@ -6,6 +6,14 @@
to_chat(user, "<span class='warning'>This component is too large for \the [src]!</span>")
return FALSE
if(H.expansion_hw)
if(LAZYLEN(expansion_bays) >= max_bays)
to_chat(user, "<span class='warning'>All of the computer's expansion bays are filled.</span>")
return FALSE
if(LAZYACCESS(expansion_bays, H.device_type))
to_chat(user, "<span class='warning'>The computer immediately ejects /the [H] and flashes an error: \"Hardware Address Conflict\".</span>")
return FALSE
if(all_components[H.device_type])
to_chat(user, "<span class='warning'>This computer's hardware slot is already occupied by \the [all_components[H.device_type]].</span>")
return FALSE
@@ -20,6 +28,8 @@
if(user && !user.transferItemToLoc(H, src))
return FALSE
if(H.expansion_hw)
LAZYSET(expansion_bays, H.device_type, H)
all_components[H.device_type] = H
to_chat(user, "<span class='notice'>You install \the [H] into \the [src].</span>")
@@ -32,7 +42,9 @@
/obj/item/modular_computer/proc/uninstall_component(obj/item/computer_hardware/H, mob/living/user = null)
if(H.holder != src) // Not our component at all.
return FALSE
if(H.expansion_hw)
LAZYREMOVE(expansion_bays, H.device_type)
all_components.Remove(H.device_type)
to_chat(user, "<span class='notice'>You remove \the [H] from \the [src].</span>")
@@ -43,6 +55,7 @@
if(enabled && !use_power())
shutdown_computer()
update_icon()
return TRUE
// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null
@@ -44,6 +44,33 @@
/obj/item/modular_computer/ui_data(mob/user)
var/list/data = get_header_data()
data["device_theme"] = device_theme
data["login"] = list()
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD]
if(cardholder)
var/obj/item/card/id/stored_card = cardholder.GetID()
if(stored_card)
var/stored_name = stored_card.registered_name
var/stored_title = stored_card.assignment
if(!stored_name)
stored_name = "Unknown"
if(!stored_title)
stored_title = "Unknown"
data["login"] = list(
IDName = stored_name,
IDJob = stored_title,
)
data["removable_media"] = list()
if(all_components[MC_SDD])
data["removable_media"] += "removable storage disk"
var/obj/item/computer_hardware/ai_slot/intelliholder = all_components[MC_AI]
if(intelliholder?.stored_card)
data["removable_media"] += "intelliCard"
var/obj/item/computer_hardware/card_slot/secondarycardholder = all_components[MC_CARD2]
if(secondarycardholder?.stored_card)
data["removable_media"] += "secondary RFID card"
data["programs"] = list()
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
for(var/datum/computer_file/program/P in hard_drive.stored_files)
@@ -157,6 +184,36 @@
light_color = new_color
update_light()
return TRUE
if("PC_Eject_Disk")
var/param = params["name"]
var/mob/user = usr
switch(param)
if("removable storage disk")
var/obj/item/computer_hardware/hard_drive/portable/portable_drive = all_components[MC_SDD]
if(!portable_drive)
return
if(uninstall_component(portable_drive, usr))
user.put_in_hands(portable_drive)
playsound(src, 'sound/machines/card_slide.ogg', 50)
if("intelliCard")
var/obj/item/computer_hardware/ai_slot/intelliholder = all_components[MC_AI]
if(!intelliholder)
return
if(intelliholder.try_eject(user))
playsound(src, 'sound/machines/card_slide.ogg', 50)
if("ID")
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD]
if(!cardholder)
return
cardholder.try_eject(user)
if("secondary RFID card")
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD2]
if(!cardholder)
return
cardholder.try_eject(user)
else
return
@@ -12,6 +12,7 @@
hardware_flag = PROGRAM_LAPTOP
max_hardware_size = 2
w_class = WEIGHT_CLASS_NORMAL
max_bays = 4
// No running around with open laptops in hands.
item_flags = SLOWS_WHILE_IN_HAND
@@ -8,6 +8,7 @@
icon_state_unpowered = null
icon_state_menu = null
hardware_flag = 0
max_bays = 4
var/obj/machinery/modular_computer/machinery_computer = null
@@ -18,7 +19,7 @@
machinery_computer = null
. = ..()
/obj/item/modular_computer/processor/New(comp) //intentional new probably
/obj/item/modular_computer/processor/New(comp)
..()
STOP_PROCESSING(SSobj, src) // Processed by its machine
@@ -56,23 +57,5 @@
machinery_computer.update_icon()
return
/obj/item/modular_computer/processor/add_verb(path)
switch(path)
if(MC_CARD)
machinery_computer.verbs += /obj/machinery/modular_computer/proc/eject_id
if(MC_SDD)
machinery_computer.verbs += /obj/machinery/modular_computer/proc/eject_disk
if(MC_AI)
machinery_computer.verbs += /obj/machinery/modular_computer/proc/eject_card
/obj/item/modular_computer/processor/remove_verb(path)
switch(path)
if(MC_CARD)
machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_id
if(MC_SDD)
machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_disk
if(MC_AI)
machinery_computer.verbs -= /obj/machinery/modular_computer/proc/eject_card
/obj/item/modular_computer/processor/attack_ghost(mob/user)
ui_interact(user)
@@ -5,10 +5,11 @@
icon_state_unpowered = "tablet"
icon_state_powered = "tablet"
icon_state_menu = "menu"
//worn_icon_state = "tablet"
// worn_icon_state = "tablet"
hardware_flag = PROGRAM_TABLET
max_hardware_size = 1
w_class = WEIGHT_CLASS_SMALL
max_bays = 3
steel_sheet_cost = 1
slot_flags = ITEM_SLOT_ID | ITEM_SLOT_BELT
has_light = TRUE //LED flashlight!
@@ -26,10 +26,20 @@
install_component(new /obj/item/computer_hardware/processor_unit/small)
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
install_component(hard_drive)
install_component(new /obj/item/computer_hardware/card_slot)
install_component(new /obj/item/computer_hardware/network_card)
install_component(new /obj/item/computer_hardware/printer/mini)
hard_drive.store_file(new /datum/computer_file/program/bounty)
//hard_drive.store_file(new /datum/computer_file/program/shipping)
hard_drive.store_file(new /datum/computer_file/program/shipping)
/obj/item/modular_computer/tablet/preset/advanced/atmos/Initialize() //This will be defunct and will be replaced when NtOS PDAs are done
. = ..()
install_component(new /obj/item/computer_hardware/sensorpackage)
/obj/item/modular_computer/tablet/preset/advanced/command/Initialize()
. = ..()
install_component(new /obj/item/computer_hardware/sensorpackage)
install_component(new /obj/item/computer_hardware/card_slot/secondary)
/// Given by the syndicate as part of the contract uplink bundle - loads in the Contractor Uplink.
/obj/item/modular_computer/tablet/syndicate_contract_uplink/preset/uplink/Initialize()
@@ -1,6 +1,6 @@
/obj/machinery/modular_computer/console/preset
// Can be changed to give devices specific hardware
var/_has_id_slot = FALSE
var/_has_second_id_slot = FALSE
var/_has_printer = FALSE
var/_has_battery = FALSE
var/_has_ai = FALSE
@@ -11,8 +11,9 @@
return
cpu.install_component(new /obj/item/computer_hardware/processor_unit)
if(_has_id_slot)
cpu.install_component(new /obj/item/computer_hardware/card_slot)
cpu.install_component(new /obj/item/computer_hardware/card_slot)
if(_has_second_id_slot)
cpu.install_component(new /obj/item/computer_hardware/card_slot/secondary)
if(_has_printer)
cpu.install_component(new /obj/item/computer_hardware/printer)
if(_has_battery)
@@ -59,7 +60,7 @@
console_department = "Command"
name = "command console"
desc = "A stationary computer. This one comes preloaded with command programs."
_has_id_slot = TRUE
_has_second_id_slot = TRUE
_has_printer = TRUE
/obj/machinery/modular_computer/console/preset/command/install_programs()
@@ -73,7 +74,7 @@
console_department = "Identification"
name = "identification console"
desc = "A stationary computer. This one comes preloaded with identification modification programs."
_has_id_slot = TRUE
_has_second_id_slot = TRUE
_has_printer = TRUE
/obj/machinery/modular_computer/console/preset/id/install_programs()
@@ -75,30 +75,6 @@
add_overlay("bsod")
add_overlay("broken")
// Eject ID card from computer, if it has ID slot with card inside.
/obj/machinery/modular_computer/proc/eject_id()
set name = "Eject ID"
set category = "Object"
if(cpu)
cpu.eject_id()
// Eject ID card from computer, if it has ID slot with card inside.
/obj/machinery/modular_computer/proc/eject_disk()
set name = "Eject Data Disk"
set category = "Object"
if(cpu)
cpu.eject_disk()
/obj/machinery/modular_computer/proc/eject_card()
set name = "Eject Intellicard"
set category = "Object"
set src in view(1)
if(cpu)
cpu.eject_card()
/obj/machinery/modular_computer/AltClick(mob/user)
if(cpu)
cpu.AltClick(user)
@@ -136,7 +112,7 @@
return
. = ..()
/obj/machinery/modular_computer/attackby(var/obj/item/W as obj, mob/user)
/obj/machinery/modular_computer/attackby(obj/item/W as obj, mob/user)
if(cpu && !(flags_1 & NODECONSTRUCT_1))
return cpu.attackby(W, user)
return ..()
@@ -169,5 +145,4 @@
// "Brute" damage mostly damages the casing.
/obj/machinery/modular_computer/bullet_act(obj/item/projectile/Proj)
if(cpu)
return cpu.bullet_act(Proj)
return ..()
cpu.bullet_act(Proj)