mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fixes Cap and HoP playtime requirements
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user