CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.66k stars 4.18k forks source link

Better electronic file handling #78043

Open ShnitzelX2 opened 1 day ago

ShnitzelX2 commented 1 day ago

Is your feature request related to a problem? Please describe.

Currently, files on in-game electronic devices (which will be referred to here as E_FILE) are anemic and separately handled. They consist of:

Poring over some history, it looks like this has been the case for over a decade. There have been a lot of requests for better electronic devices and files. This includes, but is probably not limited to:

My main motivation for planning this out is that I love getting the lore bits from laptops/phones, but you have to go out of your way, searching every device individually, to get them; ditto for maps. If we want to make searching devices easier, I feel like it makes more sense to implement E_FILE support broadly.

Solution you would like.

Infrastructure

units::ememory is a new unit, representing digital storage (B, KB, MB, GB, TB, etc.).

E_FILE is a new item type. It represents an electronic file. E_FILE items have:

E_FILE_DEVICE is a JSON use_action flag that will be applied to existing electronic devices that should handle E_FILES.

E_FILE_STORAGE is a new pocket type. It can only hold E_FILE items, and can't transfer them via the inventory -- only through the use_action of an E_FILE_DEVICE. It only has a ememory_max field for how much units::ememory it can hold.

use_action

e-devices will spawn with item_groups of E_FILE items. While "unread", an e-device will look like: laptop computer (x/x charge) <unread>. The following actions can be taken with an E_FILE_DEVICE:

Reworking Existing Content

New content

Quirks

Stuff that could be added later

Describe alternatives you have considered.

This is a top-level rough draft, no code has been written. Feedback, ideas, and anything I missed are all appreciated.

Additional context

No response