TG: Added the foundations of a special-day events system. It's a bit more robust,

tidy and efficient than calling isDay everywhere. It defaults to disabled. It
can be enabled by uncommenting ALLOW_HOLIDAYS in config/config.txt

I've added no content just the foundations. All it does is give the station a
holiday themed name and say "Happy [Holiday] Everybody!" at the round-start.

Added a .Set Holiday verb for GM and GA Admins. I'd rather people didn't use it
for now (there's not much point as there's no content yet anyway). It's mainly
for bugtesting.

Foundations are there to create holiday random events and round-start stuff so
we can keep everything together. Check out code/game/gamemodes/events/holidays !

NOTE: This is intended for easter eggs! Little trinkets and such to make these
days special. It IS NOT for spawning grief items and game-changing stuff. If you
REALLY want to add stuff like that, please speak to the project heads. If it's
used for spawning bullshit like poop or grief items I'll just remove my code.
Thanks.

Happy Friday 13th :)

Other Fixes:
Oxygen tanks no longer spam BEEPBEEPBEEPBEEP at everybody nearby. That only
happens for the person holding them.
Revision: r3450
Author: 	 elly1...@rocketmail.com
Date: 	Apr 13, 2012
This commit is contained in:
Ren Erthilo
2012-05-03 03:17:00 +01:00
parent e3229758ef
commit d92495a2b0
13 changed files with 246 additions and 7 deletions
+2
View File
@@ -31,6 +31,7 @@
#define FILE_DIR "code/game/asteroid"
#define FILE_DIR "code/game/events"
#define FILE_DIR "code/game/events/EventProcs"
#define FILE_DIR "code/game/events/EventProcs/holidays"
#define FILE_DIR "code/game/events/Events"
#define FILE_DIR "code/game/gamemodes"
#define FILE_DIR "code/game/gamemodes/autotraitor"
@@ -405,6 +406,7 @@
#include "code\game\events\EventProcs\space_ninja.dm"
#include "code\game\events\EventProcs\spacevines.dm"
#include "code\game\events\EventProcs\wormholes.dm"
#include "code\game\events\EventProcs\holidays\Holidays.dm"
#include "code\game\events\Events\AlienInfestation.dm"
#include "code\game\events\Events\Appendicitis.dm"
#include "code\game\events\Events\ElectricalStorm.dm"
+4
View File
@@ -285,6 +285,10 @@
if("popup_admin_pm")
config.popup_admin_pm = 1
if("allow_holidays")
Holiday = 1
if("useircbot")
useircbot = 1
+47 -2
View File
@@ -3,15 +3,60 @@
return station_name
var/name = "NSS Exodus"
/*
var/random = rand(1,5)
var/name = ""
station_name = 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")
station_name = name + " "
// Prefix
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")
station_name += name + " "
// ID Number
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")
*/
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = "Baystation12"
return name
return station_name
/proc/world_name(var/name)
+1
View File
@@ -88,6 +88,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()
@@ -0,0 +1 @@
//placeholder for holiday stuff
@@ -0,0 +1 @@
//placeholder for holiday stuff
@@ -0,0 +1 @@
//placeholder for holiday stuff
@@ -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 << "<font color='red'>Error: Set_Holiday: You hold insufficient rank to perform this action.</font>"
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 << "<font color='blue'>and...</font>"
world << "<h4>Happy [Holiday] Everybody!</h4>"
switch(Holiday) //special holidays
if("Easter")
//do easter stuff
if("Christmas ")
//do christmas stuff
else
//etc. you get what I'm getting at
return
//Nested in the random events loop. Will be triggered every 2 minutes
/proc/Holiday_Random_Event()
switch(Holiday) //special holidays
if("",null) //no Holiday today! Back to work!
return
if("Easter") //I'll make this into some helper procs at some point
/* var/list/turf/simulated/floor/Floorlist = list()
for(var/turf/simulated/floor/T)
if(T.contents)
Floorlist += T
var/turf/simulated/floor/F = Floorlist[rand(1,Floorlist.len)]
Floorlist = null
var/obj/structure/closet/C = locate(/obj/structure/closet) in F
var/obj/item/weapon/reagent_containers/food/snacks/chocolateegg/wrapped/Egg
if( C ) Egg = new(C)
else Egg = new(F)
*/
/* var/list/obj/containers = list()
for(var/obj/item/weapon/storage/S in world)
if(S.z != 1) continue
containers += S
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
+2
View File
@@ -113,6 +113,8 @@ var/datum/roundinfo/roundinfo = new()
spawn(-1)
world << "<FONT color='blue'><B>Enjoy the game!</B></FONT>"
world << sound('welcome.ogg') // Skie
//Holiday Round-start stuff ~Carn
Holiday_Game_Start()
spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE
+2 -2
View File
@@ -33,9 +33,9 @@
examine()
set src in usr
..()
if(air_contents.oxygen < 1)
if(air_contents.oxygen < 1 && loc==usr)
usr << text("\red <B>The meter on the [src.name] indicates you are almost out of air!</B>")
playsound(usr, 'alert.ogg', 50, 1)
usr << sound('alert.ogg')
/obj/item/weapon/tank/plasma
+2 -3
View File
@@ -18,10 +18,9 @@
examine()
set src in usr
..()
if(air_contents.oxygen < 0.4)
if(air_contents.oxygen < 0.2 && loc==usr)
usr << text("\red <B>The meter on the [src.name] indicates you are almost out of air!</B>")
playsound(usr, 'alert.ogg', 50, 1)
usr << sound('alert.ogg')
/obj/item/weapon/tank/emergency_oxygen/engi
icon_state = "emergency_engi"
+2
View File
@@ -256,6 +256,7 @@
verbs += /client/proc/toggle_gravity_off
verbs += /client/proc/toggle_random_events
verbs += /client/proc/deadmin_self
verbs += /client/proc/Set_Holiday //Force-set a Holiday
//verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables
//verbs += /client/proc/cmd_admin_explosion --Merged with view variables
//verbs += /client/proc/cmd_admin_emp --Merged with view variables
@@ -416,6 +417,7 @@
verbs -= /client/proc/deadmin_self
verbs -= /client/proc/jumptocoord
verbs -= /client/proc/everyone_random
verbs -= /client/proc/Set_Holiday
verbs -= /client/proc/cmd_admin_change_custom_event
verbs -= /client/proc/admin_invis
verbs -= /client/proc/callprocgen
+3
View File
@@ -143,5 +143,8 @@ GUEST_JOBBAN 1
## The intention is to make adminPMs more visible. (although I fnd popups annoying so this defaults to off)
#POPUP_ADMIN_PM
## Remove the # to allow special 'Easter-egg' events on special holidays such as seasonal holidays and stuff like 'Talk Like a Pirate Day' :3 YAARRR
#ALLOW_HOLIDAYS
##What address should banned people appeal ther ban at? Remember to escape the characters, if needed!
# APPEAL_ADDRESS -->APPEAL ADDRESS HERE<--