Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 901ec4f

Browse files
committed
Escape disguised objective
1 parent 624d148 commit 901ec4f

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

yogstation/code/modules/antagonists/infiltrator/objectives.dm

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,59 @@ GLOBAL_LIST_INIT(infiltrator_kidnap_areas, typecacheof(list(/area/shuttle/yogs/s
113113
/datum/objective/infiltrator/kidnap/check_completion()
114114
var/target_area = get_area(target.current)
115115
return QDELETED(target) || (target.current && (!target.current.ckey || target.current.suiciding)) || (considered_alive(target) && is_type_in_typecache(target_area, GLOB.infiltrator_kidnap_areas))
116+
117+
/datum/objective/infiltrator/escape_disguised //Sort of based on the escape with identity objective for changelings, most of the code is from that with modifications
118+
explanation_text = "Have one member of your team disguise as a crewmember using your chameleon kit, and escape on the shuttle while wearing their identification card."
119+
var/target_real_name
120+
var/target_missing_id
121+
122+
/datum/objective/infiltrator/escape_disguised/proc/potential_targets()
123+
var/list/possible_targets = list()
124+
for(var/datum/mind/M in SSticker.minds)
125+
if(!M || !considered_alive(M) || considered_afk(M) || !M.current || !M.current.client || !ishuman(M.current) || M.quiet_round)
126+
continue
127+
if(M.has_antag_datum(/datum/antagonist/infiltrator) || M.has_antag_datum(/datum/antagonist/traitor) || M.has_antag_datum(/datum/antagonist/nukeop))
128+
continue
129+
if(M.assigned_role in GLOB.command_positions)
130+
possible_targets[M] = 25
131+
else //Either command or crew, stealing IDs from security officers and then having to impersonate them on shuttle simply doesn't work well
132+
possible_targets[M] = 5
133+
return possible_targets
134+
135+
/datum/objective/infiltrator/escape_disguised/is_possible()
136+
return LAZYLEN(potential_targets())
137+
138+
/datum/objective/infiltrator/escape_disguised/find_target(dupe_search_range, blacklist)
139+
target = pickweight(potential_targets())
140+
update_explanation_text()
141+
return target
142+
143+
/datum/objective/infiltrator/escape_disguised/update_explanation_text()
144+
if(target && target.current)
145+
target_real_name = target.current.real_name
146+
explanation_text = "Have one member of your team disguise as [target.name], the [target.assigned_role] using your chameleon kit, and escape on the shuttle or an escape pod"
147+
var/mob/living/carbon/human/H
148+
if(ishuman(target.current))
149+
H = target.current
150+
if(H && H.get_id_name() != target_real_name)
151+
target_missing_id = 1
152+
else
153+
explanation_text += " while wearing their identification card"
154+
explanation_text += "."
155+
else
156+
explanation_text = "Free Objective"
157+
158+
/datum/objective/infiltrator/escape_disguised/check_completion()
159+
. = ..()
160+
if(completed)
161+
return TRUE
162+
if(!target || !target_real_name)
163+
return TRUE
164+
var/list/infiltrators = get_antag_minds(/datum/antagonist/infiltrator, TRUE)
165+
for(var/datum/mind/M in infiltrators)
166+
if(!considered_escaped(M))
167+
continue
168+
var/mob/living/carbon/human/H = M.current
169+
if(H.get_id_name() == target_real_name || target_missing_id)
170+
return TRUE
171+
return FALSE

0 commit comments

Comments
 (0)