[MIRROR] Christmas (#4491)
* Christmas (#33690) * Christmas Event Updates * Dont recreate the list every time * Check for drop del * Changes some things to placate that one guy from FTL * Christmas
This commit is contained in:
committed by
kevinz000
parent
f6e82e4460
commit
938f409782
@@ -7,6 +7,9 @@
|
||||
/*
|
||||
* Gifts
|
||||
*/
|
||||
|
||||
GLOBAL_LIST_EMPTY(possible_gifts)
|
||||
|
||||
/obj/item/a_gift
|
||||
name = "gift"
|
||||
desc = "PRESENTS!!!! eek!"
|
||||
@@ -30,6 +33,14 @@
|
||||
to_chat(M, "<span class='warning'>You're supposed to be spreading gifts, not opening them yourself!</span>")
|
||||
return
|
||||
|
||||
var/gift_type = get_gift_type()
|
||||
|
||||
qdel(src)
|
||||
var/obj/item/I = new gift_type(M)
|
||||
M.put_in_hands(I)
|
||||
I.add_fingerprint(M)
|
||||
|
||||
/obj/item/a_gift/proc/get_gift_type()
|
||||
var/gift_type_list = list(/obj/item/sord,
|
||||
/obj/item/storage/wallet,
|
||||
/obj/item/storage/photo_album,
|
||||
@@ -72,10 +83,21 @@
|
||||
|
||||
var/gift_type = pick(gift_type_list)
|
||||
|
||||
if(!ispath(gift_type, /obj/item))
|
||||
return
|
||||
return gift_type
|
||||
|
||||
qdel(src)
|
||||
var/obj/item/I = new gift_type(M)
|
||||
M.put_in_hands(I)
|
||||
I.add_fingerprint(M)
|
||||
|
||||
/obj/item/a_gift/anything
|
||||
name = "christmas gift"
|
||||
desc = "It could be anything!"
|
||||
|
||||
/obj/item/a_gift/anything/get_gift_type()
|
||||
if(!GLOB.possible_gifts.len)
|
||||
var/list/gift_types_list = subtypesof(/obj/item)
|
||||
for(var/V in gift_types_list)
|
||||
var/obj/item/I = V
|
||||
if((!initial(I.icon_state)) || (!initial(I.item_state)) || (initial(I.flags_1) & ABSTRACT_1))
|
||||
gift_types_list -= V
|
||||
GLOB.possible_gifts = gift_types_list
|
||||
var/gift_type = pick(GLOB.possible_gifts)
|
||||
|
||||
return gift_type
|
||||
|
||||
@@ -36,9 +36,6 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/structure/flora/tree/pine
|
||||
name = "pine tree"
|
||||
desc = "A coniferous pine tree."
|
||||
@@ -53,6 +50,21 @@
|
||||
name = "xmas tree"
|
||||
desc = "A wondrous decorated Christmas tree."
|
||||
icon_state = "pine_c"
|
||||
var/gifts_under_tree = FALSE
|
||||
var/list/ckeys_that_took = list()
|
||||
|
||||
/obj/structure/flora/tree/pine/xmas/attack_hand(mob/living/user)
|
||||
if(!gifts_under_tree)
|
||||
return
|
||||
if(!user.ckey)
|
||||
return
|
||||
if(ckeys_that_took[user.ckey])
|
||||
to_chat(user, "<span class='warning'>You already took your gift.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='warning'>After a bit of rummaging, you locate a gift with your name on it!</span>")
|
||||
ckeys_that_took[user.ckey] = TRUE
|
||||
var/obj/item/a_gift/anything/A = new
|
||||
user.put_in_hands(A)
|
||||
|
||||
/obj/structure/flora/tree/pine/xmas/Initialize()
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user