Merge pull request #37863 from AnturK/rr4
Fixes changeling team objectives (a bit)
This commit is contained in:
committed by
letterjay
parent
56544307ec
commit
aa7a27420c
@@ -712,6 +712,8 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
var/min_lings = 3 //Minimum amount of lings for this team objective to be possible
|
||||
var/escape_objective_compatible = FALSE
|
||||
|
||||
/datum/objective/changeling_team_objective/proc/prepare()
|
||||
return FALSE
|
||||
|
||||
//Impersonate department
|
||||
//Picks as many people as it can from a department (Security,Engineer,Medical,Science)
|
||||
@@ -724,6 +726,19 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
var/department_string = ""
|
||||
|
||||
|
||||
/datum/objective/changeling_team_objective/impersonate_department/prepare()
|
||||
var/result = FALSE
|
||||
if(command_staff_only)
|
||||
result = get_heads()
|
||||
else
|
||||
result = get_department_staff()
|
||||
if(result)
|
||||
update_explanation_text()
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
|
||||
/datum/objective/changeling_team_objective/impersonate_department/proc/get_department_staff()
|
||||
department_minds = list()
|
||||
department_real_names = list()
|
||||
@@ -756,9 +771,8 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
|
||||
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
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/objective/changeling_team_objective/impersonate_department/proc/get_heads()
|
||||
@@ -785,19 +799,8 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
|
||||
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
|
||||
|
||||
|
||||
/datum/objective/changeling_team_objective/impersonate_department/New(var/text)
|
||||
..()
|
||||
if(command_staff_only)
|
||||
get_heads()
|
||||
else
|
||||
get_department_staff()
|
||||
|
||||
update_explanation_text()
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/objective/changeling_team_objective/impersonate_department/update_explanation_text()
|
||||
@@ -862,9 +865,6 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
|
||||
|
||||
//A subtype of impersonate_department
|
||||
//This subtype always picks as many command staff as it can (HoS,HoP,Cap,CE,CMO,RD)
|
||||
//and tasks the lings with killing and replacing them
|
||||
|
||||
@@ -353,7 +353,10 @@
|
||||
if(GLOB.changeling_team_objective_type)
|
||||
var/datum/objective/changeling_team_objective/team_objective = new GLOB.changeling_team_objective_type
|
||||
team_objective.owner = owner
|
||||
objectives += team_objective
|
||||
if(team_objective.prepare())//Setting up succeeded
|
||||
objectives += team_objective
|
||||
else
|
||||
qdel(team_objective)
|
||||
return
|
||||
|
||||
/datum/antagonist/changeling/proc/forge_objectives()
|
||||
|
||||
Reference in New Issue
Block a user