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.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3450 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-04-13 16:58:03 +00:00
parent 3dae4beda4
commit 1d4b40d915
18 changed files with 258 additions and 44 deletions

View File

@@ -283,6 +283,9 @@
if("popup_admin_pm")
config.popup_admin_pm = 1
if("allow_holidays")
Holiday = 1
if("useircbot")
useircbot = 1

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()

View File

@@ -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

View File

@@ -0,0 +1 @@
//placeholder for holiday stuff

View File

@@ -0,0 +1 @@
//placeholder for holiday stuff

View File

@@ -0,0 +1 @@
//placeholder for holiday stuff

View File

@@ -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])")*/

View File

@@ -113,9 +113,10 @@ var/global/datum/controller/gameticker/ticker
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 (3000)
start_events() //handles random events and space dust.
start_events() //handles random events and space dust.
spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE

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

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"

View File

@@ -2630,7 +2630,7 @@ var/global/BSACooldown = 0
message_admins("<font color='blue'>[usr.key] has started the game.</font>")
return 1
else
alert("Game has already started you fucking jerk, stop spamming up the chat :ARGH:")
usr << "<font color='red'>Error: Start Now: Game has already started.</font>"
return 0
/obj/admins/proc/toggleenter()

View File

@@ -248,6 +248,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
@@ -398,6 +399,7 @@
verbs -= /client/proc/startSinglo
verbs -= /client/proc/jumptocoord
verbs -= /client/proc/everyone_random
verbs -= /client/proc/Set_Holiday
verbs -= /proc/possess
verbs -= /proc/release
//verbs -= /client/proc/give_spell --Merged with view variables

View File

@@ -70,7 +70,7 @@
attack_self(mob/living/user as mob)
examine()
if(rigged && isAprilFools())
if(rigged && (Holiday == "April Fool's Day"))
if(spam_flag == 0)
spam_flag = 1
playsound(src.loc, 'bikehorn.ogg', 50, 1)

View File

@@ -42,7 +42,7 @@
papers.Remove(P)
else
P = new /obj/item/weapon/paper
if(isAprilFools())
if(Holiday == "April Fool's Day")
if(prob(30))
P.info = "<font face=\"[P.crayonfont]\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>"
P.rigged = 1

View File

@@ -139,5 +139,8 @@ FEATURE_OBJECT_SPELL_SYSTEM
## 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
##Remove the # mark if you are going to use the SVN irc bot to relay adminhelps
#USEIRCBOT

View File

@@ -34,6 +34,7 @@
#define FILE_DIR "code/game/gamemodes/changeling"
#define FILE_DIR "code/game/gamemodes/cult"
#define FILE_DIR "code/game/gamemodes/events"
#define FILE_DIR "code/game/gamemodes/events/holidays"
#define FILE_DIR "code/game/gamemodes/extended"
#define FILE_DIR "code/game/gamemodes/malfunction"
#define FILE_DIR "code/game/gamemodes/meteor"
@@ -401,6 +402,7 @@
#include "code\game\gamemodes\events\space_ninja.dm"
#include "code\game\gamemodes\events\spacevines.dm"
#include "code\game\gamemodes\events\wormholes.dm"
#include "code\game\gamemodes\events\holidays\Holidays.dm"
#include "code\game\gamemodes\extended\extended.dm"
#include "code\game\gamemodes\malfunction\Malf_Modules.dm"
#include "code\game\gamemodes\malfunction\malfunction.dm"