-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathantag_team.dm
64 lines (52 loc) · 1.84 KB
/
antag_team.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
GLOBAL_LIST_EMPTY(antagonist_teams)
//A barebones antagonist team.
/datum/team
var/list/datum/mind/members = list()
var/name = "team"
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
///used for keeping track of antag datum type paths for admin editing of teams
var/antag_path
/datum/team/New(starting_members)
. = ..()
GLOB.antagonist_teams += src
if(starting_members)
if(islist(starting_members))
for(var/datum/mind/M in starting_members)
add_member(M)
else
add_member(starting_members)
/datum/team/Destroy(force, ...)
GLOB.antagonist_teams -= src
. = ..()
/datum/team/proc/is_solo()
return members.len == 1
/datum/team/proc/add_member(datum/mind/new_member)
members |= new_member
/datum/team/proc/remove_member(datum/mind/member)
members -= member
//Display members/victory/failure/objectives for the team
/datum/team/proc/roundend_report()
if(!show_roundend_report)
return
var/list/report = list()
report += span_header("[name]:")
report += "The [member_name]s were:"
report += printplayerlist(members)
if(objectives.len)
report += span_header("Team had following objectives:")
var/win = TRUE
var/objective_count = 1
for(var/datum/objective/objective in objectives)
if(objective.check_completion())
report += "<B>Objective #[objective_count]</B>: [objective.explanation_text] [span_greentext("Success!")]"
else
report += "<B>Objective #[objective_count]</B>: [objective.explanation_text] [span_redtext("Fail.")]"
win = FALSE
objective_count++
if(win)
report += span_greentext("The [name] was successful!")
else
report += span_redtext("The [name] have failed!")
return "<div class='panel redborder'>[report.Join("<br>")]</div>"