Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: antag menu #6329

Open
wants to merge 16 commits into
base: master220
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions code/__HELPERS/antag_menu_helpers.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/proc/prepare_antag_data(datum/mind/antag_mind, list/cached_data, antag_name, list/antagonist_cache)
var/uid = antag_mind.UID()
var/list/temp_list = (uid in antagonist_cache)? antagonist_cache[uid] : list()
temp_list["antag_mind_uid"] = uid
if(isnull(temp_list["antag_names"]))
temp_list["antag_names"] = list()
temp_list["antag_names"] |= antag_name
temp_list["name"] = ""
temp_list["status"] = "Нет тела"
temp_list["name"] = antag_mind.name
temp_list["body_destroyed"] = TRUE
if(!QDELETED(antag_mind.current))
temp_list["body_destroyed"] = FALSE
temp_list["status"] = ""
if(antag_mind.current.stat == DEAD)
temp_list["status"] = "(МЁРТВ)"
else if(!antag_mind.current.client)
temp_list["status"] = "(SSD)"
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
if(istype(get_area(antag_mind.current), /area/security/permabrig))
temp_list["status"] += "(ПЕРМА)"
// temp_list["ckey"] = antag_mind.current.client?.ckey
temp_list["ckey"] = ckey(antag_mind.key)
temp_list["is_hijacker"] = istype((locate(/datum/objective/hijack) in antag_mind.get_all_objectives()), /datum/objective/hijack)
cached_data["antagonists"][uid] = temp_list

/proc/prepare_antag_list(list/antags, list/cached_data, antag_name, list/antagonist_cache)
for(var/antag in antags)
prepare_antag_data(antag, cached_data, antag_name, antagonist_cache)


/proc/prepare_nodatum_antags(list/cached_data, list/antagonist_cache)
var/datum/game_mode/mode = SSticker.mode
prepare_antag_list(mode.clockwork_cult, cached_data, "Культист Ратара", antagonist_cache)
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
prepare_antag_list(mode.cult, cached_data, "Культист [SSticker.cultdat.entity_name]", antagonist_cache)
prepare_antag_list(mode.abductors, cached_data, "Абдуктор", antagonist_cache)
prepare_antag_list(mode.abductees, cached_data, "Жертва абдукторов", antagonist_cache)
prepare_antag_list(mode.head_revolutionaries, cached_data, "Глава революции", antagonist_cache)
prepare_antag_list(mode.revolutionaries, cached_data, "Революционер", antagonist_cache)
prepare_antag_list(mode.wizards, cached_data, "Маг", antagonist_cache)
prepare_antag_list(mode.apprentices, cached_data, "Ученик мага", antagonist_cache)
prepare_antag_list(mode.space_ninjas, cached_data, "Клан Паука", antagonist_cache)
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
prepare_antag_list(mode.syndicates, cached_data, "Ядерный оперативник", antagonist_cache)
prepare_antag_list(mode.shadows, cached_data, "Тень", antagonist_cache)
prepare_antag_list(mode.shadowling_thralls, cached_data, "Раб теней", antagonist_cache)
prepare_antag_list(mode.raiders, cached_data, "Вокс рейдер", antagonist_cache)
prepare_antag_list(mode.superheroes, cached_data, "Супергерой", antagonist_cache)
prepare_antag_list(mode.supervillains, cached_data, "Суперзлодей", antagonist_cache)
prepare_antag_list(mode.greyshirts, cached_data, "Грейтайд", antagonist_cache)
prepare_antag_list(mode.demons, cached_data, "Демон", antagonist_cache)
prepare_antag_list(mode.xenos, cached_data, "Ксеноморф", antagonist_cache)
prepare_antag_list(mode.eventmiscs, cached_data, "Ивентроль", antagonist_cache)
prepare_antag_list(mode.traders, cached_data, "Торговец", antagonist_cache)
prepare_antag_list(mode.terror_spiders, cached_data, "Паук Ужаса", antagonist_cache)
prepare_antag_list(mode.morphs, cached_data, "Морф", antagonist_cache)
prepare_antag_list(mode.swarmers, cached_data, "Свармер", antagonist_cache)
prepare_antag_list(mode.guardians, cached_data, "Голопаразит", antagonist_cache)
prepare_antag_list(mode.revenants, cached_data, "Ревенант", antagonist_cache)
prepare_antag_list(mode.headslugs, cached_data, "Личинка генокрада", antagonist_cache)
prepare_antag_list(mode.deathsquad, cached_data, "Боец Отряда Смерти", antagonist_cache)
prepare_antag_list(mode.honksquad, cached_data, "Член Хонксквада", antagonist_cache)
prepare_antag_list(mode.sst, cached_data, "Боец SST", antagonist_cache)
prepare_antag_list(mode.sit, cached_data, "Агент SIT", antagonist_cache)
21 changes: 21 additions & 0 deletions code/datums/elements/high_value_item.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
GLOBAL_LIST_EMPTY(high_value_items)

/datum/element/high_value_item
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY

/datum/element/high_value_item/Attach(datum/target)
. = ..()
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
GLOB.high_value_items |= target

/datum/element/high_value_item/Detach(datum/source, force)
. = ..()
var/turf/turf_loc = get_turf(source)
if(turf_loc)
message_admins("[source] has been destroyed in [get_area(turf_loc)] at [ADMIN_COORDJMP(turf_loc)].")
log_game("[source] has been destroyed at ([turf_loc.x],[turf_loc.y],[turf_loc.z]) in the location [turf_loc.loc].")
else
message_admins("[source] has been destroyed in nullspace.")
log_game("[source] has been destroyed in nullspace.")
GLOB.high_value_items -= source
247 changes: 247 additions & 0 deletions code/game/gamemodes/auto_decrare.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
/datum/game_mode/proc/auto_declare_completion_morph()
if(!length(morphs))
return

var/text = "<FONT size = 2><B>Морфами были:</B></FONT>"
for(var/datum/mind/morph in morphs)
var/traitorwin = TRUE
text += "<br>[morph.get_display_key()] был [morph.name] ("
if(morph.current)
if(morph.current.stat == DEAD)
text += "умер"
else
text += "жив"
else
text += "тело уничтожено"
text += ")"

var/list/all_objectives = morph.get_all_objectives()

if(length(all_objectives))//If the traitor had no objectives, don't need to process this.
var/count = 1
for(var/datum/objective/objective in all_objectives)
if(objective.check_completion())
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='green'><B>Успех!</B></font>"
SSblackbox.record_feedback("nested tally", "morph_objective", 1, list("[objective.type]", "SUCCESS"))
else
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='red'>Провал.</font>"
SSblackbox.record_feedback("nested tally", "morph_objective", 1, list("[objective.type]", "FAIL"))
traitorwin = FALSE
count++

if(traitorwin)
text += "<br><font color='green'><B>Морф был успешен!</B></font>"
SSblackbox.record_feedback("tally", "morph_success", 1, "SUCCESS")
else
text += "<br><font color='red'><B>Морф провалился!</B></font>"
SSblackbox.record_feedback("tally", "morph_success", 1, "FAIL")
to_chat(world, text)
return TRUE

/datum/game_mode/proc/auto_declare_completion_revenant()
if(!length(revenants))
return

var/text = "<FONT size = 2><B>Ревенантами были:</B></FONT>"
for(var/datum/mind/revenant in revenants)
var/traitorwin = TRUE
text += "<br>[revenant.get_display_key()] был [revenant.name] ("
if(revenant.current)
if(revenant.current.stat == DEAD)
text += "умер"
else
text += "жив"
else
text += "тело уничтожено"
text += ")"

var/list/all_objectives = revenant.get_all_objectives()

if(length(all_objectives))
var/count = 1
for(var/datum/objective/objective in all_objectives)
if(objective.check_completion())
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='green'><B>Успех!</B></font>"
SSblackbox.record_feedback("nested tally", "revenant_objective", 1, list("[objective.type]", "SUCCESS"))
else
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='red'>Провал.</font>"
SSblackbox.record_feedback("nested tally", "revenant_objective", 1, list("[objective.type]", "FAIL"))
traitorwin = FALSE
count++

if(traitorwin)
text += "<br><font color='green'><B>Ревенант был успешен!</B></font>"
SSblackbox.record_feedback("tally", "revenant_success", 1, "SUCCESS")
else
text += "<br><font color='red'><B>Ревенант провалился!</B></font>"
SSblackbox.record_feedback("tally", "revenant_success", 1, "FAIL")
to_chat(world, text)
return TRUE

/datum/game_mode/proc/auto_declare_completion_honksquad()
if(!length(honksquad))
return

var/text = "<FONT size = 2><B>Членами Хонксквада были:</B></FONT>"
for(var/datum/mind/honker in honksquad)
var/traitorwin = TRUE
text += "<br>[honker.get_display_key()] был [honker.name] ("
if(honker.current)
if(honker.current.stat == DEAD)
text += "умер"
traitorwin = FALSE
else
text += "жив"
else
text += "тело уничтожено"
traitorwin = FALSE
text += ")"

var/list/all_objectives = honker.get_all_objectives()

if(length(all_objectives))
var/count = 1
for(var/datum/objective/objective in all_objectives)
if(objective.check_completion())
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='green'><B>Успех!</B></font>"
SSblackbox.record_feedback("nested tally", "honksquad_objective", 1, list("[objective.type]", "SUCCESS"))
else
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='red'>Провал.</font>"
SSblackbox.record_feedback("nested tally", "honksquad_objective", 1, list("[objective.type]", "FAIL"))
traitorwin = FALSE
count++

if(traitorwin)
text += "<br><font color='green'><B>Член Хонксквада был успешен!</B></font>"
SSblackbox.record_feedback("tally", "honksquad_success", 1, "SUCCESS")
else
text += "<br><font color='red'><B>Член Хонксквада провалился!</B></font>"
SSblackbox.record_feedback("tally", "honksquad_success", 1, "FAIL")
to_chat(world, text)
return TRUE

/datum/game_mode/proc/auto_declare_completion_deathsquad()
if(!length(deathsquad))
return

var/text = "<FONT size = 2><B>Бойцами Отряда Смерти были:</B></FONT>"
for(var/datum/mind/commando in deathsquad)
var/traitorwin = TRUE
text += "<br>[commando.get_display_key()] был [commando.name] ("
if(commando.current)
if(commando.current.stat == DEAD)
text += "умер"
traitorwin = FALSE
else
text += "жив"
else
text += "тело уничтожено"
traitorwin = FALSE
text += ")"

var/list/all_objectives = commando.get_all_objectives()

if(length(all_objectives))
var/count = 1
for(var/datum/objective/objective in all_objectives)
if(objective.check_completion())
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='green'><B>Успех!</B></font>"
SSblackbox.record_feedback("nested tally", "deathsquad_objective", 1, list("[objective.type]", "SUCCESS"))
else
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='red'>Провал.</font>"
SSblackbox.record_feedback("nested tally", "deathsquad_objective", 1, list("[objective.type]", "FAIL"))
traitorwin = FALSE
count++

if(traitorwin)
text += "<br><font color='green'><B>Боец Отряда Смерти был успешен!</B></font>"
SSblackbox.record_feedback("tally", "deathsquad_success", 1, "SUCCESS")
else
text += "<br><font color='red'><B>Боец Отряда Смерти провалился!</B></font>"
SSblackbox.record_feedback("tally", "deathsquad_success", 1, "FAIL")
to_chat(world, text)
return TRUE

/datum/game_mode/proc/auto_declare_completion_sst()
if(!length(sst))
return

var/text = "<FONT size = 2><B>Бойцами Ударного Отряда Синдиката были:</B></FONT>"
for(var/datum/mind/commando in sst)
var/traitorwin = TRUE
text += "<br>[commando.get_display_key()] был [commando.name] ("
if(commando.current)
if(commando.current.stat == DEAD)
text += "умер"
traitorwin = FALSE
else
text += "жив"
else
text += "тело уничтожено"
traitorwin = FALSE
text += ")"

var/list/all_objectives = commando.get_all_objectives()

if(length(all_objectives))
var/count = 1
for(var/datum/objective/objective in all_objectives)
if(objective.check_completion())
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='green'><B>Успех!</B></font>"
SSblackbox.record_feedback("nested tally", "sst_objective", 1, list("[objective.type]", "SUCCESS"))
else
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='red'>Провал.</font>"
SSblackbox.record_feedback("nested tally", "sst_objective", 1, list("[objective.type]", "FAIL"))
traitorwin = FALSE
count++

if(traitorwin)
text += "<br><font color='green'><B>Боец Ударного Отряда Синдиката успешен!</B></font>"
SSblackbox.record_feedback("tally", "sst_success", 1, "SUCCESS")
else
text += "<br><font color='red'><B>Боец Ударного Отряда Синдиката провалился!</B></font>"
SSblackbox.record_feedback("tally", "sst_success", 1, "FAIL")
to_chat(world, text)
return TRUE

/datum/game_mode/proc/auto_declare_completion_sit()
if(!length(sit))
return

var/text = "<FONT size = 2><B>Агентами Диверсионного Отряда Синдиката были:</B></FONT>"
for(var/datum/mind/commando in sit)
var/traitorwin = TRUE
text += "<br>[commando.get_display_key()] был [commando.name] ("
if(commando.current)
if(commando.current.stat == DEAD)
text += "умер"
traitorwin = FALSE
else
text += "жив"
else
text += "тело уничтожено"
traitorwin = FALSE
text += ")"

var/list/all_objectives = commando.get_all_objectives()

if(length(all_objectives))
var/count = 1
for(var/datum/objective/objective in all_objectives)
if(objective.check_completion())
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='green'><B>Успех!</B></font>"
SSblackbox.record_feedback("nested tally", "sit_objective", 1, list("[objective.type]", "SUCCESS"))
else
text += "<br><B>Цель #[count]</B>: [objective.explanation_text] <font color='red'>Провал.</font>"
SSblackbox.record_feedback("nested tally", "sit_objective", 1, list("[objective.type]", "FAIL"))
traitorwin = FALSE
count++

if(traitorwin)
text += "<br><font color='green'><B>Агент Диверсионного Отряда Синдиката был успешен!</B></font>"
SSblackbox.record_feedback("tally", "sit_success", 1, "SUCCESS")
else
text += "<br><font color='red'><B>Агент Диверсионного Отряда Синдиката провалился!</B></font>"
SSblackbox.record_feedback("tally", "sit_success", 1, "FAIL")
to_chat(world, text)
return TRUE
1 change: 1 addition & 0 deletions code/game/gamemodes/blob/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
blob_objective.critical_mass = legit_blobs.len
blob_objective.needed_critical_mass = blob_win_count
blob_objective.set_target()
blob_objective.owner = src


/datum/game_mode/proc/blob_died()
Expand Down
Loading
Loading