Skip to content

Commit

Permalink
Adds the bureaucratic error event (ParadiseSS13#20582)
Browse files Browse the repository at this point in the history
* 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
5 people authored May 2, 2023
1 parent 6309331 commit b995253
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 6 deletions.
4 changes: 2 additions & 2 deletions code/game/jobs/job/central.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
selection_color = "#ffdddd"
access = list()
minimal_access = list()
admin_only = 1
admin_only = TRUE
outfit = /datum/outfit/job/ntnavyofficer

/datum/job/ntnavyofficer/get_access()
Expand Down Expand Up @@ -59,7 +59,7 @@
selection_color = "#ffdddd"
access = list()
minimal_access = list()
admin_only = 1
admin_only = TRUE
spawn_ert = 1
outfit = /datum/outfit/job/ntspecops

Expand Down
1 change: 0 additions & 1 deletion code/game/jobs/job/support_chaplain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
selection_color = "#dddddd"
access = list(ACCESS_MORGUE, ACCESS_CHAPEL_OFFICE, ACCESS_CREMATORIUM, ACCESS_MAINT_TUNNELS)
minimal_access = list(ACCESS_MORGUE, ACCESS_CHAPEL_OFFICE, ACCESS_CREMATORIUM, ACCESS_MAINT_TUNNELS)

outfit = /datum/outfit/job/chaplain

/datum/outfit/job/chaplain
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/syndicate_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
selection_color = "#ff0000"
access = list()
minimal_access = list()
admin_only = 1
admin_only = TRUE
syndicate_command = 1
outfit = /datum/outfit/job/syndicateofficer

Expand Down
38 changes: 38 additions & 0 deletions code/modules/events/bureaucratic_error.dm
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(" "))
5 changes: 3 additions & 2 deletions code/modules/events/event_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ GLOBAL_LIST_EMPTY(event_last_fired)
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Sentience", /datum/event/sentience, 50),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Koi School", /datum/event/carp_migration/koi, 80),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Camera Failure", /datum/event/camera_failure, 100, list(ASSIGNMENT_ENGINEER = 10),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Camera Failure", /datum/event/camera_failure, 100, list(ASSIGNMENT_ENGINEER = 10)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Fake Virus", /datum/event/fake_virus, 50),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Disease Outbreak", /datum/event/disease_outbreak, 50, list(ASSIGNMENT_MEDICAL = 25), TRUE))
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Bureaucratic Error",/datum/event/bureaucratic_error, 80, TRUE),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Disease Outbreak", /datum/event/disease_outbreak, 50, list(ASSIGNMENT_MEDICAL = 25), TRUE)
)

/datum/event_container/moderate
Expand Down
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@
#include "code\modules\events\apc_short.dm"
#include "code\modules\events\blob_spawn.dm"
#include "code\modules\events\brand_intelligence.dm"
#include "code\modules\events\bureaucratic_error.dm"
#include "code\modules\events\camera_failure.dm"
#include "code\modules\events\carp_migration.dm"
#include "code\modules\events\communications_blackout.dm"
Expand Down

0 comments on commit b995253

Please sign in to comment.