mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 15:15:34 +01:00
3799968eb3
## About The Pull Request Floppy disks received a sprite upgrade, as well as unique wraps: <img width="364" height="150" alt="image" src="https://github.com/user-attachments/assets/0ac433e3-7432-4c06-bec2-aeae00b6852f" /> <img width="786" height="527" alt="image" src="https://github.com/user-attachments/assets/0f36bd0d-0362-4431-8131-49060a2fe348" /> You can now stack floppy disks! They also scatter around when thrown. The video also showcases new styling options with a selection of stickers! You can also write something on the disk instead of selecting an icon: https://github.com/user-attachments/assets/ff0a8542-9d79-4108-ae46-672ca5d620a2 MOST disks now inherit the `/item/disk` type to properly stack and do... stuff. An updatepaths script included. ## Why It's Good For The Game Old school is cool. Stacking disks makes them feel more authentic, while styling allows for more crearivity! ## Changelog 🆑 add: New unique wraps for floppy disks qol: Floppy disks can now be stacked image: New sprites and stickers for floppy disks map: Added and ran an updatepaths script refactor: Most disks are now under the base disk item type /🆑 --------- Co-authored-by: The-Tyrant <tyrantofgaming@gmail.com>
58 lines
1.5 KiB
Plaintext
58 lines
1.5 KiB
Plaintext
/obj/item/disk/computer
|
|
/// The amount of free storage space
|
|
var/max_capacity = 16
|
|
/// The amount of storage space occupied
|
|
var/used_capacity = 0
|
|
/// List of stored files on this drive. Do NOT directly modify; use setters instead.
|
|
var/list/datum/computer_file/stored_files = list()
|
|
|
|
/// List of all programs that the disk should start with
|
|
var/list/datum/computer_file/starting_programs = list()
|
|
|
|
/obj/item/disk/computer/Initialize(mapload)
|
|
. = ..()
|
|
for(var/programs in starting_programs)
|
|
var/datum/computer_file/program_type = new programs
|
|
add_file(program_type)
|
|
|
|
/obj/item/disk/computer/Destroy(force)
|
|
. = ..()
|
|
QDEL_LIST(stored_files)
|
|
|
|
/**
|
|
* add_file
|
|
*
|
|
* Attempts to add an already existing file to the computer disk, then adds that capacity to the used capicity.
|
|
*/
|
|
/obj/item/disk/computer/proc/add_file(datum/computer_file/file)
|
|
if((file.size + used_capacity) > max_capacity)
|
|
return FALSE
|
|
stored_files.Add(file)
|
|
file.disk_host = src
|
|
used_capacity += file.size
|
|
return TRUE
|
|
|
|
/**
|
|
* remove_file
|
|
*
|
|
* Removes an app from the stored_files list, then removes their size from the capacity.
|
|
*/
|
|
/obj/item/disk/computer/proc/remove_file(datum/computer_file/file)
|
|
if(!(file in stored_files))
|
|
return FALSE
|
|
stored_files.Remove(file)
|
|
used_capacity -= file.size
|
|
qdel(file)
|
|
return TRUE
|
|
|
|
/obj/item/disk/computer/advanced
|
|
name = "advanced data disk"
|
|
icon_state = "datadisk5"
|
|
max_capacity = 64
|
|
|
|
/obj/item/disk/computer/super
|
|
name = "super data disk"
|
|
desc = "Removable disk used to store large amounts of data."
|
|
icon_state = "datadisk3"
|
|
max_capacity = 256
|