forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new primary objective for traitors! Basically it's a protect objective that only selects other traitors. It's a bit like in SS14, and may actually enable more traitor team-ups and rescues now.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
hypermods/code/modules/antagonists/traitor/objectives/protect_fellow_tot.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/datum/objective/protect/traitor_only //The opposite of killing a dude. | ||
name = "protect traitor" | ||
martyr_compatible = TRUE | ||
admin_grantable = TRUE | ||
|
||
/datum/objective/protect/traitor_only/check_completion() | ||
var/obj/item/organ/brain/brain_target | ||
if(isnull(target)) | ||
return FALSE | ||
if(human_check) | ||
brain_target = target.current?.get_organ_slot(ORGAN_SLOT_BRAIN) | ||
//Protect will always succeed when someone suicides | ||
return !target || (target.current && HAS_TRAIT(target.current, TRAIT_SUICIDED)) || considered_alive(target, enforce_human = human_check) || (brain_target && HAS_TRAIT(brain_target, TRAIT_SUICIDED)) | ||
|
||
/datum/objective/protect/traitor_only/update_explanation_text() | ||
..() | ||
if(target?.current) | ||
explanation_text = "Protect [target.name] the [!target_role_type ? target.assigned_role.title : target.special_role]. They are believed to be a syndicate agent, use your codewords or aid them in silence. Be sure to confirm their allegiance first." | ||
else | ||
explanation_text = "Free objective." | ||
|
||
/datum/objective/protect/traitor_only/admin_edit(mob/admin) | ||
admin_simple_target_pick(admin) | ||
|
||
/datum/objective/protect/traitor_only/get_target() | ||
return find_traitor_target() | ||
|
||
/datum/objective/protect/traitor_only/proc/find_traitor_target() | ||
var/list/possible_targets = list() | ||
for(var/mob/living/carbon/human/player in GLOB.player_list) | ||
if(player.stat == DEAD || player.mind == owner) | ||
continue | ||
if(player.mind?.has_antag_datum(/datum/antagonist/traitor)) | ||
possible_targets += player.mind | ||
|
||
if(!possible_targets.len) | ||
find_target() //if no traitors on station, this becomes a normal assassination obj | ||
return | ||
else | ||
target = pick(possible_targets) | ||
|
||
if(target?.current) | ||
explanation_text = "Protect [target.name] the [!target_role_type ? target.assigned_role.title : target.special_role]. They are believed to be a syndicate agent, use your codewords or aid them in silence. Be sure to confirm their allegiance first." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters