Fixes Cap and HoP playtime requirements

This commit is contained in:
Aronai Sieyes
2020-05-11 17:21:39 -04:00
parent 9648659eb1
commit 0a286687a0
2 changed files with 26 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
/datum/job/captain
disallow_jobhop = TRUE
pto_type = PTO_CIVILIAN
//dept_time_required = 60 //Pending something more complicated
dept_time_required = 80 //Pending something more complicated
/datum/job/hop
disallow_jobhop = TRUE

View File

@@ -30,4 +30,29 @@
return max(0, dept_time_required - C.play_hours[pto_type])
else // List doesn't have that entry, maybe never played, maybe invalid PTO type (you should fix that...)
return dept_time_required // Could be 0, too, which is fine! They can play that
return 0
// Special treatment for some the more complicated heads
// Captain gets every department combined
/datum/job/captain/available_in_playhours(client/C)
if(C && config.use_playtime_restriction_for_jobs)
var/remaining_time_needed = dept_time_required
for(var/key in C.play_hours)
if(isnum(C.play_hours[key]))
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[key])
return remaining_time_needed
return 0
// HoP gets civilian, cargo, and exploration combined
/datum/job/hop/available_in_playhours(client/C)
if(C && config.use_playtime_restriction_for_jobs)
var/remaining_time_needed = dept_time_required
if(isnum(C.play_hours[PTO_CIVILIAN]))
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[PTO_CIVILIAN])
if(isnum(C.play_hours[PTO_CARGO]))
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[PTO_CARGO])
if(isnum(C.play_hours[PTO_EXPLORATION]))
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[PTO_EXPLORATION])
return remaining_time_needed
return 0