From e3439f96f03faf5ff76a63ef97ed661ce4073219 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Thu, 28 Nov 2019 18:06:18 -0600 Subject: [PATCH 1/4] strange reagent fix --- .../chemistry/reagents/medicine_reagents.dm | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 6700c6c006..294292c359 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -881,40 +881,48 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/strange_reagent name = "Strange Reagent" id = "strange_reagent" - description = "A miracle drug capable of bringing the dead back to life. Only functions if the target has less than 100 brute and burn damage (independent of one another), and causes slight damage to the living." + description = "A miracle drug capable of bringing the dead back to life. Only functions when applied by patch or spray, if the target has less than 100 brute and burn damage (independent of one another) and hasn't been husked. Causes slight damage to the living." reagent_state = LIQUID color = "#A0E85E" metabolization_rate = 0.5 * REAGENTS_METABOLISM taste_description = "magnets" pH = 0 -/datum/reagent/medicine/strange_reagent/reaction_mob(mob/living/carbon/human/M, method=TOUCH, reac_volume) +/datum/reagent/medicine/strange_reagent/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(M.stat == DEAD) - if(M.getBruteLoss() >= 100 || M.getFireLoss() >= 100) - M.visible_message("[M]'s body convulses a bit, and then falls still once more.") + if(M.suiciding || M.hellbound) //they are never coming back + M.visible_message("[M]'s body does not react...") return - M.visible_message("[M]'s body convulses a bit.") - if(!M.suiciding && !(HAS_TRAIT(M, TRAIT_NOCLONE)) && !M.hellbound) - if(!M) - return - if(M.notify_ghost_cloning(source = M)) - spawn (100) //so the ghost has time to re-enter - return + if(M.getBruteLoss() >= 100 || M.getFireLoss() >= 100 || HAS_TRAIT(M, TRAIT_HUSK)) //body is too damaged to be revived + M.visible_message("[M]'s body convulses a bit, and then falls still once more.") + M.do_jitter_animation(10) + return + else + M.visible_message("[M]'s body starts convulsing!") + M.notify_ghost_cloning(source = M) + M.do_jitter_animation(10) + addtimer(CALLBACK(M, /mob/living/carbon.proc/do_jitter_animation, 10), 40) //jitter immediately, then again after 4 and 8 seconds + addtimer(CALLBACK(M, /mob/living/carbon.proc/do_jitter_animation, 10), 80) + sleep(100) //so the ghost has time to re-enter - else - M.adjustOxyLoss(-20, 0) - M.adjustToxLoss(-20, 0) - var/mob/living/carbon/H = M - for(var/organ in H.internal_organs) + + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(!(C.dna && C.dna.species && (NOBLOOD in C.dna.species.species_traits))) + C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_NORMAL) //so you don't instantly re-die from a lack of blood + for(var/organ in C.internal_organs) var/obj/item/organ/O = organ - O.setOrganDamage(0) - M.updatehealth() + O.setOrganDamage(0) //so you don't near-instantly re-die because your heart has decayed to the point of complete failure - if(M.revive()) - M.emote("gasp") - log_combat(M, M, "revived", src) + M.adjustOxyLoss(-20, 0) + M.adjustToxLoss(-20, 0) + M.updatehealth() + if(M.revive(full_heal = FALSE, admin_revive = FALSE)) + M.emote("gasp") + log_combat(M, M, "revived", src) ..() + /datum/reagent/medicine/strange_reagent/on_mob_life(mob/living/carbon/M) M.adjustBruteLoss(0.5*REM, 0) M.adjustFireLoss(0.5*REM, 0) @@ -1509,5 +1517,5 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/polypyr/overdose_process(mob/living/M) M.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5) ..() - . = 1 + . = 1 From a940110dee35b8f298f5b7acfd9746e74ba2caee Mon Sep 17 00:00:00 2001 From: Linzolle Date: Thu, 28 Nov 2019 20:51:50 -0600 Subject: [PATCH 2/4] spawn instead of sleep --- .../chemistry/reagents/medicine_reagents.dm | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 294292c359..dc752dd373 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -903,23 +903,24 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) M.do_jitter_animation(10) addtimer(CALLBACK(M, /mob/living/carbon.proc/do_jitter_animation, 10), 40) //jitter immediately, then again after 4 and 8 seconds addtimer(CALLBACK(M, /mob/living/carbon.proc/do_jitter_animation, 10), 80) - sleep(100) //so the ghost has time to re-enter + spawn(100) //so the ghost has time to re-enter + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(!(C.dna && C.dna.species && (NOBLOOD in C.dna.species.species_traits))) + C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_NORMAL) //so you don't instantly re-die from a lack of blood + for(var/organ in C.internal_organs) + var/obj/item/organ/O = organ + if(O.damage > O.maxHealth/2) + O.setOrganDamage(O.maxHealth/2) //so you don't instantly die from organ damage when being revived - if(iscarbon(M)) - var/mob/living/carbon/C = M - if(!(C.dna && C.dna.species && (NOBLOOD in C.dna.species.species_traits))) - C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_NORMAL) //so you don't instantly re-die from a lack of blood - for(var/organ in C.internal_organs) - var/obj/item/organ/O = organ - O.setOrganDamage(0) //so you don't near-instantly re-die because your heart has decayed to the point of complete failure - - M.adjustOxyLoss(-20, 0) - M.adjustToxLoss(-20, 0) - M.updatehealth() - if(M.revive(full_heal = FALSE, admin_revive = FALSE)) - M.emote("gasp") - log_combat(M, M, "revived", src) + M.adjustOxyLoss(-20, 0) + M.adjustToxLoss(-20, 0) + M.updatehealth() + if(M.revive(full_heal = FALSE, admin_revive = FALSE)) + M.grab_ghost() + M.emote("gasp") + log_combat(M, M, "revived", src) ..() From 66971236d57b3253192ad8b4edf09cf2dbfc2e79 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Thu, 28 Nov 2019 21:02:28 -0600 Subject: [PATCH 3/4] when you forget to hit ctrl+S --- code/modules/reagents/chemistry/reagents/medicine_reagents.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index dc752dd373..73a0b050ce 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -917,7 +917,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) M.adjustOxyLoss(-20, 0) M.adjustToxLoss(-20, 0) M.updatehealth() - if(M.revive(full_heal = FALSE, admin_revive = FALSE)) + if(M.revive()) M.grab_ghost() M.emote("gasp") log_combat(M, M, "revived", src) From 4863deb97841b0140a12185eb1730248f28e83ae Mon Sep 17 00:00:00 2001 From: Linzolle Date: Fri, 29 Nov 2019 12:59:25 -0600 Subject: [PATCH 4/4] blood ratio --- code/modules/reagents/chemistry/reagents/medicine_reagents.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 73a0b050ce..8d27e64542 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -908,7 +908,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) if(iscarbon(M)) var/mob/living/carbon/C = M if(!(C.dna && C.dna.species && (NOBLOOD in C.dna.species.species_traits))) - C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_NORMAL) //so you don't instantly re-die from a lack of blood + C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_NORMAL*C.blood_ratio) //so you don't instantly re-die from a lack of blood for(var/organ in C.internal_organs) var/obj/item/organ/O = organ if(O.damage > O.maxHealth/2)