-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathdisease_abilities.dm
487 lines (395 loc) · 18 KB
/
disease_abilities.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
/*
Abilities that can be purchased by disease mobs. Most are just passive symptoms that will be
added to their disease, but some are active abilites that affect only the target the overmind
is currently following.
*/
GLOBAL_LIST_INIT(disease_ability_singletons, list(
new /datum/disease_ability/action/cough,
new /datum/disease_ability/symptom/mild/sentient,
new /datum/disease_ability/action/sneeze,
new /datum/disease_ability/action/infect,
new /datum/disease_ability/symptom/mild/cough,
new /datum/disease_ability/symptom/mild/sneeze,
new /datum/disease_ability/symptom/medium/shedding,
new /datum/disease_ability/symptom/medium/beard,
new /datum/disease_ability/symptom/medium/hallucigen,
new /datum/disease_ability/symptom/medium/choking,
new /datum/disease_ability/symptom/medium/confusion,
new /datum/disease_ability/symptom/medium/youth,
new /datum/disease_ability/symptom/medium/vomit,
new /datum/disease_ability/symptom/medium/voice_change,
new /datum/disease_ability/symptom/medium/visionloss,
new /datum/disease_ability/symptom/medium/deafness,
new /datum/disease_ability/symptom/powerful/narcolepsy,
new /datum/disease_ability/symptom/medium/fever,
new /datum/disease_ability/symptom/medium/shivering,
new /datum/disease_ability/symptom/medium/headache,
new /datum/disease_ability/symptom/medium/nano_boost,
new /datum/disease_ability/symptom/medium/nano_destroy,
new /datum/disease_ability/symptom/medium/viraladaptation,
new /datum/disease_ability/symptom/medium/viralevolution,
new /datum/disease_ability/symptom/medium/vitiligo,
new /datum/disease_ability/symptom/medium/revitiligo,
new /datum/disease_ability/symptom/medium/itching,
new /datum/disease_ability/symptom/medium/heal/weight_loss,
new /datum/disease_ability/symptom/medium/heal/sensory_restoration,
new /datum/disease_ability/symptom/medium/heal/mind_restoration,
new /datum/disease_ability/symptom/powerful/fire,
new /datum/disease_ability/symptom/powerful/flesh_eating,
new /datum/disease_ability/symptom/mild/inorganic_adaptation,
new /datum/disease_ability/symptom/powerful/undead_adaptation, //yogs change
new /datum/disease_ability/symptom/powerful/heal/starlight,
new /datum/disease_ability/symptom/powerful/heal/oxygen,
new /datum/disease_ability/symptom/powerful/heal/chem,
new /datum/disease_ability/symptom/powerful/heal/metabolism,
new /datum/disease_ability/symptom/powerful/heal/dark,
new /datum/disease_ability/symptom/powerful/heal/water,
new /datum/disease_ability/symptom/powerful/heal/plasma,
new /datum/disease_ability/symptom/powerful/heal/radiation,
new /datum/disease_ability/symptom/powerful/heal/coma,
new /datum/disease_ability/symptom/powerful/heal/youth
))
/datum/disease_ability
var/name
var/cost = 0
var/required_total_points = 0
var/start_with = FALSE
var/short_desc = ""
var/long_desc = ""
var/stat_block = ""
var/threshold_block = list()
var/category = ""
var/list/symptoms
var/list/actions
/datum/disease_ability/New()
..()
if(symptoms)
var/stealth = 0
var/resistance = 0
var/stage_speed = 0
var/transmittable = 0
for(var/T in symptoms)
var/datum/symptom/S = T
stealth += initial(S.stealth)
resistance += initial(S.resistance)
stage_speed += initial(S.stage_speed)
transmittable += initial(S.transmittable)
threshold_block += initial(S.threshold_descs)
stat_block = "Resistance: [resistance]<br>Stealth: [stealth]<br>Stage Speed: [stage_speed]<br>Transmissibility: [transmittable]<br><br>"
if(symptoms.len == 1) //lazy boy's dream
name = initial(S.name)
if(short_desc == "")
short_desc = initial(S.desc)
if(long_desc == "")
long_desc = initial(S.desc)
/datum/disease_ability/proc/CanBuy(mob/camera/disease/D)
if(world.time < D.next_adaptation_time)
return FALSE
if(!D.unpurchased_abilities[src])
return FALSE
return (D.points >= cost) && (D.total_points >= required_total_points)
/datum/disease_ability/proc/Buy(mob/camera/disease/D, silent = FALSE, trigger_cooldown = TRUE)
if(!silent)
to_chat(D, span_notice("Purchased [name]."))
D.points -= cost
D.unpurchased_abilities -= src
if(trigger_cooldown)
D.adapt_cooldown()
D.purchased_abilities[src] = TRUE
for(var/V in (D.disease_instances+D.disease_template))
var/datum/disease/advance/sentient_disease/SD = V
if(symptoms)
for(var/T in symptoms)
var/datum/symptom/S = new T()
SD.symptoms += S
if(SD.processing)
S.Start(SD)
SD.Refresh()
for(var/T in actions)
var/datum/action/A = new T()
A.Grant(D)
/datum/disease_ability/proc/CanRefund(mob/camera/disease/D)
if(world.time < D.next_adaptation_time)
return FALSE
return D.purchased_abilities[src]
/datum/disease_ability/proc/Refund(mob/camera/disease/D, silent = FALSE, trigger_cooldown = TRUE)
if(!silent)
to_chat(D, span_notice("Refunded [name]."))
D.points += cost
D.unpurchased_abilities[src] = TRUE
if(trigger_cooldown)
D.adapt_cooldown()
D.purchased_abilities -= src
for(var/V in (D.disease_instances+D.disease_template))
var/datum/disease/advance/sentient_disease/SD = V
if(symptoms)
for(var/T in symptoms)
var/datum/symptom/S = locate(T) in SD.symptoms
if(S)
SD.symptoms -= S
if(SD.processing)
S.End(SD)
qdel(S)
SD.Refresh()
for(var/T in actions)
var/datum/action/A = locate(T) in D.actions
qdel(A)
//these sybtypes are for conveniently separating the different categories, they have no unique code.
/datum/disease_ability/action
category = "Active"
/datum/disease_ability/symptom
category = "Symptom"
//active abilities and their associated actions
/datum/disease_ability/action/cough
name = "Voluntary Coughing"
actions = list(/datum/action/cooldown/disease_cough)
cost = 0
required_total_points = 0
start_with = TRUE
short_desc = "Force the host you are following to cough, spreading your infection to those nearby."
long_desc = "Force the host you are following to cough with extra force, spreading your infection to those within two meters of your host even if your transmissibility is low.<br>Cooldown: 10 seconds"
/datum/action/cooldown/disease_cough
name = "Cough"
button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "cough"
desc = "Force the host you are following to cough with extra force, spreading your infection to those within two meters of your host even if your transmissibility is low.<br>Cooldown: 10 seconds"
cooldown_time = 10 SECONDS
/datum/action/cooldown/disease_cough/Activate()
var/mob/camera/disease/D = owner
var/mob/living/L = D.following_host
if(!L)
return FALSE
if(L.stat != CONSCIOUS)
to_chat(D, span_warning("Your host must be conscious to cough."))
return FALSE
to_chat(D, span_notice("You force [L.real_name] to cough."))
L.emote("cough")
if(L.CanSpreadAirborneDisease()) //don't spread germs if they covered their mouth
var/datum/disease/advance/sentient_disease/SD = D.hosts[L]
SD.spread(2)
StartCooldown()
/datum/disease_ability/action/sneeze
name = "Voluntary Sneezing"
actions = list(/datum/action/cooldown/disease_sneeze)
cost = 2
required_total_points = 3
short_desc = "Force the host you are following to sneeze, spreading your infection to those in front of them."
long_desc = "Force the host you are following to sneeze with extra force, spreading your infection to any victims in a 4 meter cone in front of your host.<br>Cooldown: 20 seconds"
/datum/action/cooldown/disease_sneeze
name = "Sneeze"
button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "sneeze"
desc = "Force the host you are following to sneeze with extra force, spreading your infection to any victims in a 4 meter cone in front of your host even if your transmissibility is low.<br>Cooldown: 20 seconds"
cooldown_time = 20 SECONDS
/datum/action/cooldown/disease_sneeze/Activate()
var/mob/camera/disease/D = owner
var/mob/living/L = D.following_host
if(!L)
return FALSE
if(L.stat != CONSCIOUS)
to_chat(D, span_warning("Your host must be conscious to sneeze."))
return FALSE
to_chat(D, span_notice("You force [L.real_name] to sneeze."))
L.emote("sneeze")
if(L.CanSpreadAirborneDisease()) //don't spread germs if they covered their mouth
var/datum/disease/advance/sentient_disease/SD = D.hosts[L]
for(var/mob/living/M in oview(4, SD.affected_mob))
if(is_A_facing_B(SD.affected_mob, M) && disease_air_spread_walk(get_turf(SD.affected_mob), get_turf(M)))
M.AirborneContractDisease(SD, TRUE)
StartCooldown()
/datum/disease_ability/action/infect
name = "Secrete Infection"
actions = list(/datum/action/cooldown/disease_infect)
cost = 2
required_total_points = 3
short_desc = "Cause all objects your host is touching to become infectious for a limited time, spreading your infection to anyone who touches them."
long_desc = "Cause the host you are following to excrete an infective substance from their pores, causing all objects touching their skin to transmit your infection to anyone who touches them for the next 30 seconds. This includes the floor, if they are not wearing shoes, and any items they are holding, if they are not wearing gloves.<br>Cooldown: 40 seconds"
/datum/action/cooldown/disease_infect
name = "Secrete Infection"
button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "infect"
desc = "Cause the host you are following to excrete an infective substance from their pores, causing all objects touching their skin to transmit your infection to anyone who touches them for the next 30 seconds.<br>Cooldown: 40 seconds"
cooldown_time = 40 SECONDS
/datum/action/cooldown/disease_infect/Activate()
var/mob/camera/disease/D = owner
var/mob/living/carbon/human/H = D.following_host
if(!H)
return FALSE
for(var/V in H.get_equipped_items(FALSE))
var/obj/O = V
O.AddComponent(/datum/component/infective, D.disease_template, 300)
//no shoes? infect the floor.
if(!H.shoes)
var/turf/T = get_turf(H)
if(T && !isspaceturf(T))
T.AddComponent(/datum/component/infective, D.disease_template, 300)
//no gloves? infect whatever we are holding.
if(!H.gloves)
for(var/V in H.held_items)
if(!V)
continue
var/obj/O = V
O.AddComponent(/datum/component/infective, D.disease_template, 300)
StartCooldown()
/*******************BASE SYMPTOM TYPES*******************/
// cost is for convenience and can be changed. If you're changing req_tot_points then don't use the subtype...
//healing costs more so you have to techswitch from naughty disease otherwise we'd have friendly disease for easy greentext (no fun!)
/datum/disease_ability/symptom/mild
cost = 2
required_total_points = 4
category = "Symptom (Weak)"
/datum/disease_ability/symptom/medium
cost = 4
required_total_points = 8
category = "Symptom"
/datum/disease_ability/symptom/medium/heal
cost = 5
category = "Symptom (+)"
/datum/disease_ability/symptom/powerful
cost = 4
required_total_points = 16
category = "Symptom (Strong)"
/datum/disease_ability/symptom/powerful/heal
cost = 8
category = "Symptom (Strong+)"
/******MILD******/
/datum/disease_ability/symptom/mild/sentient
cost = 0
required_total_points = 0
name = "Sentient Resistance"
start_with = TRUE
symptoms = list(/datum/symptom/sentient)
short_desc = "Due to its sentience, the virus is able to passively increase its resistance to detection and cures"
long_desc = "Due to its sentience, the virus is able to passively increase its resistance to detection and cures"
/datum/symptom/sentient
name = "Sentient Resistance"
desc = "Due to its sentience, the virus is able to passively increase its resistance to detection and cures"
stealth = 4
resistance = 2
stage_speed = 0
transmittable = 0
level = 0
severity = 0
symptom_delay_min = 2
symptom_delay_max = 15
var/infective = FALSE
threshold_descs = list()
/datum/disease_ability/symptom/mild/cough
name = "Involuntary Coughing"
symptoms = list(/datum/symptom/cough)
short_desc = "Cause victims to cough intermittently."
long_desc = "Cause victims to cough intermittently, spreading your infection if your transmissibility is high."
/datum/disease_ability/symptom/mild/sneeze
name = "Involuntary Sneezing"
symptoms = list(/datum/symptom/sneeze)
short_desc = "Cause victims to sneeze intermittently."
long_desc = "Cause victims to sneeze intermittently, spreading your infection and also increasing transmissibility and resistance, at the cost of stealth."
/******MEDIUM******/
/datum/disease_ability/symptom/medium/shedding
symptoms = list(/datum/symptom/shedding)
/datum/disease_ability/symptom/medium/beard
symptoms = list(/datum/symptom/beard)
short_desc = "Cause all victims to grow a luscious beard."
long_desc = "Cause all victims to grow a luscious beard. Ineffective against Santa Claus."
/datum/disease_ability/symptom/medium/hallucigen
symptoms = list(/datum/symptom/hallucigen)
short_desc = "Cause victims to hallucinate."
long_desc = "Cause victims to hallucinate. Decreases stats, especially resistance."
/datum/disease_ability/symptom/medium/choking
symptoms = list(/datum/symptom/choking)
short_desc = "Cause victims to choke."
long_desc = "Cause victims to choke, threatening asphyxiation. Decreases stats, especially transmissibility."
/datum/disease_ability/symptom/medium/confusion
symptoms = list(/datum/symptom/confusion)
short_desc = "Cause victims to become confused."
long_desc = "Cause victims to become confused intermittently."
/datum/disease_ability/symptom/medium/youth
symptoms = list(/datum/symptom/youth)
short_desc = "Cause victims to become eternally young."
long_desc = "Cause victims to become eternally young. Provides boosts to all stats except transmissibility."
/datum/disease_ability/symptom/medium/vomit
symptoms = list(/datum/symptom/vomit)
short_desc = "Cause victims to vomit."
long_desc = "Cause victims to vomit. Slightly increases transmissibility. Vomiting also causes the victims to lose nutrition and removes some toxin damage."
/datum/disease_ability/symptom/medium/voice_change
symptoms = list(/datum/symptom/voice_change)
short_desc = "Change the voice of victims."
long_desc = "Change the voice of victims, causing confusion in communications."
/datum/disease_ability/symptom/medium/visionloss
symptoms = list(/datum/symptom/visionloss)
short_desc = "Damage the eyes of victims, eventually causing blindness."
long_desc = "Damage the eyes of victims, eventually causing blindness. Decreases all stats."
/datum/disease_ability/symptom/medium/deafness
symptoms = list(/datum/symptom/deafness)
/datum/disease_ability/symptom/medium/fever
symptoms = list(/datum/symptom/fever)
/datum/disease_ability/symptom/medium/shivering
symptoms = list(/datum/symptom/shivering)
/datum/disease_ability/symptom/medium/headache
symptoms = list(/datum/symptom/headache)
/datum/disease_ability/symptom/medium/nano_boost
symptoms = list(/datum/symptom/nano_boost)
/datum/disease_ability/symptom/medium/nano_destroy
symptoms = list(/datum/symptom/nano_destroy)
/datum/disease_ability/symptom/medium/viraladaptation
symptoms = list(/datum/symptom/viraladaptation)
short_desc = "Cause your infection to become more resistant to detection and eradication."
long_desc = "Cause your infection to mimic the function of normal body cells, becoming much harder to spot and to eradicate, but reducing its speed."
/datum/disease_ability/symptom/medium/viralevolution
symptoms = list(/datum/symptom/viralevolution)
/datum/disease_ability/symptom/medium/vitiligo
symptoms = list(/datum/symptom/vitiligo)
/datum/disease_ability/symptom/medium/revitiligo
symptoms = list(/datum/symptom/revitiligo)
/datum/disease_ability/symptom/medium/itching
symptoms = list(/datum/symptom/itching)
short_desc = "Cause victims to itch."
long_desc = "Cause victims to itch, increasing all stats except stealth."
/datum/disease_ability/symptom/medium/heal/weight_loss
symptoms = list(/datum/symptom/weight_loss)
short_desc = "Cause victims to lose weight."
long_desc = "Cause victims to lose weight, and make it almost impossible for them to gain nutrition from food. Reduced nutrition allows your infection to spread more easily from hosts, especially by sneezing."
/datum/disease_ability/symptom/medium/heal/sensory_restoration
symptoms = list(/datum/symptom/sensory_restoration)
short_desc = "Regenerate eye and ear damage of victims."
long_desc = "Regenerate eye and ear damage of victims."
/datum/disease_ability/symptom/medium/heal/mind_restoration
symptoms = list(/datum/symptom/mind_restoration)
/******POWERFUL******/
/datum/disease_ability/symptom/powerful/fire
symptoms = list(/datum/symptom/fire)
/datum/disease_ability/symptom/powerful/flesh_eating
symptoms = list(/datum/symptom/flesh_eating)
/datum/disease_ability/symptom/mild/inorganic_adaptation
symptoms = list(/datum/symptom/inorganic_adaptation)
//yogs start
/datum/disease_ability/symptom/powerful/undead_adaptation
symptoms = list(/datum/symptom/undead_adaptation)
//yogs end
/datum/disease_ability/symptom/powerful/narcolepsy
symptoms = list(/datum/symptom/narcolepsy)
/****HEALING SUBTYPE****/
/datum/disease_ability/symptom/powerful/heal/starlight
symptoms = list(/datum/symptom/heal/starlight)
/datum/disease_ability/symptom/powerful/heal/oxygen
symptoms = list(/datum/symptom/oxygen)
/datum/disease_ability/symptom/powerful/heal/chem
symptoms = list(/datum/symptom/heal/chem)
/datum/disease_ability/symptom/powerful/heal/metabolism
symptoms = list(/datum/symptom/heal/metabolism)
short_desc = "Increase the metabolism of victims, causing them to process chemicals and grow hungry faster."
long_desc = "Increase the metabolism of victims, causing them to process chemicals twice as fast and grow hungry more quickly."
/datum/disease_ability/symptom/powerful/heal/dark
symptoms = list(/datum/symptom/heal/darkness)
/datum/disease_ability/symptom/powerful/heal/water
symptoms = list(/datum/symptom/heal/water)
/datum/disease_ability/symptom/powerful/heal/plasma
symptoms = list(/datum/symptom/heal/plasma)
/datum/disease_ability/symptom/powerful/heal/radiation
symptoms = list(/datum/symptom/heal/radiation)
/datum/disease_ability/symptom/powerful/heal/coma
symptoms = list(/datum/symptom/heal/coma)
short_desc = "Cause victims to fall into a healing coma when hurt."
long_desc = "Cause victims to fall into a healing coma when hurt."
/datum/disease_ability/symptom/powerful/heal/youth
symptoms = list(/datum/symptom/youth)