/
medicine_reagents.dm
1738 lines (1518 loc) · 87.2 KB
/
medicine_reagents.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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//////////////////////////////////////////////////////////////////////////////////////////
// MEDICINE REAGENTS
//////////////////////////////////////////////////////////////////////////////////////
// where all the reagents related to medicine go.
/datum/reagent/medicine
taste_description = "bitterness"
/datum/reagent/medicine/New()
. = ..()
// All medicine metabolizes out slower / stay longer if you have a better metabolism
chemical_flags |= REAGENT_REVERSE_METABOLISM
/datum/reagent/medicine/leporazine
name = "Leporazine"
description = "Leporazine will effectively regulate a patient's body temperature, ensuring it never leaves safe levels."
ph = 8.4
color = "#DB90C6"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/leporazine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/target_temp = affected_mob.get_body_temp_normal(apply_change = FALSE)
if(affected_mob.bodytemperature > target_temp)
affected_mob.adjust_bodytemperature(-40 * TEMPERATURE_DAMAGE_COEFFICIENT * REM * seconds_per_tick, target_temp)
else if(affected_mob.bodytemperature < (target_temp + 1))
affected_mob.adjust_bodytemperature(40 * TEMPERATURE_DAMAGE_COEFFICIENT * REM * seconds_per_tick, 0, target_temp)
if(ishuman(affected_mob))
var/mob/living/carbon/human/affected_human = affected_mob
if(affected_human.coretemperature > target_temp)
affected_human.adjust_coretemperature(-40 * TEMPERATURE_DAMAGE_COEFFICIENT * REM * seconds_per_tick, target_temp)
else if(affected_human.coretemperature < (target_temp + 1))
affected_human.adjust_coretemperature(40 * TEMPERATURE_DAMAGE_COEFFICIENT * REM * seconds_per_tick, 0, target_temp)
/datum/reagent/medicine/adminordrazine //An OP chemical for admins
name = "Adminordrazine"
description = "It's magic. We don't have to explain it."
color = "#E0BB00" //golden for the gods
taste_description = "badmins"
chemical_flags = REAGENT_DEAD_PROCESS
metabolized_traits = list(TRAIT_ANALGESIA)
/// Flags to fullheal every metabolism tick
var/full_heal_flags = ~(HEAL_BRUTE|HEAL_BURN|HEAL_TOX|HEAL_RESTRAINTS|HEAL_REFRESH_ORGANS)
// The best stuff there is. For testing/debugging.
/datum/reagent/medicine/adminordrazine/on_hydroponics_apply(obj/machinery/hydroponics/mytray, mob/user)
mytray.adjust_waterlevel(round(volume))
mytray.adjust_plant_health(round(volume))
mytray.adjust_pestlevel(-rand(1,5))
mytray.adjust_weedlevel(-rand(1,5))
if(volume < 3)
return
switch(rand(100))
if(66 to 100)
mytray.mutatespecie()
if(33 to 65)
mytray.mutateweed()
if(1 to 32)
mytray.mutatepest(user)
else
if(prob(20))
mytray.visible_message(span_warning("Nothing happens..."))
/datum/reagent/medicine/adminordrazine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
affected_mob.heal_bodypart_damage(brute = 5 * REM * seconds_per_tick, burn = 5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
affected_mob.adjustToxLoss(-5 * REM * seconds_per_tick, updating_health = FALSE, forced = TRUE, required_biotype = affected_biotype)
// Heal everything! That we want to. But really don't heal reagents. Otherwise we'll lose ... us.
affected_mob.fully_heal(full_heal_flags & ~HEAL_ALL_REAGENTS) // there is no need to return UPDATE_MOB_HEALTH because this proc calls updatehealth()
/datum/reagent/medicine/adminordrazine/quantum_heal
name = "Quantum Medicine"
description = "Rare and experimental particles, that apparently swap the user's body with one from an alternate dimension where it's completely healthy."
taste_description = "science"
full_heal_flags = ~(HEAL_ADMIN|HEAL_BRUTE|HEAL_BURN|HEAL_TOX|HEAL_RESTRAINTS|HEAL_ALL_REAGENTS|HEAL_REFRESH_ORGANS)
/datum/reagent/medicine/synaptizine
name = "Synaptizine"
description = "Increases resistance to stuns as well as reducing drowsiness and hallucinations."
color = COLOR_MAGENTA
ph = 4
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/synaptizine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
affected_mob.adjust_drowsiness(-10 SECONDS * REM * seconds_per_tick)
affected_mob.AdjustAllImmobility(-20 * REM * seconds_per_tick)
if(holder.has_reagent(/datum/reagent/toxin/mindbreaker))
holder.remove_reagent(/datum/reagent/toxin/mindbreaker, 5 * REM * seconds_per_tick)
affected_mob.adjust_hallucinations(-20 SECONDS * REM * seconds_per_tick)
if(SPT_PROB(16, seconds_per_tick))
if(affected_mob.adjustToxLoss(1, updating_health = FALSE, required_biotype = affected_biotype))
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/synaphydramine
name = "Diphen-Synaptizine"
description = "Reduces drowsiness, hallucinations, and Histamine from body."
color = "#EC536D" // rgb: 236, 83, 109
ph = 5.2
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED|REAGENT_NO_RANDOM_RECIPE
/datum/reagent/medicine/synaphydramine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
affected_mob.adjust_drowsiness(-10 SECONDS * REM * seconds_per_tick)
if(holder.has_reagent(/datum/reagent/toxin/mindbreaker))
holder.remove_reagent(/datum/reagent/toxin/mindbreaker, 5 * REM * seconds_per_tick)
if(holder.has_reagent(/datum/reagent/toxin/histamine))
holder.remove_reagent(/datum/reagent/toxin/histamine, 5 * REM * seconds_per_tick)
affected_mob.adjust_hallucinations(-20 SECONDS * REM * seconds_per_tick)
if(SPT_PROB(16, seconds_per_tick))
if(affected_mob.adjustToxLoss(1 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/sansufentanyl
name = "Sansufentanyl"
description = "Temporary side effects include - nausea, dizziness, impaired motor coordination."
color = "#07e4d1"
ph = 6.2
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/sansufentanyl/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
affected_mob.adjust_confusion_up_to(3 SECONDS * REM * seconds_per_tick, 5 SECONDS)
affected_mob.adjust_dizzy_up_to(6 SECONDS * REM * seconds_per_tick, 12 SECONDS)
if(affected_mob.adjustStaminaLoss(1 * REM * seconds_per_tick, updating_stamina = FALSE))
. = UPDATE_MOB_HEALTH
if(SPT_PROB(10, seconds_per_tick))
to_chat(affected_mob, "You feel confused and disoriented.")
if(prob(30))
SEND_SOUND(affected_mob, sound('sound/weapons/flash_ring.ogg'))
/datum/reagent/medicine/cryoxadone
name = "Cryoxadone"
description = "A chemical mixture with almost magical healing powers. Its main limitation is that the patient's body temperature must be under 270K for it to metabolise correctly."
color = "#0000C8"
taste_description = "blue"
ph = 11
burning_temperature = 20 //cold burning
burning_volume = 0.1
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/cryoxadone/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
metabolization_rate = REAGENTS_METABOLISM * (0.00001 * (affected_mob.bodytemperature ** 2) + 0.5)
if(affected_mob.bodytemperature >= T0C || !HAS_TRAIT(affected_mob, TRAIT_KNOCKEDOUT))
return
var/power = -0.00003 * (affected_mob.bodytemperature ** 2) + 3
var/need_mob_update
need_mob_update = affected_mob.adjustOxyLoss(-3 * power * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
need_mob_update += affected_mob.adjustBruteLoss(-power * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(-power * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustToxLoss(-power * REM * seconds_per_tick, updating_health = FALSE, forced = TRUE, required_biotype = affected_biotype) //heals TOXINLOVERs
for(var/i in affected_mob.all_wounds)
var/datum/wound/iter_wound = i
iter_wound.on_xadone(power * REM * seconds_per_tick)
REMOVE_TRAIT(affected_mob, TRAIT_DISFIGURED, TRAIT_GENERIC) //fixes common causes for disfiguration
if(need_mob_update)
return UPDATE_MOB_HEALTH
// Healing
/datum/reagent/medicine/cryoxadone/on_hydroponics_apply(obj/machinery/hydroponics/mytray, mob/user)
mytray.adjust_plant_health(round(volume * 3))
mytray.adjust_toxic(-round(volume * 3))
/datum/reagent/medicine/pyroxadone
name = "Pyroxadone"
description = "A mixture of cryoxadone and slime jelly, that apparently inverses the requirement for its activation."
color = "#f7832a"
taste_description = "spicy jelly"
ph = 12
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/pyroxadone/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
var/power = 0
switch(affected_mob.bodytemperature)
if(BODYTEMP_HEAT_DAMAGE_LIMIT to 400)
power = 2
if(400 to 460)
power = 3
else
power = 5
if(affected_mob.on_fire)
power *= 2
var/need_mob_update
need_mob_update = affected_mob.adjustOxyLoss(-2 * power * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
need_mob_update += affected_mob.adjustBruteLoss(-power * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(-1.5 * power * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustToxLoss(-power * REM * seconds_per_tick, updating_health = FALSE, forced = TRUE, required_biotype = affected_biotype)
if(need_mob_update)
. = UPDATE_MOB_HEALTH
for(var/i in affected_mob.all_wounds)
var/datum/wound/iter_wound = i
iter_wound.on_xadone(power * REM * seconds_per_tick)
REMOVE_TRAIT(affected_mob, TRAIT_DISFIGURED, TRAIT_GENERIC)
/datum/reagent/medicine/rezadone
name = "Rezadone"
description = "A powder derived from fish toxin, Rezadone can effectively restore corpses husked by burns as well as treat minor wounds. Overdose will cause intense nausea and minor toxin damage."
reagent_state = SOLID
color = "#669900" // rgb: 102, 153, 0
overdose_threshold = 30
ph = 12.2
taste_description = "fish"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.25
inverse_chem = /datum/reagent/inverse/rezadone
// Rezadone is almost never used in favor of cryoxadone. Hopefully this will change that. // No such luck so far // with clone damage gone, someone will find a better use for rezadone... right?
/datum/reagent/medicine/rezadone/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.heal_bodypart_damage(
brute = 1 * REM * seconds_per_tick,
burn = 1 * REM * seconds_per_tick,
updating_health = FALSE,
required_bodytype = affected_biotype
))
. = UPDATE_MOB_HEALTH
REMOVE_TRAIT(affected_mob, TRAIT_DISFIGURED, TRAIT_GENERIC)
/datum/reagent/medicine/rezadone/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.adjustToxLoss(1 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
. = UPDATE_MOB_HEALTH
affected_mob.set_dizzy_if_lower(10 SECONDS * REM * seconds_per_tick)
affected_mob.set_jitter_if_lower(10 SECONDS * REM * seconds_per_tick)
/datum/reagent/medicine/rezadone/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume)
. = ..()
if(!iscarbon(exposed_mob))
return
var/mob/living/carbon/patient = exposed_mob
if(reac_volume >= 5 && HAS_TRAIT_FROM(patient, TRAIT_HUSK, BURN) && patient.getFireLoss() < UNHUSK_DAMAGE_THRESHOLD) //One carp yields 12u rezadone.
patient.cure_husk(BURN)
patient.visible_message(span_nicegreen("[patient]'s body rapidly absorbs moisture from the environment, taking on a more healthy appearance."))
/datum/reagent/medicine/spaceacillin
name = "Spaceacillin"
description = "Spaceacillin will provide limited resistance against disease and parasites. Also reduces infection in serious burns."
color = "#E1F2E6"
metabolization_rate = 0.1 * REAGENTS_METABOLISM
ph = 8.1
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
added_traits = list(TRAIT_VIRUS_RESISTANCE)
//Goon Chems. Ported mainly from Goonstation. Easily mixable (or not so easily) and provide a variety of effects.
/datum/reagent/medicine/oxandrolone
name = "Oxandrolone"
description = "Stimulates the healing of severe burns. Extremely rapidly heals severe burns and slowly heals minor ones. Overdose will worsen existing burns."
reagent_state = LIQUID
color = "#1E8BFF"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
overdose_threshold = 25
ph = 10.7
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.3
inverse_chem = /datum/reagent/inverse/oxandrolone
/datum/reagent/medicine/oxandrolone/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
if(affected_mob.getFireLoss() > 25)
need_mob_update = affected_mob.adjustFireLoss(-4 * REM * seconds_per_tick * normalise_creation_purity(), updating_health = FALSE, required_bodytype = affected_bodytype) //Twice as effective as AIURI for severe burns
else
need_mob_update = affected_mob.adjustFireLoss(-0.5 * REM * seconds_per_tick * normalise_creation_purity(), updating_health = FALSE, required_bodytype = affected_bodytype) //But only a quarter as effective for more minor ones
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/oxandrolone/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.getFireLoss()) //It only makes existing burns worse
if(affected_mob.adjustFireLoss(4.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_biotype)) // it's going to be healing either 4 or 0.5
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/salglu_solution
name = "Saline-Glucose Solution"
description = "Has a 33% chance per metabolism cycle to heal brute and burn damage. Can be used as a temporary blood substitute, as well as slowly speeding blood regeneration."
reagent_state = LIQUID
color = "#DCDCDC"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
overdose_threshold = 60
taste_description = "sweetness and salt"
var/last_added = 0
var/maximum_reachable = BLOOD_VOLUME_NORMAL - 10 //So that normal blood regeneration can continue with salglu active
var/extra_regen = 0.25 // in addition to acting as temporary blood, also add about half this much to their actual blood per second
ph = 5.5
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/salglu_solution/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
if(last_added)
affected_mob.blood_volume -= last_added
last_added = 0
if(affected_mob.blood_volume < maximum_reachable) //Can only up to double your effective blood level.
var/amount_to_add = min(affected_mob.blood_volume, 5*volume)
var/new_blood_level = min(affected_mob.blood_volume + amount_to_add, maximum_reachable)
last_added = new_blood_level - affected_mob.blood_volume
affected_mob.blood_volume = new_blood_level + (extra_regen * REM * seconds_per_tick)
if(SPT_PROB(18, seconds_per_tick))
need_mob_update = affected_mob.adjustBruteLoss(-0.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_biotype)
need_mob_update += affected_mob.adjustFireLoss(-0.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_biotype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/salglu_solution/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
if(SPT_PROB(1.5, seconds_per_tick))
if(holder)
to_chat(affected_mob, span_warning("You feel salty."))
holder.add_reagent(/datum/reagent/consumable/salt, 1)
holder.remove_reagent(/datum/reagent/medicine/salglu_solution, 0.5)
else if(SPT_PROB(1.5, seconds_per_tick))
if(holder)
to_chat(affected_mob, span_warning("You feel sweet."))
holder.add_reagent(/datum/reagent/consumable/sugar, 1)
holder.remove_reagent(/datum/reagent/medicine/salglu_solution, 0.5)
if(SPT_PROB(18, seconds_per_tick))
need_mob_update = affected_mob.adjustBruteLoss(0.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_biotype)
need_mob_update += affected_mob.adjustFireLoss(0.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_biotype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/mine_salve
name = "Miner's Salve"
description = "A powerful painkiller. Restores bruising and burns in addition to making the patient believe they are fully healed. Also great for treating severe burn wounds in a pinch."
reagent_state = LIQUID
color = "#6D6374"
metabolization_rate = 0.4 * REAGENTS_METABOLISM
ph = 2.6
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED|REAGENT_AFFECTS_WOUNDS
metabolized_traits = list(TRAIT_ANALGESIA)
/datum/reagent/medicine/mine_salve/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
need_mob_update = affected_mob.adjustBruteLoss(-0.25 * REM * seconds_per_tick, FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(-0.25 * REM * seconds_per_tick, FALSE, required_bodytype = affected_bodytype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/mine_salve/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume, show_message = TRUE)
. = ..()
if(!iscarbon(exposed_mob) || (exposed_mob.stat == DEAD))
return
if(methods & (INGEST|VAPOR|INJECT))
exposed_mob.adjust_nutrition(-5)
if(show_message)
to_chat(exposed_mob, span_warning("Your stomach feels empty and cramps!"))
if(methods & (PATCH|TOUCH))
var/mob/living/carbon/exposed_carbon = exposed_mob
for(var/datum/surgery/surgery as anything in exposed_carbon.surgeries)
surgery.speed_modifier = max(0.1, surgery.speed_modifier)
if(show_message)
to_chat(exposed_carbon, span_danger("You feel your injuries fade away to nothing!") )
/datum/reagent/medicine/mine_salve/on_mob_metabolize(mob/living/affected_mob)
. = ..()
affected_mob.apply_status_effect(/datum/status_effect/grouped/screwy_hud/fake_healthy, type)
/datum/reagent/medicine/mine_salve/on_mob_end_metabolize(mob/living/affected_mob)
. = ..()
affected_mob.remove_status_effect(/datum/status_effect/grouped/screwy_hud/fake_healthy, type)
/datum/reagent/medicine/mine_salve/on_burn_wound_processing(datum/wound/burn/flesh/burn_wound)
burn_wound.sanitization += 0.3
burn_wound.flesh_healing += 0.5
/datum/reagent/medicine/omnizine
name = "Omnizine"
description = "Slowly heals all damage types. Overdose will cause damage in all types instead."
reagent_state = LIQUID
color = "#DCDCDC"
metabolization_rate = 0.25 * REAGENTS_METABOLISM
overdose_threshold = 30
var/healing = 0.5
ph = 2
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/omnizine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
need_mob_update = affected_mob.adjustToxLoss(-healing * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype)
need_mob_update += affected_mob.adjustOxyLoss(-healing * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
need_mob_update += affected_mob.adjustBruteLoss(-healing * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(-healing * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/omnizine/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
need_mob_update = affected_mob.adjustToxLoss(1.5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype)
need_mob_update += affected_mob.adjustOxyLoss(1.5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
need_mob_update += affected_mob.adjustBruteLoss(1.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(1.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/omnizine/protozine
name = "Protozine"
description = "A less environmentally friendly and somewhat weaker variant of omnizine."
color = "#d8c7b7"
healing = 0.2
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/calomel
name = "Calomel"
description = "Quickly purges the body of all chemicals except itself. The more health a person has, \
the more toxin damage it will deal. It can heal toxin damage when people have low enough health."
reagent_state = LIQUID
color = "#c85319"
metabolization_rate = 1 * REAGENTS_METABOLISM
taste_description = "acid"
overdose_threshold = 20
ph = 1.5
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/calomel/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
for(var/datum/reagent/target_reagent in affected_mob.reagents.reagent_list)
if(istype(target_reagent, /datum/reagent/medicine/calomel))
continue
affected_mob.reagents.remove_reagent(target_reagent.type, 3 * REM * seconds_per_tick)
var/toxin_amount = round(affected_mob.health / 40, 0.1)
if(affected_mob.adjustToxLoss(toxin_amount * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/calomel/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
for(var/datum/reagent/medicine/calomel/target_reagent in affected_mob.reagents.reagent_list)
affected_mob.reagents.remove_reagent(target_reagent.type, 2 * REM * seconds_per_tick)
if(affected_mob.adjustToxLoss(2.5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/ammoniated_mercury
name = "Ammoniated Mercury"
description = "Quickly purges the body of toxic chemicals. Heals toxin damage when in a good condition someone has \
no brute and fire damage. When hurt with brute or fire damage, it can deal a great amount of toxin damage. \
When there are no toxins present, it starts slowly purging itself."
reagent_state = LIQUID
color = "#f3f1f0"
metabolization_rate = 0.1 * REAGENTS_METABOLISM
taste_description = "metallic"
overdose_threshold = 10
ph = 7
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.50
inverse_chem = /datum/reagent/inverse/ammoniated_mercury
/datum/reagent/medicine/ammoniated_mercury/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/toxin_chem_amount = 0
for(var/datum/reagent/toxin/target_reagent in affected_mob.reagents.reagent_list)
toxin_chem_amount += 1
affected_mob.reagents.remove_reagent(target_reagent.type, 5 * REM * seconds_per_tick)
var/toxin_amount = round(affected_mob.getBruteLoss() / 15, 0.1) + round(affected_mob.getFireLoss() / 30, 0.1) - 3
if(affected_mob.adjustToxLoss(toxin_amount * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
. = UPDATE_MOB_HEALTH
if(toxin_chem_amount == 0)
for(var/datum/reagent/medicine/ammoniated_mercury/target_reagent in affected_mob.reagents.reagent_list)
affected_mob.reagents.remove_reagent(target_reagent.type, 1 * REM * seconds_per_tick)
/datum/reagent/medicine/ammoniated_mercury/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.adjustToxLoss(3 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/potass_iodide
name = "Potassium Iodide"
description = "Heals low toxin damage while the patient is irradiated, and will halt the damaging effects of radiation."
reagent_state = LIQUID
color = "#BAA15D"
metabolization_rate = 2 * REAGENTS_METABOLISM
ph = 12 //It's a reducing agent
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
metabolized_traits = list(TRAIT_HALT_RADIATION_EFFECTS)
/datum/reagent/medicine/potass_iodide/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(HAS_TRAIT(affected_mob, TRAIT_IRRADIATED))
if(affected_mob.adjustToxLoss(-1 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/pen_acid
name = "Pentetic Acid"
description = "Reduces massive amounts of toxin damage while purging other chemicals from the body."
reagent_state = LIQUID
color = "#E6FFF0"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
ph = 1 //One of the best buffers, NEVERMIND!
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.4
inverse_chem = /datum/reagent/inverse/pen_acid
metabolized_traits = list(TRAIT_HALT_RADIATION_EFFECTS)
/datum/reagent/medicine/pen_acid/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.adjustToxLoss(-2 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
. = UPDATE_MOB_HEALTH
for(var/datum/reagent/R in affected_mob.reagents.reagent_list)
if(R != src)
affected_mob.reagents.remove_reagent(R.type, 2 * REM * seconds_per_tick)
/datum/reagent/medicine/sal_acid
name = "Salicylic Acid"
description = "Stimulates the healing of severe bruises. Extremely rapidly heals severe bruising and slowly heals minor ones. Overdose will worsen existing bruising."
reagent_state = LIQUID
color = "#D2D2D2"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
overdose_threshold = 25
ph = 2.1
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.3
inverse_chem = /datum/reagent/inverse/sal_acid
/datum/reagent/medicine/sal_acid/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
if(affected_mob.getBruteLoss() > 25)
need_mob_update = affected_mob.adjustBruteLoss(-4 * REM * seconds_per_tick * normalise_creation_purity(), updating_health = FALSE, required_bodytype = affected_bodytype)
else
need_mob_update = affected_mob.adjustBruteLoss(-0.5 * REM * seconds_per_tick * normalise_creation_purity(), updating_health = FALSE, required_bodytype = affected_bodytype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/sal_acid/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.getBruteLoss()) //It only makes existing bruises worse
if(affected_mob.adjustBruteLoss(4.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = BODYTYPE_ORGANIC)) // it's going to be healing either 4 or 0.5
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/salbutamol
name = "Salbutamol"
description = "Rapidly restores oxygen deprivation as well as preventing more of it to an extent."
reagent_state = LIQUID
color = COLOR_CYAN
metabolization_rate = 0.25 * REAGENTS_METABOLISM
ph = 2
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.25
inverse_chem = /datum/reagent/inverse/salbutamol
/datum/reagent/medicine/salbutamol/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/need_mob_update
need_mob_update = affected_mob.adjustOxyLoss(-3 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
if(affected_mob.losebreath >= 4)
var/obj/item/organ/internal/lungs/affected_lungs = affected_mob.get_organ_slot(ORGAN_SLOT_LUNGS)
var/our_respiration_type = affected_lungs ? affected_lungs.respiration_type : affected_mob.mob_respiration_type // use lungs' respiration type or mob_respiration_type if no lungs
if(our_respiration_type & affected_respiration_type)
affected_mob.losebreath -= 2 * REM * seconds_per_tick
need_mob_update = TRUE
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/ephedrine
name = "Ephedrine"
description = "Increases resistance to batons and movement speed, giving you hand cramps. Overdose deals toxin damage and inhibits breathing."
reagent_state = LIQUID
color = "#D2FFFA"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
overdose_threshold = 30
ph = 12
purity = REAGENT_STANDARD_PURITY
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
addiction_types = list(/datum/addiction/stimulants = 4) //1.6 per 2 seconds
inverse_chem = /datum/reagent/inverse/corazargh
inverse_chem_val = 0.4
metabolized_traits = list(TRAIT_BATON_RESISTANCE, TRAIT_STIMULATED)
/datum/reagent/medicine/ephedrine/on_mob_metabolize(mob/living/affected_mob)
. = ..()
affected_mob.add_movespeed_modifier(/datum/movespeed_modifier/reagent/ephedrine)
var/purity_movespeed_accounting = -0.375 * normalise_creation_purity()
affected_mob.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/reagent/ephedrine, TRUE, purity_movespeed_accounting)
/datum/reagent/medicine/ephedrine/on_mob_end_metabolize(mob/living/affected_mob)
. = ..()
affected_mob.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/ephedrine)
/datum/reagent/medicine/ephedrine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/obj/item/active_held_item = affected_mob.get_active_held_item()
if(SPT_PROB(10 * (1.5-creation_purity), seconds_per_tick) && iscarbon(affected_mob) && active_held_item?.w_class > WEIGHT_CLASS_SMALL)
if(active_held_item && affected_mob.dropItemToGround(active_held_item))
to_chat(affected_mob, span_notice("Your hands spaz out and you drop what you were holding!"))
affected_mob.set_jitter_if_lower(20 SECONDS)
affected_mob.AdjustAllImmobility(-20 * REM * seconds_per_tick * normalise_creation_purity())
affected_mob.adjustStaminaLoss(-1 * REM * seconds_per_tick * normalise_creation_purity(), updating_stamina = FALSE)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/ephedrine/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(SPT_PROB(1 * (1 + (1-normalise_creation_purity())), seconds_per_tick) && iscarbon(affected_mob))
var/datum/disease/D = new /datum/disease/heart_failure
affected_mob.ForceContractDisease(D)
to_chat(affected_mob, span_userdanger("You're pretty sure you just felt your heart stop for a second there.."))
affected_mob.playsound_local(affected_mob, 'sound/effects/singlebeat.ogg', 100, 0)
if(SPT_PROB(3.5 * (1 + (1-normalise_creation_purity())), seconds_per_tick))
to_chat(affected_mob, span_notice("[pick("Your head pounds.", "You feel a tight pain in your chest.", "You find it hard to stay still.", "You feel your heart practically beating out of your chest.")]"))
if(SPT_PROB(18 * (1 + (1-normalise_creation_purity())), seconds_per_tick))
affected_mob.adjustToxLoss(1 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype)
affected_mob.losebreath++
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/diphenhydramine
name = "Diphenhydramine"
description = "Rapidly purges the body of Histamine and reduces jitteriness. Slight chance of causing drowsiness."
reagent_state = LIQUID
color = "#64FFE6"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
ph = 11.5
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/diphenhydramine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(SPT_PROB(5, seconds_per_tick))
affected_mob.adjust_drowsiness(2 SECONDS)
affected_mob.adjust_jitter(-2 SECONDS * REM * seconds_per_tick)
holder.remove_reagent(/datum/reagent/toxin/histamine, 3 * REM * seconds_per_tick)
/datum/reagent/medicine/morphine
name = "Morphine"
description = "A painkiller that allows the patient to move at full speed even when injured. Causes drowsiness and eventually unconsciousness in high doses. Overdose will cause a variety of effects, ranging from minor to lethal."
reagent_state = LIQUID
color = "#A9FBFB"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
overdose_threshold = 30
ph = 8.96
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
addiction_types = list(/datum/addiction/opioids = 10)
metabolized_traits = list(TRAIT_ANALGESIA)
/datum/reagent/medicine/morphine/on_mob_metabolize(mob/living/affected_mob)
. = ..()
affected_mob.add_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown)
/datum/reagent/medicine/morphine/on_mob_end_metabolize(mob/living/affected_mob)
. = ..()
affected_mob.remove_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown)
/datum/reagent/medicine/morphine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(current_cycle > 5)
affected_mob.add_mood_event("numb", /datum/mood_event/narcotic_medium, name)
switch(current_cycle)
if(12)
to_chat(affected_mob, span_warning("You start to feel tired...") )
if(13 to 25)
affected_mob.adjust_drowsiness(2 SECONDS * REM * seconds_per_tick)
if(25 to INFINITY)
affected_mob.Sleeping(40 * REM * seconds_per_tick)
/datum/reagent/medicine/morphine/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(SPT_PROB(18, seconds_per_tick))
affected_mob.drop_all_held_items()
affected_mob.set_dizzy_if_lower(4 SECONDS)
affected_mob.set_jitter_if_lower(4 SECONDS)
/datum/reagent/medicine/oculine
name = "Oculine"
description = "Quickly restores eye damage, cures nearsightedness, and has a chance to restore vision to the blind."
reagent_state = LIQUID
color = "#404040" //oculine is dark grey, inacusiate is light grey
metabolization_rate = 0.25 * REAGENTS_METABOLISM
taste_description = "earthy bitterness"
purity = REAGENT_STANDARD_PURITY
ph = 10
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem = /datum/reagent/inverse/oculine
inverse_chem_val = 0.45
///The lighting alpha that the mob had on addition
var/delta_light
/datum/reagent/medicine/oculine/on_mob_add(mob/living/affected_mob)
if(!iscarbon(affected_mob))
return
RegisterSignal(affected_mob, COMSIG_CARBON_GAIN_ORGAN, PROC_REF(on_gained_organ))
RegisterSignal(affected_mob, COMSIG_CARBON_LOSE_ORGAN, PROC_REF(on_removed_organ))
var/obj/item/organ/internal/eyes/eyes = affected_mob.get_organ_slot(ORGAN_SLOT_EYES)
if(!eyes)
return
improve_eyesight(affected_mob, eyes)
/datum/reagent/medicine/oculine/proc/improve_eyesight(mob/living/carbon/affected_mob, obj/item/organ/internal/eyes/eyes)
delta_light = creation_purity*10
eyes.lighting_cutoff += delta_light
affected_mob.update_sight()
/datum/reagent/medicine/oculine/proc/restore_eyesight(mob/living/carbon/affected_mob, obj/item/organ/internal/eyes/eyes)
eyes.lighting_cutoff -= delta_light
affected_mob.update_sight()
/datum/reagent/medicine/oculine/proc/on_gained_organ(mob/affected_mob, obj/item/organ/organ)
SIGNAL_HANDLER
if(!istype(organ, /obj/item/organ/internal/eyes))
return
var/obj/item/organ/internal/eyes/affected_eyes = organ
improve_eyesight(affected_mob, affected_eyes)
/datum/reagent/medicine/oculine/proc/on_removed_organ(mob/prev_affected_mob, obj/item/organ/organ)
SIGNAL_HANDLER
if(!istype(organ, /obj/item/organ/internal/eyes))
return
var/obj/item/organ/internal/eyes/eyes = organ
restore_eyesight(prev_affected_mob, eyes)
/datum/reagent/medicine/oculine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/normalized_purity = normalise_creation_purity()
affected_mob.adjust_temp_blindness(-4 SECONDS * REM * seconds_per_tick * normalized_purity)
affected_mob.adjust_eye_blur(-4 SECONDS * REM * seconds_per_tick * normalized_purity)
var/obj/item/organ/internal/eyes/eyes = affected_mob.get_organ_slot(ORGAN_SLOT_EYES)
if(eyes)
// Healing eye damage will cure nearsightedness and blindness from ... eye damage
if(eyes.apply_organ_damage(-2 * REM * seconds_per_tick * normalise_creation_purity(), required_organ_flag = affected_organ_flags))
. = UPDATE_MOB_HEALTH
// If our eyes are seriously damaged, we have a probability of causing eye blur while healing depending on purity
if(eyes.damaged && IS_ORGANIC_ORGAN(eyes) && SPT_PROB(16 - min(normalized_purity * 6, 12), seconds_per_tick))
// While healing, gives some eye blur
if(affected_mob.is_blind_from(EYE_DAMAGE))
to_chat(affected_mob, span_warning("Your vision slowly returns..."))
affected_mob.adjust_eye_blur(20 SECONDS)
else if(affected_mob.is_nearsighted_from(EYE_DAMAGE))
to_chat(affected_mob, span_warning("The blackness in your peripheral vision begins to fade."))
affected_mob.adjust_eye_blur(5 SECONDS)
/datum/reagent/medicine/oculine/on_mob_delete(mob/living/affected_mob)
. = ..()
var/obj/item/organ/internal/eyes/eyes = affected_mob.get_organ_slot(ORGAN_SLOT_EYES)
if(!eyes)
return
restore_eyesight(affected_mob, eyes)
/datum/reagent/medicine/inacusiate
name = "Inacusiate"
description = "Rapidly repairs damage to the patient's ears to cure deafness, assuming the source of said deafness isn't from genetic mutations, chronic deafness, or a total defecit of ears." //by "chronic" deafness, we mean people with the "deaf" quirk
color = "#606060" // ditto
ph = 2
purity = REAGENT_STANDARD_PURITY
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.3
inverse_chem = /datum/reagent/impurity/inacusiate
/datum/reagent/medicine/inacusiate/on_mob_add(mob/living/affected_mob, amount)
. = ..()
if(creation_purity >= 1)
RegisterSignal(affected_mob, COMSIG_MOVABLE_HEAR, PROC_REF(owner_hear))
//Lets us hear whispers from far away!
/datum/reagent/medicine/inacusiate/proc/owner_hear(datum/source, message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods = list())
SIGNAL_HANDLER
if(!isliving(holder.my_atom))
return
var/mob/living/affected_mob = holder.my_atom
var/atom/movable/composer = holder.my_atom
if(message_mods[WHISPER_MODE])
message = composer.compose_message(affected_mob, message_language, message, null, spans, message_mods)
/datum/reagent/medicine/inacusiate/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/obj/item/organ/internal/ears/ears = affected_mob.get_organ_slot(ORGAN_SLOT_EARS)
if(!ears)
return
ears.adjustEarDamage(-4 * REM * seconds_per_tick * normalise_creation_purity(), -4 * REM * seconds_per_tick * normalise_creation_purity())
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/inacusiate/on_mob_delete(mob/living/affected_mob)
. = ..()
UnregisterSignal(affected_mob, COMSIG_MOVABLE_HEAR)
/datum/reagent/medicine/atropine
name = "Atropine"
description = "If a patient is in critical condition, rapidly heals all damage types as well as regulating oxygen in the body. Excellent for stabilizing wounded patients, and said to neutralize blood-activated internal explosives found amongst clandestine black op agents."
reagent_state = LIQUID
color = "#1D3535" //slightly more blue, like epinephrine
metabolization_rate = 0.25 * REAGENTS_METABOLISM
overdose_threshold = 35
ph = 12
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
inverse_chem_val = 0.35
inverse_chem = /datum/reagent/inverse/atropine
added_traits = list(TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION)
/datum/reagent/medicine/atropine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.health <= affected_mob.crit_threshold)
var/need_mob_update
need_mob_update = affected_mob.adjustToxLoss(-2 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype)
need_mob_update += affected_mob.adjustBruteLoss(-2* REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(-2 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustOxyLoss(-5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
if(need_mob_update)
. = UPDATE_MOB_HEALTH
var/obj/item/organ/internal/lungs/affected_lungs = affected_mob.get_organ_slot(ORGAN_SLOT_LUNGS)
var/our_respiration_type = affected_lungs ? affected_lungs.respiration_type : affected_mob.mob_respiration_type
if(our_respiration_type & affected_respiration_type)
affected_mob.losebreath = 0
if(SPT_PROB(10, seconds_per_tick))
affected_mob.set_dizzy_if_lower(10 SECONDS)
affected_mob.set_jitter_if_lower(10 SECONDS)
/datum/reagent/medicine/atropine/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(affected_mob.adjustToxLoss(0.5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype))
. = UPDATE_MOB_HEALTH
affected_mob.set_dizzy_if_lower(2 SECONDS * REM * seconds_per_tick)
affected_mob.set_jitter_if_lower(2 SECONDS * REM * seconds_per_tick)
/datum/reagent/medicine/epinephrine
name = "Epinephrine"
description = "Very minor boost to stun resistance. Slowly heals damage if a patient is in critical condition, as well as regulating oxygen loss. Overdose causes weakness and toxin damage."
reagent_state = LIQUID
color = "#D2FFFA"
metabolization_rate = 0.25 * REAGENTS_METABOLISM
overdose_threshold = 30
ph = 10.2
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
metabolized_traits = list(TRAIT_NOCRITDAMAGE)
/datum/reagent/medicine/epinephrine/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(holder.has_reagent(/datum/reagent/toxin/lexorin))
if(SPT_PROB(10, seconds_per_tick))
holder.add_reagent(/datum/reagent/toxin/histamine, 4)
return
var/need_mob_update
if(affected_mob.health <= affected_mob.crit_threshold)
need_mob_update = affected_mob.adjustToxLoss(-0.5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype)
need_mob_update += affected_mob.adjustBruteLoss(-0.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(-0.5 * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustOxyLoss(-0.5 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
if(affected_mob.losebreath >= 4)
var/obj/item/organ/internal/lungs/affected_lungs = affected_mob.get_organ_slot(ORGAN_SLOT_LUNGS)
var/our_respiration_type = affected_lungs ? affected_lungs.respiration_type : affected_mob.mob_respiration_type
if(our_respiration_type & affected_respiration_type)
affected_mob.losebreath -= 2 * REM * seconds_per_tick
need_mob_update = TRUE
if(affected_mob.losebreath < 0)
affected_mob.losebreath = 0
need_mob_update = TRUE
need_mob_update += affected_mob.adjustStaminaLoss(-0.5 * REM * seconds_per_tick, updating_stamina = FALSE)
if(SPT_PROB(10, seconds_per_tick))
affected_mob.AdjustAllImmobility(-20)
need_mob_update = TRUE
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/epinephrine/metabolize_reagent(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
if(holder.has_reagent(/datum/reagent/toxin/lexorin))
holder.remove_reagent(/datum/reagent/toxin/lexorin, 2 * REM * seconds_per_tick)
holder.remove_reagent(/datum/reagent/medicine/epinephrine, 1 * REM * seconds_per_tick)
return ..()
/datum/reagent/medicine/epinephrine/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(SPT_PROB(18, REM * seconds_per_tick))
var/need_mob_update
need_mob_update = affected_mob.adjustStaminaLoss(2.5 * REM * seconds_per_tick, updating_stamina = FALSE)
need_mob_update += affected_mob.adjustToxLoss(1 * REM * seconds_per_tick, updating_health = FALSE, required_biotype = affected_biotype)
var/obj/item/organ/internal/lungs/affected_lungs = affected_mob.get_organ_slot(ORGAN_SLOT_LUNGS)
var/our_respiration_type = affected_lungs ? affected_lungs.respiration_type : affected_mob.mob_respiration_type
if(our_respiration_type & affected_respiration_type)
affected_mob.losebreath++
need_mob_update = TRUE
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/strange_reagent
name = "Strange Reagent"
description = "A miracle drug capable of bringing the dead back to life. Works topically unless anotamically complex, in which case works orally. Cannot revive targets under -%MAXHEALTHRATIO% health."
reagent_state = LIQUID
color = "#A0E85E"
metabolization_rate = 1.25 * REAGENTS_METABOLISM
taste_description = "magnets"
ph = 0.5
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/// The amount of damage a single unit of this will heal
var/healing_per_reagent_unit = 5
/// The ratio of the excess reagent used to contribute to excess healing
var/excess_healing_ratio = 0.8
/// Do we instantly revive
var/instant = FALSE
/// The maximum amount of damage we can revive from, as a ratio of max health
var/max_revive_damage_ratio = 2
/datum/reagent/medicine/strange_reagent/instant
name = "Stranger Reagent"
instant = TRUE
chemical_flags = NONE
/datum/reagent/medicine/strange_reagent/New()
. = ..()
description = replacetext(description, "%MAXHEALTHRATIO%", "[max_revive_damage_ratio * 100]%")
if(instant)
description += " It appears to be pulsing with a warm pink light."
// FEED ME SEYMOUR
/datum/reagent/medicine/strange_reagent/on_hydroponics_apply(obj/machinery/hydroponics/mytray, mob/user)
mytray.spawnplant()
/// Calculates the amount of reagent to at a bare minimum make the target not dead
/datum/reagent/medicine/strange_reagent/proc/calculate_amount_needed_to_revive(mob/living/benefactor)
var/their_health = benefactor.getMaxHealth() - (benefactor.getBruteLoss() + benefactor.getFireLoss())
if(their_health > 0)
return 1
return round(-their_health / healing_per_reagent_unit, DAMAGE_PRECISION)
/// Calculates the amount of reagent that will be needed to both revive and full heal the target. Looks at healing_per_reagent_unit and excess_healing_ratio
/datum/reagent/medicine/strange_reagent/proc/calculate_amount_needed_to_full_heal(mob/living/benefactor)
var/their_health = benefactor.getBruteLoss() + benefactor.getFireLoss()
var/max_health = benefactor.getMaxHealth()
if(their_health >= max_health)
return 1
var/amount_needed_to_revive = calculate_amount_needed_to_revive(benefactor)
var/expected_amount_to_full_heal = round(max_health / healing_per_reagent_unit, DAMAGE_PRECISION) / excess_healing_ratio
return amount_needed_to_revive + expected_amount_to_full_heal
/datum/reagent/medicine/strange_reagent/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume)
if(exposed_mob.stat != DEAD || !(exposed_mob.mob_biotypes & MOB_ORGANIC))
return ..()
if(HAS_TRAIT(exposed_mob, TRAIT_SUICIDED)) //they are never coming back
exposed_mob.visible_message(span_warning("[exposed_mob]'s body does not react..."))
return
if(iscarbon(exposed_mob) && !(methods & INGEST)) //simplemobs can still be splashed
return ..()
if(HAS_TRAIT(exposed_mob, TRAIT_HUSK))
exposed_mob.visible_message(span_warning("[exposed_mob]'s body lets off a puff of smoke..."))
return
if((exposed_mob.getBruteLoss() + exposed_mob.getFireLoss()) > (exposed_mob.getMaxHealth() * max_revive_damage_ratio))
exposed_mob.visible_message(span_warning("[exposed_mob]'s body convulses violently, before falling still..."))
return
var/needed_to_revive = calculate_amount_needed_to_revive(exposed_mob)
if(reac_volume < needed_to_revive)
exposed_mob.visible_message(span_warning("[exposed_mob]'s body convulses a bit, and then falls still once more."))
exposed_mob.do_jitter_animation(10)
return
exposed_mob.visible_message(span_warning("[exposed_mob]'s body starts convulsing!"))
exposed_mob.notify_revival("Your body is being revived with Strange Reagent!")
exposed_mob.do_jitter_animation(10)
// we factor in healing needed when determing if we do anything
var/healing = needed_to_revive * healing_per_reagent_unit
// but excessive healing is penalized, to reward doctors who use the perfect amount
reac_volume -= needed_to_revive
healing += (reac_volume * healing_per_reagent_unit) * excess_healing_ratio
// during unit tests, we want it to happen immediately
if(instant)
exposed_mob.do_strange_reagent_revival(healing)
else
// jitter immediately, after four seconds, and after eight seconds
addtimer(CALLBACK(exposed_mob, TYPE_PROC_REF(/mob/living, do_jitter_animation), 1 SECONDS), 4 SECONDS)
addtimer(CALLBACK(exposed_mob, TYPE_PROC_REF(/mob/living, do_strange_reagent_revival), healing), 7 SECONDS)
addtimer(CALLBACK(exposed_mob, TYPE_PROC_REF(/mob/living, do_jitter_animation), 1 SECONDS), 8 SECONDS)
return ..()
/datum/reagent/medicine/strange_reagent/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
var/damage_at_random = rand(0, 250)/100 //0 to 2.5
var/need_mob_update
need_mob_update = affected_mob.adjustBruteLoss(damage_at_random * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
need_mob_update += affected_mob.adjustFireLoss(damage_at_random * REM * seconds_per_tick, updating_health = FALSE, required_bodytype = affected_bodytype)
if(need_mob_update)
return UPDATE_MOB_HEALTH
/datum/reagent/medicine/mannitol
name = "Mannitol"
description = "Efficiently restores brain damage."