/
organs.dm
189 lines (156 loc) · 6.01 KB
/
organs.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/obj/item/organ/alien
icon_state = "xgibmid2"
food_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/toxin/acid = 10)
var/list/alien_powers = list()
/obj/item/organ/alien/Initialize()
. = ..()
for(var/A in alien_powers)
if(ispath(A))
alien_powers -= A
alien_powers += new A(src)
/obj/item/organ/alien/Destroy()
QDEL_LIST(alien_powers)
return ..()
/obj/item/organ/alien/Insert(mob/living/carbon/M, special = 0)
..()
for(var/obj/effect/proc_holder/alien/P in alien_powers)
M.AddAbility(P)
/obj/item/organ/alien/Remove(mob/living/carbon/M, special = 0)
for(var/obj/effect/proc_holder/alien/P in alien_powers)
M.RemoveAbility(P)
..()
/obj/item/organ/alien/plasmavessel
name = "plasma vessel"
icon_state = "plasma"
w_class = WEIGHT_CLASS_NORMAL
zone = BODY_ZONE_CHEST
slot = ORGAN_SLOT_XENO_PLASMAVESSEL
alien_powers = list(/obj/effect/proc_holder/alien/plant, /obj/effect/proc_holder/alien/transfer)
food_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/toxin/plasma = 10)
/// The current amount of stored plasma.
var/storedPlasma = 100
/// The maximum plasma this organ can store.
var/max_plasma = 250
/// The rate this organ regenerates its owners health at per damage type per second.
var/heal_rate = 2.5
/// The rate this organ regenerates plasma at per second.
var/plasma_rate = 5
/obj/item/organ/alien/plasmavessel/large
name = "large plasma vessel"
icon_state = "plasma_large"
w_class = WEIGHT_CLASS_BULKY
storedPlasma = 200
max_plasma = 500
plasma_rate = 7.5
/obj/item/organ/alien/plasmavessel/large/queen
plasma_rate = 10
/obj/item/organ/alien/plasmavessel/small
name = "small plasma vessel"
icon_state = "plasma_small"
w_class = WEIGHT_CLASS_SMALL
storedPlasma = 100
max_plasma = 150
plasma_rate = 2.5
/obj/item/organ/alien/plasmavessel/small/tiny
name = "tiny plasma vessel"
icon_state = "plasma_tiny"
w_class = WEIGHT_CLASS_TINY
max_plasma = 100
alien_powers = list(/obj/effect/proc_holder/alien/transfer)
/obj/item/organ/alien/plasmavessel/on_life(delta_time, times_fired)
//If there are alien weeds on the ground then heal if needed or give some plasma
if(locate(/obj/structure/alien/weeds) in owner.loc)
if(owner.health >= owner.maxHealth)
owner.adjustPlasma(plasma_rate * delta_time)
else
var/heal_amt = heal_rate
if(!isalien(owner))
heal_amt *= 0.2
owner.adjustPlasma(0.5 * plasma_rate * delta_time)
owner.adjustBruteLoss(-heal_amt * delta_time)
owner.adjustFireLoss(-heal_amt * delta_time)
owner.adjustOxyLoss(-heal_amt * delta_time)
owner.adjustCloneLoss(-heal_amt * delta_time)
else
owner.adjustPlasma(0.1 * plasma_rate * delta_time)
/obj/item/organ/alien/plasmavessel/Insert(mob/living/carbon/M, special = 0)
..()
if(isalien(M))
var/mob/living/carbon/alien/A = M
A.updatePlasmaDisplay()
/obj/item/organ/alien/plasmavessel/Remove(mob/living/carbon/M, special = 0)
..()
if(isalien(M))
var/mob/living/carbon/alien/A = M
A.updatePlasmaDisplay()
#define QUEEN_DEATH_DEBUFF_DURATION 2400
/obj/item/organ/alien/hivenode
name = "hive node"
icon_state = "hivenode"
zone = BODY_ZONE_HEAD
slot = ORGAN_SLOT_XENO_HIVENODE
w_class = WEIGHT_CLASS_TINY
///Indicates if the queen died recently, aliens are heavily weakened while this is active.
var/recent_queen_death = FALSE
alien_powers = list(/obj/effect/proc_holder/alien/whisper)
/obj/item/organ/alien/hivenode/Insert(mob/living/carbon/M, special = 0)
..()
M.faction |= ROLE_ALIEN
ADD_TRAIT(M, TRAIT_XENO_IMMUNE, "xeno immune")
/obj/item/organ/alien/hivenode/Remove(mob/living/carbon/M, special = 0)
M.faction -= ROLE_ALIEN
REMOVE_TRAIT(M, TRAIT_XENO_IMMUNE, "xeno immune")
..()
//When the alien queen dies, all aliens suffer a penalty as punishment for failing to protect her.
/obj/item/organ/alien/hivenode/proc/queen_death()
if(!owner|| owner.stat == DEAD)
return
if(isalien(owner)) //Different effects for aliens than humans
to_chat(owner, "<span class='userdanger'>Your Queen has been struck down!</span>")
to_chat(owner, "<span class='danger'>You are struck with overwhelming agony! You feel confused, and your connection to the hivemind is severed.</span>")
owner.emote("roar")
owner.Stun(200) //Actually just slows them down a bit.
else if(ishuman(owner)) //Humans, being more fragile, are more overwhelmed by the mental backlash.
to_chat(owner, "<span class='danger'>You feel a splitting pain in your head, and are struck with a wave of nausea. You cannot hear the hivemind anymore!</span>")
owner.emote("scream")
owner.Paralyze(100)
owner.jitteriness += 30
owner.add_confusion(30)
owner.stuttering += 30
recent_queen_death = TRUE
owner.throw_alert("alien_noqueen", /atom/movable/screen/alert/alien_vulnerable)
addtimer(CALLBACK(src, .proc/clear_queen_death), QUEEN_DEATH_DEBUFF_DURATION)
/obj/item/organ/alien/hivenode/proc/clear_queen_death()
if(QDELETED(src)) //In case the node is deleted
return
recent_queen_death = FALSE
if(!owner) //In case the xeno is butchered or subjected to surgery after death.
return
to_chat(owner, "<span class='noticealien'>The pain of the queen's death is easing. You begin to hear the hivemind again.</span>")
owner.clear_alert("alien_noqueen")
#undef QUEEN_DEATH_DEBUFF_DURATION
/obj/item/organ/alien/resinspinner
name = "resin spinner"
icon_state = "stomach-x"
zone = BODY_ZONE_PRECISE_MOUTH
slot = ORGAN_SLOT_XENO_RESINSPINNER
alien_powers = list(/obj/effect/proc_holder/alien/resin)
/obj/item/organ/alien/acid
name = "acid gland"
icon_state = "acid"
zone = BODY_ZONE_PRECISE_MOUTH
slot = ORGAN_SLOT_XENO_ACIDGLAND
alien_powers = list(/obj/effect/proc_holder/alien/acid)
/obj/item/organ/alien/neurotoxin
name = "neurotoxin gland"
icon_state = "neurotox"
zone = BODY_ZONE_PRECISE_MOUTH
slot = ORGAN_SLOT_XENO_NEUROTOXINGLAND
alien_powers = list(/obj/effect/proc_holder/alien/neurotoxin)
/obj/item/organ/alien/eggsac
name = "egg sac"
icon_state = "eggsac"
zone = BODY_ZONE_PRECISE_GROIN
slot = ORGAN_SLOT_XENO_EGGSAC
w_class = WEIGHT_CLASS_BULKY
alien_powers = list(/obj/effect/proc_holder/alien/lay_egg)