|
976 | 976 |
|
977 | 977 | if(prob(3))
|
978 | 978 | C.vomit(50, FALSE, FALSE, 1, purge_ratio = 0.2)
|
| 979 | + |
| 980 | +/datum/reagent/medicine/adenosine |
| 981 | + name = "Adenosine" |
| 982 | + description = "A pharmaceutical used to lower a patient's heartrate. Can be used to restart hearts when dosed correctly." |
| 983 | + reagent_state = LIQUID |
| 984 | + color = "#7F10C0" |
| 985 | + metabolization_rate = 0.5 |
| 986 | + |
| 987 | + overdose_threshold = 10.1 |
| 988 | + |
| 989 | +/datum/reagent/medicine/adenosine/affect_blood(mob/living/carbon/C, removed) |
| 990 | + if(overdosed) |
| 991 | + return |
| 992 | + |
| 993 | + if(current_cycle < SECONDS_TO_REAGENT_CYCLES(10)) // Seconds 1-8 do nothing. (0.5 to 2u) |
| 994 | + return |
| 995 | + |
| 996 | + if(current_cycle in SECONDS_TO_REAGENT_CYCLES(10) to SECONDS_TO_REAGENT_CYCLES(14)) // Seconds 10-14 stop ya heart. (2.5 to 3.5) |
| 997 | + if(C.set_heartattack(TRUE)) |
| 998 | + log_health(C, "Heart stopped due to adenosine misdose.") |
| 999 | + C.Unconscious(3 SECONDS) |
| 1000 | + return |
| 1001 | + |
| 1002 | + if(current_cycle == SECONDS_TO_REAGENT_CYCLES(16)) // Restart heart after 16 seconds (exactly 4u) |
| 1003 | + if(C.set_heartattack(FALSE)) |
| 1004 | + log_health(C, "Heart restarted due to adenosine.") |
| 1005 | + return |
| 1006 | + |
| 1007 | + if(current_cycle in SECONDS_TO_REAGENT_CYCLES(18) to SECONDS_TO_REAGENT_CYCLES(28)) // 4.5u to 7u is a safe buffer. |
| 1008 | + return |
| 1009 | + |
| 1010 | + if(!prob(25)) // Only runs after 7 units have been processed. |
| 1011 | + return |
| 1012 | + |
| 1013 | + switch(rand(1,10)) |
| 1014 | + if(1 to 7) |
| 1015 | + C.losebreath += 4 |
| 1016 | + if(8 to 9) |
| 1017 | + C.adjustOxyLoss(rand(3, 4), FALSE) |
| 1018 | + . = TRUE |
| 1019 | + if(10) |
| 1020 | + if(C.set_heartattack(TRUE)) |
| 1021 | + log_health(C, "Heart stopped due to improper adenosine dose.") |
| 1022 | + |
| 1023 | +/datum/reagent/medicine/adenosine/overdose_process(mob/living/carbon/C) |
| 1024 | + if(C.set_heartattack(TRUE)) |
| 1025 | + log_health(C, "Heart stopped due to adenosine overdose.") |
| 1026 | + |
| 1027 | + if(prob(25)) |
| 1028 | + C.losebreath += 4 |
| 1029 | + C.adjustOxyLoss(rand(5,25), 0) |
| 1030 | + return TRUE |
0 commit comments