diff --git a/_maps/map_files220/MetaStation/MetaStation.dmm b/_maps/map_files220/MetaStation/MetaStation.dmm index 24e736f4f45c..7e29e3e7b655 100644 --- a/_maps/map_files220/MetaStation/MetaStation.dmm +++ b/_maps/map_files220/MetaStation/MetaStation.dmm @@ -51925,6 +51925,7 @@ d2 = 2; icon_state = "1-2" }, +/obj/effect/spawner/xmastree, /turf/simulated/floor/plasteel/goonplaque/commission, /area/station/hallway/secondary/bridge) "gHm" = ( @@ -68808,6 +68809,10 @@ }, /turf/simulated/floor/plasteel, /area/station/science/toxins/mixing) +"ojT" = ( +/obj/effect/spawner/xmastree, +/turf/simulated/floor/wood, +/area/station/service/bar) "olg" = ( /obj/structure/cable/yellow{ d1 = 4; @@ -124183,7 +124188,7 @@ bwz aPF bGv uwy -bEv +ojT bGi bEv bGi diff --git a/_maps/map_files220/cyberiad/cyberiad.dmm b/_maps/map_files220/cyberiad/cyberiad.dmm index d6975990869c..6f770705876b 100644 --- a/_maps/map_files220/cyberiad/cyberiad.dmm +++ b/_maps/map_files220/cyberiad/cyberiad.dmm @@ -19878,7 +19878,7 @@ /obj/structure/flora/tree/jungle{ pixel_y = -14 }, -/turf/simulated/floor/plasteel/goonplaque/memorial, +/turf/simulated/floor/grass, /area/station/hallway/secondary/exit) "bzf" = ( /obj/effect/spawner/window/reinforced/polarized/grilled{ @@ -24557,6 +24557,7 @@ "bTZ" = ( /obj/structure/flora/ausbushes/ywflowers, /obj/structure/flora/ausbushes/sparsegrass, +/obj/effect/spawner/xmastree, /turf/simulated/floor/grass, /area/station/medical/sleeper) "bUa" = ( @@ -49115,6 +49116,13 @@ icon_state = "yellowcorner" }, /area/station/maintenance/fsmaint) +"eVw" = ( +/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, +/obj/machinery/atmospherics/pipe/simple/hidden/supply, +/obj/structure/disposalpipe/segment, +/obj/effect/spawner/xmastree, +/turf/simulated/floor/carpet, +/area/station/service/chapel) "eVD" = ( /obj/machinery/atmospherics/pipe/simple/hidden/supply{ dir = 6 @@ -91498,6 +91506,7 @@ /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{ dir = 4 }, +/obj/effect/spawner/xmastree, /turf/simulated/floor/wood/fancy/cherry, /area/station/service/bar/atrium) "uuH" = ( @@ -149713,7 +149722,7 @@ sRx sRx bxB sRx -sRx +eVw xZg oRu uyO diff --git a/_maps/map_files220/delta/delta.dmm b/_maps/map_files220/delta/delta.dmm index 21d65f570e46..4902ee333c87 100644 --- a/_maps/map_files220/delta/delta.dmm +++ b/_maps/map_files220/delta/delta.dmm @@ -45212,6 +45212,7 @@ }, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, /obj/machinery/atmospherics/pipe/simple/hidden/supply, +/obj/effect/spawner/xmastree, /turf/simulated/floor/plasteel/grimy, /area/station/service/chapel) "dLy" = ( @@ -63646,6 +63647,7 @@ /area/station/security/interrogation/observation) "iOx" = ( /obj/machinery/hologram/holopad, +/obj/effect/spawner/xmastree, /turf/simulated/floor/wood/fancy, /area/station/service/theatre) "iOy" = ( diff --git a/modular_ss220/events/_events.dme b/modular_ss220/events/_events.dme index 85d3a02f16e5..f2d0c0781a56 100644 --- a/modular_ss220/events/_events.dme +++ b/modular_ss220/events/_events.dme @@ -3,3 +3,4 @@ #include "code/new_space_laws.dm" #include "code/headcrabs.dm" #include "code/infestation_extended.dm" +#include "code/christmas.dm" diff --git a/modular_ss220/events/code/christmas.dm b/modular_ss220/events/code/christmas.dm new file mode 100644 index 000000000000..12eac5a26135 --- /dev/null +++ b/modular_ss220/events/code/christmas.dm @@ -0,0 +1,181 @@ +#define COMSIG_SUBSYSTEM_POST_INITIALIZE "post_initialize" + +GLOBAL_LIST_EMPTY(possible_gifts) + +/datum/controller/subsystem/holiday/Initialize() + . = ..() + SEND_SIGNAL(src, COMSIG_SUBSYSTEM_POST_INITIALIZE) + +// Landmark for tree +/obj/effect/spawner/xmastree + name = "christmas tree spawner" + icon = 'icons/mob/screen_gen.dmi' + icon_state = "x2" + layer = LOW_LANDMARK_LAYER + /// Christmas tree, no presents included. + var/christmas_tree = /obj/structure/flora/tree/pine/xmas + /// Christmas tree, presents included. + var/presents_tree = /obj/structure/flora/tree/pine/xmas/presents + +/obj/effect/spawner/xmastree/Initialize(mapload) + . = ..() + if(!SSholiday.initialized) + RegisterSignal(SSholiday, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(place_tree)) + else + place_tree() + +/obj/effect/spawner/xmastree/proc/place_tree() + if(NEW_YEAR in SSholiday.holidays) + new presents_tree(get_turf(src)) + else if(CHRISTMAS in SSholiday.holidays) + new christmas_tree(get_turf(src)) + return qdel(src) + +// Gift +/obj/item/gift + icon = 'modular_ss220/events/icons/xmas.dmi' + +/obj/item/a_gift + icon = 'modular_ss220/events/icons/xmas.dmi' + +/obj/item/a_gift/anything + name = "\improper новогодний подарок" + desc = "Подарок! Что же тут..." + +/obj/item/a_gift/anything/attack_self(mob/M) + if(!GLOB.possible_gifts.len) + var/list/gift_types_list = subtypesof(/obj/item) + for(var/thing in gift_types_list) + var/obj/item/item = thing + if((!initial(item.icon_state)) || (!initial(item.item_state)) || (initial(item.flags) & (ABSTRACT | NODROP)) || (initial(item.w_class) > 6)) + gift_types_list -= thing + GLOB.possible_gifts = gift_types_list + + var/something = pick(GLOB.possible_gifts) + var/obj/item/gift = new something(M) + M.unEquip(src, TRUE) + M.put_in_hands(gift) + gift.add_fingerprint(M) + playsound(loc, 'sound/items/poster_ripped.ogg', 100, TRUE) + qdel(src) + return + +// Xmas Tree +/obj/structure/flora/tree/pine/xmas + name = "\improper новогодняя ёлка" + desc = "Превосходная новогодняя ёлка." + icon = 'modular_ss220/events/icons/xmastree.dmi' + icon_state = "xmas_tree" + resistance_flags = INDESTRUCTIBLE // Protected by the christmas spirit + +/obj/structure/flora/tree/pine/xmas/Initialize(mapload) + . = ..() + icon_state = initial(icon_state) + +/obj/structure/flora/tree/pine/xmas/presents + icon_state = "xmas_tree_presents" + desc = "Превосходная новогодняя ёлка. Под ней подарки!" + var/gift_type = /obj/item/a_gift + var/unlimited = FALSE + var/static/list/took_presents // Shared between all xmas trees + +/obj/structure/flora/tree/pine/xmas/presents/anything + gift_type = /obj/item/a_gift/anything + +/obj/structure/flora/tree/pine/xmas/presents/Initialize(mapload) + . = ..() + if(!took_presents) + took_presents = list() + +/obj/structure/flora/tree/pine/xmas/presents/attack_hand(mob/living/user, list/modifiers) + . = ..() + if(.) + return + if(!user.ckey) + return + + if(took_presents[user.ckey] && !unlimited) + to_chat(user, span_warning("Ты не видишь подарка со своим именем.")) + return + + to_chat(user, span_notice("Немного покопавшись, ты нашёл подарок со своим именем.")) + + if(!unlimited) + took_presents[user.ckey] = TRUE + + var/obj/item/G = new gift_type(src) + user.put_in_hands(G) + +/obj/structure/flora/tree/pine/xmas/presents/unlimited + desc = "Превосходная новогодняя ёлка. Кажется под ней нескончаемый запас подарков!" + unlimited = TRUE + +/obj/structure/flora/tree/pine/xmas/presents/anything/unlimited + desc = "Превосходная новогодняя ёлка. Кажется под ней нескончаемый запас полностью случайных подарков!" + unlimited = TRUE + +// Рождество +/datum/holiday/xmas/celebrate() + // Новогоднее освещение + for(var/obj/machinery/light/lights in GLOB.machines) + lights.brightness_color = "#FFE6D9" + lights.nightshift_light_color = "#FFC399" + // Гурлянды + for(var/obj/structure/window/full/reinforced/rwindows in world) + rwindows.edge_overlay_file = 'modular_ss220/events/icons/xmaslights.dmi' + for(var/obj/structure/window/full/plasmareinforced/rplasma in world) + rplasma.edge_overlay_file = 'modular_ss220/events/icons/xmaslights.dmi' + for(var/turf/simulated/wall/indestructible/fakeglass/fakeglass in world) + fakeglass.edge_overlay_file = 'modular_ss220/events/icons/xmaslights.dmi' + // Новогодний цвет окон + for(var/obj/structure/window/windows in world) + windows.color = "#6CA66C" + for(var/obj/machinery/door/window/windoor in world) + windoor.color = "#6CA66C" + for(var/turf/simulated/wall/indestructible/fakeglass/fakeglass in world) + fakeglass.color = "#6CA66C" + // Их не красить + for(var/obj/structure/window/full/plasmabasic/plasma in world) + plasma.color = null + for(var/obj/structure/window/full/plasmareinforced/rplasma in world) + rplasma.color = null + for(var/obj/structure/window/full/shuttle/shuttle in world) + shuttle.color = null + for(var/obj/structure/window/full/plastitanium/syndie in world) + syndie.color = null + // Лучший подарок для лучшего экипажа + for(var/obj/structure/reagent_dispensers/beerkeg/nuke/beernuke in world) + beernuke.icon = 'modular_ss220/events/icons/nuclearbomb.dmi' + for(var/obj/machinery/nuclearbomb/nuke in world) + nuke.icon = 'modular_ss220/events/icons/nuclearbomb.dmi' + // Новогодние цветочки (И снеговик) + for(var/obj/item/kirbyplants/plants in world) + plants.icon = 'modular_ss220/events/icons/xmas.dmi' + plants.icon_state = "plant-[rand(1,9)]" + // Шляпа Иану + for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_list) + Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat) + // Снеговик в крафт + for(var/datum/crafting_recipe/snowman/S in GLOB.crafting_recipes) + S.always_available = TRUE + break + //The following spawn is necessary as both the timer and the shuttle systems initialise after the events system does, so we can't add stuff to the shuttle system as it doesn't exist yet and we can't use a timer + spawn(60 SECONDS) + var/datum/supply_packs/misc/snow_machine/xmas = SSeconomy.supply_packs["[/datum/supply_packs/misc/snow_machine]"] + xmas.special = FALSE + +// Световые маски на гурлянды, красивое в темноте +/obj/structure/window/full/reinforced/update_overlays() + . = ..() + if(CHRISTMAS in SSholiday.holidays) + underlays += emissive_appearance(edge_overlay_file, "[smoothing_junction]_lightmask") + +/obj/structure/window/full/plasmareinforced/update_overlays() + . = ..() + if(CHRISTMAS in SSholiday.holidays) + underlays += emissive_appearance(edge_overlay_file, "[smoothing_junction]_lightmask") + +/turf/simulated/wall/indestructible/fakeglass/update_overlays() + . = ..() + if(CHRISTMAS in SSholiday.holidays) + underlays += emissive_appearance(edge_overlay_file, "[smoothing_junction]_lightmask") diff --git a/modular_ss220/events/icons/nuclearbomb.dmi b/modular_ss220/events/icons/nuclearbomb.dmi new file mode 100644 index 000000000000..87f9e234200d Binary files /dev/null and b/modular_ss220/events/icons/nuclearbomb.dmi differ diff --git a/modular_ss220/events/icons/xmas.dmi b/modular_ss220/events/icons/xmas.dmi new file mode 100644 index 000000000000..cf30a5d2990c Binary files /dev/null and b/modular_ss220/events/icons/xmas.dmi differ diff --git a/modular_ss220/events/icons/xmaslights.dmi b/modular_ss220/events/icons/xmaslights.dmi new file mode 100644 index 000000000000..be779fe2dcab Binary files /dev/null and b/modular_ss220/events/icons/xmaslights.dmi differ diff --git a/modular_ss220/events/icons/xmastree.dmi b/modular_ss220/events/icons/xmastree.dmi new file mode 100644 index 000000000000..c7acfc69b00d Binary files /dev/null and b/modular_ss220/events/icons/xmastree.dmi differ