Files
Paradise/code/modules/events/bureaucratic_error.dm
Pedro b55bef2ed2 Nanotrasen Career Trainer - REVIVAL (PT1) (#26512)
* Nct ID

* Preferences, job creation, access and other stuff

* Sprites, defines, hidden job pref and other stuff!

* Missed a comma

* Sprites updated, clothing code, outfit and id

* Fix a small oops

* Data chip + Sechud icon

* Offstation, access, datachip code, ticket autoresponse and a lot of other stuff.

* Typo, spritesheet fixingg and icon color

* Telebaton removed, not allowed to scan ERT IDs, blacklisted some access

* Applies suggestion

Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>
Signed-off-by: Pedro <79126660+LetXxx@users.noreply.github.com>

* Applying Suggestions!

* Forgot to increase the number of slots, oops

* Added a few items that I forgot, applying suggestions.

* Fix check fail?

* Mapping Tools/Icons.

* Office added to all maps, a few modifications to fit.

* Adds ACCESS_TRAINER to who needs it.

* Fixing check fails.

* NCT Beret obj are now where they're supposed to be

* Suggestion

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Pedro <79126660+LetXxx@users.noreply.github.com>

* Sprites fix + NCT flag

* Code Suggestion

* Sprite update

* Suggestions

* Diagoras Office, conflict fix.

* Day 1 fixes, suggestions.

* bundle rebuild

* Fixing a few issues.

* Mapping review + Suggestions

* Fixed check fail.

* Conflict fix + You shouldn't be able to insert the NCT chip into an id console

* Fix map conflicts

* Plasmaman icons and Kidan icon fix

* Conflict fix?

* A few changes following feedback.

* Small description changed, as per requested feedback.

* Suggestions/Fix

* Forgot some mapping issues

* Suggestions

* Fixed?

* Fix linters

* More fixes

* aaaaaaaaaaa

* Christa's reviews

* Naming stuff

---------

Signed-off-by: Pedro <79126660+LetXxx@users.noreply.github.com>
Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
2024-12-30 21:13:52 +00:00

53 lines
1.8 KiB
Plaintext

/datum/event/bureaucratic_error
announceWhen = 1
/// Jobs that are not allowed to be picked for the bureaucratic error
var/list/blacklisted_jobs = list(
/datum/job/assistant,
/datum/job/ai,
/datum/job/cyborg,
/datum/job/blueshield,
/datum/job/chaplain,
/datum/job/officer,
/datum/job/warden
)
/// Jobs that pass an additional 40% chance per roll to be picked for the bureaucratic error
var/list/uncommon_jobs = list(
/datum/job/chief_engineer,
/datum/job/cmo,
/datum/job/rd,
/datum/job/hos,
/datum/job/captain,
/datum/job/hop,
/datum/job/nanotrasenrep,
/datum/job/judge,
/datum/job/qm,
/datum/job/nanotrasentrainer
)
/datum/event/bureaucratic_error/announce()
GLOB.major_announcement.Announce("A recent bureaucratic error in the Human Resources Department may result in personnel shortages in some departments and redundant staffing in others. Contact your local HoP to solve this issue.", "Paperwork Mishap Alert")
/datum/event/bureaucratic_error/start()
var/list/affected_jobs = list() // For logging
var/list/jobs = SSjobs.occupations.Copy()
var/datum/job/overflow
var/overflow_amount = pick(1, 2)
var/errors = 0
while(errors < overflow_amount)
var/random_change = pick(-2, -1, 1, 2)
overflow = pick_n_take(jobs)
if((overflow.admin_only) || (overflow.type in blacklisted_jobs))
continue
if(overflow.type in uncommon_jobs)
if(prob(40))
random_change = clamp(random_change, 1, 2)
else
continue
overflow.total_positions = max(overflow.total_positions + random_change, 0)
affected_jobs += "[overflow.title] slot changed by [random_change]"
errors++
log_and_message_admins(affected_jobs.Join(".\n"))
for(var/mob/M as anything in GLOB.dead_mob_list)
to_chat(M, "<span class='deadsay'><b>Bureaucratic Error:</b> The following job slots have changed: \n[affected_jobs.Join(",\n ")].</span>")