diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index d93712c18312..85f241c95b00 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -82,8 +82,10 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas //And then set it up to be handed out in forge_changeling_objectives var/list/team_objectives = typesof(/datum/objective/changeling_team_objective) - /datum/objective/changeling_team_objective var/list/possible_team_objectives = list() - for(var/datum/objective/changeling_team_objective/T in team_objectives) - if(changelings.len >= initial(T.min_lings)) + for(var/T in team_objectives) + var/datum/objective/changeling_team_objective/CTO = T + + if(changelings.len >= initial(CTO.min_lings)) possible_team_objectives += T if(possible_team_objectives.len && prob(20*changelings.len)) @@ -349,7 +351,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas prof.dna = new_dna prof.name = H.real_name prof.protected = protect - + var/list/slots = list("head", "wear_mask", "back", "wear_suit", "w_uniform", "shoes", "belt", "gloves", "glasses", "ears", "wear_id", "s_store") for(var/slot in slots) var/obj/item/I = H.vars[slot] @@ -425,7 +427,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas /datum/changelingprofile var/name = "a bug" - + var/protected = 0 var/datum/dna/dna = null @@ -435,6 +437,6 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas var/list/exists_list = list() var/list/item_color_list = list() var/list/item_state_list = list() - + /datum/changelingprofile/Destroy() qdel(dna) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 17f812ccf899..82894239a306 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -667,7 +667,7 @@ var/global/list/possible_items_special = list() /datum/objective/changeling_team_objective //Abstract type martyr_compatible = 0 //Suicide is not teamwork! explanation_text = "Changeling Friendship!" - var/min_lings = 3 //Minimum amount of lings for this team objective to be possible + var/min_lings = 1//3 //Minimum amount of lings for this team objective to be possible @@ -701,13 +701,18 @@ var/global/list/possible_items_special = list() var/ling_count = ticker.mode.changelings for(var/datum/mind/M in ticker.minds) - if(department_head in M.assigned_job.department_head) + if(M in ticker.mode.changelings) + continue + if(department_head in get_department_heads(M.assigned_role)) if(ling_count) ling_count-- department_minds += M department_real_names += M.current.real_name + else + break if(!department_minds.len) + log_game("[type] has failed to find department staff, and has removed itself. the round will continue normally") owner.objectives -= src qdel(src) return @@ -724,16 +729,19 @@ var/global/list/possible_items_special = list() var/needed_heads = rand(min_lings,command_positions.len) needed_heads = min(ticker.mode.changelings.len,needed_heads) - for(var/datum/mind/possible_head in ticker.minds) - if(possible_head in ticker.mode.changelings) //Looking at you HoP. + var/list/heads = ticker.mode.get_living_heads() + for(var/datum/mind/head in heads) + if(head in ticker.mode.changelings) //Looking at you HoP. continue - if(possible_head.assigned_job.title in command_positions) - if(needed_heads) - department_minds += possible_head - department_real_names += possible_head.current.real_name - needed_heads-- + if(needed_heads) + department_minds += head + department_real_names += head.current.real_name + needed_heads-- + else + break if(!department_minds.len) + log_game("[type] has failed to find department heads, and has removed itself. the round will continue normally") owner.objectives -= src qdel(src) return @@ -783,6 +791,9 @@ var/global/list/possible_items_special = list() //Check each department member's mind to see if any of them made it to centcomm alive, if they did it's an automatic fail for(var/datum/mind/M in department_minds) + if(M in ticker.mode.changelings) //Lings aren't picked for this, but let's be safe + continue + if(M.current) var/turf/mloc = get_turf(M.current) if(mloc.onCentcom() && (M.current.stat != DEAD)) diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index 9bcc58643d72..e47d66df1790 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -125,3 +125,15 @@ var/list/nonhuman_positions = list( /proc/guest_jobbans(job) return ((job in command_positions) || (job in nonhuman_positions) || (job in security_positions)) + + + +//this is necessary because antags happen before job datums are handed out, but NOT before they come into existence +//so I can't simply use job datum.department_head straight from the mind datum, laaaaame. +/proc/get_department_heads(var/job_title) + if(!job_title) + return list() + + for(var/datum/job/J in SSjob.occupations) + if(J.title == job_title) + return J.department_head //this is a list \ No newline at end of file