[MIRROR] Fix: Blood Deficiency removing more blood than intended [MDB IGNORE] (#16959)

* Fix: Blood Deficiency removing more blood than intended (#70563)

* Fix: Blood Deficiency removing more blood than intended

Co-authored-by: Dani Glore <danielsglore@gmail.com>
This commit is contained in:
SkyratBot
2022-10-19 01:18:06 +01:00
committed by GitHub
co-authored by Dani Glore
parent 66d007ce54
commit 1973efcd6d
+8 -4
View File
@@ -62,17 +62,21 @@
hardcore_value = 8
processing_quirk = TRUE
mail_goodies = list(/obj/item/reagent_containers/blood/o_minus) // universal blood type that is safe for all
var/min_blood = BLOOD_VOLUME_SAFE - 25 // just barely survivable without treatment
var/drain_rate = 0.275
/datum/quirk/blooddeficiency/process(delta_time)
if(quirk_holder.stat == DEAD)
return
var/mob/living/carbon/human/H = quirk_holder
if(NOBLOOD in H.dna.species.species_traits) //can't lose blood if your species doesn't have any
var/mob/living/carbon/human/carbon_target = quirk_holder
if(NOBLOOD in carbon_target.dna.species.species_traits) //can't lose blood if your species doesn't have any
return
if (H.blood_volume > (BLOOD_VOLUME_SAFE - 25)) // just barely survivable without treatment
H.blood_volume -= 0.275 * delta_time
if (carbon_target.blood_volume <= min_blood)
return
// Ensures that we don't reduce total blood volume below min_blood.
carbon_target.blood_volume = max(min_blood, carbon_target.blood_volume - drain_rate * delta_time)
/datum/quirk/item_quirk/blindness
name = "Blind"