Files
Polaris/code/modules/events/event_manager.dm
giacomand@gmail.com 458fddbea5 - Tweaks to spiders to be less robust.
- Made goats/cows not give infinite milk but instead slowly generate milk in their udder for collecting.
- Lowered speak chance for chickens and added a limit for how many chickens can be bred.
- Lowered the chances of an egg to be a chicken hatching egg.
- If you put an egg in your pocket it won't be a chicken hatching egg anymore.
- Chickens won't spawn inside you anymore.
- Added some abstract classes to the list of things that shouldn't spawn with slime cores.
- Increased the time between events.
- Added a spawn spiders button for admins.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5535 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-12 23:07:51 +00:00

50 lines
1.1 KiB
Plaintext

var/list/allEvents = typesof(/datum/event) - /datum/event
var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event
var/eventTimeLower = 15000 //15 minutes
var/eventTimeUpper = 30000 //30 minutes
var/scheduledEvent = null
//Currently unused. Needs an admin panel for messing with events.
/proc/addPotentialEvent(var/type)
potentialRandomEvents |= type
/proc/removePotentialEvent(var/type)
potentialRandomEvents -= type
/proc/checkEvent()
if(!scheduledEvent)
scheduledEvent = world.timeofday + rand(eventTimeLower, eventTimeUpper)
else if(world.timeofday > scheduledEvent)
spawnEvent()
scheduledEvent = null
checkEvent()
/proc/spawnEvent()
if(!config.allow_random_events)
return
var/Type = pick(potentialRandomEvents)
if(!Type)
return
//The event will add itself to the MC's event list
//and start working via the constructor.
new Type
/client/proc/forceEvent(var/type in allEvents)
set name = "Trigger Event (Debug Only)"
set category = "Debug"
if(!holder)
return
if(ispath(type))
new type
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)