Skip to content

Commit

Permalink
moves client procs to client_procs.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdtalon committed Dec 6, 2023
1 parent 8d686ff commit 6c059ae
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -795,3 +795,50 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list(
xeno_prefix = "XX"
if(!xeno_postfix || xeno_name_ban)
xeno_postfix = ""

/// playtime for all castes
/client/proc/get_total_xeno_playtime(skip_cache = FALSE)
if(cached_xeno_playtime && !skip_cache)
return cached_xeno_playtime

var/total_xeno_playtime = 0

for(var/caste in GLOB.RoleAuthority.castes_by_name)
total_xeno_playtime += get_job_playtime(src, caste)

total_xeno_playtime += get_job_playtime(src, JOB_XENOMORPH)

if(player_entity)
var/past_xeno_playtime = player_entity.get_playtime(STATISTIC_XENO)
if(past_xeno_playtime)
total_xeno_playtime += past_xeno_playtime


cached_xeno_playtime = total_xeno_playtime

return total_xeno_playtime

/// playtime for drone and drone evolution castes
/client/proc/get_total_drone_playtime()
var/total_drone_playtime = 0

var/list/drone_evo_castes = list(XENO_CASTE_DRONE, XENO_CASTE_CARRIER, XENO_CASTE_BURROWER, XENO_CASTE_HIVELORD, XENO_CASTE_QUEEN)

for(var/caste in GLOB.RoleAuthority.castes_by_name)
if(!(caste in drone_evo_castes))
continue
total_drone_playtime += get_job_playtime(src, caste)

return total_drone_playtime

/// playtime for t3 castes and queen
/client/proc/get_total_t3_playtime()
var/total_t3_playtime = 0
var/datum/caste_datum/caste
for(var/caste_name in GLOB.RoleAuthority.castes_by_name)
caste = GLOB.RoleAuthority.castes_by_name[caste_name]
if(caste.tier < 3)
continue
total_t3_playtime += get_job_playtime(src, caste_name)

return total_t3_playtime

0 comments on commit 6c059ae

Please sign in to comment.