diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index ca29b09f718..eb76a68ef19 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -1,5 +1,17 @@ #define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day +#define JANUARY 1 +#define FEBRUARY 2 +#define MARCH 3 +#define APRIL 4 +#define MAY 5 +#define JUNE 6 +#define JULY 7 +#define AUGUST 8 +#define SEPTEMBER 9 +#define OCTOBER 10 +#define NOVEMBER 11 +#define DECEMBER 12 //Human Overlays Indexes///////// #define SPECIES_LAYER 26 // mutantrace colors... these are on a seperate layer in order to prvent diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index d0b8e36896b..50f981a3b04 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -70,23 +70,16 @@ var/religion_name = null new_station_name = name + " " // Prefix - switch(SSevent.holiday) - //get normal name - if(null,"",0) - name = pick("", "Stanford", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist","Corrogated","Skeleton","Race", "Fatguy", "Gentleman", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Spess", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot", "Hats", "Pizza") - if(name) - new_station_name += name + " " - - //For special days like christmas, easter, new-years etc ~Carn - if("Friday the 13th") - name = pick("Mike","Friday","Evil","Myers","Murder","Deathly","Stabby") - new_station_name += name + " " + for(var/holiday_name in SSevent.holidays) + if(holiday_name == "Friday the 13th") random = 13 - else - //get the first word of the Holiday and use that - var/i = findtext(SSevent.holiday," ",1,0) - name = copytext(SSevent.holiday,1,i) - new_station_name += name + " " + var/datum/holiday/holiday = SSevent.holidays[holiday_name] + name = holiday.getStationPrefix() + //get normal name + if(!name) + name = pick("", "Stanford", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist","Corrogated","Skeleton","Race", "Fatguy", "Gentleman", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Spess", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot", "Hats", "Pizza") + if(name) + new_station_name += name + " " // Suffix name = pick("Station", "Fortress", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard","Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", "Complex", "Base", "Facility", "Depot", "Outpost", "Installation", "Drydock", "Observatory", "Array", "Relay", "Monitor", "Platform", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker", "Roost", "Fat Camp") diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 93e38c36be7..1beb4c4e5e0 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -11,7 +11,7 @@ var/datum/subsystem/events/SSevent var/frequency_lower = 3000 //5 minutes lower bound. var/frequency_upper = 9000 //15 minutes upper bound. Basically an event will happen every 5 to 15 minutes. - var/holiday //This will be a string of the name of any realworld holiday which occurs today (GMT time) + var/list/holidays //List of all holidays occuring today or null if no holidays var/wizardmode = 0 @@ -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(E.holidayID != holiday) continue + if(!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(E.holidayID != holiday) continue + if(!holidays[E.holidayID]) continue sum_of_weights -= E.weight if(sum_of_weights <= 0) //we've hit our goal @@ -152,12 +152,12 @@ var/datum/subsystem/events/SSevent ////////////// //Uncommenting ALLOW_HOLIDAYS in config.txt will enable holidays -//It's easy to add stuff. Just modify getHoliday to set holiday to something using the switch for DD(#day) MM(#month) YY(#year). -//You can then check if it's a special day in any code in the game by doing if(events.holiday == "MyHolidayID") +//It's easy to add stuff. Just add a holiday datum in code/modules/holiday/holidays.dm +//You can then check if it's a special day in any code in the game by doing if(SSevent.holidays["Groundhog Day"]) //You can also make holiday random events easily thanks to Pete/Gia's system. -//simply make a random event normally, then assign it a holidayID string which matches the one you gave it in getHolday. -//Anything with a holidayID, which does not match the holiday string, will never occur. +//simply make a random event normally, then assign it a holidayID string which matches the holiday's name. +//Anything with a holidayID, which isn't in the holidays list, will never occur. //Please, Don't spam stuff up with stupid stuff (key example being april-fools Pooh/ERP/etc), //And don't forget: CHECK YOUR CODE!!!! We don't want any zero-day bugs which happen only on holidays and never get found/fixed! @@ -165,111 +165,27 @@ var/datum/subsystem/events/SSevent ////////////////////////////////////////////////////////////////////////////////////////////////////////// //ALSO, MOST IMPORTANTLY: Don't add stupid stuff! Discuss bonus content with Project-Heads first please!// ////////////////////////////////////////////////////////////////////////////////////////////////////////// -~Carn */ +*/ -//sets up the holiday string in the events manager. +//sets up the holidays and holidays list /datum/subsystem/events/proc/getHoliday() if(!config.allow_holidays) return // Holiday stuff was not enabled in the config! - holiday = null - var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year - var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month - var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day + var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year + var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month + var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day - //Main switch. If any of these are too dumb/inappropriate, or you have better ones, feel free to change whatever - switch(MM) - if(1) //Jan - switch(DD) - if(1) holiday = "New Year" - - if(2) //Feb - switch(DD) - if(2) holiday = "Groundhog Day" - if(14) holiday = "Valentine's Day" - if(17) holiday = "Random Acts of Kindness Day" - - if(3) //Mar - switch(DD) - if(14) holiday = "Pi Day" - if(17) holiday = "St. Patrick's Day" - if(27) - if(YY == 16) - holiday = "Easter" - if(31) - if(YY == 13) - holiday = "Easter" - - if(4) //Apr - switch(DD) - if(1) - holiday = "April Fool's Day" - if(YY == 18 && prob(50)) holiday = "Easter" - if(5) - if(YY == 15) holiday = "Easter" - if(16) - if(YY == 17) holiday = "Easter" - if(20) - holiday = "Four-Twenty" - if(YY == 14 && prob(50)) holiday = "Easter" - if(22) holiday = "Earth Day" - - if(5) //May - switch(DD) - if(1) holiday = "Labour Day" - if(4) holiday = "FireFighter's Day" - if(12) holiday = "Owl and Pussycat Day" //what a dumb day of observence...but we -do- have costumes already :3 - - if(6) //Jun - - if(7) //Jul - switch(DD) - if(1) holiday = "Doctor's Day" - if(2) holiday = "UFO Day" - if(8) holiday = "Writer's Day" - if(30) holiday = "Friendship Day" - - if(8) //Aug - switch(DD) - if(5) holiday = "Beer Day" - - if(9) //Sep - switch(DD) - if(19) holiday = "Talk-Like-a-Pirate Day" - if(28) holiday = "Stupid-Questions Day" - - if(10) //Oct - switch(DD) - if(4) holiday = "Animal's Day" - if(7) holiday = "Smiling Day" - if(16) holiday = "Boss' Day" - if(31) holiday = "Halloween" - - if(11) //Nov - switch(DD) - if(1) holiday = "Vegan Day" - if(13) holiday = "Kindness Day" - if(19) holiday = "Flowers Day" - if(21) holiday = "Saying-'Hello' Day" - - if(12) //Dec - switch(DD) - if(10) holiday = "Human-Rights Day" - if(14) holiday = "Monkey Day" - if(21) holiday = "Mayan Doomsday Anniversary" - if(22) holiday = "Orgasming Day" //lol. These all actually exist - if(24) holiday = "Xmas" - if(25) holiday = "Xmas" - if(26) holiday = "Boxing Day" - if(31) holiday = "New Year" - - if(!holiday) - //Friday the 13th - if(DD == 13) - if(time2text(world.timeofday, "DDD") == "Fri") - holiday = "Friday the 13th" - - world.update_status() + for(var/H in typesof(/datum/holiday) - /datum/holiday) + var/datum/holiday/holiday = new H() + if(holiday.shouldCelebrate(DD, MM, YY)) + holiday.celebrate() + if(!holidays) + holidays = list() + holidays[holiday.name] = holiday + if(holidays) + holidays = shuffle(holidays) + world.update_status() /datum/subsystem/events/proc/toggleWizardmode() wizardmode = !wizardmode diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 2f6c5b2d9d6..b95467bc9b7 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.holiday == "April Fool's Day") + if(SSevent.holidays["April Fool's Day"]) login_music = 'sound/ambience/clown.ogg' /datum/subsystem/ticker/Initialize() @@ -188,11 +188,13 @@ var/datum/subsystem/ticker/ticker world << "Welcome to [station_name()], enjoy your stay!" - world << sound('sound/AI/welcome.ogg') // Skie - //Holiday Round-start stuff ~Carn - if(SSevent.holiday) + world << sound('sound/AI/welcome.ogg') + + if(SSevent.holidays) world << "and..." - world << "