Files
2543d88548 Punch Clock PDA Application/Modular Console (#2900)
## 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>

![GIF 12-Jan-25 6-22-47
PM](https://github.com/user-attachments/assets/2b90ccb6-a175-4e2a-80c2-bfe717f99358)
</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>
2025-02-11 01:03:45 -08:00

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