Protect objective should select other traitors now

This commit is contained in:
alex-gh
2014-04-17 03:28:38 +02:00
parent d55450f591
commit 6dbe28ee14
2 changed files with 18 additions and 2 deletions
+17 -1
View File
@@ -35,7 +35,6 @@ datum/objective
if(possible_targets.len > 0)
target = pick(possible_targets)
proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned.
var/list/possible_targets = list()
for(var/datum/mind/possible_target in ticker.minds)
@@ -44,6 +43,15 @@ datum/objective
if(possible_targets.len > 0)
target = pick(possible_targets)
//Selects someone with a specific special role if role is != null. Or just anyone with a special role
proc/find_target_with_special_role(role)
var/list/possible_targets = list()
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && ishuman(possible_target.current) && (role && possible_target.special_role == role || !role && possible_target.special_role) && (possible_target.current.stat != 2) )
possible_targets += possible_target
if(possible_targets.len > 0)
target = pick(possible_targets)
datum/objective/assassinate
find_target()
@@ -276,6 +284,14 @@ datum/objective/protect//The opposite of killing a dude.
explanation_text = "Free Objective"
return target
find_target_with_special_role(role,role_type=0)
..(role)
if(target && target.current)
explanation_text = "Protect [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]."
else
explanation_text = "Free Objective"
return target
check_completion()
if(!target) //If it's a free objective.
return 1
+1 -1
View File
@@ -109,7 +109,7 @@
if(41 to 50)
var/datum/objective/protect/protect_objective = new
protect_objective.owner = traitor
protect_objective.find_target_by_role("Traitor",0) //Protect your fellow traitor
protect_objective.find_target_with_special_role(null,0)
if (!protect_objective.target)
protect_objective.find_target() //We could not find any traitors, protect somebody
traitor.objectives += protect_objective