-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy paththrall_tumor.dm
93 lines (85 loc) · 3.36 KB
/
thrall_tumor.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
//Snowflake spot for putting sling organ related stuff
/obj/item/organ/shadowtumor
name = "black tumor"
desc = "A tiny black mass with red tendrils trailing from it. It seems to shrivel in the light."
icon_state = "blacktumor"
w_class = 1
zone = BODY_ZONE_HEAD
slot = ORGAN_SLOT_BRAIN_TUMOR
///How many process ticks the organ can be in light before it evaporates
var/organ_health = 3
///Cached darkspawn team that gets the willpower
var/datum/team/darkspawn/antag_team
///How much willpower is granted by this tumor
var/willpower_amount = 1
/obj/item/organ/shadowtumor/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/organ/shadowtumor/Destroy()
STOP_PROCESSING(SSobj, src)
..()
/obj/item/organ/shadowtumor/process()
if(isturf(loc))
var/turf/T = loc
var/light_count = T.get_lumcount()
if(light_count > SHADOW_SPECIES_DIM_LIGHT && organ_health > 0) //Die in the light
organ_health--
else if(light_count < SHADOW_SPECIES_DIM_LIGHT && organ_health < 3) //Heal in the dark
organ_health = min(organ_health + 1, 3)
if(organ_health <= 0)
visible_message(span_warning("[src] collapses in on itself!"))
qdel(src)
else
organ_health = min(organ_health+0.5, 3)
if(owner && owner.stat != DEAD && antag_team)
antag_team.willpower_progress(willpower_amount)
/obj/item/organ/shadowtumor/on_find(mob/living/finder)
. = ..()
finder.visible_message(span_danger("[finder] opens up [owner]'s skull, revealing a pulsating black mass, with red tendrils attaching it to [owner.p_their()] brain."))
////////////////////////////////////////////////////////////////////////////////////
//------------------------------Thrall version------------------------------------//
////////////////////////////////////////////////////////////////////////////////////
/obj/item/organ/shadowtumor/thrall
//provides extra willpower because willpower was spent to thrall someone
willpower_amount = 2
///adds a cooldown to the resist so a thrall ipc or preternis can't weaponize it
COOLDOWN_DECLARE(resist_cooldown)
///How long the resist cooldown is
var/cooldown_length = 15 SECONDS
/obj/item/organ/shadowtumor/thrall/process()
if(!isthrall(owner))
qdel(src)
return
return ..()
/obj/item/organ/shadowtumor/thrall/proc/resist(mob/living/carbon/M)
if(QDELETED(src))
return FALSE
if(!(M.stat == CONSCIOUS))//Thralls cannot be deconverted while awake
return FALSE
if(!isthrall(M))//non thralls don't resist
return FALSE
if(!COOLDOWN_FINISHED(src, resist_cooldown))//adds a cooldown to the resist so a thrall ipc or preternis can't weaponize it
return FALSE
COOLDOWN_START(src, resist_cooldown, cooldown_length)
playsound(M,'sound/effects/tendril_destroyed.ogg', 80, 1)
to_chat(M, span_progenitor("<b><i>NOT LIKE THIS!</i></b>"))
M.visible_message(span_danger("[M] suddenly slams upward and knocks everyone back!"))
M.resting = FALSE //Remove all stuns
M.SetAllImmobility(0, TRUE)
for(var/mob/living/user as anything in range(2, get_turf(src)))
if(!istype(user))
continue
if(is_team_darkspawn(user))
continue
var/turf/target = get_ranged_target_turf(user, get_dir(M, user))
user.throw_at(target, 2, 2, M)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.Knockdown(4 SECONDS)
C.adjustBruteLoss(20)
if(issilicon(user))
var/mob/living/silicon/S = user
S.Knockdown(8 SECONDS)
S.adjustBruteLoss(20)
playsound(S, 'sound/effects/bang.ogg', 50, 1)
return TRUE