-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathtraitor_datum_backstory.dm
62 lines (58 loc) · 2.37 KB
/
traitor_datum_backstory.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
/datum/antagonist/traitor
/// A list of factions the traitor can pick from freely.
var/list/allowed_factions = list(
TRAITOR_FACTION_SYNDICATE,
TRAITOR_FACTION_BLACK_MARKET,
TRAITOR_FACTION_INDEPENDENT,
TRAITOR_FACTION_DONK,
TRAITOR_FACTION_WAFFLE,
TRAITOR_FACTION_CYBERSUN,
TRAITOR_FACTION_VAHLEN,
TRAITOR_FACTION_GORLEX,
TRAITOR_FACTION_SELF)
/// A list of factions the traitor can pick from freely.
var/list/recommended_factions = list()
/// A list of backstories that are allowed for this traitor.
var/list/allowed_backstories
/// A list of recommended backstories for this traitor, based on their murderbone status.
var/list/recommended_backstories
/// The actual backstory for this traitor. Can be null.
var/datum/traitor_backstory/backstory
/// The actual faction for this traitor. Can be null.
var/datum/traitor_faction/faction
/datum/antagonist/traitor/proc/setup_backstories(murderbone, hijack)
if(murderbone || hijack)
recommended_factions = list(TRAITOR_FACTION_SYNDICATE, TRAITOR_FACTION_INDEPENDENT)
allowed_backstories = list()
recommended_backstories = list()
for(var/datum/traitor_backstory/path as anything in subtypesof(/datum/traitor_backstory))
var/datum/traitor_backstory/backstory = GLOB.traitor_backstories["[path]"]
if(!istype(backstory))
continue
if(!murderbone)
allowed_backstories += "[path]"
if(hijack && backstory.murderbone)
recommended_backstories += "[path]"
continue
if(backstory.has_motivation(TRAITOR_MOTIVATION_FORCED))
continue
allowed_backstories += "[path]"
if(backstory.murderbone)
recommended_backstories += "[path]"
// add_menu_action() -- dont need doubles lol -- cowbot93
/datum/antagonist/traitor/proc/set_faction(datum/traitor_faction/new_faction)
if(!istype(new_faction))
return
var/no_faction = isnull(faction)
faction = new_faction
employer = new_faction.employer_name
if(no_faction)
if(new_faction.give_codewords)
give_codewords()
equip(silent)
log_game("[key_name(owner)] selected traitor faction [new_faction.name]")
SSblackbox.record_feedback("tally", "traitor_faction_selected", 1, new_faction.name)
/datum/antagonist/traitor/proc/set_backstory(datum/traitor_backstory/new_backstory)
backstory = new_backstory
log_game("[key_name(owner)] selected traitor backstory [new_backstory.name]")
SSblackbox.record_feedback("tally", "traitor_backstory_selected", 1, new_backstory.name)