Skip to content

Commit

Permalink
Protect Traitor Objective
Browse files Browse the repository at this point in the history
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
hyperjll committed Mar 7, 2025
1 parent cbfff13 commit 0dccc63
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/modules/antagonists/traitor/datum_traitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@
kill_objective.find_target()
return kill_objective

if(prob(10))
var/datum/objective/protect/traitor_only/protect_tot_objective = new()
protect_tot_objective.owner = owner
protect_tot_objective.find_traitor_target()
return protect_tot_objective

var/datum/objective/steal/steal_objective = new()
steal_objective.owner = owner
steal_objective.find_target()
Expand Down
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."
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6780,6 +6780,7 @@
#include "hypermods\code\modules\antagonists\initial_infected\initial_infected.dm"
#include "hypermods\code\modules\antagonists\ninja\energy_net_nets.dm"
#include "hypermods\code\modules\antagonists\traitor\final_objective\cyborg_rift.dm"
#include "hypermods\code\modules\antagonists\traitor\objectives\protect_fellow_tot.dm"
#include "hypermods\code\modules\antagonists\traitor\objectives\sabotage_machinery.dm"
#include "hypermods\code\modules\antagonists\traitor\objectives\sleeper_protocol.dm"
#include "hypermods\code\modules\antagonists\traitor\objectives\tide_bug_department.dm"
Expand Down

0 comments on commit 0dccc63

Please sign in to comment.