mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
This reverts commit c914d556c1.
This commit is contained in:
committed by
Rob Bailey
parent
e25979b966
commit
ed9f8a265b
@@ -1,35 +1,23 @@
|
||||
/datum/atom_hud/antag
|
||||
hud_icons = list(ANTAG_HUD)
|
||||
var/self_visible = TRUE
|
||||
var/team_hud = FALSE
|
||||
|
||||
/datum/atom_hud/antag/hidden
|
||||
self_visible = FALSE
|
||||
|
||||
/datum/atom_hud/antag/team
|
||||
team_hud = TRUE
|
||||
|
||||
/datum/atom_hud/antag/proc/join_hud(mob/M)
|
||||
var/datum/atom_hud/antag/mind_hud = M.mind.antag_hud
|
||||
|
||||
if (team_hud)
|
||||
mind_hud = M.mind.team_antag_hud
|
||||
|
||||
//sees_hud should be set to 0 if the mob does not get to see it's own hud type.
|
||||
if(!istype(M))
|
||||
CRASH("join_hud(): [M] ([M.type]) is not a mob!")
|
||||
if(mind_hud) //note: please let this runtime if a mob has no mind, as mindless mobs shouldn't be getting antagged
|
||||
mind_hud.leave_hud(M)
|
||||
if(M.mind.antag_hud) //note: please let this runtime if a mob has no mind, as mindless mobs shouldn't be getting antagged
|
||||
M.mind.antag_hud.leave_hud(M)
|
||||
|
||||
if(ANTAG_HUD in M.hud_possible) //Current mob does not support antag huds ie newplayer
|
||||
add_to_hud(M)
|
||||
if(self_visible)
|
||||
add_hud_to(M)
|
||||
|
||||
if (!team_hud)
|
||||
M.mind.antag_hud = src
|
||||
else
|
||||
M.mind.team_antag_hud = src
|
||||
M.mind.antag_hud = src
|
||||
|
||||
/datum/atom_hud/antag/proc/leave_hud(mob/M)
|
||||
if(!M)
|
||||
@@ -39,39 +27,30 @@
|
||||
remove_from_hud(M)
|
||||
remove_hud_from(M)
|
||||
if(M.mind)
|
||||
if (!team_hud)
|
||||
M.mind.antag_hud = null
|
||||
else
|
||||
M.mind.team_antag_hud = null
|
||||
|
||||
M.mind.antag_hud = null
|
||||
|
||||
|
||||
//GAME_MODE PROCS
|
||||
//called to set a mob's antag icon state
|
||||
/proc/set_antag_hud(mob/M, new_icon_state, team_hud=FALSE)
|
||||
/proc/set_antag_hud(mob/M, new_icon_state)
|
||||
if(!istype(M))
|
||||
CRASH("set_antag_hud(): [M] ([M.type]) is not a mob!")
|
||||
var/image/holder = M.hud_list[ANTAG_HUD]
|
||||
if(holder)
|
||||
holder.icon_state = new_icon_state
|
||||
if(M.mind || new_icon_state) //in mindless mobs, only null is acceptable, otherwise we're antagging a mindless mob, meaning we should runtime
|
||||
if (!team_hud)
|
||||
M.mind.antag_hud_icon_state = new_icon_state
|
||||
else
|
||||
M.mind.team_antag_hud_icon_state = new_icon_state
|
||||
M.mind.antag_hud_icon_state = new_icon_state
|
||||
|
||||
|
||||
//MIND PROCS
|
||||
//these are called by mind.transfer_to()
|
||||
/datum/mind/proc/transfer_antag_huds(datum/atom_hud/antag/global_newhud, datum/atom_hud/antag/team_newhud)
|
||||
/datum/mind/proc/transfer_antag_huds(datum/atom_hud/antag/newhud)
|
||||
leave_all_antag_huds()
|
||||
|
||||
set_antag_hud(current, antag_hud_icon_state)
|
||||
set_antag_hud(current, team_antag_hud_icon_state, TRUE)
|
||||
|
||||
if(global_newhud)
|
||||
global_newhud.join_hud(current)
|
||||
if(team_newhud)
|
||||
team_newhud.join_hud(current)
|
||||
if(newhud)
|
||||
newhud.join_hud(current)
|
||||
|
||||
/datum/mind/proc/leave_all_antag_huds()
|
||||
for(var/datum/atom_hud/antag/hud in GLOB.huds)
|
||||
if(hud.hudusers[current])
|
||||
hud.leave_hud(current)
|
||||
hud.leave_hud(current)
|
||||
@@ -7,18 +7,10 @@ GLOBAL_LIST_EMPTY(antagonist_teams)
|
||||
var/member_name = "member"
|
||||
var/list/objectives = list() //common objectives, these won't be added or removed automatically, subtypes handle this, this is here for bookkeeping purposes.
|
||||
var/show_roundend_report = TRUE
|
||||
var/has_hud = FALSE /// Does the team have its own HUD?
|
||||
var/hud_icon_state = "traitor" /// Default icon
|
||||
var/datum/atom_hud/antag/team/team_hud = new /// HUD datum
|
||||
|
||||
/datum/team/New(starting_members)
|
||||
. = ..()
|
||||
GLOB.antagonist_teams += src
|
||||
|
||||
if (has_hud)
|
||||
team_hud.self_visible = TRUE
|
||||
GLOB.huds += team_hud
|
||||
|
||||
if(starting_members)
|
||||
if(islist(starting_members))
|
||||
for(var/datum/mind/M in starting_members)
|
||||
@@ -34,17 +26,9 @@ GLOBAL_LIST_EMPTY(antagonist_teams)
|
||||
return members.len == 1
|
||||
|
||||
/datum/team/proc/add_member(datum/mind/new_member)
|
||||
if (has_hud)
|
||||
team_hud.join_hud(new_member.current)
|
||||
set_antag_hud(new_member.current, hud_icon_state, TRUE)
|
||||
|
||||
members |= new_member
|
||||
|
||||
/datum/team/proc/remove_member(datum/mind/member)
|
||||
if (has_hud)
|
||||
team_hud.leave_hud(member.current)
|
||||
set_antag_hud(member.current, null, TRUE)
|
||||
|
||||
members -= member
|
||||
|
||||
//Display members/victory/failure/objectives for the team
|
||||
|
||||
@@ -89,9 +89,6 @@
|
||||
/datum/team/brother_team
|
||||
name = "brotherhood"
|
||||
member_name = "blood brother"
|
||||
has_hud = TRUE
|
||||
hud_icon_state = "brother"
|
||||
|
||||
var/meeting_area
|
||||
var/static/meeting_areas = list("The Bar", "Dorms", "Escape Dock", "Arrivals", "Holodeck", "Primary Tool Storage", "Recreation Area", "Chapel", "Library")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user