Hardware rework

- Hardware pieces are now items, rather than datums.
- Adds deconstruction for computers. Empty tablet/laptop/console frames may be wrenched to break them back into metal sheets. You have to empty the frame first, by using screwdriver to take out components one by one.
- Components may be moved between devices. You can for example take your tablet, remove it's hard drive, and slot it into a console. It will have all the files it had on your tablet.
- Not all hardware can be fitted into all devices. Tablet can't hold 2K GQ cluster hard drive, for example.
- Hardware may be fabricated by research for relatively low costs, once you have relevant research levels. Obtaining computer this way is much cheaper than buying it at the vendor.
- Data crystals added (glorified USB flash sticks) that allow file transfer to different devices. File browser program updated accordingly to support importing/exporting of files to these crystals.
- Battery module added.  These are wrappers for actual power cell object and act as limit for cell size, otherwise it would be possible to have 30k cells inside devices, which would allow them to run insanely long.
This commit is contained in:
Atlantis
2015-12-02 10:32:49 +01:00
parent 0dda785c50
commit 7e39ef1a38
27 changed files with 779 additions and 203 deletions
@@ -32,9 +32,11 @@
machinery_computer = comp
machinery_computer.cpu = src
hardware_flag = machinery_computer.hardware_flag
max_hardware_size = machinery_computer.max_hardware_size
steel_sheet_cost = machinery_computer.steel_sheet_cost
/obj/item/modular_computer/processor/find_hardware_by_name(var/N)
var/datum/computer_hardware/H = machinery_computer.find_hardware_by_name(N)
var/obj/item/weapon/computer_hardware/H = machinery_computer.find_hardware_by_name(N)
if(H)
return H
else
@@ -71,4 +73,40 @@
visible_message("\The [machinery_computer] shuts down.")
enabled = 0
machinery_computer.update_icon()
return
return
// Tesla links only work on machinery types, so we'll override the default try_install_component() proc
/obj/item/modular_computer/processor/try_install_component(var/mob/living/user, var/obj/item/weapon/computer_hardware/H, var/found = 0)
if(istype(H, /obj/item/weapon/computer_hardware/tesla_link))
if(machinery_computer.tesla_link)
user << "This computer's tesla link slot is already occupied by \the [machinery_computer.tesla_link]."
return
var/obj/item/weapon/computer_hardware/tesla_link/L = H
L.holder = machinery_computer
machinery_computer.tesla_link = L
// Consoles don't usually have internal power source, so we can't disable tesla link in them.
if(istype(machinery_computer, /obj/machinery/modular_computer/console))
L.critical = 1
found = 1
..(user, H, found)
/obj/item/modular_computer/processor/uninstall_component(var/mob/living/user, var/obj/item/weapon/computer_hardware/H, var/found = 0, var/critical = 0)
if(machinery_computer.tesla_link == H)
machinery_computer.tesla_link = null
var/obj/item/weapon/computer_hardware/tesla_link/L = H
L.critical = 0 // That way we can install tesla link from console to laptop and it will be possible to turn it off via config.
L.holder = null
found = 1
..(user, H, found, critical)
/obj/item/modular_computer/processor/get_all_components()
var/list/all_components = ..()
if(machinery_computer.tesla_link)
all_components.Add(machinery_computer.tesla_link)
return all_components
// Perform adjacency checks on our machinery counterpart, rather than on ourselves.
/obj/item/modular_computer/processor/Adjacent(var/atom/neighbor)
if(!machinery_computer)
return 0
return machinery_computer.Adjacent(neighbor)