Skip to content

Commit

Permalink
[MIRROR] Adding a blood brother via the team panel sets it up correct…
Browse files Browse the repository at this point in the history
…ly (#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 <[email protected]>
Co-authored-by: Jacquerel <[email protected]>
  • Loading branch information
3 people authored Mar 7, 2024
1 parent b686f6c commit 6772f32
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
1 change: 1 addition & 0 deletions code/modules/admin/antag_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ GLOBAL_VAR(antag_prototypes)
out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]<br>"
out += "Assigned role: [assigned_role.title]. <a href='?src=[REF(src)];role_edit=1'>Edit</a><br>"
out += "Faction and special role: <b><font color='red'>[special_role]</font></b><br>"
out += "<a href='?_src_=holder;[HrefToken()];check_teams=1'>Show Teams</a><br><br>"

var/special_statuses = get_special_statuses()
if(length(special_statuses))
Expand Down
43 changes: 36 additions & 7 deletions code/modules/antagonists/brother/brother.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6772f32

Please sign in to comment.