Weights the likelihood of command positions by your age.

For most head positions, a good age is between 25 and 60, with ages towards the middle of that being even better. 25 because I figure for stuff like research, engineer etc. they'll want someone with fresh knowledge. Captain's best age starts at 35 though, due to that being an "old geezer job".
This commit is contained in:
cib
2013-06-09 01:13:13 +02:00
parent 6d1dabf3dd
commit 8c6b8add20

View File

@@ -134,7 +134,40 @@ var/global/datum/controller/occupations/job_master
if(!job) continue
var/list/candidates = FindOccupationCandidates(job, level)
if(!candidates.len) continue
var/mob/new_player/candidate = pick(candidates)
// Build a weighted list, weight by age.
var/list/weightedCandidates = list()
// Different head positions have different good ages.
var/good_age_minimal = 25
var/good_age_maximal = 60
if(command_position == "Captain")
good_age_minimal = 30
good_age_maximal = 70 // Old geezer captains ftw
for(var/mob/V in candidates)
// Log-out during round-start? What a bad boy, no head position for you!
if(!V.client) continue
var/age = V.client.prefs.age
switch(age)
if(good_age_minimal - 10 to good_age_minimal)
weightedCandidates[V] = 3 // Still a bit young.
if(good_age_minimal to good_age_minimal + 10)
weightedCandidates[V] = 6 // Better.
if(good_age_minimal + 10 to good_age_maximal - 10)
weightedCandidates[V] = 10 // Great.
if(good_age_maximal - 10 to good_age_maximal)
weightedCandidates[V] = 6 // Still good.
if(good_age_maximal to good_age_maximal + 10)
weightedCandidates[V] = 6 // Bit old, don't you think?
if(good_age_maximal to good_age_maximal + 50)
weightedCandidates[V] = 3 // Geezer.
else
// If there's ABSOLUTELY NOBODY ELSE
if(candidates.len == 1) weightedCandidates[V] = 1
var/mob/new_player/candidate = pickweight(weightedCandidates)
if(AssignRole(candidate, command_position))
return 1
return 0