From 1e78a6befcb98443b245bc5ef02a355ba764b57c Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Fri, 27 May 2022 15:39:05 -0400 Subject: [PATCH] Reworks exotic blood conversion handling so dead species can regain blood via transfusion (#17851) * Reworks exotic blood conversion handling * proc coefficient * remove comment * Update code/modules/reagents/chemistry/holder.dm Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> --- .../mob/living/carbon/human/species/_species.dm | 4 ---- code/modules/reagents/chemistry/holder.dm | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 87789077afa..6622c1aa347 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -336,10 +336,6 @@ // Return 0 if it shouldn't deplete and do its normal effect // Other return values will cause weird badness /datum/species/proc/handle_reagents(mob/living/carbon/human/H, datum/reagent/R) - if(R.id == exotic_blood) - H.blood_volume = min(H.blood_volume + round(R.volume, 0.1), BLOOD_VOLUME_NORMAL) - H.reagents.del_reagent(R.id) - return FALSE return TRUE // For special snowflake species effects diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index f599f3ea8c4..5e3bf3b8df8 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -571,12 +571,26 @@ var/check = reaction_check(A, R) if(!check) continue + if(handle_exotic_blood(A, R, method, volume_modifier)) + continue R.reaction_mob(A, method, R.volume * volume_modifier, show_message) if("TURF") R.reaction_turf(A, R.volume * volume_modifier, R.color) if("OBJ") R.reaction_obj(A, R.volume * volume_modifier) +/datum/reagents/proc/handle_exotic_blood(atom/A, datum/reagent/R, method, volume_modifier) + if(!R || !method || method != REAGENT_INGEST) + return FALSE + if(ishuman(A)) + var/mob/living/carbon/human/H = A + if(R.id == H.dna.species.exotic_blood) + H.blood_volume = min(H.blood_volume + round(R.volume * volume_modifier, 0.1), BLOOD_VOLUME_NORMAL) + del_reagent(R.id) + return TRUE + return FALSE + + /datum/reagents/proc/add_reagent_list(list/list_reagents, list/data = null) // Like add_reagent but you can enter a list. Format it like this: list("toxin" = 10, "beer" = 15) for(var/r_id in list_reagents) var/amt = list_reagents[r_id]