From a8d38c5b76ee41a2a6427e68add97a617b89aa5e Mon Sep 17 00:00:00 2001 From: Ater Ignis Date: Wed, 6 Feb 2013 13:28:21 +0400 Subject: [PATCH] iv drip taking blood can't be just syringe copypaste - stupid having 50 different blood-datums of 4 in volume --- code/game/machinery/iv_drip.dm | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index c27ae7faa80..311f8d88101 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -69,8 +69,6 @@ /obj/machinery/iv_drip/process() set background = 1 - ..() - if(src.attached) if(!(get_dist(src, src.attached) <= 1)) visible_message("The needle is ripped out of [src.attached], doesn't that hurt?") @@ -101,7 +99,12 @@ var/mob/living/carbon/human/T = attached if(!istype(T)) return - var/datum/reagent/B = new /datum/reagent/blood + var/datum/reagent/B + for(var/datum/reagent/blood/Blood in beaker.reagents.reagent_list) + if(Blood.data && Blood.data["blood_type"]==T.dna.b_type) + B = Blood + break + if(!B) B = new /datum/reagent/blood if(!T.dna) return if(NOCLONE in T.mutations) @@ -112,7 +115,7 @@ if(T.vessel.get_reagent_amount("blood") < amount) return B.holder = beaker - B.volume = amount + B.volume += amount //set reagent data B.data["donor"] = T @@ -121,7 +124,10 @@ B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0) if(T.resistances && T.resistances.len) - B.data["resistances"] = T.resistances.Copy() + if(B.data["resistances"]) + B.data["resistances"] |= T.resistances.Copy() + else + B.data["resistances"] = T.resistances.Copy() B.data["blood_type"] = copytext(T.dna.b_type,1,0) @@ -130,14 +136,15 @@ temp_chem += R.name temp_chem[R.name] = R.volume B.data["trace_chem"] = list2params(temp_chem) - B.data["antibodies"] = T.antibodies + B.data["antibodies"] |= T.antibodies T.vessel.remove_reagent("blood",amount) // Removes blood if human - beaker.reagents.reagent_list += B + beaker.reagents.reagent_list |= B beaker.reagents.update_total() beaker.on_reagent_change() beaker.reagents.handle_reactions() + update_icon() /obj/machinery/iv_drip/attack_hand(mob/user as mob) if(src.beaker) @@ -168,6 +175,11 @@ ..() if (!(usr in view(2)) && usr!=src.loc) return + if(mode == "take") + usr << "The IV drip is taking blood." + else if(mode == "give") + usr << "The IV drip is injecting." + if(beaker) usr << "\blue Attached is \a [beaker] with:" if(beaker.reagents && beaker.reagents.reagent_list.len)