From b0b423e1552784317f403a69d6fbbc1e539c028e Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Tue, 10 Sep 2024 00:55:04 +0300 Subject: [PATCH] Count team member as invalid target for an objective --- modular_ss220/_defines220/code/gamemode.dm | 2 ++ modular_ss220/antagonists/code/objectives.dm | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/modular_ss220/_defines220/code/gamemode.dm b/modular_ss220/_defines220/code/gamemode.dm index 239da29ff7b3..85e57c57aa58 100644 --- a/modular_ss220/_defines220/code/gamemode.dm +++ b/modular_ss220/_defines220/code/gamemode.dm @@ -2,3 +2,5 @@ #define SPECIAL_ROLE_VOX_RAIDER "Vox Raider" #define isvoxcash(W) (istype(W, /obj/item/stack/vox_cash)) + +#define TARGET_INVALID_SAME_TEAM (-1) diff --git a/modular_ss220/antagonists/code/objectives.dm b/modular_ss220/antagonists/code/objectives.dm index 8eb3bc18ac00..ef8d445429dc 100644 --- a/modular_ss220/antagonists/code/objectives.dm +++ b/modular_ss220/antagonists/code/objectives.dm @@ -1,3 +1,12 @@ +/datum/objective/is_invalid_target(datum/mind/possible_target) + . = ..() + if(.) + return + if(team) + for(var/datum/antagonist/target_datum in possible_target.antag_datums) + if(team == target_datum.get_team()) + return TARGET_INVALID_SAME_TEAM + /datum/objective/raider_steal name = "Raider theft" needs_target = FALSE