mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
@@ -41,3 +41,16 @@
|
||||
#define BOXING_DAY "Boxing Day"
|
||||
#define NEW_YEARS_EVE "New Year's Eve"
|
||||
#define FRIDAY_THE_13TH "Friday the 13th"
|
||||
|
||||
//timeslots as strings
|
||||
#define SLEEPTIME "the morning shift" //3 to 11
|
||||
#define EUROTIME "the European shift" //12 to 15
|
||||
#define DAYTIME "the day shift" //16 to 18
|
||||
#define PRIMETIME "primetime" //19 to 22
|
||||
#define LATETIME "the late shift" //23 to 2
|
||||
//timeslots as hour values
|
||||
#define SLEEPTIME_HOURS 3 to 11
|
||||
#define EUROTIME_HOURS 12 to 15
|
||||
#define DAYTIME_HOURS 16 to 18
|
||||
#define PRIMETIME_HOURS 19 to 22
|
||||
#define LATETIME_HOURS 23, 0 to 2
|
||||
@@ -98,3 +98,25 @@
|
||||
//returns timestamp in a sql and ISO 8601 friendly format
|
||||
/proc/SQLtime()
|
||||
return time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
|
||||
|
||||
//Returns time as a "slot", a predefined type of time, see dates.dm for defines
|
||||
/proc/getTimeslot()
|
||||
switch(text2num(time2text(world.timeofday, "hh")))
|
||||
if(SLEEPTIME_HOURS)
|
||||
return SLEEPTIME
|
||||
if(EUROTIME_HOURS)
|
||||
return EUROTIME
|
||||
if(DAYTIME_HOURS)
|
||||
return DAYTIME
|
||||
if(PRIMETIME_HOURS)
|
||||
return PRIMETIME
|
||||
if(LATETIME_HOURS)
|
||||
return LATETIME
|
||||
CRASH("getTimeslot: Hour not found.")
|
||||
|
||||
|
||||
var/global/obj/effect/statclick/time/time_statclick
|
||||
/proc/timeStatEntry()
|
||||
if(!time_statclick)
|
||||
time_statclick = new /obj/effect/statclick/time("loading...")
|
||||
stat("Station Time:", time_statclick.update("[worldtime2text()]"))
|
||||
@@ -10,6 +10,9 @@
|
||||
name = text
|
||||
return src
|
||||
|
||||
/obj/effect/statclick/time/Click()
|
||||
to_chat(usr,"<span class='notice'>The server time is [time2text(world.timeofday, "hh:mm:ss")]. The time slot is [getTimeslot()].</span>")
|
||||
|
||||
/obj/effect/statclick/debug
|
||||
var/class
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
var/required_pop = list(10,10,0,0,0,0,0,0,0,0)//if enemy_jobs was set, this is the amount of population required for the ruleset to fire. enemy jobs count double
|
||||
var/required_candidates = 0//the rule needs this many candidates (post-trimming) to be executed (example: Cult need 4 players at round start)
|
||||
var/weight = 5//1 -> 9, probability for this rule to be picked against other rules
|
||||
var/list/weekday_rule_boost = list()
|
||||
var/list/timeslot_rule_boost = list()
|
||||
var/cost = 0//threat cost for this rule.
|
||||
var/logo = ""//any state from /icons/logos.dmi
|
||||
var/calledBy //who dunnit, for round end scoreboard
|
||||
@@ -114,6 +116,7 @@
|
||||
return FALSE
|
||||
|
||||
/datum/dynamic_ruleset/proc/get_weight()
|
||||
weight *= weight_time_day()
|
||||
if(repeatable && weight > 1)
|
||||
for(var/datum/dynamic_ruleset/DR in mode.executed_rules)
|
||||
if(istype(DR,src.type))
|
||||
@@ -123,6 +126,15 @@
|
||||
message_admins("[name] had [weight] weight (-[initial(weight) - weight]).")
|
||||
return weight
|
||||
|
||||
//Return a multiplicative weight. 1 for nothing special.
|
||||
/datum/dynamic_ruleset/proc/weight_time_day()
|
||||
var/weigh = 1
|
||||
if(time2text(world.timeofday, "DDD") in weekday_rule_boost)
|
||||
weigh *= 2
|
||||
if(getTimeslot() in timeslot_rule_boost)
|
||||
weigh *= 2
|
||||
return weigh
|
||||
|
||||
/datum/dynamic_ruleset/proc/trim_candidates()
|
||||
return
|
||||
|
||||
|
||||
@@ -371,6 +371,7 @@
|
||||
required_pop = list(25,20,20,15,15,15,10,10,10,10)
|
||||
required_candidates = 1
|
||||
weight = 2
|
||||
weekday_rule_boost = list("Tue")
|
||||
cost = 30
|
||||
requirements = list(90,90,90,80,60,40,30,20,10,10)
|
||||
high_population_requirement = 70
|
||||
@@ -481,6 +482,7 @@
|
||||
required_pop = list(0,0,10,10,15,15,20,20,20,25)
|
||||
required_candidates = 1
|
||||
weight = 1
|
||||
timeslot_rule_boost = list(SLEEPTIME)
|
||||
cost = 5
|
||||
requirements = list(5,5,15,15,25,25,55,55,55,75)
|
||||
logo = "rambler-logo"
|
||||
|
||||
@@ -425,6 +425,7 @@
|
||||
required_pop = list(30,25,25,20,20,20,15,15,15,15)
|
||||
required_candidates = 1
|
||||
weight = 3
|
||||
weekday_rule_boost = list("Tue")
|
||||
cost = 45
|
||||
requirements = list(90,90,90,80,60,40,30,20,10,10)
|
||||
high_population_requirement = 70
|
||||
|
||||
@@ -477,7 +477,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/Stat()
|
||||
..()
|
||||
if(statpanel("Status"))
|
||||
stat(null, "Station Time: [worldtime2text()]")
|
||||
timeStatEntry()
|
||||
if(ticker.mode)
|
||||
for(var/datum/faction/F in ticker.mode.factions)
|
||||
var/f_stat = F.get_statpanel_addition()
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
if(statpanel("Status") && ticker)
|
||||
if (ticker.current_state != GAME_STATE_PREGAME)
|
||||
stat("Station Time:", "[worldtime2text()]")
|
||||
timeStatEntry()
|
||||
if(ticker.hide_mode)
|
||||
stat("Game Mode:", "Secret")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user