Heads/sec/legal can no longer join after revolutionaries have won + Refactor (#22328)

* THE THIRD REV PR

* 2nd time

* final changes

* yea

* fixes

* comments

* oops

* sirryan review

* Update code/game/jobs/job/support.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
Contrabang
2023-09-25 19:03:25 -04:00
committed by GitHub
co-authored by Luc
parent 6118cc8f48
commit 59c70f983b
17 changed files with 115 additions and 74 deletions
+1 -1
View File
@@ -875,7 +875,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
return
var/job = input("Please select job slot to free", "Free Job Slot") as null|anything in jobs
if(job)
SSjobs.FreeRole(job)
SSjobs.FreeRole(job, force = TRUE)
log_admin("[key_name(usr)] has freed a job slot for [job].")
message_admins("[key_name_admin(usr)] has freed a job slot for [job].")
@@ -53,6 +53,7 @@
. = TRUE
/datum/team/revolution/proc/check_all_victory()
update_team_objectives()
check_rev_victory()
check_heads_victory()
@@ -62,6 +63,16 @@
return FALSE
SSshuttle.clearHostileEnvironment(src) // revs can take the shuttle too if they want
log_admin("Revolutionary win conditions met. All command, security, and legal jobs are now closed.")
message_admins("The revolutionaries have won! All command, security, and legal jobs have been closed. You can change this with the \"Free Job Slot\" verb.")
// HOP can still technically alter some roles, but Nanotrasen wouldn't send heads/sec under threat to the station after revs win
var/banned_departments = DEP_FLAG_COMMAND | DEP_FLAG_SECURITY | DEP_FLAG_LEGAL
for(var/datum/job/job in SSjobs.occupations)
if(!(job.job_department_flags & banned_departments))
continue
job.total_positions = 0
job.job_banned_gamemode = TRUE
return TRUE
/datum/team/revolution/proc/check_heads_victory()
@@ -60,7 +60,7 @@
/datum/species/grey/after_equip_job(datum/job/J, mob/living/carbon/human/H)
var/translator_pref = H.client.prefs.active_character.speciesprefs
if(translator_pref || ((ismindshielded(H) || J.is_command || J.supervisors == "the captain") && HAS_TRAIT(H, TRAIT_WINGDINGS)))
if(translator_pref || ((ismindshielded(H) || J.job_department_flags & DEP_FLAG_COMMAND) && HAS_TRAIT(H, TRAIT_WINGDINGS)))
if(J.title == "Mime")
return
if(J.title == "Clown")
+7 -7
View File
@@ -262,22 +262,22 @@
if(job.is_position_available())
var/list/opening_data = list("title" = job.title)
// Is the job a command job?
if(job.title in GLOB.command_positions)
if(job.job_department_flags & DEP_FLAG_COMMAND)
opening_data["is_command"] = TRUE
// Add the job opening to the corresponding categories
// Ugly!
opening_data = list(opening_data)
if(job.is_security)
if(job.job_department_flags & DEP_FLAG_SECURITY)
jobs["security"] += opening_data
if(job.is_engineering)
if(job.job_department_flags & DEP_FLAG_ENGINEERING)
jobs["engineering"] += opening_data
if(job.is_medical)
if(job.job_department_flags & DEP_FLAG_MEDICAL)
jobs["medical"] += opening_data
if(job.is_science)
if(job.job_department_flags & DEP_FLAG_SCIENCE)
jobs["science"] += opening_data
if(job.is_service)
if(job.job_department_flags & DEP_FLAG_SERVICE)
jobs["service"] += opening_data
if(job.is_supply)
if(job.job_department_flags & DEP_FLAG_SUPPLY)
jobs["supply"] += opening_data
// Append temp photo