Antag Info and fixing the handshake finally

This commit is contained in:
keronshb
2021-10-14 20:43:41 -04:00
parent 8cb16aa0f3
commit 29a01f2d05
3 changed files with 29 additions and 1 deletions
-1
View File
@@ -200,7 +200,6 @@
/datum/mind/proc/has_antag_datum(datum_type, check_subtypes = TRUE)
if(!datum_type)
return
. = FALSE
for(var/a in antag_datums)
var/datum/antagonist/A = a
if(check_subtypes && istype(A, datum_type))
+1
View File
@@ -13,6 +13,7 @@ GLOBAL_LIST_EMPTY(objectives)
var/completed = FALSE //currently only used for custom objectives.
var/completable = TRUE //Whether this objective shows greentext when completed
var/martyr_compatible = FALSE //If the objective is compatible with martyr objective, i.e. if you can still do it while dead.
var/objective_name = "Objective" //name used in printing this objective (Objective #1)
/datum/objective/New(var/text)
GLOB.objectives += src // CITADEL EDIT FOR CRYOPODS
@@ -169,6 +169,8 @@ GLOBAL_LIST_EMPTY(antagonists)
owner.remove_skill_modifier(GET_SKILL_MOD_ID(A, type))
if(!LAZYLEN(owner.antag_datums))
owner.current.remove_from_current_living_antags()
if(info_button)
QDEL_NULL(info_button)
if(!silent && owner.current)
farewell()
var/datum/team/team = get_team()
@@ -364,6 +366,32 @@ GLOBAL_LIST_EMPTY(antagonists)
return
..()
///ANTAGONIST UI STUFF
/datum/antagonist/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, ui_name, name)
ui.open()
/datum/antagonist/ui_state(mob/user)
return GLOB.always_state
///generic helper to send objectives as data through tgui. supports smart objectives too!
/datum/antagonist/proc/get_objectives()
var/objective_count = 1
var/list/objective_data = list()
//all obj
for(var/datum/objective/objective in objectives)
objective_data += list(list(
"count" = objective_count,
"name" = objective.objective_name,
"explanation" = objective.explanation_text,
"complete" = objective.completed,
))
objective_count++
return objective_data
//button for antags to review their descriptions/info
/datum/action/antag_info