From 7b92808a20c123f1ee63ec0b250455fe625c364b Mon Sep 17 00:00:00 2001 From: Atermonera Date: Tue, 2 Oct 2018 00:10:57 -0700 Subject: [PATCH] Merge pull request #5621 from Anewbe/hemophilia Fixes some bloodloss bugs --- code/modules/organs/blood.dm | 16 ++++++----- html/changelogs/Anewbe - Bloodloss.yml | 37 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 html/changelogs/Anewbe - Bloodloss.yml diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 93f7ef495bc..bb38043767d 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -160,17 +160,17 @@ var/const/CE_STABLE_THRESHOLD = 0.5 for(var/datum/wound/W in temp.wounds) if(W.bleeding()) if(W.damage_type == PIERCE) //gunshots and spear stabs bleed more - blood_loss_divisor -= 5 + blood_loss_divisor = max(blood_loss_divisor - 5, 1) else if(W.damage_type == BRUISE) //bruises bleed less - blood_loss_divisor += 5 + blood_loss_divisor = max(blood_loss_divisor + 5, 1) //the farther you get from those vital regions, the less you bleed //depending on how dangerous bleeding turns out to be, it might be better to only apply the reduction to hands and feet if((temp.organ_tag == BP_L_ARM) || (temp.organ_tag == BP_R_ARM) || (temp.organ_tag == BP_L_LEG) || (temp.organ_tag == BP_R_LEG)) - blood_loss_divisor += 5 + blood_loss_divisor = max(blood_loss_divisor + 5, 1) else if((temp.organ_tag == BP_L_HAND) || (temp.organ_tag == BP_R_HAND) || (temp.organ_tag == BP_L_FOOT) || (temp.organ_tag == BP_R_FOOT)) - blood_loss_divisor += 10 + blood_loss_divisor = max(blood_loss_divisor + 10, 1) if(CE_STABLE in chem_effects) //Inaprov slows bloodloss - blood_loss_divisor += 10 + blood_loss_divisor = max(blood_loss_divisor + 10, 1) if(temp.applied_pressure) if(ishuman(temp.applied_pressure)) var/mob/living/carbon/human/H = temp.applied_pressure @@ -198,6 +198,9 @@ var/const/CE_STABLE_THRESHOLD = 0.5 if(!amt) return 0 + if(amt > vessel.get_reagent_amount("blood")) + amt = vessel.get_reagent_amount("blood") - 1 // Bit of a safety net; it's impossible to add blood if there's not blood already in the vessel. + return vessel.remove_reagent("blood",amt * (src.mob_size/MOB_MEDIUM)) /**************************************************** @@ -208,7 +211,8 @@ var/const/CE_STABLE_THRESHOLD = 0.5 /mob/living/carbon/proc/take_blood(obj/item/weapon/reagent_containers/container, var/amount) var/datum/reagent/B = get_blood(container.reagents) - if(!B) B = new /datum/reagent/blood + if(!B) + B = new /datum/reagent/blood B.holder = container B.volume += amount diff --git a/html/changelogs/Anewbe - Bloodloss.yml b/html/changelogs/Anewbe - Bloodloss.yml new file mode 100644 index 00000000000..8ec14a38db5 --- /dev/null +++ b/html/changelogs/Anewbe - Bloodloss.yml @@ -0,0 +1,37 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Anewbe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "You can no longer have ALL of your blood punched out." + - bugfix: "Haemophiliacs will no longer spontaneously have ALL of their blood go missing from ~90%."