-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathdarkspawn_thrall.dm
175 lines (148 loc) · 7.46 KB
/
darkspawn_thrall.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/**
* Helper proc to check if someone has a shadow tumor
*/
/proc/get_shadow_tumor(mob/living/source)
if(!istype(source))
return
var/obj/item/organ/tumor = source.getorganslot(ORGAN_SLOT_BRAIN_TUMOR)
if(!tumor || !istype(tumor, /obj/item/organ/shadowtumor)) //if they somehow lose their tumor in an unusual way
return
return tumor
/datum/antagonist/thrall
name = "Darkspawn Thrall"
job_rank = ROLE_DARKSPAWN
antag_hud_name = "thrall"
roundend_category = "thralls"
antagpanel_category = "Darkspawn"
antag_moodlet = /datum/mood_event/thrall
///The abilities granted to the thrall
var/list/abilities = list(/datum/action/cooldown/spell/toggle/nightvision, /datum/action/cooldown/spell/pointed/darkspawn_build/thrall_eye/thrall)
///The darkspawn team that the thrall is on
var/datum/team/darkspawn/team
/datum/antagonist/thrall/get_team()
return team
/datum/antagonist/thrall/on_gain()
owner.special_role = "thrall"
message_admins("[key_name_admin(owner.current)] was thralled by a darkspawn!")
log_game("[key_name(owner.current)] was thralled by a darkspawn!")
for (var/datum/team/darkspawn/T in GLOB.antagonist_teams)
team = T
if(!team)
team = new
stack_trace("thrall made without darkspawns")
return ..()
/datum/antagonist/thrall/on_removal()
message_admins("[key_name_admin(owner.current)] was dethralled!")
log_game("[key_name(owner.current)] was dethralled!")
owner.special_role = null
var/mob/living/M = owner.current
M.faction -= ROLE_DARKSPAWN
if(issilicon(M))
M.audible_message(span_notice("[M] lets out a short blip, followed by a low-pitched beep."))
to_chat(M,span_userdanger("You have been turned into a[ iscyborg(M) ? " cyborg" : "n AI" ]! You are no longer a thrall! Though you try, you cannot remember anything about your servitude..."))
else
M.visible_message(span_big("[M] looks like their mind is their own again!"))
to_chat(M,span_userdanger("A piercing white light floods your eyes. Your mind is your own again! Though you try, you cannot remember anything about the darkspawn or your time under their command..."))
return ..()
/datum/antagonist/thrall/apply_innate_effects(mob/living/mob_override)
var/mob/living/current_mob = mob_override || owner.current
if(!current_mob)
return //sanity check
if(team)
team.add_thrall(current_mob.mind)
add_team_hud(current_mob, /datum/antagonist/darkspawn)
RegisterSignal(current_mob, COMSIG_LIVING_LIFE, PROC_REF(thrall_life))
RegisterSignal(current_mob, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(update_owner_overlay))
current_mob.update_appearance(UPDATE_OVERLAYS)
current_mob.grant_language(/datum/language/darkspawn)
current_mob.faction |= ROLE_DARKSPAWN
current_mob.AddComponent(/datum/component/internal_cam, list(ROLE_DARKSPAWN))
var/datum/component/internal_cam/cam = current_mob.GetComponent(/datum/component/internal_cam)
if(cam)
cam.change_cameranet(GLOB.thrallnet)
for(var/spell in abilities)
if(ispreternis(current_mob) && ispath(spell, /datum/action/cooldown/spell/toggle/nightvision))
continue //preterni are already designed for it
var/datum/action/cooldown/spell/new_spell = new spell(owner)
new_spell.Grant(current_mob)
if(isliving(current_mob))
var/obj/item/organ/shadowtumor/thrall/ST = current_mob.getorganslot(ORGAN_SLOT_BRAIN_TUMOR)
if(!ST || !istype(ST))
ST = new
ST.Insert(current_mob, FALSE, FALSE)
if(team)
ST.antag_team = team
/datum/antagonist/thrall/remove_innate_effects(mob/living/mob_override)
var/mob/living/current_mob = mob_override || owner.current
if(!current_mob)
return //sanity check
if(team)
team.remove_thrall(current_mob.mind)
UnregisterSignal(current_mob, COMSIG_LIVING_LIFE)
UnregisterSignal(current_mob, COMSIG_ATOM_UPDATE_OVERLAYS)
current_mob.update_appearance(UPDATE_OVERLAYS)
current_mob.remove_language(/datum/language/darkspawn)
current_mob.faction -= ROLE_DARKSPAWN
qdel(current_mob.GetComponent(/datum/component/internal_cam))
for(var/datum/action/cooldown/spell/spells in current_mob.actions)
if(spells.type in abilities)//no keeping your abilities
spells.Remove(current_mob)
qdel(spells)
var/obj/item/organ/tumor = get_shadow_tumor(current_mob)
if(tumor)
qdel(tumor)
current_mob.update_sight()
////////////////////////////////////////////////////////////////////////////////////
//--------------------------------Antag hud---------------------------------------//
////////////////////////////////////////////////////////////////////////////////////
/datum/antagonist/thrall/add_team_hud(mob/target, antag_to_check)
QDEL_NULL(team_hud_ref)
team_hud_ref = WEAKREF(target.add_alt_appearance(
/datum/atom_hud/alternate_appearance/basic/has_antagonist,
"antag_team_hud_[REF(src)]",
hud_image_on(target),
antag_to_check || type,
))
// Add HUDs that they couldn't see before
for (var/datum/atom_hud/alternate_appearance/basic/has_antagonist/antag_hud as anything in GLOB.has_antagonist_huds)
if (is_team_darkspawn(owner.current)) //needs to change this line so both the darkspawn and thrall sees it
antag_hud.show_to(owner.current)
////////////////////////////////////////////////////////////////////////////////////
//--------------------------------Body Sigil--------------------------------------//
////////////////////////////////////////////////////////////////////////////////////
/datum/antagonist/thrall/proc/update_owner_overlay(atom/source, list/overlays)
SIGNAL_HANDLER
if(!ishuman(source))
return
//draw both the overlay itself and the emissive overlay
var/mutable_appearance/overlay = mutable_appearance('yogstation/icons/mob/darkspawn.dmi', "veil_sigils", -UNDER_SUIT_LAYER)
overlay.color = COLOR_DARKSPAWN_PSI
overlays += overlay
////////////////////////////////////////////////////////////////////////////////////
//-----------Check if the thrall has a tumor, if not, dethrall them---------------//
////////////////////////////////////////////////////////////////////////////////////
/datum/antagonist/thrall/proc/thrall_life(mob/living/source, seconds_per_tick, times_fired)
if(!source || source.stat == DEAD)
return
if(!get_shadow_tumor(source)) //if they somehow lose their tumor in an unusual way
source.remove_thrall()
////////////////////////////////////////////////////////////////////////////////////
//-------------------------------Antag greet--------------------------------------//
////////////////////////////////////////////////////////////////////////////////////
/datum/antagonist/thrall/greet()
to_chat(owner, span_progenitor("Krx'lna tyhx graha xthl'kap" ))
var/list/flavour = list()
if(ispreternis(owner.current))
flavour += "You feel the warm consciousness welcome your own. Realization spews forth as the veil recedes."
else
flavour += "You feel the vast consciousness slowly consume your own and the veil falls away."
flavour += "Serve the darkspawn above all else. Your former allegiances are now forfeit."
flavour += "Their goal is yours, and yours is theirs."
to_chat(owner, span_velvet(flavour.Join("<br>")))
to_chat(owner, span_notice("<i>Use <b>.[MODE_KEY_DARKSPAWN]</b> before your messages to speak over the Mindlink.</i>"))
to_chat(owner, span_notice("<i>Blending in with regular crewmembers will generate willpower for your masters.</i>"))
to_chat(owner, span_notice("<i>Ask for help from your masters or fellows if you're new to this role.</i>"))
SEND_SOUND(owner.current, sound ('yogstation/sound/ambience/antag/become_veil.ogg', volume = 50))
flash_color(owner, flash_color = COLOR_VELVET, flash_time = 10 SECONDS)
/datum/antagonist/thrall/roundend_report()
return "[printplayer(owner)]"