diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index a7d03508502..d764d6a66e4 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -283,6 +283,9 @@ if("popup_admin_pm") config.popup_admin_pm = 1 + if("allow_holidays") + Holiday = 1 + if("useircbot") useircbot = 1 diff --git a/code/defines/procs/station_name.dm b/code/defines/procs/station_name.dm index bbebf356f14..69d5a0126d8 100644 --- a/code/defines/procs/station_name.dm +++ b/code/defines/procs/station_name.dm @@ -2,41 +2,59 @@ if (station_name) return station_name + var/random = rand(1,5) var/name = "" + //Rare: Pre-Prefix if (prob(10)) - name += pick("Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", "Automated", "Experimental", "Augmented") - name += " " + name = pick("Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", "Automated", "Experimental", "Augmented") + station_name = name + " " // Prefix - 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) - name += " " + switch(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) + 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") + station_name += name + " " + random = 13 + else + //get the first word of the Holiday and use that + var/i = findtext(Holiday," ",1,0) + name = copytext(Holiday,1,i) + 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") - name += " " + 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") + station_name += name + " " // ID Number - if (prob(40)) - name += "[rand(1, 99)]" - else if (prob(50)) - name += pick("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega") - else if (prob(30)) - name += pick("II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX") - else if (prob(40)) - name += pick("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu") - else - name += pick("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen") + switch(random) + if(1) + station_name += "[rand(1, 99)]" + if(2) + station_name += pick("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega") + if(3) + station_name += pick("II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX") + if(4) + station_name += pick("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu") + if(5) + station_name += pick("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen") + if(13) + station_name += pick("13","XIII","Thirteen") - station_name = name if (config && config.server_name) world.name = "[config.server_name]: [name]" else - world.name = name + world.name = station_name - return name + return station_name /proc/world_name(var/name) diff --git a/code/defines/procs/time_stamp.dm b/code/defines/procs/time_stamp.dm index e9e72a95636..f8e8fa82be8 100644 --- a/code/defines/procs/time_stamp.dm +++ b/code/defines/procs/time_stamp.dm @@ -22,7 +22,3 @@ proc/isDay(var/month, var/day) // Uncomment this out when debugging! //else //return 1 - -/* Check if it's april fools day */ -proc/isAprilFools() - return isDay(4, 1) diff --git a/code/game/cellautomata.dm b/code/game/cellautomata.dm index 17204286693..7edc8756970 100644 --- a/code/game/cellautomata.dm +++ b/code/game/cellautomata.dm @@ -82,6 +82,7 @@ if (config.usewhitelist) load_whitelist() LoadBansjob() + Get_Holiday() //~Carn, needs to be here when the station is named so :P src.update_status() makepowernets() diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 17ec8da588e..b1e5fef9ba6 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -1,14 +1,22 @@ /proc/start_events() - if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station - spawn(1) - dust_swarm("weak") - if (!event && prob(eventchance) && config.allow_random_events) //CARN: checks to see if random events are enabled. - event() - hadevent = 1 - spawn(1300) - event = 0 - spawn(1200) - start_events() + //changed to a while(1) loop since they are more efficient. + //Moved the spawn in here to allow it to be called with advance proc call if it crashes. + //and also to stop spawn copying variables from the game ticker + spawn(3000) + while(1) + if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station + spawn(1) + dust_swarm("weak") + if (!event) + //CARN: checks to see if random events are enabled. + if(config.allow_random_events && prob(eventchance)) + event() + hadevent = 1 + else + Holiday_Random_Event() + else + event = 0 + sleep(1200) /proc/event() event = 1 diff --git a/code/game/gamemodes/events/holidays/AprilFools.dm b/code/game/gamemodes/events/holidays/AprilFools.dm new file mode 100644 index 00000000000..2b4a1008ff1 --- /dev/null +++ b/code/game/gamemodes/events/holidays/AprilFools.dm @@ -0,0 +1 @@ +//placeholder for holiday stuff \ No newline at end of file diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm new file mode 100644 index 00000000000..2b4a1008ff1 --- /dev/null +++ b/code/game/gamemodes/events/holidays/Christmas.dm @@ -0,0 +1 @@ +//placeholder for holiday stuff \ No newline at end of file diff --git a/code/game/gamemodes/events/holidays/Easter.dm b/code/game/gamemodes/events/holidays/Easter.dm new file mode 100644 index 00000000000..2b4a1008ff1 --- /dev/null +++ b/code/game/gamemodes/events/holidays/Easter.dm @@ -0,0 +1 @@ +//placeholder for holiday stuff \ No newline at end of file diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm new file mode 100644 index 00000000000..857cac7c30a --- /dev/null +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -0,0 +1,178 @@ +//Uncommenting ALLOW_HOLIDAYS in config.txt will enable Holidays +var/global/Holiday = null + +//Just thinking ahead! Here's the foundations to a more robust Holiday event system. +//It's easy as hell to add stuff. Just set Holiday to something using the switch (or something else) +//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only +//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause +//the game to lag even more in the name of one-day content. + +////////////////////////////////////////////////////////////////////////////////////////////////////////// +//ALSO, MOST IMPORTANTLY: Don't add stupid stuff! Discuss bonus content with Project-Heads first please!// +////////////////////////////////////////////////////////////////////////////////////////////////////////// +// ~Carn + +//sets up the Holiday global variable. Shouldbe called on game configuration or something. +/proc/Get_Holiday() + if(!Holiday) return // Holiday stuff was not enabled in the config! + + Holiday = null // reset our switch now so we can recycle it as our Holiday name + + 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's Day" + + 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(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(14) Holiday = "Pi Day" + 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(22) Holiday = "Orgasming Day" //lol. These all actually exist + if(24) Holiday = "Christmas Eve" + if(25) Holiday = "Christmas" + if(26) Holiday = "Boxing Day" + if(31) Holiday = "New Year's Eve" + + if(!Holiday) + //Friday the 13th + if(DD == 13) + if(time2text(world.timeofday, "DDD") == "Fri") + Holiday = "Friday the 13th" + +//Allows GA and GM to set the Holiday variable +/client/proc/Set_Holiday(T as text|null) + set name = ".Set Holiday" + set category = "Fun" + set desc = "Force-set the Holiday variable to make the game think it's a certain day." + + if( !holder || !(holder.rank in list("Game Master","Game Admin")) ) + src << "Error: Set_Holiday: You hold insufficient rank to perform this action." + return + + if(!T) return + + Holiday = T + //get a new station name + station_name = null + station_name() + //update our hub status + world.update_status() +// Holiday_Game_Start() + + message_admins("\blue ADMIN: Event: [key_name(src)] force-set Holiday to \"[Holiday]\"") + log_admin("[key_name(src)] force-set Holiday to \"[Holiday]\"") + + +//Run at the start of a round +/proc/Holiday_Game_Start() + if(Holiday) + world << "and..." + world << "