diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 6899c55c8de..6de1f27d0af 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -631,7 +631,7 @@ def_value = "custom" var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list( - "assassinate", "blood", "debrain", "protect", "prevent", "hijack", "escape", "survive", "steal", "download", + "assassinate", "assassinateonce", "blood", "debrain", "protect", "prevent", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "destroy", "maroon", "identity theft", "custom") if(!new_obj_type) return @@ -639,7 +639,7 @@ var/datum/objective/new_objective = null switch(new_obj_type) - if("assassinate","protect","debrain", "maroon") + if("assassinate", "assassinateonce", "protect","debrain", "maroon") //To determine what to name the objective in explanation text. var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. @@ -654,7 +654,7 @@ possible_targets_random += possible_target.current // For random picking, only valid targets var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/assassinateonce, /datum/objective/protect, /datum/objective/debrain) if(objective&&(objective.type in objective_list) && objective:target) def_target = objective.target.current possible_targets = sortAtom(possible_targets) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 758f2c57a30..9fdc83f0b0a 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -107,6 +107,7 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) possible_targets += possible_target + if(possible_targets.len > 0) target = pick(possible_targets) @@ -164,6 +165,32 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) return FALSE return TRUE +/datum/objective/assassinateonce + name = "Assassinate once" + martyr_compatible = TRUE + var/won = FALSE + +/datum/objective/assassinateonce/find_target(list/target_blacklist) + ..() + if(target?.current) + explanation_text = "Teach [target.current.real_name], the [target.assigned_role], a lesson they will not forget. The target only needs to die once for success." + RegisterSignal(target.current, list(COMSIG_MOB_DEATH, COMSIG_PARENT_QDELETING), PROC_REF(check_midround_completion)) + else + explanation_text = "Free Objective" + return target + +/datum/objective/assassinateonce/check_completion() + return won || completed || !target?.current?.ckey + +/datum/objective/assassinateonce/proc/check_midround_completion() + won = TRUE + UnregisterSignal(target.current, list(COMSIG_MOB_DEATH, COMSIG_PARENT_QDELETING)) + +/datum/objective/assassinateonce/on_target_cryo() + if(won) + return + return ..() + /datum/objective/mutiny name = "Mutiny" diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm index 396d4582dc1..fb0eb239727 100644 --- a/code/modules/antagonists/traitor/datum_traitor.dm +++ b/code/modules/antagonists/traitor/datum_traitor.dm @@ -130,6 +130,8 @@ add_antag_objective(/datum/objective/debrain) else if(prob(30)) add_antag_objective(/datum/objective/maroon) + else if(prob(30)) + add_antag_objective(/datum/objective/assassinateonce) else add_antag_objective(/datum/objective/assassinate) else