mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
## About The Pull Request Adds a new NTOS application to the game: "Plexagon Punch Clock", which functions similarly to the time clock in cryo. Using the app, crew members can clock out wherever they want. This will also create a locked briefcase containing certain job-related items; this can be unlocked by the player once they return to the shift, or by a relevant Command member. For later changes I'd like to be able to have this app be able to clock in/out a user via their DNA imprint. ## Why It's Good For The Game - It's easier to clock out before going for RP/ERP when done with work. - Placing job items in an easily-accessible box means that it's less annoying to return to work after finishing RP/ERP - Convenience ## Proof Of Testing <details> <summary>Screenshots/Videos</summary>  </details> ## Changelog 🆑 ArrisFairburne, LT3 add: Added a new app to clock in and out from any NT OS-compatible device (Plexagon Punch Clock) qol: Your job items are now locked into a box instead of warped to cryo, when clocking out /🆑 --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com> Co-authored-by: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com>
27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
/datum/controller/subsystem/job/proc/FreeRole(rank)
|
|
if(!rank)
|
|
stack_trace("FreeRole called to free job slot with no rank specified")
|
|
return
|
|
var/datum/job/job = get_job(rank)
|
|
if(!job)
|
|
stack_trace("FreeRole could not map rank [rank] to a job slot")
|
|
return FALSE
|
|
log_econ("Modifying job slots of [job.title]. Existing slots: [job.current_positions]/[job.total_positions] New slots: [max(0, job.current_positions - 1)]/[job.total_positions]")
|
|
job.current_positions = max(0, job.current_positions - 1)
|
|
|
|
/// Used for clocking back in, re-claiming the previously freed role. Returns false if no slot is available.
|
|
/datum/controller/subsystem/job/proc/OccupyRole(rank)
|
|
if(!rank)
|
|
stack_trace("OccupyRole called to free job slot with no rank specified")
|
|
return FALSE
|
|
var/datum/job/job = get_job(rank)
|
|
if(!job)
|
|
stack_trace("FreeRole could not map rank [rank] to a job slot")
|
|
return FALSE
|
|
if(job.current_positions >= job.total_positions)
|
|
log_econ("Modifying job slots of [job.title] failed due to no job slot being available. Current slots: [job.current_positions]/[job.total_positions]")
|
|
return FALSE
|
|
log_econ("Modifying job slots of [job.title]. Existing slots: [job.current_positions]/[job.total_positions] New slots: [job.current_positions + 1]/[job.total_positions]")
|
|
job.current_positions = job.current_positions + 1
|
|
return TRUE
|