[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()
|
||||
. = ..()
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
/datum/round_event_control/treevenge
|
||||
name = "Treevenge (Christmas)"
|
||||
holidayID = CHRISTMAS
|
||||
typepath = /datum/round_event/treevenge
|
||||
max_occurrences = 1
|
||||
weight = 20
|
||||
|
||||
/datum/round_event/treevenge/start()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
var/mob/living/simple_animal/hostile/tree/evil_tree = new /mob/living/simple_animal/hostile/tree(xmas.loc)
|
||||
evil_tree.icon_state = xmas.icon_state
|
||||
evil_tree.icon_living = evil_tree.icon_state
|
||||
evil_tree.icon_dead = evil_tree.icon_state
|
||||
evil_tree.icon_gib = evil_tree.icon_state
|
||||
qdel(xmas) //b-but I don't want to delete xmas...
|
||||
|
||||
//this is an example of a possible round-start event
|
||||
/datum/round_event_control/presents
|
||||
name = "Presents under Trees (Christmas)"
|
||||
@@ -24,12 +8,11 @@
|
||||
earliest_start = 0
|
||||
|
||||
/datum/round_event/presents/start()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
for(var/obj/structure/flora/tree/pine/xmas/xmas in world)
|
||||
if(!(xmas.z in GLOB.station_z_levels))
|
||||
continue
|
||||
for(var/turf/open/floor/T in orange(1,xmas))
|
||||
for(var/i=1,i<=rand(1,5),i++)
|
||||
new /obj/item/a_gift(T)
|
||||
xmas.icon_state = "pinepresents"
|
||||
xmas.gifts_under_tree = TRUE
|
||||
for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_living_list)
|
||||
Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian))
|
||||
for(var/obj/machinery/computer/security/telescreen/entertainment/Monitor in GLOB.machines)
|
||||
@@ -98,7 +81,7 @@
|
||||
name = "Santa is coming to town! (Christmas)"
|
||||
holidayID = CHRISTMAS
|
||||
typepath = /datum/round_event/santa
|
||||
weight = 150
|
||||
weight = 20
|
||||
max_occurrences = 1
|
||||
earliest_start = 20000
|
||||
|
||||
|
||||
@@ -387,9 +387,9 @@ Since Ramadan is an entire month that lasts 29.5 days on average, the start and
|
||||
|
||||
/datum/holiday/xmas
|
||||
name = CHRISTMAS
|
||||
begin_day = 23
|
||||
begin_day = 22
|
||||
begin_month = DECEMBER
|
||||
end_day = 25
|
||||
end_day = 27
|
||||
|
||||
/datum/holiday/xmas/greet()
|
||||
return "Have a merry Christmas!"
|
||||
|
||||
Reference in New Issue
Block a user