mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
Adds "Teach them a lesson" Objective (traitor only) (#22933)
* Adds the tech them a lesson objective. * minor changes * SPACING! * onesmallupdate * requestedchanges * requestedchanges
This commit is contained in:
+3
-3
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user