/
heal.dm
654 lines (560 loc) · 22.3 KB
/
heal.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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
/datum/symptom/heal
name = "Basic Healing (does nothing)" //warning for adminspawn viruses
desc = "You should not be seeing this."
stealth = 0
resistance = 0
stage_speed = 0
transmittable = 0
level = 0 //not obtainable
base_message_chance = 20 //here used for the overlays
symptom_delay_min = 1
symptom_delay_max = 1
var/passive_message = "" //random message to infected but not actively healing people
/datum/symptom/heal/Activate(datum/disease/advance/A)
. = ..()
if(!.)
return
var/mob/living/M = A.affected_mob
switch(A.stage)
if(4, 5)
var/effectiveness = CanHeal(A)
if(!effectiveness)
if(passive_message && prob(2) && passive_message_condition(M))
to_chat(M, passive_message)
return
else
Heal(M, A, effectiveness)
return
/datum/symptom/heal/proc/CanHeal(datum/disease/advance/A)
return power
/datum/symptom/heal/proc/Heal(mob/living/M, datum/disease/advance/A, actual_power)
return TRUE
/datum/symptom/heal/proc/passive_message_condition(mob/living/M)
return TRUE
/*Starlight Condensation
* Slightly reduces stealth
* Reduces resistance
* No change to stage speed
* Slightly increases transmissibility
* Bonus: Heals host when exposed to starlight
*/
/datum/symptom/heal/starlight
name = "Starlight Condensation"
desc = "The virus reacts to direct starlight, producing regenerative chemicals. Works best against toxin-based damage."
stealth = -1
resistance = -2
stage_speed = 0
transmittable = 1
level = 6
passive_message = span_notice("You miss the feeling of starlight on your skin.")
var/nearspace_penalty = 0.3
threshold_descs = list(
"Stage Speed 6" = "Increases healing speed.",
"Transmission 6" = "Removes penalty for only being close to space.",
)
#define STARLIGHT_CAN_HEAL 2
#define STARLIGHT_CAN_HEAL_WITH_PENALTY 1
#define STARLIGHT_CANNOT_HEAL 0
#define STARLIGHT_MAX_RANGE 2
/datum/symptom/heal/starlight/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalTransmittable() >= 6)
nearspace_penalty = 1
if(A.totalStageSpeed() >= 6)
power = 2
/datum/symptom/heal/starlight/proc/CanTileHealDirectional(turf/turf_to_check, direction)
if(direction == UP)
turf_to_check = GET_TURF_ABOVE(turf_to_check)
if(!turf_to_check)
return STARLIGHT_CANNOT_HEAL
var/area/area_to_check = get_area(turf_to_check)
var/levels_of_glass = 0 // Since starlight condensation only works 2 tiles to the side anyways, it shouldn't work with like 100 z-levels of glass
while(levels_of_glass <= STARLIGHT_MAX_RANGE)
// Outdoors covers lavaland and unroofed areas but with tiles under,
// while space covers normal space and those caused by explosions,
// if there is a floor tile when checking above, that means
// a roof exists so the outdoors should only work downwards
if(isspaceturf(turf_to_check) || (area_to_check.outdoors && direction == DOWN))
if (levels_of_glass)
return STARLIGHT_CAN_HEAL_WITH_PENALTY // Glass gives a penalty.
return STARLIGHT_CAN_HEAL // No glass = can heal fully.
// Our turf is transparent, but it's NOT openspace - it's something like glass which reduces power
if(istransparentturf(turf_to_check) && !(istype(turf_to_check, /turf/open/openspace)))
levels_of_glass += 1
// Our turf is transparent OR openspace - we can check higher or lower z-levels
if(istransparentturf(turf_to_check) || istype(turf_to_check, /turf/open/openspace))
// Check above or below us
if(direction == UP)
turf_to_check = GET_TURF_ABOVE(turf_to_check)
else
turf_to_check = GET_TURF_BELOW(turf_to_check)
// If we found a turf above or below us,
// then we can rerun the loop on the newly found turf / area
// (Probably, with +1 to levels_of_glass)
if(turf_to_check)
area_to_check = get_area(turf_to_check)
continue
// If we didn't find a turf above or below us -
// Checking below, we assume that space is below us (as we're standing on station)
// Checking above, we check that the area is "outdoors" before assuming if it is space or not.
else
if(direction == DOWN || (direction == UP && area_to_check.outdoors))
if (levels_of_glass)
return STARLIGHT_CAN_HEAL_WITH_PENALTY
return STARLIGHT_CAN_HEAL
return STARLIGHT_CANNOT_HEAL // Hit a non-space, Non-transparent turf - no healsies
/datum/symptom/heal/starlight/proc/CanTileHeal(turf/original_turf, satisfied_with_penalty)
var/current_heal_level = CanTileHealDirectional(original_turf, DOWN)
if(current_heal_level == STARLIGHT_CAN_HEAL)
return current_heal_level
if(current_heal_level && satisfied_with_penalty) // do not care if there is a healing penalty or no
return current_heal_level
var/heal_level_from_above = CanTileHealDirectional(original_turf, UP)
if(heal_level_from_above > current_heal_level)
return heal_level_from_above
else
return current_heal_level
/datum/symptom/heal/starlight/CanHeal(datum/disease/advance/A)
var/mob/living/affected_mob = A.affected_mob
var/turf/turf_of_mob = get_turf(affected_mob)
switch(CanTileHeal(turf_of_mob, FALSE))
if(STARLIGHT_CAN_HEAL_WITH_PENALTY)
return power * nearspace_penalty
if(STARLIGHT_CAN_HEAL)
return power
for(var/turf/turf_to_check in view(affected_mob, STARLIGHT_MAX_RANGE))
if(CanTileHeal(turf_to_check, TRUE))
return power * nearspace_penalty
#undef STARLIGHT_CAN_HEAL
#undef STARLIGHT_CAN_HEAL_WITH_PENALTY
#undef STARLIGHT_CANNOT_HEAL
#undef STARLIGHT_MAX_RANGE
/datum/symptom/heal/starlight/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = actual_power
if(M.getToxLoss() && prob(5))
to_chat(M, span_notice("Your skin tingles as the starlight seems to heal you."))
M.adjustToxLoss(-(4 * heal_amt)) //most effective on toxins
var/list/parts = M.get_damaged_bodyparts(1,1, BODYTYPE_ORGANIC)
if(!parts.len)
return
for(var/obj/item/bodypart/bodypart in parts)
if(bodypart.heal_damage(heal_amt/parts.len, heal_amt/parts.len, required_bodytype = BODYTYPE_ORGANIC))
M.update_damage_overlays()
return 1
/datum/symptom/heal/starlight/passive_message_condition(mob/living/M)
if(M.getBruteLoss() || M.getFireLoss() || M.getToxLoss())
return TRUE
return FALSE
/*Toxolysis
* No change to stealth
* Reduces resistance
* Increases stage speed
* Reduces transmissibility
* Bonus: Removes all reagents from the host
*/
/datum/symptom/heal/chem
name = "Toxolysis"
desc = "The virus rapidly breaks down any foreign chemicals in the bloodstream."
stealth = 0
resistance = -2
stage_speed = 2
transmittable = -2
level = 7
required_organ = ORGAN_SLOT_HEART
threshold_descs = list(
"Resistance 7" = "Increases chem removal speed.",
"Stage Speed 6" = "Consumed chemicals nourish the host.",
)
var/food_conversion = FALSE
/datum/symptom/heal/chem/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalStageSpeed() >= 6)
food_conversion = TRUE
if(A.totalResistance() >= 7)
power = 2
/datum/symptom/heal/chem/Heal(mob/living/M, datum/disease/advance/A, actual_power)
for(var/datum/reagent/R in M.reagents.reagent_list) //Not just toxins!
M.reagents.remove_reagent(R.type, actual_power)
if(food_conversion)
M.adjust_nutrition(0.3)
if(prob(2))
to_chat(M, span_notice("You feel a mild warmth as your blood purifies itself."))
return 1
/*Metabolic Boost
* Slightly reduces stealth
* Reduces resistance
* Increases stage speed
* Slightly increases transmissibility
* Bonus: Doubles the rate of chemical metabolisation
* Increases nutrition loss rate
*/
/datum/symptom/heal/metabolism
name = "Metabolic Boost"
desc = "The virus causes the host's metabolism to accelerate rapidly, making them process chemicals twice as fast,\
but also causing increased hunger."
stealth = -1
resistance = -2
stage_speed = 2
transmittable = 1
level = 7
required_organ = ORGAN_SLOT_STOMACH
threshold_descs = list(
"Stealth 3" = "Reduces hunger rate.",
"Stage Speed 10" = "Chemical metabolization is tripled instead of doubled.",
)
var/triple_metabolism = FALSE
var/reduced_hunger = FALSE
/datum/symptom/heal/metabolism/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalStageSpeed() >= 10)
triple_metabolism = TRUE
if(A.totalStealth() >= 3)
reduced_hunger = TRUE
/datum/symptom/heal/metabolism/Heal(mob/living/carbon/infected_mob, datum/disease/advance/A, actual_power)
var/metabolic_boost = triple_metabolism ? 2 : 1
infected_mob.reagents.metabolize(infected_mob, metabolic_boost * SSMOBS_DT, 0, can_overdose=TRUE) //this works even without a liver; it's intentional since the virus is metabolizing by itself
infected_mob.overeatduration = max(infected_mob.overeatduration - 4 SECONDS, 0)
var/lost_nutrition = 9 - (reduced_hunger * 5)
infected_mob.adjust_nutrition(-lost_nutrition * HUNGER_FACTOR) //Hunger depletes at 10x the normal speed
if(prob(2))
to_chat(infected_mob, span_notice("You feel an odd gurgle in your stomach, as if it was working much faster than normal."))
return TRUE
/*Nocturnal Regeneration
* Increases stealth
* Slightly reduces resistance
* Reduces stage speed
* Slightly reduces transmissibility
* Bonus: Heals brute damage when in the dark
*/
/datum/symptom/heal/darkness
name = "Nocturnal Regeneration"
desc = "The virus is able to mend the host's flesh when in conditions of low light, repairing physical damage. More effective against brute damage."
stealth = 2
resistance = -1
stage_speed = -2
transmittable = -1
level = 6
passive_message = span_notice("You feel tingling on your skin as light passes over it.")
threshold_descs = list(
"Stage Speed 8" = "Doubles healing speed.",
)
/datum/symptom/heal/darkness/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalStageSpeed() >= 8)
power = 2
/datum/symptom/heal/darkness/CanHeal(datum/disease/advance/A)
var/mob/living/M = A.affected_mob
var/light_amount = 0
if(isturf(M.loc)) //else, there's considered to be no light
var/turf/T = M.loc
light_amount = min(1,T.get_lumcount()) - 0.5
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
return power
/datum/symptom/heal/darkness/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = 2 * actual_power
var/list/parts = M.get_damaged_bodyparts(1,1,BODYTYPE_ORGANIC)
if(!parts.len)
return
if(prob(5))
to_chat(M, span_notice("The darkness soothes and mends your wounds."))
for(var/obj/item/bodypart/bodypart in parts)
if(bodypart.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5, required_bodytype = BODYTYPE_ORGANIC)) //more effective on brute
M.update_damage_overlays()
return 1
/datum/symptom/heal/darkness/passive_message_condition(mob/living/M)
if(M.getBruteLoss() || M.getFireLoss())
return TRUE
return FALSE
/*Regen Coma
* No effect on stealth
* Increases resistance
* Reduces stage speed greatly
* Decreases transmissibility
* Bonus: Puts the host into a coma when severely hurt, healing them
*/
/datum/symptom/heal/coma
name = "Regenerative Coma"
desc = "The virus causes the host to fall into a death-like coma when severely damaged, then rapidly fixes the damage."
stealth = 0
resistance = 2
stage_speed = -3
transmittable = -2
level = 8
passive_message = span_notice("The pain from your wounds makes you feel oddly sleepy...")
var/deathgasp = FALSE
var/stabilize = FALSE
var/active_coma = FALSE //to prevent multiple coma procs
threshold_descs = list(
"Stealth 2" = "Host appears to die when falling into a coma.",
"Resistance 4" = "The virus also stabilizes the host while they are in critical condition.",
"Stage Speed 7" = "Increases healing speed.",
)
/datum/symptom/heal/coma/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalStageSpeed() >= 7)
power = 1.5
if(A.totalResistance() >= 4)
stabilize = TRUE
if(A.totalStealth() >= 2)
deathgasp = TRUE
/datum/symptom/heal/coma/on_stage_change(datum/disease/advance/A) //mostly copy+pasted from the code for self-respiration's TRAIT_NOBREATH stuff
. = ..()
if(!.)
return FALSE
if(A.stage >= 4 && stabilize)
ADD_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
else
REMOVE_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
return TRUE
/datum/symptom/heal/coma/End(datum/disease/advance/A)
. = ..()
if(!.)
return
if(active_coma)
uncoma()
REMOVE_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
/datum/symptom/heal/coma/CanHeal(datum/disease/advance/A)
var/mob/living/M = A.affected_mob
if(HAS_TRAIT(M, TRAIT_DEATHCOMA))
return power
if(M.IsSleeping())
return power * 0.25 //Voluntary unconsciousness yields lower healing.
switch(M.stat)
if(UNCONSCIOUS, HARD_CRIT)
return power * 0.9
if(SOFT_CRIT)
return power * 0.5
if(M.getBruteLoss() + M.getFireLoss() >= 70 && !active_coma)
to_chat(M, span_warning("You feel yourself slip into a regenerative coma..."))
active_coma = TRUE
addtimer(CALLBACK(src, PROC_REF(coma), M), 6 SECONDS)
/datum/symptom/heal/coma/proc/coma(mob/living/M)
if(QDELETED(M) || M.stat == DEAD)
return
M.fakedeath("regenerative_coma", !deathgasp)
addtimer(CALLBACK(src, PROC_REF(uncoma), M), 30 SECONDS)
/datum/symptom/heal/coma/proc/uncoma(mob/living/M)
if(QDELETED(M) || !active_coma)
return
active_coma = FALSE
M.cure_fakedeath("regenerative_coma")
/datum/symptom/heal/coma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = 4 * actual_power
var/list/parts = M.get_damaged_bodyparts(1,1)
if(!parts.len)
return
for(var/obj/item/bodypart/bodypart in parts)
if(bodypart.heal_damage(heal_amt/parts.len, heal_amt/parts.len, required_bodytype = BODYTYPE_ORGANIC))
M.update_damage_overlays()
if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0)
uncoma(M)
return 1
/datum/symptom/heal/coma/passive_message_condition(mob/living/M)
if((M.getBruteLoss() + M.getFireLoss()) > 30)
return TRUE
return FALSE
/datum/symptom/heal/water
name = "Tissue Hydration"
desc = "The virus uses excess water inside and outside the body to repair damaged tissue cells. More effective when using holy water and against burns."
stealth = 0
resistance = -1
stage_speed = 0
transmittable = 1
level = 6
passive_message = span_notice("Your skin feels oddly dry...")
required_organ = ORGAN_SLOT_LIVER
threshold_descs = list(
"Resistance 5" = "Water is consumed at a much slower rate.",
"Stage Speed 7" = "Increases healing speed.",
)
var/absorption_coeff = 1
/datum/symptom/heal/water/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalStageSpeed() >= 7)
power = 2
if(A.totalResistance() >= 5)
absorption_coeff = 0.25
/datum/symptom/heal/water/CanHeal(datum/disease/advance/advanced_disease)
. = 0
var/mob/living/carbon/infected_mob = advanced_disease.affected_mob
if(infected_mob.fire_stacks < 0)
infected_mob.adjust_fire_stacks(min(absorption_coeff, -infected_mob.fire_stacks))
. += power
if(infected_mob.reagents.has_reagent(/datum/reagent/water/holywater, needs_metabolizing = FALSE))
infected_mob.reagents.remove_reagent(/datum/reagent/water/holywater, 0.5 * absorption_coeff)
. += power * 0.75
else if(infected_mob.reagents.has_reagent(/datum/reagent/water, needs_metabolizing = FALSE))
infected_mob.reagents.remove_reagent(/datum/reagent/water, 0.5 * absorption_coeff)
. += power * 0.5
/datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = 2 * actual_power
var/list/parts = M.get_damaged_bodyparts(1,1, BODYTYPE_ORGANIC) //more effective on burns
if(!parts.len)
return
if(prob(5))
to_chat(M, span_notice("You feel yourself absorbing the water around you to soothe your damaged skin."))
for(var/obj/item/bodypart/bodypart in parts)
if(bodypart.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len, required_bodytype = BODYTYPE_ORGANIC))
M.update_damage_overlays()
return 1
/datum/symptom/heal/water/passive_message_condition(mob/living/carbon/infected_mob)
if(infected_mob.getBruteLoss() || infected_mob.getFireLoss())
return TRUE
return FALSE
/// Determines the rate at which Plasma Fixation heals based on the amount of plasma in the air
#define HEALING_PER_MOL 1.1
/// Determines the rate at which Plasma Fixation heals based on the amount of plasma being breathed through internals
#define HEALING_PER_BREATH_PRESSURE 0.05
/// Determines the highest amount you can be healed for when breathing plasma from internals
#define MAX_HEAL_COEFFICIENT_INTERNALS 0.75
/// Determines the highest amount you can be healed for from pulling plasma from the environment
#define MAX_HEAL_COEFFICIENT_ENVIRONMENT 0.5
/// Determines the highest amount you can be healed for when there is plasma in the bloodstream
#define MAX_HEAL_COEFFICIENT_BLOODSTREAM 0.75
/// This is the base heal amount before being multiplied by the healing coefficients
#define BASE_HEAL_PLASMA_FIXATION 4
/datum/symptom/heal/plasma
name = "Plasma Fixation"
desc = "The virus draws plasma from the atmosphere and from inside the body to heal and stabilize body temperature."
stealth = 0
resistance = 3
stage_speed = -2
transmittable = -2
level = 8
passive_message = span_notice("You feel an odd attraction to plasma.")
required_organ = ORGAN_SLOT_LIVER
threshold_descs = list(
"Transmission 6" = "Increases temperature adjustment rate.",
"Stage Speed 7" = "Increases healing speed.",
)
var/temp_rate = 1
/datum/symptom/heal/plasma/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalStageSpeed() >= 7)
power = 2
if(A.totalTransmittable() >= 6)
temp_rate = 4
// We do this to prevent liver damage from injecting plasma when plasma fixation virus reaches stage 4 and beyond
/datum/symptom/heal/plasma/on_stage_change(datum/disease/advance/advanced_disease)
. = ..()
if(!.)
return FALSE
if(advanced_disease.stage >= 4)
ADD_TRAIT(advanced_disease.affected_mob, TRAIT_PLASMA_LOVER_METABOLISM, DISEASE_TRAIT)
else
REMOVE_TRAIT(advanced_disease.affected_mob, TRAIT_PLASMA_LOVER_METABOLISM, DISEASE_TRAIT)
return TRUE
/datum/symptom/heal/plasma/End(datum/disease/advance/advanced_disease)
. = ..()
if(!.)
return
REMOVE_TRAIT(advanced_disease.affected_mob, TRAIT_PLASMA_LOVER_METABOLISM, DISEASE_TRAIT)
// Check internals breath, environmental plasma, and plasma in bloodstream to determine the heal power
/datum/symptom/heal/plasma/CanHeal(datum/disease/advance/advanced_disease)
var/mob/living/carbon/infected_mob = advanced_disease.affected_mob
var/datum/gas_mixture/environment
var/list/gases
. = 0
// Check internals
/// the amount of mols in a breath is significantly lower than in the environment so we are just going to use the tank's
/// distribution pressure as an abstraction rather than calculate it using the ideal gas equation.
/// balanced around a tank set to 4kpa = about 0.2 healing power. maxes out at 0.75 healing power, or 15kpa.
var/obj/item/tank/internals/internals_tank = infected_mob.internal
if(internals_tank)
var/datum/gas_mixture/tank_contents = internals_tank.return_air()
if(tank_contents && round(tank_contents.return_pressure())) // make sure the tank is not empty or 0 pressure
if(tank_contents.gases[/datum/gas/plasma])
// higher tank distribution pressure leads to more healing, but once you get to about 15kpa you reach the max
. += power * min(MAX_HEAL_COEFFICIENT_INTERNALS, internals_tank.distribute_pressure * HEALING_PER_BREATH_PRESSURE)
else // Check environment
if(infected_mob.loc)
environment = infected_mob.loc.return_air()
if(environment)
gases = environment.gases
if(gases[/datum/gas/plasma])
. += power * min(MAX_HEAL_COEFFICIENT_INTERNALS, gases[/datum/gas/plasma][MOLES] * HEALING_PER_MOL)
// Check for reagents in bloodstream
if(infected_mob.reagents.has_reagent(/datum/reagent/toxin/plasma, needs_metabolizing = TRUE))
. += power * MAX_HEAL_COEFFICIENT_BLOODSTREAM //Determines how much the symptom heals if injected or ingested
/datum/symptom/heal/plasma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = BASE_HEAL_PLASMA_FIXATION * actual_power
if(prob(5))
to_chat(M, span_notice("You feel yourself absorbing plasma inside and around you..."))
var/target_temp = M.get_body_temp_normal()
if(M.bodytemperature > target_temp)
M.adjust_bodytemperature(-20 * temp_rate * TEMPERATURE_DAMAGE_COEFFICIENT, target_temp)
if(prob(5))
to_chat(M, span_notice("You feel less hot."))
else if(M.bodytemperature < (M.get_body_temp_normal() + 1))
M.adjust_bodytemperature(20 * temp_rate * TEMPERATURE_DAMAGE_COEFFICIENT, 0, target_temp)
if(prob(5))
to_chat(M, span_notice("You feel warmer."))
M.adjustToxLoss(-heal_amt)
var/list/parts = M.get_damaged_bodyparts(1,1, BODYTYPE_ORGANIC)
if(!parts.len)
return
if(prob(5))
to_chat(M, span_notice("The pain from your wounds fades rapidly."))
for(var/obj/item/bodypart/bodypart in parts)
if(bodypart.heal_damage(heal_amt/parts.len, heal_amt/parts.len, required_bodytype = BODYTYPE_ORGANIC))
M.update_damage_overlays()
return 1
///Plasma End
#undef HEALING_PER_MOL
#undef HEALING_PER_BREATH_PRESSURE
#undef MAX_HEAL_COEFFICIENT_INTERNALS
#undef MAX_HEAL_COEFFICIENT_ENVIRONMENT
#undef MAX_HEAL_COEFFICIENT_BLOODSTREAM
#undef BASE_HEAL_PLASMA_FIXATION
/datum/symptom/heal/radiation
name = "Radioactive Resonance"
desc = "The virus uses radiation to fix damage through dna mutations."
stealth = -1
resistance = -2
stage_speed = 2
transmittable = -3
level = 6
symptom_delay_min = 1
symptom_delay_max = 1
passive_message = span_notice("Your skin glows faintly for a moment.")
threshold_descs = list(
"Transmission 6" = "Additionally heals cellular damage.",
"Resistance 7" = "Increases healing speed.",
)
/datum/symptom/heal/radiation/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
if(A.totalResistance() >= 7)
power = 2
/datum/symptom/heal/radiation/CanHeal(datum/disease/advance/A)
return HAS_TRAIT(A.affected_mob, TRAIT_IRRADIATED) ? power : 0
/datum/symptom/heal/radiation/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = actual_power
if(M.adjustToxLoss(-(2 * heal_amt), updating_health = FALSE))
M.updatehealth()
var/list/parts = M.get_damaged_bodyparts(1,1, BODYTYPE_ORGANIC)
if(!parts.len)
return
if(prob(4))
to_chat(M, span_notice("Your skin glows faintly, and you feel your wounds mending themselves."))
for(var/obj/item/bodypart/bodypart in parts)
if(bodypart.heal_damage(heal_amt/parts.len, heal_amt/parts.len, required_bodytype = BODYTYPE_ORGANIC))
M.update_damage_overlays()
return 1
/datum/symptom/heal/radiation/can_generate_randomly()
return ..() && !HAS_TRAIT(SSstation, STATION_TRAIT_RADIOACTIVE_NEBULA) //because people can never really suffer enough