forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the bureaucratic error event (ParadiseSS13#20582)
* camera failure event * Increasing the amount * No disabling cameras on protected areas * Adds the bureaucratic error event * human resources department is lore friendly * Pick instead of rand * ops * Added allow_bureaucratic_error to jobs * scales up with number of engineers * mundane category * Update code/modules/events/camerafailure.dm Co-authored-by: S34N <[email protected]> * conflict fix * No error for blacklisted jobs * Update code/modules/events/bureaucratic_error.dm Co-authored-by: Luc <[email protected]> * Lewcc review * better file name * better name part 2 * farie review * Apply suggestions from code review Co-authored-by: Farie82 <[email protected]> * Update code/modules/events/camera_failure.dm Co-authored-by: Farie82 <[email protected]> * Update code/modules/events/bureaucratic_error.dm Co-authored-by: Charlie <[email protected]> * checking for admin only * Blacklist and small fix * Farie review * Update code/modules/events/bureaucratic_error.dm Co-authored-by: Charlie <[email protected]> --------- Co-authored-by: S34N <[email protected]> Co-authored-by: Luc <[email protected]> Co-authored-by: Farie82 <[email protected]> Co-authored-by: Charlie <[email protected]>
- Loading branch information
1 parent
6309331
commit b995253
Showing
6 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/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/chief_engineer, | ||
/datum/job/cmo, | ||
/datum/job/rd, | ||
/datum/job/hos, | ||
/datum/job/ai, | ||
/datum/job/captain, | ||
/datum/job/hop, | ||
/datum/job/nanotrasenrep, | ||
/datum/job/blueshield, | ||
/datum/job/judge, | ||
/datum/job/chaplain | ||
) | ||
|
||
/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.", "Paperwork Mishap Alert") | ||
|
||
/datum/event/bureaucratic_error/start() | ||
var/list/affected_jobs // For logging | ||
var/list/jobs = SSjobs.occupations.Copy() | ||
var/datum/job/overflow | ||
var/overflow_amount = rand(1, 6) | ||
var/errors = 0 | ||
while(errors <= overflow_amount) | ||
var/random_change = pick(-1, 1) | ||
overflow = pick_n_take(jobs) | ||
if(overflow.admin_only) | ||
continue | ||
if(overflow.type in blacklisted_jobs) | ||
continue | ||
overflow.total_positions = max(overflow.total_positions + random_change, 0) | ||
affected_jobs += "[overflow] slot changed by [random_change].\n" | ||
errors++ | ||
log_and_message_admins(affected_jobs.Join(" ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters