From 4ee608e0c7c0d7b333bc700d24e890c26bf3b5e6 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Wed, 16 Oct 2019 09:15:04 -0500 Subject: [PATCH] Fixes blood transfusion, QOL to IV drippers --- code/game/machinery/iv_drip.dm | 7 +++-- .../chemistry/reagents/other_reagents.dm | 27 ++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 48015afc24..621ca266bb 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -146,10 +146,11 @@ if(!amount) if(prob(5)) visible_message("[src] pings.") + playsound(loc, 'sound/machines/beep.ogg', 50, 1) return // If the human is losing too much blood, beep. - if(attached.blood_volume < ((BLOOD_VOLUME_SAFE*attached.blood_ratio) && prob(5))) + if(attached.blood_volume < ((BLOOD_VOLUME_SAFE*attached.blood_ratio) && prob(5) && ishuman(attached))) //really couldn't care less about monkeys visible_message("[src] beeps loudly.") playsound(loc, 'sound/machines/twobeep.ogg', 50, 1) attached.transfer_blood_to(beaker, amount) @@ -183,7 +184,9 @@ if(usr.incapacitated()) return if(beaker) - beaker.forceMove(drop_location()) + if(usr && Adjacent(usr) && !issiliconoradminghost(usr)) + if(!usr.put_in_hands(beaker)) + beaker.forceMove(drop_location()) beaker = null update_icon() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 430b9be754..a92e8d1f52 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -26,19 +26,22 @@ else //ingest, patch or inject L.ForceContractDisease(D) -/datum/reagent/blood/on_mob_life(mob/living/carbon/C, method=INJECT, reac_volume) //needed so we don't nuke people with massive toxins now. Because apparently being hyperlethal is preferable to stamina drain - if(!istype(C)) - return - var/blood_id = C.get_blood_id() - if((blood_id == "blood" || blood_id == "jellyblood") && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) - if(!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))) - C.adjustToxLoss(2*REM, TRUE, TRUE) //forced to ensure people don't use it to gain tox as slime person - C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM) //but it should still refill blood - else - C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM) + if(iscarbon(L)) + var/mob/living/carbon/C = L + var/blood_id = C.get_blood_id() + if((blood_id == "blood" || blood_id == "jellyblood") && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) + C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM * C.blood_ratio) + // we don't care about bloodtype here, we're just refilling the mob - holder.remove_reagent(id, 1) - return TRUE + if(reac_volume >= 10 && istype(L) && method != INJECT) + L.add_blood_DNA(list(data["blood_DNA"] = data["blood_type"])) + +/datum/reagent/blood/on_mob_life(mob/living/carbon/C) //Because lethals are preferred over stamina. damnifino. + var/blood_id = C.get_blood_id() + if((blood_id == "blood" || blood_id == "jellyblood")) + if(!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))) //we only care about bloodtype here because this is where the poisoning should be + C.adjustToxLoss(rand(2,8)*REM, TRUE, TRUE) //forced to ensure people don't use it to gain beneficial toxin as slime person + ..() /datum/reagent/blood/reaction_obj(obj/O, volume) if(volume >= 3 && istype(O))