/tg/ Station 13 - Modules - TypesVar Details - Proc Details

mystery_box

Vars

box_close_timerA timer for how long it takes for the box to close itself
box_expire_timerA timer for how long it takes for the box to start its expire animation
box_stateThe box's current state, and whether it can be interacted with in different ways
current_sound_channelStores the current sound channel we're using so we can cut off our own sounds as needed. Randomized after each roll
grant_extra_magIf the prize is a ballistic gun with an external magazine, should we grant the user a spare mag?
presented_itemThe object that represents the rapidly changing item that will be granted upon being claimed. Is not, itself, an item.
selectable_base_typeEvery type that's a child of this that has an icon, icon_state, and isn't ABSTRACT is fair game. More granularity to come
valid_typesThe instantiated list that contains all of the valid items that can be chosen from. Generated in /obj/structure/mystery_box/proc/generate_valid_types

Procs

activateThe box has been activated, play the sound and spawn the prop item
close_boxThe box is closed, whether because the prize fully expired, or it was claimed. Start resetting all of the state stuff
generate_valid_typesThis proc is used to define what item types valid_types is filled with
grant_weaponSomeone attacked the box with an empty hand, spawn the shown prize and give it to them, then close the box
present_weaponThe box has finished choosing, mark it as available for grabbing
ready_againThe cooldown between activations has finished, shake to show that
start_expire_offerThe prize is still claimable, but the animation will show it start to recede back into the box

Var Details

box_close_timer

A timer for how long it takes for the box to close itself

box_expire_timer

A timer for how long it takes for the box to start its expire animation

box_state

The box's current state, and whether it can be interacted with in different ways

current_sound_channel

Stores the current sound channel we're using so we can cut off our own sounds as needed. Randomized after each roll

grant_extra_mag

If the prize is a ballistic gun with an external magazine, should we grant the user a spare mag?

presented_item

The object that represents the rapidly changing item that will be granted upon being claimed. Is not, itself, an item.

selectable_base_type

Every type that's a child of this that has an icon, icon_state, and isn't ABSTRACT is fair game. More granularity to come

valid_types

The instantiated list that contains all of the valid items that can be chosen from. Generated in /obj/structure/mystery_box/proc/generate_valid_types

Proc Details

activate

The box has been activated, play the sound and spawn the prop item

close_box

The box is closed, whether because the prize fully expired, or it was claimed. Start resetting all of the state stuff

generate_valid_types

This proc is used to define what item types valid_types is filled with

grant_weapon

Someone attacked the box with an empty hand, spawn the shown prize and give it to them, then close the box

present_weapon

The box has finished choosing, mark it as available for grabbing

ready_again

The cooldown between activations has finished, shake to show that

start_expire_offer

The prize is still claimable, but the animation will show it start to recede back into the box