mystery_box
Vars | |
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? |
minds_that_opened_us | A list of weakrefs to mind datums of people that opened it and how many times. |
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 |
uses_left | How many time can it still be used? |
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 |
Procs | |
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 |
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?
minds_that_opened_us
A list of weakrefs to mind datums of people that opened it and how many times.
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
uses_left
How many time can it still be used?
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