Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes blood_absorption_rate into proc/get_blood_absorption_rate() and make it depend on the blood level on living/human #17012

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/mob/living.dm
Expand Up @@ -100,7 +100,6 @@
var/blood_color = DEFAULT_BLOOD_COLOR
var/bleeding = 0
var/bleeding_internal = 0
var/blood_absorption_rate = 1 // amount of blood to absorb from the reagent holder per Life()
var/list/bandaged = list()
var/being_staunched = 0 // is someone currently putting pressure on their wounds?

Expand Down Expand Up @@ -2265,3 +2264,7 @@
else
src.say(message)
src.stat = old_stat // back to being dead 😌

/// Returns the rate of blood to absorb from the reagent holder per Life()
/mob/living/proc/get_blood_absorption_rate()
return 1 // that's the standard absorption rate
20 changes: 20 additions & 0 deletions code/mob/living/carbon/human.dm
Expand Up @@ -3475,3 +3475,23 @@
. += 1
if(istype(src.wear_mask, /obj/item/clothing/mask/clown_hat))
. += 1

/mob/living/carbon/human/get_blood_absorption_rate()
. = ..()
var/blood_metabolism_multiplier = 1
//We adjust the amount of blood we absorb depending on how much the body needs it. Hypotensive causes a higher rate, Hypertensive causes a decreased rate
switch(src.blood_volume)
if(551 to INFINITY)
blood_metabolism_multiplier = 0.8
if(476 to 550)
blood_metabolism_multiplier = 1
if(426 to 475)
blood_metabolism_multiplier = 1.25
if(301 to 425)
blood_metabolism_multiplier = 1.5
if(201 to 300)
blood_metabolism_multiplier = 2
else
blood_metabolism_multiplier = 3
//Now we multiply the absorption rate with the metabolism multiplier
. *= blood_metabolism_multiplier
2 changes: 1 addition & 1 deletion code/mob/living/life/chems.dm
Expand Up @@ -13,7 +13,7 @@
owner.reagents.temperature_reagents(owner.bodytemperature, 100*reagent_time_multiplier, 100, 15*reagent_time_multiplier)

if (blood_system && owner.reagents.get_reagent("[owner.blood_id]"))
var/blood2absorb = min(owner.blood_absorption_rate, owner.reagents.get_reagent_amount("[owner.blood_id]")) * reagent_time_multiplier
var/blood2absorb = min(owner.get_blood_absorption_rate(), owner.reagents.get_reagent_amount("[owner.blood_id]")) * reagent_time_multiplier
owner.reagents.remove_reagent("[owner.blood_id]", blood2absorb)
owner.blood_volume += blood2absorb
if (owner.metabolizes && owner.reagents)//idk it runtimes)
Expand Down