Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: New Year #873

Merged
merged 8 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion _maps/map_files220/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -52202,6 +52202,7 @@
d2 = 2;
icon_state = "1-2"
},
/obj/effect/spawner/xmastree,
/turf/simulated/floor/plasteel/goonplaque/commission,
/area/station/hallway/secondary/bridge)
"gHm" = (
Expand Down Expand Up @@ -69088,6 +69089,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;
Expand Down Expand Up @@ -124395,7 +124400,7 @@ bwz
aPF
bGv
uwy
bEv
ojT
bGi
bEv
bGi
Expand Down
13 changes: 11 additions & 2 deletions _maps/map_files220/cyberiad/cyberiad.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -149713,7 +149722,7 @@ sRx
sRx
bxB
sRx
sRx
eVw
xZg
oRu
uyO
Expand Down
2 changes: 2 additions & 0 deletions _maps/map_files220/delta/delta.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down
1 change: 1 addition & 0 deletions modular_ss220/events/_events.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
#include "code/new_space_laws.dm"
#include "code/headcrabs.dm"
#include "code/infestation_extended.dm"
#include "code/christmas.dm"
181 changes: 181 additions & 0 deletions modular_ss220/events/code/christmas.dm
Original file line number Diff line number Diff line change
@@ -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")
Binary file added modular_ss220/events/icons/nuclearbomb.dmi
Binary file not shown.
Binary file added modular_ss220/events/icons/xmas.dmi
Binary file not shown.
Binary file added modular_ss220/events/icons/xmaslights.dmi
Binary file not shown.
Binary file added modular_ss220/events/icons/xmastree.dmi
Binary file not shown.