mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
Job refactor 2: less hardcoded lists (#60578)
* Job refactor 2: less hardcoded lists * Obsessed can happen
This commit is contained in:
@@ -162,14 +162,14 @@
|
||||
return
|
||||
var/list/viable_coworkers = list()
|
||||
var/list/all_coworkers = list()
|
||||
var/our_departments = oldmind.assigned_role.departments
|
||||
var/our_departments = oldmind.assigned_role.departments_bitflags
|
||||
for(var/mob/living/carbon/human/human_alive in GLOB.alive_mob_list)
|
||||
if(!human_alive.mind)
|
||||
continue
|
||||
if(human_alive == oldmind.current || human_alive.mind.assigned_role.faction != FACTION_STATION || human_alive.mind.has_antag_datum(/datum/antagonist/obsessed))
|
||||
continue //the jealousy target has to have a job, and not be the obsession or obsessed.
|
||||
all_coworkers += human_alive.mind
|
||||
if(!(our_departments & human_alive.mind.assigned_role.departments))
|
||||
if(!(our_departments & human_alive.mind.assigned_role.departments_bitflags))
|
||||
continue
|
||||
viable_coworkers += human_alive.mind
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
|
||||
/datum/antagonist/gang/purple/check_gang_objective()
|
||||
for(var/mob/player as anything in GLOB.player_list)
|
||||
if(!(player.mind.assigned_role.departments & DEPARTMENT_SECURITY))
|
||||
if(!(player.mind.assigned_role.departments_bitflags & DEPARTMENT_BITFLAG_SECURITY))
|
||||
continue
|
||||
if(!player.suiciding && !considered_alive(player))
|
||||
return FALSE
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/datum/antagonist/rev/can_be_owned(datum/mind/new_owner)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(new_owner.assigned_role.departments & DEPARTMENT_COMMAND)
|
||||
if(new_owner.assigned_role.departments_bitflags & DEPARTMENT_BITFLAG_COMMAND)
|
||||
return FALSE
|
||||
if(new_owner.unconvertable)
|
||||
return FALSE
|
||||
@@ -417,7 +417,7 @@
|
||||
if (isnull(mind))
|
||||
continue
|
||||
|
||||
if (!(mind.assigned_role.departments & (DEPARTMENT_SECURITY|DEPARTMENT_COMMAND)))
|
||||
if (!(mind.assigned_role.departments_bitflags & (DEPARTMENT_BITFLAG_SECURITY|DEPARTMENT_BITFLAG_COMMAND)))
|
||||
continue
|
||||
|
||||
if (mind in ex_revs + ex_headrevs)
|
||||
@@ -435,8 +435,9 @@
|
||||
else
|
||||
mind.announce_objectives()
|
||||
|
||||
for (var/job_name in GLOB.command_positions + GLOB.security_positions)
|
||||
var/datum/job/job = SSjob.GetJob(job_name)
|
||||
for(var/datum/job/job as anything in SSjob.joinable_occupations)
|
||||
if(!(job.departments_bitflags & (DEPARTMENT_BITFLAG_SECURITY|DEPARTMENT_BITFLAG_COMMAND)))
|
||||
continue
|
||||
job.allow_bureaucratic_error = FALSE
|
||||
job.total_positions = 0
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
objectives += kill_objective
|
||||
return
|
||||
|
||||
if(prob(DOWNLOAD_PROB) && !(locate(/datum/objective/download) in objectives) && !(owner.assigned_role.departments & DEPARTMENT_SCIENCE))
|
||||
if(prob(DOWNLOAD_PROB) && !(locate(/datum/objective/download) in objectives) && !(owner.assigned_role.departments_bitflags & DEPARTMENT_BITFLAG_SCIENCE))
|
||||
var/datum/objective/download/download_objective = new
|
||||
download_objective.owner = owner
|
||||
download_objective.gen_amount_goal()
|
||||
|
||||
Reference in New Issue
Block a user