July 5th TG sync (#1883)

July 5th TG sync
This commit is contained in:
Poojawa
2017-07-05 22:14:19 -05:00
committed by GitHub
parent 454b9c3d68
commit b1b4826c0c
1264 changed files with 149689 additions and 570309 deletions
+8 -3
View File
@@ -70,7 +70,10 @@ SUBSYSTEM_DEF(events)
if(!E.canSpawnEvent(players_amt, gamemode))
continue
if(E.weight < 0) //for round-start events etc.
if(TriggerEvent(E))
var/res = TriggerEvent(E)
if(res == EVENT_INTERRUPTED)
continue //like it never happened
if(res == EVENT_CANT_RUN)
return
sum_of_weights += E.weight
@@ -89,7 +92,7 @@ SUBSYSTEM_DEF(events)
. = E.preRunEvent()
if(. == EVENT_CANT_RUN)//we couldn't run this event for some reason, set its max_occurrences to 0
E.max_occurrences = 0
else if(. != EVENT_CANCELLED)
else if(. == EVENT_READY)
E.runEvent(TRUE)
/datum/round_event/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
@@ -172,10 +175,12 @@ SUBSYSTEM_DEF(events)
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/DDD = text2num(time2text(world.timeofday, "DDD")) // get the current weekday
var/W = weekdayofthemonth() // is this the first monday? second? etc.
for(var/H in subtypesof(/datum/holiday))
var/datum/holiday/holiday = new H()
if(holiday.shouldCelebrate(DD, MM, YY))
if(holiday.shouldCelebrate(DD, MM, YY, W, DDD))
holiday.celebrate()
if(!holidays)
holidays = list()