From 8eba8715752ce6ea09e922d14b4b4748fe02b637 Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Sun, 18 Nov 2012 17:45:20 +0000 Subject: [PATCH] Can no toggle whether an objective is completed via the traitor panel. Currently only works for custom objectives. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5110 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/mind.dm | 9 +++++++-- code/game/gamemodes/objective.dm | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 92629558aea..2119367924b 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -324,7 +324,7 @@ datum/mind else var/obj_count = 1 for(var/datum/objective/objective in objectives) - out += "[obj_count]: [objective.explanation_text] Edit Delete
" + out += "[obj_count]: [objective.explanation_text] Edit Delete Toggle Completion
" obj_count++ out += "Add objective

" @@ -464,9 +464,14 @@ datum/mind else if (href_list["obj_delete"]) var/datum/objective/objective = locate(href_list["obj_delete"]) - if (!objective) return + if(!istype(objective)) return objectives -= objective + else if(href_list["obj_completed"]) + var/datum/objective/objective = locate(href_list["obj_completed"]) + if(!istype(objective)) return + objective.completed = !objective.completed + else if (href_list["revolution"]) switch(href_list["revolution"]) if("clear") diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 2e8169a7041..19218424a04 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -5,13 +5,14 @@ datum/objective var/explanation_text = "Nothing" //What that person is supposed to do. var/datum/mind/target = null //If they are focused on a particular person. var/target_amount = 0 //If they are focused on a particular number. Steal objectives have their own counter. + var/completed = 0 //currently only used for custom objectives. New(var/text) if(text) explanation_text = text proc/check_completion() - return 1 + return completed proc/find_target() var/list/possible_targets = list()