Refactors antag team code. Adds an admin UI to interact with teams (#19870)

* adds antag team framework code

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* sirryan review

* adds the ability for admins to add members

* oops

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
SteelSlayer
2022-12-26 13:32:55 -06:00
committed by GitHub
parent 9caf885ae1
commit 80d2959d19
8 changed files with 306 additions and 40 deletions
+43
View File
@@ -1609,6 +1609,49 @@
else if(href_list["check_antagonist"])
check_antagonists()
else if(href_list["check_teams"])
if(!check_rights(R_ADMIN))
return
check_teams()
else if(href_list["team_command"])
if(!check_rights(R_ADMIN))
return
var/datum/team/team
var/datum/mind/member
if(href_list["team"])
team = locateUID(href_list["team"])
if(QDELETED(team))
to_chat(usr, "<span class='warning'>This team doesn't exist anymore!</span>")
return
if(href_list["member"])
member = locateUID(href_list["member"])
if(QDELETED(member))
to_chat(usr, "<span class='warning'>This team member doesn't exist anymore!</span>")
return
switch(href_list["team_command"])
if("communicate")
team.admin_communicate(usr)
if("delete_team")
message_admins("[key_name_admin(usr)] has deleted the '[team.name]' team.")
log_admin("[key_name_admin(usr)] has deleted the '[team.name]' team.")
qdel(team)
if("rename_team")
team.admin_rename_team(usr)
if("admin_add_member")
team.admin_add_member(usr)
if("remove_member")
team.admin_remove_member(usr, member)
if("view_member")
show_player_panel(member.current)
if("add_objective")
team.admin_add_objective(usr)
if("remove_objective")
var/datum/objective/O = locateUID(href_list["objective"])
if(O)
team.admin_remove_objective(usr, O)
check_teams()
else if(href_list["take_question"])
var/index = text2num(href_list["take_question"])