mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 09:02:27 +00:00
- 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.
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
/datum/computer_file/
|
|
var/filename = "NewFile" // Placeholder. No spacebars
|
|
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
|
|
var/size = 1 // File size in GQ. Integers only!
|
|
var/obj/item/weapon/computer_hardware/hard_drive/holder // Holder that contains this file.
|
|
var/unsendable = 0 // Whether the file may be sent to someone via NTNet transfer or other means.
|
|
var/undeletable = 0 // Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc.
|
|
|
|
/datum/computer_file/Destroy()
|
|
if(!holder)
|
|
return ..()
|
|
|
|
holder.remove_file(src)
|
|
// holder.holder is the computer that has drive installed. If we are Destroy()ing program that's currently running kill it.
|
|
if(holder.holder2 && holder.holder2.active_program == src)
|
|
holder.holder2.kill_program(1)
|
|
holder = null
|
|
..()
|
|
|
|
// Returns independent copy of this file.
|
|
/datum/computer_file/proc/clone(var/rename = 0)
|
|
var/datum/computer_file/temp = new type
|
|
temp.unsendable = unsendable
|
|
temp.undeletable = undeletable
|
|
temp.size = size
|
|
if(rename)
|
|
temp.filename = filename + "(Copy)"
|
|
else
|
|
temp.filename = filename
|
|
temp.filetype = filetype
|
|
return temp |