diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index eb76a68ef19..60a0f565f24 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -13,6 +13,15 @@ #define NOVEMBER 11 #define DECEMBER 12 +//Select holiday names -- If you test for a holiday in the code, make the holiday's name a define and test for that instead +#define NEW_YEAR "New Year" +#define VALENTINES "Valentine's Day" +#define APRIL_FOOLS "April Fool's Day" +#define EASTER "Easter" +#define HALLOWEEN "Halloween" +#define CHRISTMAS "Christmas" +#define FRIDAY_13TH "Friday the 13th" + //Human Overlays Indexes///////// #define SPECIES_LAYER 26 // mutantrace colors... these are on a seperate layer in order to prvent #define BODY_BEHIND_LAYER 25 diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 1beb4c4e5e0..929d2078bb2 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -65,7 +65,7 @@ var/datum/subsystem/events/SSevent if(E.occurrences >= E.max_occurrences) continue if(E.earliest_start >= world.time) continue if(E.holidayID) - if(!holidays[E.holidayID]) continue + if(!holidays || !holidays[E.holidayID]) continue if(E.weight < 0) //for round-start events etc. if(E.runEvent() == PROCESS_KILL) E.max_occurrences = 0 @@ -82,7 +82,7 @@ var/datum/subsystem/events/SSevent if(E.occurrences >= E.max_occurrences) continue if(E.earliest_start >= world.time) continue if(E.holidayID) - if(!holidays[E.holidayID]) continue + if(!holidays || !holidays[E.holidayID]) continue sum_of_weights -= E.weight if(sum_of_weights <= 0) //we've hit our goal diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index b95467bc9b7..040232d7baa 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -47,7 +47,7 @@ var/datum/subsystem/ticker/ticker NEW_SS_GLOBAL(ticker) login_music = pickweight(list('sound/ambience/title2.ogg' = 49, 'sound/ambience/title1.ogg' = 49, 'sound/ambience/clown.ogg' = 2)) // choose title music! - if(SSevent.holidays["April Fool's Day"]) + if(SSevent.holidays && SSevent.holidays[APRIL_FOOLS]) login_music = 'sound/ambience/clown.ogg' /datum/subsystem/ticker/Initialize() diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 58a3dc0607e..22f77f0e643 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -13,7 +13,7 @@ var/sound/admin_sound log_admin("[key_name(src)] played sound [S]") message_admins("[key_name_admin(src)] played sound [S]") - if(SSevent.holidays["April Fool's Day"]) + if(SSevent.holidays && SSevent.holidays[APRIL_FOOLS]) admin_sound.frequency = pick(0.5, 0.7, 0.8, 0.85, 0.9, 0.95, 1.1, 1.2, 1.4, 1.6, 2.0, 2.5) src << "You feel the Honkmother messing with your song..." diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index 172a562905b..e55c3203f4c 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -13,7 +13,7 @@ var/max_occurrences = 20 //The maximum number of times this event can occur (naturally), it can still be forced. //By setting this to 0 you can effectively disable an event. - var/holidayID //string which should match the events.holiday variable if you wish this event to be holiday-specific + var/holidayID = "" //string which should be in the SSevents.holidays list if you wish this event to be holiday-specific //anything with a (non-null) holidayID which does not match holiday, cannot run. var/wizardevent = 0 diff --git a/code/modules/events/holiday/friday13th.dm b/code/modules/events/holiday/friday13th.dm index a227cb6f611..e1a393fb867 100644 --- a/code/modules/events/holiday/friday13th.dm +++ b/code/modules/events/holiday/friday13th.dm @@ -2,7 +2,7 @@ /datum/round_event_control/fridaythethirteen name = "Friday the 13th" - holidayID = "Friday the 13th" + holidayID = FRIDAY_13TH typepath = /datum/round_event/fridaythethirteen weight = -1 max_occurrences = 1 diff --git a/code/modules/events/holiday/halloween.dm b/code/modules/events/holiday/halloween.dm index d08eebb919e..8c3536444de 100644 --- a/code/modules/events/holiday/halloween.dm +++ b/code/modules/events/holiday/halloween.dm @@ -1,6 +1,6 @@ /datum/round_event_control/spooky name = "2 SPOOKY! (Halloween)" - holidayID = "Halloween" + holidayID = HALLOWEEN typepath = /datum/round_event/spooky weight = -1 //forces it to be called, regardless of weight max_occurrences = 1 @@ -27,7 +27,7 @@ /datum/round_event_control/carp_migration/eyeballs name = "Eyeball Migration" typepath = /datum/round_event/carp_migration/eyeballs - holidayID = "Halloween" + holidayID = HALLOWEEN weight = 25 earliest_start = 0 @@ -40,7 +40,7 @@ /datum/round_event_control/meteor_wave/spooky name = "Pumpkin Wave" typepath = /datum/round_event/meteor_wave/spooky - holidayID = "Halloween" + holidayID = HALLOWEEN weight = 20 max_occurrences = 2 diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm index f7f3d202206..eacc8eacaba 100644 --- a/code/modules/events/holiday/xmas.dm +++ b/code/modules/events/holiday/xmas.dm @@ -1,6 +1,6 @@ /datum/round_event_control/treevenge name = "Treevenge (Christmas)" - holidayID = "Xmas" + holidayID = CHRISTMAS typepath = /datum/round_event/treevenge max_occurrences = 1 weight = 20 @@ -17,7 +17,7 @@ //this is an example of a possible round-start event /datum/round_event_control/presents name = "Presents under Trees (Christmas)" - holidayID = "Xmas" + holidayID = CHRISTMAS typepath = /datum/round_event/presents weight = -1 //forces it to be called, regardless of weight max_occurrences = 1 @@ -81,7 +81,7 @@ /datum/round_event_control/santa name = "Santa is coming to town! (Christmas)" - holidayID = "Xmas" + holidayID = CHRISTMAS typepath = /datum/round_event/santa weight = 150 max_occurrences = 1 diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm index 99c624df84d..50190ce4e67 100644 --- a/code/modules/holiday/holidays.dm +++ b/code/modules/holiday/holidays.dm @@ -54,7 +54,7 @@ // The actual holidays /datum/holiday/new_year - name = "New Year" + name = NEW_YEAR begin_day = 30 // 1 day early begin_month = DECEMBER end_day = 5 //4 days extra @@ -65,8 +65,8 @@ begin_day = 2 begin_month = FEBRUARY -/datum/holiday/velentines - name = "Velentine's Day" +/datum/holiday/valentines + name = VALENTINES begin_day = 9 //6 days early begin_month = FEBRUARY end_day = 15 //1 day extra @@ -90,7 +90,7 @@ begin_month = MARCH /datum/holiday/april_fools - name = "April Fool's Day" + name = APRIL_FOOLS begin_day = 1 begin_month = APRIL end_day = 8 //7 days extra so everyone can enjoy the festivities @@ -177,7 +177,7 @@ begin_month = OCTOBER /datum/holiday/halloween - name = "Halloween" + name = HALLOWEEN begin_day = 24 //7 days early begin_month = OCTOBER end_day = 7 //7 days extra @@ -220,7 +220,7 @@ begin_month = DECEMBER /datum/holiday/xmas - name = "Christmas" + name = CHRISTMAS begin_day = 18 //7 days early begin_month = DECEMBER end_day = 8 //14 days extra, christmas is important @@ -247,7 +247,7 @@ return pick("Mike","Friday","Evil","Myers","Murder","Deathly","Stabby") /datum/holiday/easter - name = "Easter" + name = EASTER var/const/days_early = 1 //to make editing the holiday easier var/const/days_extra = 6 diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 5a1e1c07e12..cf006b775cc 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -81,7 +81,7 @@ /obj/item/weapon/paper/attack_self(mob/user) user.examinate(src) - if(rigged && (SSevent.holidays["April Fool's Day"])) + if(rigged && (SSevent.holidays && SSevent.holidays[APRIL_FOOLS])) if(spam_flag == 0) spam_flag = 1 playsound(loc, 'sound/items/bikehorn.ogg', 50, 1) diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 4ca90ad8e57..a26c0497223 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -47,7 +47,7 @@ papers.Remove(P) else P = new /obj/item/weapon/paper - if(SSevent.holidays["April Fool's Day"]) + if(SSevent.holidays && SSevent.holidays[APRIL_FOOLS]) if(prob(30)) P.info = "HONK HONK HONK HONK HONK HONK HONK
HOOOOOOOOOOOOOOOOOOOOOONK
APRIL FOOLS
" P.rigged = 1