mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
Removes ID computer parts (Removes computer hardware) (#71320)
## About The Pull Request Removes the last computer part in the game: ID parts Because this is removed, I also removed all computer hardware in the game, and removed mentions of it in the game. There is still 'hardware', as in Computer, Tablet, or Laptop. Computers now all hold one ID slot by default, the only time a second ID was needed was to use the access of both at once, and for the ID modification application. This was now replaced with a new UI that only has one tab, one ID slot: https://user-images.githubusercontent.com/53777086/202801939-151b783f-75c8-46bf-a6c5-1b57b0d0da8e.mp4 ## Why It's Good For The Game Computer hardware is finally dead 🦀 ## Changelog 🆑 balance: All modular computers now only have one ID slot, and cannot be upgraded. qol: The HoP's access application now only has one app, logging in will directly modify the ID that's in it, making it less confusing to swap back and forth. /🆑
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar to GLOB.PDAs (used primarily with ntmessenger.dm)
|
||||
|
||||
// This is the base type that does all the hardware stuff.
|
||||
// This is the base type of computer
|
||||
// Other types expand it - tablets and laptops are subtypes
|
||||
// consoles use "procssor" item that is held inside it.
|
||||
/obj/item/modular_computer
|
||||
@@ -14,16 +14,20 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
armor = list(MELEE = 0, BULLET = 20, LASER = 20, ENERGY = 100, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0)
|
||||
light_system = MOVABLE_LIGHT_DIRECTIONAL
|
||||
|
||||
///The power cell the computer uses to run on.
|
||||
var/obj/item/stock_parts/cell/internal_cell = /obj/item/stock_parts/cell
|
||||
|
||||
///The ID currently stored in the computer.
|
||||
var/obj/item/card/id/computer_id_slot
|
||||
///The disk in this PDA. If set, this will be inserted on Initialize.
|
||||
var/obj/item/computer_disk/inserted_disk
|
||||
///The power cell the computer uses to run on.
|
||||
var/obj/item/stock_parts/cell/internal_cell = /obj/item/stock_parts/cell
|
||||
///A pAI currently loaded into the modular computer.
|
||||
var/obj/item/pai_card/inserted_pai
|
||||
|
||||
///The amount of storage space the computer starts with.
|
||||
var/max_capacity = 128
|
||||
///The amount of storage space we've got filled
|
||||
var/used_capacity = 0
|
||||
///List of stored files on this drive. DO NOT MODIFY DIRECTLY!
|
||||
///List of stored files on this drive. Use `store_file` and `remove_file` instead of modifying directly!
|
||||
var/list/datum/computer_file/stored_files = list()
|
||||
|
||||
///Non-static list of programs the computer should recieve on Initialize.
|
||||
@@ -35,13 +39,20 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
/datum/computer_file/program/filemanager,
|
||||
)
|
||||
|
||||
///The program currently active on the tablet.
|
||||
var/datum/computer_file/program/active_program
|
||||
///Idle programs on background. They still receive process calls but can't be interacted with.
|
||||
var/list/idle_threads = list()
|
||||
/// Amount of programs that can be ran at once
|
||||
var/max_idle_programs = 2
|
||||
|
||||
///Flag of the type of device the modular computer is, deciding what types of apps it can run.
|
||||
var/hardware_flag = NONE
|
||||
// Options: PROGRAM_ALL | PROGRAM_CONSOLE | PROGRAM_LAPTOP | PROGRAM_TABLET
|
||||
|
||||
///Whether the icon state should be bypassed entirely, used for PDAs.
|
||||
var/bypass_state = FALSE
|
||||
///The theme, used for the main menu, some hardware config, and file browser apps.
|
||||
///The theme, used for the main menu and file browser apps.
|
||||
var/device_theme = "ntos"
|
||||
|
||||
///Bool on whether the computer is currently active or not.
|
||||
@@ -63,12 +74,12 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
|
||||
///The last recorded amount of power used.
|
||||
var/last_power_usage = 0
|
||||
///Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too.
|
||||
///Power usage when the computer is open (screen is active) and can be interacted with.
|
||||
var/base_active_power_usage = 75
|
||||
///Power usage when the computer is idle and screen is off (currently only applies to laptops)
|
||||
var/base_idle_power_usage = 5
|
||||
|
||||
// Modular computers can run on various devices. Each DEVICE (Laptop, Console, Tablet,..)
|
||||
// Modular computers can run on various devices. Each DEVICE (Laptop, Console & Tablet)
|
||||
// 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.
|
||||
|
||||
@@ -77,41 +88,22 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
|
||||
var/display_overlays = TRUE // If FALSE, don't draw overlays on this device at all
|
||||
|
||||
/// 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
|
||||
///The w_class (size) hardware it can handle, laptops get extra, computers get more.
|
||||
var/max_hardware_size = 0
|
||||
|
||||
///The full name of the stored ID card's identity. These vars should probably be on the PDA.
|
||||
var/saved_identification
|
||||
///The job title of the stored ID card
|
||||
var/saved_job
|
||||
|
||||
///The program currently active on the tablet.
|
||||
var/datum/computer_file/program/active_program
|
||||
///Idle programs on background. They still receive process calls but can't be interacted with.
|
||||
var/list/idle_threads = list()
|
||||
/// Amount of programs that can be ran at once
|
||||
var/max_idle_programs = 2
|
||||
|
||||
///The 'computer' itself, as an obj. Primarily used for Adjacent() and UI visibility checks, especially for computers.
|
||||
var/obj/physical
|
||||
///Amount of steel sheets refunded when disassembling an empty frame of this computer.
|
||||
var/steel_sheet_cost = 5
|
||||
|
||||
///A pAI currently loaded into the modular computer.
|
||||
var/obj/item/pai_card/inserted_pai
|
||||
/// Allow people with chunky fingers to use?
|
||||
var/allow_chunky = FALSE
|
||||
|
||||
///If hit by a Clown virus, remaining honks left until it stops.
|
||||
var/honkvirus_amount = 0
|
||||
///Whether the PDA can still use NTNet while out of NTNet's reach.
|
||||
var/long_ranged = FALSE
|
||||
/// Allow people with chunky fingers to use?
|
||||
var/allow_chunky = FALSE
|
||||
|
||||
///The amount of paper currently stored in the PDA
|
||||
var/stored_paper = 10
|
||||
@@ -153,10 +145,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
wipe_program(forced = TRUE)
|
||||
for(var/datum/computer_file/program/idle as anything in idle_threads)
|
||||
idle.kill_program(TRUE)
|
||||
for(var/port in all_components)
|
||||
var/obj/item/computer_hardware/component = all_components[port]
|
||||
qdel(component)
|
||||
all_components?.Cut()
|
||||
//Some components will actually try and interact with this, so let's do it later
|
||||
QDEL_NULL(soundloop)
|
||||
QDEL_LIST(stored_files)
|
||||
@@ -166,6 +154,8 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
QDEL_NULL(inserted_disk)
|
||||
if(istype(inserted_pai))
|
||||
QDEL_NULL(inserted_pai)
|
||||
if(computer_id_slot)
|
||||
QDEL_NULL(computer_id_slot)
|
||||
|
||||
physical = null
|
||||
return ..()
|
||||
@@ -201,98 +191,37 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
return internal_cell
|
||||
|
||||
/obj/item/modular_computer/AltClick(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(issilicon(user))
|
||||
return
|
||||
return FALSE
|
||||
if(!user.canUseTopic(src, be_close = TRUE))
|
||||
return FALSE
|
||||
|
||||
if(user.canUseTopic(src, be_close = TRUE))
|
||||
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(RemoveID(user))
|
||||
return TRUE
|
||||
|
||||
if(istype(card_slot) && card_slot.stored_card && card_slot?.try_eject(user))
|
||||
return TRUE
|
||||
|
||||
if(istype(card_slot2) && card_slot2?.stored_card && card_slot2?.try_eject(user))
|
||||
return TRUE
|
||||
|
||||
if(istype(inserted_pai)) // Remove pAI
|
||||
user.put_in_hands(inserted_pai)
|
||||
balloon_alert(user, "removed pAI")
|
||||
inserted_pai = null
|
||||
return TRUE
|
||||
|
||||
if(!istype(src, /obj/item/modular_computer/tablet))
|
||||
return FALSE
|
||||
if(istype(inserted_pai)) // Remove pAI
|
||||
user.put_in_hands(inserted_pai)
|
||||
balloon_alert(user, "removed pAI")
|
||||
inserted_pai = null
|
||||
return TRUE
|
||||
|
||||
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs. //guess what
|
||||
/obj/item/modular_computer/GetAccess()
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
if(card_slot)
|
||||
return card_slot.GetAccess()
|
||||
if(computer_id_slot)
|
||||
return computer_id_slot.GetAccess()
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/GetID()
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
|
||||
|
||||
var/obj/item/card/id/first_id = card_slot?.GetID()
|
||||
var/obj/item/card/id/second_id = card_slot2?.GetID()
|
||||
|
||||
// We have two IDs, pick the one with the most command accesses, preferring the primary slot.
|
||||
if(first_id && second_id)
|
||||
var/first_id_tally = SSid_access.tally_access(first_id, ACCESS_FLAG_COMMAND)
|
||||
var/second_id_tally = SSid_access.tally_access(second_id, ACCESS_FLAG_COMMAND)
|
||||
|
||||
return (first_id_tally >= second_id_tally) ? first_id : second_id
|
||||
|
||||
// If we don't have both ID slots filled, pick the one that is filled.
|
||||
if(first_id)
|
||||
return first_id
|
||||
if(second_id)
|
||||
return second_id
|
||||
|
||||
// Otherwise, we have no ID at all.
|
||||
if(computer_id_slot)
|
||||
return computer_id_slot
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/get_id_examine_strings(mob/user)
|
||||
. = ..()
|
||||
|
||||
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/card/id/id_card1 = card_slot?.GetID()
|
||||
var/obj/item/card/id/id_card2 = card_slot2?.GetID()
|
||||
|
||||
if(id_card1 || id_card2)
|
||||
if(id_card1 && id_card2)
|
||||
. += "\The [src] is displaying [id_card1] and [id_card2]."
|
||||
var/list/id_icons = list()
|
||||
id_icons += id_card1.get_id_examine_strings(user)
|
||||
id_icons += id_card2.get_id_examine_strings(user)
|
||||
. += id_icons.Join(" ")
|
||||
else if(id_card1)
|
||||
. += "\The [src] is displaying [id_card1]."
|
||||
. += id_card1.get_id_examine_strings(user)
|
||||
else
|
||||
. += "\The [src] is displaying [id_card2]."
|
||||
. += id_card2.get_id_examine_strings(user)
|
||||
|
||||
/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]
|
||||
|
||||
var/removed_id = (card_slot2?.try_eject() || card_slot?.try_eject())
|
||||
if(removed_id)
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
if(human_wearer.wear_id == src)
|
||||
human_wearer.sec_hud_set_ID()
|
||||
update_slot_icon()
|
||||
update_appearance()
|
||||
|
||||
return removed_id
|
||||
|
||||
return ..()
|
||||
if(computer_id_slot)
|
||||
. += "\The [src] is displaying [computer_id_slot]."
|
||||
. += computer_id_slot.get_id_examine_strings(user)
|
||||
|
||||
/obj/item/modular_computer/proc/print_text(text_to_print, paper_title = "")
|
||||
if(!stored_paper)
|
||||
@@ -306,25 +235,61 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
stored_paper--
|
||||
return TRUE
|
||||
|
||||
/obj/item/modular_computer/InsertID(obj/item/inserting_item)
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
|
||||
|
||||
if(!(card_slot || card_slot2))
|
||||
/**
|
||||
* InsertID
|
||||
* Attempt to insert the ID in either card slot.
|
||||
* Args:
|
||||
* inserting_id - the ID being inserted
|
||||
* user - The person inserting the ID
|
||||
*/
|
||||
/obj/item/modular_computer/InsertID(obj/item/card/inserting_id, mob/user)
|
||||
//all slots taken
|
||||
if(computer_id_slot)
|
||||
return FALSE
|
||||
|
||||
var/obj/item/card/inserting_id = inserting_item.GetID()
|
||||
if(!inserting_id)
|
||||
return FALSE
|
||||
computer_id_slot = inserting_id
|
||||
if(user)
|
||||
if(!user.transferItemToLoc(inserting_id, src))
|
||||
return FALSE
|
||||
to_chat(user, span_notice("You insert \the [inserting_id] into the card slot."))
|
||||
else
|
||||
inserting_id.forceMove(src)
|
||||
|
||||
if((card_slot?.try_insert(inserting_id)) || (card_slot2?.try_insert(inserting_id)))
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
if(human_wearer.wear_id == src)
|
||||
human_wearer.sec_hud_set_ID()
|
||||
update_appearance()
|
||||
update_slot_icon()
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
if(human_wearer.wear_id == src)
|
||||
human_wearer.sec_hud_set_ID()
|
||||
update_appearance()
|
||||
update_slot_icon()
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Removes the ID card from the computer, and puts it in loc's hand if it's a mob
|
||||
* Args:
|
||||
* user - The mob trying to remove the ID, if there is one
|
||||
*/
|
||||
/obj/item/modular_computer/RemoveID(mob/user)
|
||||
if(!computer_id_slot)
|
||||
return ..()
|
||||
|
||||
if(user)
|
||||
if(!issilicon(user) && in_range(src, user))
|
||||
user.put_in_hands(computer_id_slot)
|
||||
balloon_alert(user, "removed ID")
|
||||
to_chat(user, span_notice("You remove the card from the card slot."))
|
||||
else
|
||||
computer_id_slot.forceMove(drop_location())
|
||||
|
||||
computer_id_slot = null
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
if(human_wearer.wear_id == src)
|
||||
human_wearer.sec_hud_set_ID()
|
||||
update_slot_icon()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/item/modular_computer/MouseDrop(obj/over_object, src_location, over_location)
|
||||
@@ -379,21 +344,12 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
. += "It is upgraded with an experimental long-ranged network capabilities, picking up NTNet frequencies while further away."
|
||||
. += span_notice("It has [max_capacity] GQ of storage capacity.")
|
||||
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
|
||||
var/multiple_slots = istype(card_slot) && istype(card_slot2)
|
||||
if(card_slot)
|
||||
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_slot2?.stored_card
|
||||
var/multiple_cards = (first_ID && second_ID)
|
||||
if(Adjacent(user))
|
||||
. += "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 || second_ID]"]."
|
||||
else
|
||||
. += "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_info("Alt-click [src] to eject the identification card[multiple_cards ? "s":""].")
|
||||
if(computer_id_slot)
|
||||
if(Adjacent(user))
|
||||
. += "It has \the [computer_id_slot] card installed in its card slot."
|
||||
else
|
||||
. += "It has [multiple_slots ? "two slots" : "a slot"] installed for identification cards."
|
||||
. += "Its identification card slot is currently occupied."
|
||||
. += span_info("Alt-click [src] to eject the identification card.")
|
||||
|
||||
/obj/item/modular_computer/examine_more(mob/user)
|
||||
. = ..()
|
||||
@@ -409,10 +365,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
/obj/item/modular_computer/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
|
||||
. = ..()
|
||||
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
var/obj/item/computer_hardware/card_slot/card_slot2 = all_components[MC_CARD2]
|
||||
|
||||
if(card_slot?.stored_card || card_slot2?.stored_card) // IDs get removed first before pAIs
|
||||
if(computer_id_slot) // ID get removed first before pAIs
|
||||
context[SCREENTIP_CONTEXT_ALT_LMB] = "Remove ID"
|
||||
. = CONTEXTUAL_SCREENTIP_SET
|
||||
else if(inserted_pai)
|
||||
@@ -450,6 +403,12 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
internal_cell = null
|
||||
if(enabled && !use_power())
|
||||
shutdown_computer()
|
||||
if(computer_id_slot == gone)
|
||||
computer_id_slot = null
|
||||
update_slot_icon()
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
human_wearer.sec_hud_set_ID()
|
||||
return ..()
|
||||
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
@@ -744,13 +703,12 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
|
||||
/obj/item/modular_computer/attackby(obj/item/attacking_item, mob/user, params)
|
||||
// Check for ID first
|
||||
if(isidcard(attacking_item) && InsertID(attacking_item))
|
||||
if(isidcard(attacking_item) && InsertID(attacking_item, user))
|
||||
return
|
||||
|
||||
// Check for cash next
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
|
||||
if(card_slot && iscash(attacking_item))
|
||||
var/obj/item/card/id/inserted_id = card_slot.GetID()
|
||||
if(computer_id_slot && iscash(attacking_item))
|
||||
var/obj/item/card/id/inserted_id = computer_id_slot.GetID()
|
||||
if(inserted_id)
|
||||
inserted_id.attackby(attacking_item, user) // If we do, try and put that attacking object in
|
||||
return
|
||||
@@ -807,13 +765,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
bin.update_appearance()
|
||||
return
|
||||
|
||||
|
||||
// Insert items into the components
|
||||
for(var/h in all_components)
|
||||
var/obj/item/computer_hardware/H = all_components[h]
|
||||
if(H.try_insert(attacking_item, user))
|
||||
return
|
||||
|
||||
// Insert a data disk
|
||||
if(istype(attacking_item, /obj/item/computer_disk))
|
||||
if(!user.transferItemToLoc(attacking_item, src))
|
||||
@@ -822,48 +773,10 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
playsound(src, 'sound/machines/card_slide.ogg', 50)
|
||||
return
|
||||
|
||||
// Insert new hardware
|
||||
if(istype(attacking_item, /obj/item/computer_hardware))
|
||||
if(install_component(attacking_item, user))
|
||||
playsound(src, 'sound/machines/card_slide.ogg', 50)
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/screwdriver_act(mob/user, obj/item/tool)
|
||||
. = ..()
|
||||
if((resistance_flags & INDESTRUCTIBLE) || (flags_1 & NODECONSTRUCT_1))
|
||||
return
|
||||
if(!length(all_components))
|
||||
balloon_alert(user, "no components installed!")
|
||||
return
|
||||
var/list/component_names = list()
|
||||
for(var/h in all_components)
|
||||
var/obj/item/computer_hardware/H = all_components[h]
|
||||
component_names.Add(H.name)
|
||||
|
||||
var/choice = tgui_input_list(user, "Component to uninstall", "Computer maintenance", sort_list(component_names))
|
||||
if(isnull(choice))
|
||||
if(internal_cell)
|
||||
user.put_in_hands(internal_cell)
|
||||
to_chat(user, span_notice("You detach \the [internal_cell] from \the [src]."))
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
|
||||
var/obj/item/computer_hardware/H = find_hardware_by_name(choice)
|
||||
if(!H)
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
|
||||
tool.play_tool_sound(src, user, 20, volume=20)
|
||||
uninstall_component(H, user)
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
|
||||
/obj/item/modular_computer/wrench_act(mob/living/user, obj/item/tool)
|
||||
. = ..()
|
||||
if(length(all_components))
|
||||
balloon_alert(user, "remove the other components!")
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
tool.play_tool_sound(src, user, 20, volume=20)
|
||||
new /obj/item/stack/sheet/iron(get_turf(loc), steel_sheet_cost)
|
||||
user.balloon_alert(user, "disassembled")
|
||||
@@ -871,7 +784,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
qdel(src)
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
|
||||
|
||||
/obj/item/modular_computer/welder_act(mob/living/user, obj/item/tool)
|
||||
. = ..()
|
||||
if(atom_integrity == max_integrity)
|
||||
@@ -889,6 +801,16 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
|
||||
update_appearance()
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
|
||||
/obj/item/modular_computer/deconstruct(disassembled = TRUE)
|
||||
break_apart()
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/proc/break_apart()
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
physical.visible_message(span_notice("\The [src] breaks apart!"))
|
||||
var/turf/newloc = get_turf(src)
|
||||
new /obj/item/stack/sheet/iron(newloc, round(steel_sheet_cost / 2))
|
||||
relay_qdel()
|
||||
|
||||
// Used by processor to relay qdel() to machinery type.
|
||||
/obj/item/modular_computer/proc/relay_qdel()
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/obj/item/modular_computer/proc/can_install_component(obj/item/computer_hardware/try_install, mob/living/user = null)
|
||||
if(!try_install.can_install(src, user))
|
||||
return FALSE
|
||||
|
||||
if(try_install.w_class > max_hardware_size)
|
||||
to_chat(user, span_warning("This component is too large for \the [src]!"))
|
||||
return FALSE
|
||||
|
||||
if(try_install.expansion_hw)
|
||||
if(LAZYLEN(expansion_bays) >= max_bays)
|
||||
to_chat(user, span_warning("All of the computer's expansion bays are filled."))
|
||||
return FALSE
|
||||
if(LAZYACCESS(expansion_bays, try_install.device_type))
|
||||
to_chat(user, span_warning("The computer immediately ejects /the [try_install] and flashes an error: \"Hardware Address Conflict\"."))
|
||||
return FALSE
|
||||
|
||||
if(all_components[try_install.device_type])
|
||||
to_chat(user, span_warning("This computer's hardware slot is already occupied by \the [all_components[try_install.device_type]]."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/// Installs component.
|
||||
/obj/item/modular_computer/proc/install_component(obj/item/computer_hardware/install, mob/living/user = null)
|
||||
if(!can_install_component(install, user))
|
||||
return FALSE
|
||||
|
||||
if(user && !user.transferItemToLoc(install, src))
|
||||
return FALSE
|
||||
|
||||
if(install.expansion_hw)
|
||||
LAZYSET(expansion_bays, install.device_type, install)
|
||||
all_components[install.device_type] = install
|
||||
|
||||
to_chat(user, span_notice("You install \the [install] into \the [src]."))
|
||||
install.holder = src
|
||||
install.forceMove(src)
|
||||
install.on_install(src, user)
|
||||
|
||||
|
||||
/// Uninstalls component.
|
||||
/obj/item/modular_computer/proc/uninstall_component(obj/item/computer_hardware/yeet, mob/living/user = null)
|
||||
if(yeet.holder != src) // Not our component at all.
|
||||
return FALSE
|
||||
|
||||
to_chat(user, span_notice("You remove \the [yeet] from \the [src]."))
|
||||
|
||||
yeet.forceMove(get_turf(src))
|
||||
forget_component(yeet)
|
||||
yeet.on_remove(src, user)
|
||||
if(enabled && !use_power())
|
||||
shutdown_computer()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/// This isn't the "uninstall fully" proc, it just makes the computer lose all its references to the component
|
||||
/obj/item/modular_computer/proc/forget_component(obj/item/computer_hardware/wipe_memory)
|
||||
if(wipe_memory.holder != src)
|
||||
return FALSE
|
||||
if(wipe_memory.expansion_hw)
|
||||
LAZYREMOVE(expansion_bays, wipe_memory.device_type)
|
||||
all_components.Remove(wipe_memory.device_type)
|
||||
wipe_memory.holder = null
|
||||
|
||||
/// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null
|
||||
/obj/item/modular_computer/proc/find_hardware_by_name(name)
|
||||
for(var/i in all_components)
|
||||
var/obj/component = all_components[i]
|
||||
if(component.name == name)
|
||||
return component
|
||||
return null
|
||||
@@ -1,32 +0,0 @@
|
||||
/obj/item/modular_computer/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
|
||||
. = ..()
|
||||
var/component_probability = min(50, max(damage_amount*0.1, 1 - atom_integrity/max_integrity))
|
||||
switch(damage_flag)
|
||||
if(BULLET)
|
||||
component_probability = damage_amount * 0.5
|
||||
if(LASER)
|
||||
component_probability = damage_amount * 0.66
|
||||
if(component_probability)
|
||||
for(var/I in all_components)
|
||||
var/obj/item/computer_hardware/H = all_components[I]
|
||||
if(prob(component_probability))
|
||||
H.take_damage(round(damage_amount*0.5), damage_type, damage_flag, 0)
|
||||
|
||||
/obj/item/modular_computer/deconstruct(disassembled = TRUE)
|
||||
break_apart()
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/proc/break_apart()
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
physical.visible_message(span_notice("\The [src] breaks apart!"))
|
||||
var/turf/newloc = get_turf(src)
|
||||
new /obj/item/stack/sheet/iron(newloc, round(steel_sheet_cost/2))
|
||||
for(var/C in all_components)
|
||||
var/obj/item/computer_hardware/H = all_components[C]
|
||||
if(QDELETED(H))
|
||||
continue
|
||||
uninstall_component(H)
|
||||
H.forceMove(newloc)
|
||||
if(prob(25))
|
||||
H.take_damage(rand(10,30), BRUTE, 0, 0)
|
||||
relay_qdel()
|
||||
@@ -34,10 +34,6 @@
|
||||
/obj/item/modular_computer/proc/handle_power(delta_time)
|
||||
var/power_usage = screen_on ? base_active_power_usage : base_idle_power_usage
|
||||
|
||||
for(var/obj/item/computer_hardware/H in all_components)
|
||||
if(H.enabled)
|
||||
power_usage += H.power_usage
|
||||
|
||||
if(use_power(power_usage))
|
||||
last_power_usage = power_usage
|
||||
return TRUE
|
||||
|
||||
@@ -59,10 +59,7 @@
|
||||
data["device_theme"] = device_theme
|
||||
data["login"] = list()
|
||||
|
||||
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD]
|
||||
data["cardholder"] = !!cardholder
|
||||
|
||||
if(cardholder)
|
||||
if(computer_id_slot)
|
||||
var/stored_name = saved_identification
|
||||
var/stored_title = saved_job
|
||||
if(!stored_name)
|
||||
@@ -74,8 +71,8 @@
|
||||
IDJob = saved_job,
|
||||
)
|
||||
data["proposed_login"] = list(
|
||||
IDName = cardholder.current_identification,
|
||||
IDJob = cardholder.current_job,
|
||||
IDName = computer_id_slot.registered_name,
|
||||
IDJob = computer_id_slot.assignment,
|
||||
)
|
||||
|
||||
data["removable_media"] = list()
|
||||
@@ -84,9 +81,6 @@
|
||||
var/datum/computer_file/program/ai_restorer/airestore_app = locate() in stored_files
|
||||
if(airestore_app?.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()
|
||||
for(var/datum/computer_file/program/P in stored_files)
|
||||
@@ -182,28 +176,14 @@
|
||||
if(airestore_app.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
|
||||
if(cardholder.try_eject(user))
|
||||
playsound(src, 'sound/machines/card_slide.ogg', 50)
|
||||
if("secondary RFID card")
|
||||
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD2]
|
||||
if(!cardholder)
|
||||
return
|
||||
if(cardholder.try_eject(user))
|
||||
if(RemoveID())
|
||||
playsound(src, 'sound/machines/card_slide.ogg', 50)
|
||||
if("PC_Imprint_ID")
|
||||
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD]
|
||||
if(!cardholder)
|
||||
return
|
||||
|
||||
saved_identification = cardholder.current_identification
|
||||
saved_job = cardholder.current_job
|
||||
|
||||
saved_identification = computer_id_slot.registered_name
|
||||
saved_job = computer_id_slot.assignment
|
||||
UpdateDisplay()
|
||||
|
||||
playsound(src, 'sound/machines/terminal_processing.ogg', 15, TRUE)
|
||||
|
||||
if("PC_Pai_Interact")
|
||||
switch(params["option"])
|
||||
if("eject")
|
||||
|
||||
@@ -10,10 +10,8 @@
|
||||
display_overlays = FALSE
|
||||
|
||||
hardware_flag = PROGRAM_LAPTOP
|
||||
max_hardware_size = 2
|
||||
max_idle_programs = 3
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
max_bays = 4
|
||||
|
||||
// No running around with open laptops in hands.
|
||||
item_flags = SLOWS_WHILE_IN_HAND
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Held by /obj/machinery/modular_computer to reduce amount of copy-pasted code.
|
||||
//TODO: REFACTOR THIS SPAGHETTI CODE, MAKE IT A COMPUTER_HARDWARE COMPONENT OR REMOVE IT
|
||||
//TODO: REFACTOR THIS SPAGHETTI CODE
|
||||
/obj/item/modular_computer/processor
|
||||
name = "processing unit"
|
||||
desc = "An advanced computer." //modular PCs examine us
|
||||
@@ -8,7 +8,6 @@
|
||||
icon_state_unpowered = null
|
||||
icon_state_menu = null
|
||||
hardware_flag = 0
|
||||
max_bays = 4
|
||||
|
||||
///The modular computer MACHINE that hosts us.
|
||||
var/obj/machinery/modular_computer/machinery_computer
|
||||
@@ -27,7 +26,6 @@
|
||||
machinery_computer.cpu = src
|
||||
internal_cell = machinery_computer.internal_cell
|
||||
hardware_flag = machinery_computer.hardware_flag
|
||||
max_hardware_size = machinery_computer.max_hardware_size
|
||||
steel_sheet_cost = machinery_computer.steel_sheet_cost
|
||||
max_idle_programs = machinery_computer.max_idle_programs
|
||||
update_integrity(machinery_computer.get_integrity())
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
/datum/computer_file/program/budgetorders,
|
||||
)
|
||||
|
||||
/obj/item/modular_computer/tablet/pda/heads/Initialize(mapload)
|
||||
. = ..()
|
||||
install_component(new /obj/item/computer_hardware/card_slot/secondary)
|
||||
|
||||
/obj/item/modular_computer/tablet/pda/heads/captain
|
||||
name = "captain PDA"
|
||||
greyscale_config = /datum/greyscale_config/tablet/captain
|
||||
|
||||
@@ -11,10 +11,8 @@
|
||||
base_icon_state = "tablet"
|
||||
worn_icon_state = "tablet"
|
||||
hardware_flag = PROGRAM_TABLET
|
||||
max_hardware_size = 1
|
||||
max_idle_programs = 2
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
max_bays = 3
|
||||
steel_sheet_cost = 2
|
||||
slot_flags = ITEM_SLOT_ID | ITEM_SLOT_BELT
|
||||
has_light = TRUE //LED flashlight!
|
||||
@@ -166,8 +164,6 @@
|
||||
inserted_item = null
|
||||
update_appearance()
|
||||
playsound(src, 'sound/machines/pda_button2.ogg', 50, TRUE)
|
||||
else
|
||||
balloon_alert(user, "nothing to remove!")
|
||||
|
||||
// Tablet 'splosion..
|
||||
|
||||
@@ -412,8 +408,7 @@
|
||||
|
||||
/obj/item/modular_computer/tablet/pda/update_overlays()
|
||||
. = ..()
|
||||
var/obj/item/computer_hardware/card_slot/card = all_components[MC_CARD]
|
||||
if(card?.stored_card)
|
||||
if(computer_id_slot)
|
||||
. += mutable_appearance(initial(icon), "id_overlay")
|
||||
if(light_on)
|
||||
. += mutable_appearance(initial(icon), "light_overlay")
|
||||
@@ -421,7 +416,3 @@
|
||||
/obj/item/modular_computer/tablet/pda/attack_ai(mob/user)
|
||||
to_chat(user, span_notice("It doesn't feel right to snoop around like that..."))
|
||||
return // we don't want ais or cyborgs using a private role tablet
|
||||
|
||||
/obj/item/modular_computer/tablet/pda/Initialize(mapload)
|
||||
. = ..()
|
||||
install_component(new /obj/item/computer_hardware/card_slot)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/obj/machinery/modular_computer/console/preset
|
||||
// Can be changed to give devices specific hardware
|
||||
var/_has_second_id_slot = FALSE
|
||||
///List of programs the computer starts with, given on Initialize.
|
||||
var/list/datum/computer_file/starting_programs = list()
|
||||
|
||||
@@ -9,9 +7,6 @@
|
||||
if(!cpu)
|
||||
return
|
||||
|
||||
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)
|
||||
for(var/programs in starting_programs)
|
||||
var/datum/computer_file/program/program_type = new programs
|
||||
cpu.store_file(program_type)
|
||||
@@ -32,7 +27,6 @@
|
||||
console_department = "Research"
|
||||
name = "research director's console"
|
||||
desc = "A stationary computer. This one comes preloaded with research programs."
|
||||
_has_second_id_slot = TRUE
|
||||
starting_programs = list(
|
||||
/datum/computer_file/program/ntnetmonitor,
|
||||
/datum/computer_file/program/chatclient,
|
||||
@@ -46,7 +40,6 @@
|
||||
console_department = "Command"
|
||||
name = "command console"
|
||||
desc = "A stationary computer. This one comes preloaded with command programs."
|
||||
_has_second_id_slot = TRUE
|
||||
starting_programs = list(
|
||||
/datum/computer_file/program/chatclient,
|
||||
/datum/computer_file/program/card_mod,
|
||||
@@ -57,7 +50,6 @@
|
||||
console_department = "Identification"
|
||||
name = "identification console"
|
||||
desc = "A stationary computer. This one comes preloaded with identification modification programs."
|
||||
_has_second_id_slot = TRUE
|
||||
starting_programs = list(
|
||||
/datum/computer_file/program/chatclient,
|
||||
/datum/computer_file/program/card_mod,
|
||||
|
||||
@@ -29,13 +29,11 @@
|
||||
var/screen_icon_state_menu = "menu"
|
||||
///Icon state overlay when the computer is powered, but not 'switched on'.
|
||||
var/screen_icon_screensaver = "standby"
|
||||
///Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed.
|
||||
var/max_hardware_size = 0
|
||||
///Amount of steel sheets refunded when disassembling an empty frame of this computer.
|
||||
var/steel_sheet_cost = 10
|
||||
///Light luminosity when turned on
|
||||
var/light_strength = 0
|
||||
///Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too.
|
||||
///Power usage when the computer is open (screen is active) and can be interacted with.
|
||||
var/base_active_power_usage = 100
|
||||
///Power usage when the computer is idle and screen is off (currently only applies to laptops)
|
||||
var/base_idle_power_usage = 10
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
density = TRUE
|
||||
base_idle_power_usage = 100
|
||||
base_active_power_usage = 500
|
||||
max_hardware_size = 4
|
||||
steel_sheet_cost = 10
|
||||
light_strength = 2
|
||||
max_integrity = 300
|
||||
|
||||
Reference in New Issue
Block a user