mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge branch 'release' of https://github.com/VOREStation/VOREStation into izac-voreupdate
This commit is contained in:
@@ -17,14 +17,14 @@ datum/controller/transfer_controller/Destroy()
|
||||
datum/controller/transfer_controller/process()
|
||||
currenttick = currenttick + 1
|
||||
//VOREStation Edit START
|
||||
if (round_duration_in_ticks >= shift_last_vote - 2 MINUTES)
|
||||
shift_last_vote = 999999999999 //Setting to a stupidly high number since it'll be not used again.
|
||||
to_world("Warning: This upcoming round-extend vote will be your ONLY extend vote. Wrap up your scenes in the next 4 fuckin hours if the round is extended.") //YAWN EDIT NIGGA VOREStation Edit
|
||||
if (round_duration_in_ticks >= shift_hard_end - 1 MINUTE)
|
||||
if (round_duration_in_ds >= shift_last_vote - 2 MINUTES)
|
||||
shift_last_vote = 99999999 //Setting to a stupidly high number since it'll be not used again.
|
||||
to_world("<b>Warning: You have one hour left in the shift. Wrap up your scenes in the next 60 minutes before the transfer is called.</b>") //VOREStation Edit
|
||||
if (round_duration_in_ds >= shift_hard_end - 1 MINUTE)
|
||||
init_shift_change(null, 1)
|
||||
shift_hard_end = timerbuffer + config.vote_autotransfer_interval //If shuttle somehow gets recalled, let's force it to call again next time a vote would occur.
|
||||
timerbuffer = timerbuffer + config.vote_autotransfer_interval //Just to make sure a vote doesn't occur immediately afterwords.
|
||||
else if (round_duration_in_ticks >= timerbuffer - 1 MINUTE)
|
||||
else if (round_duration_in_ds >= timerbuffer - 1 MINUTE)
|
||||
SSvote.autotransfer()
|
||||
//VOREStation Edit END
|
||||
timerbuffer = timerbuffer + config.vote_autotransfer_interval
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
var/static/pto_cap = 100 //Hours
|
||||
var/static/require_flavor = FALSE
|
||||
var/static/ipqualityscore_apikey //API key for ipqualityscore.com
|
||||
var/static/use_playtime_restriction_for_jobs = FALSE
|
||||
|
||||
/hook/startup/proc/read_vs_config()
|
||||
var/list/Lines = file2list("config/config.txt")
|
||||
@@ -61,4 +62,6 @@
|
||||
config.require_flavor = TRUE
|
||||
if ("ipqualityscore_apikey")
|
||||
config.ipqualityscore_apikey = value
|
||||
if ("use_playtime_restriction_for_jobs")
|
||||
config.use_playtime_restriction_for_jobs = TRUE
|
||||
return 1
|
||||
|
||||
@@ -156,12 +156,15 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
|
||||
// Please don't stuff random bullshit here,
|
||||
// Make a subsystem, give it the SS_NO_FIRE flag, and do your work in it's Initialize()
|
||||
/datum/controller/master/Initialize(delay, init_sss)
|
||||
/datum/controller/master/Initialize(delay, init_sss, tgs_prime)
|
||||
set waitfor = 0
|
||||
|
||||
if(delay)
|
||||
sleep(delay)
|
||||
|
||||
if(tgs_prime)
|
||||
world.TgsInitializationComplete()
|
||||
|
||||
if(init_sss)
|
||||
init_subtypes(/datum/controller/subsystem, subsystems)
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ SUBSYSTEM_DEF(game_master)
|
||||
return FALSE
|
||||
|
||||
// Last minute antagging is bad for humans to do, so the GM will respect the start and end of the round.
|
||||
var/mills = round_duration_in_ticks
|
||||
var/mills = round_duration_in_ds
|
||||
var/mins = round((mills % 36000) / 600)
|
||||
var/hours = round(mills / 36000)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(nightshift)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/nightshift/fire(resumed = FALSE)
|
||||
if(round_duration_in_ticks < nightshift_first_check)
|
||||
if(round_duration_in_ds < nightshift_first_check)
|
||||
return
|
||||
check_nightshift()
|
||||
|
||||
|
||||
@@ -47,23 +47,33 @@ SUBSYSTEM_DEF(persist)
|
||||
|
||||
// Update client whatever
|
||||
var/client/C = M.client
|
||||
var/wait_in_hours = (wait / (1 HOUR)) * J.timeoff_factor
|
||||
var/wait_in_hours = wait / (1 HOUR)
|
||||
var/pto_factored = wait_in_hours * J.timeoff_factor
|
||||
LAZYINITLIST(C.department_hours)
|
||||
LAZYINITLIST(C.play_hours)
|
||||
var/dept_hours = C.department_hours
|
||||
if(isnum(C.department_hours[department_earning]))
|
||||
dept_hours[department_earning] += wait_in_hours
|
||||
var/play_hours = C.play_hours
|
||||
if(isnum(dept_hours[department_earning]))
|
||||
dept_hours[department_earning] += pto_factored
|
||||
else
|
||||
dept_hours[department_earning] = wait_in_hours
|
||||
dept_hours[department_earning] = pto_factored
|
||||
|
||||
//Cap it
|
||||
// If they're earning PTO they must be in a useful job so are earning playtime in that department
|
||||
if(J.timeoff_factor > 0)
|
||||
if(isnum(play_hours[department_earning]))
|
||||
play_hours[department_earning] += wait_in_hours
|
||||
else
|
||||
play_hours[department_earning] = wait_in_hours
|
||||
|
||||
// Cap it
|
||||
dept_hours[department_earning] = min(config.pto_cap, dept_hours[department_earning])
|
||||
|
||||
|
||||
// Okay we figured it out, lets update database!
|
||||
var/sql_ckey = sql_sanitize_text(C.ckey)
|
||||
var/sql_dpt = sql_sanitize_text(department_earning)
|
||||
var/sql_bal = text2num("[C.department_hours[department_earning]]")
|
||||
var/DBQuery/query = dbcon.NewQuery("INSERT INTO vr_player_hours (ckey, department, hours) VALUES ('[sql_ckey]', '[sql_dpt]', [sql_bal]) ON DUPLICATE KEY UPDATE hours = VALUES(hours)")
|
||||
var/sql_total = text2num("[C.play_hours[department_earning]]")
|
||||
var/DBQuery/query = dbcon.NewQuery("INSERT INTO vr_player_hours (ckey, department, hours, total_hours) VALUES ('[sql_ckey]', '[sql_dpt]', [sql_bal], [sql_total]) ON DUPLICATE KEY UPDATE hours = VALUES(hours), total_hours = VALUES(total_hours)")
|
||||
query.Execute()
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
|
||||
@@ -394,21 +394,26 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/create_characters()
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player && player.ready && player.mind)
|
||||
if(player.mind.assigned_role=="AI")
|
||||
if(player && player.ready && player.mind?.assigned_role)
|
||||
var/datum/job/J = SSjob.get_job(player.mind.assigned_role)
|
||||
|
||||
// Snowflakey AI treatment
|
||||
if(J.mob_type & JOB_SILICON_AI)
|
||||
player.close_spawn_windows()
|
||||
player.AIize()
|
||||
else if(!player.mind.assigned_role)
|
||||
player.AIize(move = TRUE)
|
||||
continue
|
||||
else
|
||||
//VOREStation Edit Start
|
||||
var/mob/living/carbon/human/new_char = player.create_character()
|
||||
if(new_char)
|
||||
qdel(player)
|
||||
if(istype(new_char) && !(new_char.mind.assigned_role=="Cyborg"))
|
||||
data_core.manifest_inject(new_char)
|
||||
//VOREStation Edit End
|
||||
|
||||
// Ask their new_player mob to spawn them
|
||||
if(!player.spawn_checks_vr(player.mind.assigned_role)) continue //VOREStation Add
|
||||
var/mob/living/carbon/human/new_char = player.create_character()
|
||||
|
||||
// Created their playable character, delete their /mob/new_player
|
||||
if(new_char)
|
||||
qdel(player)
|
||||
|
||||
// If they're a carbon, they can get manifested
|
||||
if(J.mob_type & JOB_CARBON)
|
||||
data_core.manifest_inject(new_char)
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/collect_minds()
|
||||
for(var/mob/living/player in player_list)
|
||||
|
||||
Reference in New Issue
Block a user