Files
Bubberstation/code/game/objects/items/stacks/tickets.dm
T
TemporalOroboros e4079c87b8 update_appearance (#55468)
Creates update_name and update_desc
Creates the wrapper proc update_appearance to batch update_name, update_desc, and update_icon together
Less non-icon handling code in update_icon and friends
Signal hooks for things that want to change names and descriptions
99%+ of the changes in this are just from switching everything over to update_appearance from update_icon
2021-02-19 12:06:18 -03:00

35 lines
893 B
Plaintext

/obj/item/stack/arcadeticket
name = "arcade tickets"
desc = "Wow! With enough of these, you could buy a bike! ...Pssh, yeah right."
singular_name = "arcade ticket"
icon_state = "arcade-ticket"
inhand_icon_state = "tickets"
w_class = WEIGHT_CLASS_TINY
max_amount = 30
merge_type = /obj/item/stack/arcadeticket
/obj/item/stack/arcadeticket/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1)
. = ..()
update_appearance()
/obj/item/stack/arcadeticket/update_icon_state()
. = ..()
var/amount = get_amount()
switch(amount)
if(12 to INFINITY)
icon_state = "arcade-ticket_4"
if(6 to 12)
icon_state = "arcade-ticket_3"
if(2 to 6)
icon_state = "arcade-ticket_2"
else
icon_state = "arcade-ticket"
/obj/item/stack/arcadeticket/proc/pay_tickets()
amount -= 2
if (amount == 0)
qdel(src)
/obj/item/stack/arcadeticket/thirty
amount = 30