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()