From 6772f320cb9d23df3c713f394cd83f24116aea58 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:17:53 +0300 Subject: [PATCH] [MIRROR] Adding a blood brother via the team panel sets it up correctly (#2284) * Adding a blood brother via the team panel sets it up correctly (#81799) ## About The Pull Request In a recent round, it was noticed that it's kind of annoying and fiddly for an admin to add someone to a blood brother team (for instance, if they had to recreate someone's mob to fix a different issue). Now if you add someone to a blood brother team via the teams panel, it will set them up as a blood brother properly. It's probably in the future worth examining this behaviour for other team antags as well. I also added a link to the Team Panel to the Antag Panel because I had a skill issue and kept forgetting how to access it. Finally, the conversion logging looked all kinds of fucked, so I fixed it. I will be honest: I don't know what that list does but the arguments it was recording were both wrong and didn't make any sense. ## Why It's Good For The Game Makes admin lives easier. Using this panel you can now add sapient Ian to a blood brother team. ## Changelog :cl: admin: Made it easier for admins to adjust blood brother teams using admin tools. fix: Correct blood brother conversion logging. /:cl: * Adding a blood brother via the team panel sets it up correctly --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: Jacquerel --- code/modules/admin/antag_panel.dm | 1 + code/modules/antagonists/brother/brother.dm | 43 +++++++++++++++++---- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/code/modules/admin/antag_panel.dm b/code/modules/admin/antag_panel.dm index 78601deeb02..c44b766d878 100644 --- a/code/modules/admin/antag_panel.dm +++ b/code/modules/admin/antag_panel.dm @@ -100,6 +100,7 @@ GLOBAL_VAR(antag_prototypes) out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" out += "Assigned role: [assigned_role.title]. Edit
" out += "Faction and special role: [special_role]
" + out += "Show Teams

" var/special_statuses = get_special_statuses() if(length(special_statuses)) diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index 79b19a89ea3..2782da7c210 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -77,22 +77,23 @@ flashed.balloon_alert(source, "[flashed.p_they()] resist!") return - flashed.mind.add_antag_datum(/datum/antagonist/brother, team) + if (!team.add_brother(flashed, key_name(source))) // Shouldn't happen given the former, more specific checks but just in case + flashed.balloon_alert(source, "failed!") + return + source.log_message("converted [key_name(flashed)] to blood brother", LOG_ATTACK) flashed.log_message("was converted by [key_name(source)] to blood brother", LOG_ATTACK) - log_game("[key_name(flashed)] converted [key_name(source)] to blood brother", list( - "flashed" = flashed, - "victim" = source, + log_game("[key_name(flashed)] was made into a blood brother by [key_name(source)]", list( + "converted" = flashed, + "converted by" = source, )) - - flashed.balloon_alert(source, "converted") - to_chat(source, span_notice("[span_bold("[flashed]")] has been converted to aide you as your Brother!")) flash.burn_out() flashed.mind.add_memory( \ /datum/memory/recruited_by_blood_brother, \ protagonist = flashed, \ antagonist = owner.current, \ ) + flashed.balloon_alert(source, "converted") UnregisterSignal(source, COMSIG_MOB_SUCCESSFUL_FLASHED_CARBON) source.RemoveComponentSource(REF(src), /datum/component/can_flash_from_behind) @@ -172,6 +173,34 @@ if (prob(10)) brothers_left += 1 +/datum/team/brother_team/add_member(datum/mind/new_member) + . = ..() + if (!new_member.has_antag_datum(/datum/antagonist/brother)) + add_brother(new_member.current) + +/datum/team/brother_team/remove_member(datum/mind/member) + if (!(member in members)) + return + . = ..() + member.remove_antag_datum(/datum/antagonist/brother) + if (isnull(member.current)) + return + for (var/datum/mind/brother_mind as anything in members) + to_chat(brother_mind, span_warning("[span_bold("[member.current.real_name]")] is no longer your brother!")) + update_name() + +/// Adds a new brother to the team +/datum/team/brother_team/proc/add_brother(mob/living/new_brother, source) + if (isnull(new_brother) || isnull(new_brother.mind) || !GET_CLIENT(new_brother) || new_brother.mind.has_antag_datum(/datum/antagonist/brother)) + return FALSE + + for (var/datum/mind/brother_mind as anything in members) + if (brother_mind == new_brother.mind) + continue + to_chat(brother_mind, span_notice("[span_bold("[new_brother.real_name]")] has been converted to aid you as your brother!")) + new_brother.mind.add_antag_datum(/datum/antagonist/brother, src) + return TRUE + /datum/team/brother_team/proc/update_name() var/list/last_names = list() for(var/datum/mind/team_minds as anything in members)