From d088aacaf104b63350dfa7da2882f5236dc90c54 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 7 Jan 2017 17:59:36 -0800 Subject: [PATCH] Switches from being days based to playtime based --- code/__HELPERS/game.dm | 6 +++--- code/datums/datumvars.dm | 6 +++--- code/game/jobs/job_exp.dm | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 5917886d3cb..69ea87f8fda 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -418,7 +418,7 @@ /proc/SecondsToTicks(var/seconds) return seconds * 10 -proc/pollCandidates(var/Question, var/be_special_type, var/antag_age_check = 0, var/poll_time = 300, var/ignore_respawnability = 0, var/min_days = 0) +proc/pollCandidates(var/Question, var/be_special_type, var/antag_age_check = 0, var/poll_time = 300, var/ignore_respawnability = 0, var/min_hours = 0) var/roletext = be_special_type ? get_roletext(be_special_type) : null var/list/mob/dead/observer/candidates = list() var/time_passed = world.time @@ -437,8 +437,8 @@ proc/pollCandidates(var/Question, var/be_special_type, var/antag_age_check = 0, if(roletext) if(jobban_isbanned(G, roletext) || jobban_isbanned(G, "Syndicate")) continue - if(min_days) - if(G.client.player_age < min_days) + if(min_hours) + if(G.client.get_exp_living_num() < min_hours * 60) continue if(G.has_enabled_antagHUD) continue diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index dddc722a845..01d2e626b29 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -616,9 +616,9 @@ body return to_chat(M, "Control of your mob has been offered to dead players.") log_admin("[key_name(usr)] has offered control of ([key_name(M)]) to ghosts.") - message_admins("[key_name_admin(usr)] has offered control of ([key_name_admin(M)]) to ghosts") - var/mindays = input(usr, "Minimum days required to play [M]?", "Set Min Days", 30) as num - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [M.real_name]?", poll_time = 100, min_days = mindays) + var/minhours = input(usr, "Minimum hours required to play [M]?", "Set Min Hrs", 10) as num + message_admins("[key_name_admin(usr)] has offered control of ([key_name_admin(M)]) to ghosts with [minhours] hrs playtime") + var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [M.real_name]?", poll_time = 100, min_hours = minhours) var/mob/dead/observer/theghost = null if(candidates.len) diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index 23d217a83bc..746dfcacf44 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -106,9 +106,12 @@ /client/proc/get_exp_living() + return get_exp_format(get_exp_living_num()) + +/client/proc/get_exp_living_num() var/list/play_records = params2list(prefs.exp) var/exp_living = text2num(play_records[EXP_TYPE_LIVING]) - return get_exp_format(exp_living) + return exp_living /proc/get_exp_format(var/expnum) if(expnum > 60)