Files
mcbalaam 3799968eb3 feat: new floppy disk sprites; most disks are now under the /item/disk type; adds disk stacking, uqinue styling and wrapping (#94112)
## 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>
2026-01-04 08:52:18 +13:00

102 lines
3.4 KiB
Plaintext

/**
* Bitrunning tech disks which let you load full loadouts into the vdom on first avatar generation.
*/
/obj/item/disk/bitrunning/gimmick
desc = "A disk containing source code. It can be used to preload gimmick loadouts into the virtual domain."
/// The selected loadout that this grants
var/datum/bitrunning_gimmick/granted_loadout
/// The list of loadouts that this can grant
var/list/datum/bitrunning_gimmick/selectable_loadouts
/obj/item/disk/bitrunning/gimmick/Destroy()
QDEL_NULL(granted_loadout)
return ..()
/obj/item/disk/bitrunning/gimmick/load_onto_avatar(mob/living/carbon/human/neo, mob/living/carbon/human/avatar, domain_flags)
if(isnull(granted_loadout))
return BITRUNNER_GEAR_LOAD_FAILED
return granted_loadout.grant_loadout(neo, avatar, domain_flags)
/obj/item/disk/bitrunning/gimmick/attack_self(mob/user, modifiers)
. = ..()
if(granted_loadout)
return
var/names = list()
for(var/datum/bitrunning_gimmick/loadout as anything in selectable_loadouts)
names += initial(loadout.name)
var/choice = tgui_input_list(user, message = "Select a gimmick loadout", title = "Bitrunning Program", items = names)
if(isnull(choice) || !user.is_holding(src))
return
for(var/datum/bitrunning_gimmick/loadout as anything in selectable_loadouts)
if(initial(loadout.name) == choice)
granted_loadout = new loadout()
balloon_alert(user, "selected")
playsound(user, 'sound/items/click.ogg', 50, TRUE)
choice_made = choice
/**
* The datum used by the gimmick loadout disk to determine what a loadout actually spawns.
*/
/datum/bitrunning_gimmick
/// Player readable name of the gimmick loadout
var/name = "Gimmick Loadout"
/// The list of actions that this will grant
var/list/datum/action/granted_actions
/// The list of items that this will grant
var/list/obj/item/granted_items
/// The item type we will use as a container for our granted items, given to the avatar
var/obj/item/container_item_type = /obj/item/storage/briefcase/secure/digital_storage
/// Prefix our name onto the
var/prefix_container_name = TRUE
/// Grants out loadout.
/datum/bitrunning_gimmick/proc/grant_loadout(mob/living/carbon/human/neo, mob/living/carbon/human/avatar, domain_flags)
var/return_flags = NONE
return_flags |= grant_items(neo, avatar, domain_flags)
return_flags |= grant_abilities(neo, avatar, domain_flags)
return return_flags
/datum/bitrunning_gimmick/proc/grant_items(mob/living/carbon/human/neo, mob/living/carbon/human/avatar, domain_flags)
if(!length(granted_items))
return NONE
if(domain_flags & DOMAIN_FORBIDS_ITEMS)
return BITRUNNER_GEAR_LOAD_BLOCKED
var/obj/item/container_item = new container_item_type()
if(prefix_container_name)
container_item.name = "[LOWER_TEXT(name)]'s [initial(container_item.name)]"
for(var/obj/item/granted_item as anything in granted_items)
new granted_item(container_item)
avatar.put_in_hands(container_item)
return NONE
/datum/bitrunning_gimmick/proc/grant_abilities(mob/living/carbon/human/neo, mob/living/carbon/human/avatar, domain_flags)
if(!length(granted_actions))
return NONE
if(domain_flags & DOMAIN_FORBIDS_ABILITIES)
return BITRUNNER_GEAR_LOAD_BLOCKED
var/return_flags = NONE
for(var/datum/action/granted_action as anything in granted_actions)
if(locate(granted_action) in avatar.actions)
return_flags |= BITRUNNER_GEAR_LOAD_FAILED
continue
var/datum/action/our_action = new granted_action()
our_action.Grant(avatar)
return return_flags