From 92e6646a4c53f0414a1fc5766c72de893194cea7 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 5 May 2021 14:44:21 +0300 Subject: [PATCH 01/16] time to make blood even more pain --- code/datums/diseases/advance/symptoms/oxygen.dm | 2 +- .../antagonists/abductor/equipment/glands/heal.dm | 4 ++-- code/modules/antagonists/cult/blood_magic.dm | 4 ++-- code/modules/antagonists/cult/cult_structures.dm | 2 +- .../antagonists/eldritch_cult/eldritch_magic.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 1 + code/modules/mob/living/carbon/human/species.dm | 2 +- .../living/carbon/human/species_types/jellypeople.dm | 10 +++++----- .../mob/living/carbon/human/species_types/vampire.dm | 2 +- code/modules/mob/living/living_defines.dm | 1 + .../reagents/chemistry/reagents/alcohol_reagents.dm | 2 +- .../reagents/chemistry/reagents/medicine_reagents.dm | 6 +++--- .../reagents/chemistry/reagents/other_reagents.dm | 12 ++++++------ .../research/nanites/nanite_programs/healing.dm | 2 +- .../research/xenobiology/crossbreeding/consuming.dm | 2 +- code/modules/research/xenobiology/xenobiology.dm | 2 +- code/modules/surgery/organs/lungs.dm | 2 +- .../code/modules/reagents/chemistry/reagents/SDGF.dm | 8 ++++---- 18 files changed, 34 insertions(+), 32 deletions(-) diff --git a/code/datums/diseases/advance/symptoms/oxygen.dm b/code/datums/diseases/advance/symptoms/oxygen.dm index 24e01dbbaf..a035697a20 100644 --- a/code/datums/diseases/advance/symptoms/oxygen.dm +++ b/code/datums/diseases/advance/symptoms/oxygen.dm @@ -47,7 +47,7 @@ Bonus M.adjustOxyLoss(-7, 0) M.losebreath = max(0, M.losebreath - 4) if(regenerate_blood && M.blood_volume < (BLOOD_VOLUME_NORMAL * M.blood_ratio)) - M.blood_volume += 1 + M.integrating_blood += 1 else if(prob(base_message_chance)) to_chat(M, "[pick("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.")]") diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index 5ea8f77d6c..e596901a58 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -53,7 +53,7 @@ replace_blood() return if(owner.blood_volume < BLOOD_VOLUME_OKAY) - owner.blood_volume = BLOOD_VOLUME_NORMAL + owner.integrating_blood = BLOOD_VOLUME_NORMAL to_chat(owner, "You feel your blood pulsing within you.") return @@ -144,7 +144,7 @@ owner.Stun(15) owner.adjustToxLoss(-15, TRUE, TRUE) - owner.blood_volume = min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20) + owner.integrating_blood = min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20) if(owner.blood_volume < BLOOD_VOLUME_NORMAL) keep_going = TRUE diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 901c83b1b7..b4ff8753f5 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -691,12 +691,12 @@ if(H.blood_volume < (BLOOD_VOLUME_SAFE*H.blood_ratio)) var/restore_blood = (BLOOD_VOLUME_SAFE*H.blood_ratio) - H.blood_volume if(uses*2 < restore_blood) - H.blood_volume += uses*2 + H.integrating_blood += uses*2 to_chat(user,"You use the last of your blood rites to restore what blood you could!") uses = 0 return ..() else - H.blood_volume = (BLOOD_VOLUME_SAFE*H.blood_ratio) + H.integrating_blood = (BLOOD_VOLUME_SAFE*H.blood_ratio) uses -= round(restore_blood/2) to_chat(user,"Your blood rites have restored [H == user ? "your" : "[H.p_their()]"] blood to safe levels!") var/overall_damage = H.getBruteLoss() + H.getFireLoss() + H.getToxLoss() + H.getOxyLoss() diff --git a/code/modules/antagonists/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm index 25fd446b06..15b4ee13f6 100644 --- a/code/modules/antagonists/cult/cult_structures.dm +++ b/code/modules/antagonists/cult/cult_structures.dm @@ -222,7 +222,7 @@ if(M.health < M.maxHealth) M.adjustHealth(-3) if(ishuman(L) && L.blood_volume < (BLOOD_VOLUME_NORMAL * L.blood_ratio)) - L.blood_volume += 1.0 + L.integrating_blood += 1.0 CHECK_TICK if(last_corrupt <= world.time) var/list/validturfs = list() diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm index bb95a8bdf3..0dfedfceb4 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm @@ -147,7 +147,7 @@ carbon_target.blood_volume -= 20 if(carbon_user.blood_volume < BLOOD_VOLUME_MAXIMUM) //we dont want to explode after all - carbon_user.blood_volume += 20 + carbon_user.integrating_blood += 20 return /obj/effect/proc_holder/spell/pointed/blood_siphon/can_target(atom/target, mob/user, silent) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 8660e115a6..78782e1ab6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -823,6 +823,7 @@ dna.remove_mutation(HM.name) if(blood_volume < (BLOOD_VOLUME_NORMAL*blood_ratio)) blood_volume = (BLOOD_VOLUME_NORMAL*blood_ratio) + integrating_blood = 0 ..() /mob/living/carbon/human/check_weakness(obj/item/weapon, mob/living/attacker) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 986fc38cd3..024130b3d3 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1365,7 +1365,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) /datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(chem.type == exotic_blood && !istype(exotic_blood, /datum/reagent/blood)) - H.blood_volume = min(H.blood_volume + round(chem.volume, 0.1), BLOOD_VOLUME_MAXIMUM) + H.integrating_blood = min(H.blood_volume + round(chem.volume, 0.1), BLOOD_VOLUME_MAXIMUM) H.reagents.del_reagent(chem.type) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 7a15fd2e5c..345bc5a19d 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -56,16 +56,16 @@ exotic_blood_color = "#" + H.dna.features["mcolor"] /datum/species/jelly/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for blooduskers + if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for bloodsuckers return if(!H.blood_volume) - H.blood_volume += 5 + H.integrating_blood += 5 H.adjustBruteLoss(5) to_chat(H, "You feel empty!") if(H.blood_volume < (BLOOD_VOLUME_NORMAL * H.blood_ratio)) if(H.nutrition >= NUTRITION_LEVEL_STARVING) - H.blood_volume += 3 + H.integrating_blood += 3 H.nutrition -= 2.5 if(H.blood_volume < (BLOOD_VOLUME_OKAY*H.blood_ratio)) if(prob(5)) @@ -85,7 +85,7 @@ consumed_limb.drop_limb() to_chat(H, "Your [consumed_limb] is drawn back into your body, unable to maintain its shape!") qdel(consumed_limb) - H.blood_volume += 20 + H.integrating_blood += 20 ////////////////////////////////////////////////////////SLIMEPEOPLE/////////////////////////////////////////////////////////////////// @@ -154,7 +154,7 @@ if(prob(5)) to_chat(H, "You feel very bloated!") else if(H.nutrition >= NUTRITION_LEVEL_WELL_FED) - H.blood_volume += 3 + H.integrating_blood += 3 H.nutrition -= 2.5 ..() diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm index 89b3d603ea..fb418a1da4 100644 --- a/code/modules/mob/living/carbon/human/species_types/vampire.dm +++ b/code/modules/mob/living/carbon/human/species_types/vampire.dm @@ -113,7 +113,7 @@ to_chat(victim, "[H] is draining your blood!") to_chat(H, "You drain some blood!") playsound(H, 'sound/items/drink.ogg', 30, 1, -2) - victim.blood_volume = clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) + victim.integrating_blood = clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) H.blood_volume = clamp(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM) if(!victim.blood_volume) to_chat(H, "You finish off [victim]'s blood supply!") diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 386f1174e1..d743d2baea 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -109,6 +109,7 @@ var/stun_absorption = null //converted to a list of stun absorption sources this mob has when one is added var/blood_volume = 0 //how much blood the mob has + var/integrating_blood = 0 //this is the variable you want to affect if you want to give the mob blood, this will slowly turn into normal blood, preventing some cheesyness var/blood_ratio = 1 //How much blood the mob needs, in terms of ratio (i.e 1.2 will require BLOOD_VOLUME_NORMAL of 672) DO NOT GO ABOVE 3.55 Well, actually you can but, then they can't get enough blood. var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index aae21464b1..25c93fdaba 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -574,7 +574,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(AmBloodsucker(C)) disgust_bloodsucker(FALSE, 1) //Bloodsuckers get SOME blood from it, for style reasons. if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.blood_volume = min((BLOOD_VOLUME_NORMAL*C.blood_ratio), C.blood_volume + 3) //Bloody Mary quickly restores blood loss. + C.integrating_blood = min((BLOOD_VOLUME_NORMAL*C.blood_ratio), C.blood_volume + 3) //Bloody Mary quickly restores blood loss. ..() /datum/reagent/consumable/ethanol/brave_bull diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 65443b65c7..436ca1d98f 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -411,7 +411,7 @@ var/amount_to_add = min(M.blood_volume, volume*5) var/new_blood_level = min(M.blood_volume + amount_to_add, maximum_reachable) last_added = new_blood_level - M.blood_volume - M.blood_volume = new_blood_level + extra_regen + M.integrating_blood = new_blood_level + extra_regen if(prob(33)) M.adjustBruteLoss(-0.5*REM, 0) M.adjustFireLoss(-0.5*REM, 0) @@ -1274,7 +1274,7 @@ M.adjustCloneLoss(-3*REM, FALSE) M.adjustStaminaLoss(-25*REM,FALSE) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.blood_volume += 40 // blood fall out man bad + M.integrating_blood += 40 // blood fall out man bad ..() . = 1 @@ -1295,7 +1295,7 @@ M.adjustCloneLoss(-1.25*REM, FALSE) M.adjustStaminaLoss(-4*REM,FALSE) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.blood_volume += 3 + M.integrating_blood += 3 ..() . = 1 diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index fe8f923e1a..d0c08b2326 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -48,7 +48,7 @@ var/mob/living/carbon/C = L var/blood_id = C.get_blood_id() if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) - C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM * C.blood_ratio) + C.integrating_blood = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM * C.blood_ratio) // we don't care about bloodtype here, we're just refilling the mob if(reac_volume >= 10 && istype(L) && method != INJECT) @@ -253,7 +253,7 @@ /datum/reagent/water/on_mob_life(mob/living/carbon/M) . = ..() if(M.blood_volume) - M.blood_volume += 0.1 // water is good for you! + M.integrating_blood += 0.1 // water is good for you! /* * Water reaction to turf @@ -368,7 +368,7 @@ /datum/reagent/water/holywater/on_mob_life(mob/living/carbon/M) if(M.blood_volume) - M.blood_volume += 0.1 // water is good for you! + M.integrating_blood += 0.1 // water is good for you! if(!data) data = list("misc" = 1) data["misc"]++ @@ -454,7 +454,7 @@ M.adjustBruteLoss(-2, FALSE) M.adjustFireLoss(-2, FALSE) if(ishuman(M) && M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.blood_volume += 3 + M.integrating_blood += 3 else // Will deal about 90 damage when 50 units are thrown M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, FALSE) @@ -1144,7 +1144,7 @@ if((HAS_TRAIT(C, TRAIT_NOMARROW))) return if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.blood_volume += 0.25 + C.integrating_blood += 0.25 ..() /datum/reagent/iron/reaction_mob(mob/living/M, method=TOUCH, reac_volume) @@ -2550,7 +2550,7 @@ M.adjustBruteLoss(-3, FALSE) M.adjustFireLoss(-3, FALSE) if(ishuman(M) && M.blood_volume < BLOOD_VOLUME_NORMAL) - M.blood_volume += 3 + M.integrating_blood += 3 else M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, FALSE) diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 920faae928..46d7cb3501 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -107,7 +107,7 @@ /datum/nanite_program/blood_restoring/active_effect() if(iscarbon(host_mob)) var/mob/living/carbon/C = host_mob - C.blood_volume += 2 + C.integrating_blood += 2 /datum/nanite_program/repairing name = "Mechanical Repair" diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index af37a70232..c999a5de8e 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -322,7 +322,7 @@ Consuming extracts: playsound(get_turf(M), 'sound/effects/splat.ogg', 10, 1) if(iscarbon(M)) var/mob/living/carbon/C = M - C.blood_volume += 25 //Half a vampire drain. + C.integrating_blood += 25 //Half a vampire drain. /obj/item/slimecross/consuming/green colour = "green" diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index a8cefd9bed..1195f7e766 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -187,7 +187,7 @@ switch(activation_type) if(SLIME_ACTIVATE_MINOR) user.adjust_nutrition(50) - user.blood_volume += 50 + user.integrating_blood += 50 to_chat(user, "You activate [src], and your body is refilled with fresh slime jelly!") return 150 diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 953c8b2c1b..7768b2c490 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -605,7 +605,7 @@ . = ..() if (breath) var/plasma_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/plasma)) - owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. + owner.integrating_blood += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. /obj/item/organ/lungs/yamerol name = "Yamerol lungs" diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 60c009bc29..6b6c43b36f 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -127,7 +127,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING else to_chat(SM, "While you find your newfound existence strange, you share the same memories as [M.real_name]. However, You find yourself indifferent to the goals you previously had, and take more interest in your newfound independence, but still have an indescribable care for the safety of your original.") log_reagent("FERMICHEM: [SM] ckey: [SM.key]'s is not bound by [M] ckey [M.key]'s will, and is free to determine their own goals, while respecting and acting as their origin.") - + to_chat(SM, "You feel a strange sensation building in your mind as you realise there's two of you. Before you get a chance to think about it, you suddenly split from your old body, and find yourself face to face with your original, a perfect clone of your origin.") SM.client?.change_view(CONFIG_GET(string/default_view)) to_chat(M, "You feel a strange sensation building in your mind as you realise there's two of you. Before you get a chance to think about it, a mass splits from you, and find yourself face to face with yourself.") @@ -226,7 +226,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING M.adjustCloneLoss(-10, 0) //I don't want to make Rezadone obsolete. M.adjustBruteLoss(-25, 0)// Note that this takes a long time to apply and makes you fat and useless when it's in you, I don't think this small burst of healing will be useful considering how long it takes to get there. M.adjustFireLoss(-25, 0) - M.blood_volume += 250 + M.integrating_blood += 250 M.heal_bodypart_damage(1,1) M.action_cooldown_mod = 1 if (M.nutrition < 1500) @@ -236,7 +236,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING to_chat(M, "the cells fail to hold enough mass to generate a clone, instead diffusing into your system.") M.adjustBruteLoss(-10, 0) M.adjustFireLoss(-10, 0) - M.blood_volume += 100 + M.integrating_blood += 100 M.action_cooldown_mod = 1 if (M.nutrition < 1500) M.adjust_nutrition(500) @@ -309,7 +309,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING /datum/reagent/fermi/SDGFheal/on_mob_life(mob/living/carbon/M)//Used to heal the clone after splitting, the clone spawns damaged. (i.e. insentivies players to make more than required, so their clone doesn't have to be treated) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.blood_volume += 10 + M.integrating_blood += 10 M.adjustCloneLoss(-2, 0) M.setOrganLoss(ORGAN_SLOT_BRAIN, -1) M.adjust_nutrition(10) From d9f6e51bc8b7b955677965929690dd2d1f2aef93 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 5 May 2021 15:26:20 +0300 Subject: [PATCH 02/16] making it actually work properly --- code/game/objects/items/devices/scanners.dm | 2 + .../abductor/equipment/glands/heal.dm | 4 +- code/modules/antagonists/cult/blood_magic.dm | 4 +- code/modules/mob/living/blood.dm | 43 +++++++++++-------- .../mob/living/carbon/human/species.dm | 2 +- .../carbon/human/species_types/vampire.dm | 2 +- .../chemistry/reagents/alcohol_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 2 +- .../chemistry/reagents/other_reagents.dm | 2 +- 9 files changed, 35 insertions(+), 28 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 8b5e1edd91..b9ec48a1b4 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -432,6 +432,8 @@ GENETICS SCANNER var/datum/reagent/R = GLOB.chemical_reagents_list[blood_typepath] if(R) blood_type = R.name + if(C.integrating_blood) + msg += "[C.integrating_blood] cl of blood is being integrated into their bloodstream\n" if(C.scan_blood_volume() <= (BLOOD_VOLUME_SAFE*C.blood_ratio) && C.scan_blood_volume() > (BLOOD_VOLUME_OKAY*C.blood_ratio)) msg += "LOW blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" else if(C.scan_blood_volume() <= (BLOOD_VOLUME_OKAY*C.blood_ratio)) diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index e596901a58..5ea8f77d6c 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -53,7 +53,7 @@ replace_blood() return if(owner.blood_volume < BLOOD_VOLUME_OKAY) - owner.integrating_blood = BLOOD_VOLUME_NORMAL + owner.blood_volume = BLOOD_VOLUME_NORMAL to_chat(owner, "You feel your blood pulsing within you.") return @@ -144,7 +144,7 @@ owner.Stun(15) owner.adjustToxLoss(-15, TRUE, TRUE) - owner.integrating_blood = min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20) + owner.blood_volume = min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20) if(owner.blood_volume < BLOOD_VOLUME_NORMAL) keep_going = TRUE diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index b4ff8753f5..901c83b1b7 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -691,12 +691,12 @@ if(H.blood_volume < (BLOOD_VOLUME_SAFE*H.blood_ratio)) var/restore_blood = (BLOOD_VOLUME_SAFE*H.blood_ratio) - H.blood_volume if(uses*2 < restore_blood) - H.integrating_blood += uses*2 + H.blood_volume += uses*2 to_chat(user,"You use the last of your blood rites to restore what blood you could!") uses = 0 return ..() else - H.integrating_blood = (BLOOD_VOLUME_SAFE*H.blood_ratio) + H.blood_volume = (BLOOD_VOLUME_SAFE*H.blood_ratio) uses -= round(restore_blood/2) to_chat(user,"Your blood rites have restored [H == user ? "your" : "[H.p_their()]"] blood to safe levels!") var/overall_damage = H.getBruteLoss() + H.getFireLoss() + H.getToxLoss() + H.getOxyLoss() diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index cf1a158fc5..41265c384a 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -39,26 +39,31 @@ return if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. - //Blood regeneration if there is some space - if(blood_volume < BLOOD_VOLUME_NORMAL && !HAS_TRAIT(src, TRAIT_NOHUNGER)) + if(blood_volume < BLOOD_VOLUME_NORMAL) var/nutrition_ratio = 0 - switch(nutrition) - if(0 to NUTRITION_LEVEL_STARVING) - nutrition_ratio = 0.2 - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - nutrition_ratio = 0.4 - if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) - nutrition_ratio = 0.6 - if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) - nutrition_ratio = 0.8 - else - nutrition_ratio = 1 - if(satiety > 80) - nutrition_ratio *= 1.25 - adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) - blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) - + if(integrating_blood) //Do we have blood to normalize in our system? + integrating_blood -- + blood_volume ++ + if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) + switch(nutrition) + if(0 to NUTRITION_LEVEL_STARVING) + nutrition_ratio = 0.2 + if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) + nutrition_ratio = 0.4 + if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) + nutrition_ratio = 0.6 + if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) + nutrition_ratio = 0.8 + else + nutrition_ratio = 1 + if(satiety > 80) + nutrition_ratio *= 1.25 + adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) + blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) + else + if(integrating_blood) + integrating_blood -- //Effects of bloodloss var/word = pick("dizzy","woozy","faint") switch(blood_volume) @@ -368,7 +373,7 @@ return blood_ratio = 1 -/mob/living/proc/AdjustBloodVol(var/value) +/mob/living/proc/AdjustBloodVol(value) if(blood_ratio == value) return blood_ratio = value diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 024130b3d3..a65f84c7f4 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1365,7 +1365,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) /datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(chem.type == exotic_blood && !istype(exotic_blood, /datum/reagent/blood)) - H.integrating_blood = min(H.blood_volume + round(chem.volume, 0.1), BLOOD_VOLUME_MAXIMUM) + H.integrating_blood += round(chem.volume, 0.1)) H.reagents.del_reagent(chem.type) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm index fb418a1da4..89b3d603ea 100644 --- a/code/modules/mob/living/carbon/human/species_types/vampire.dm +++ b/code/modules/mob/living/carbon/human/species_types/vampire.dm @@ -113,7 +113,7 @@ to_chat(victim, "[H] is draining your blood!") to_chat(H, "You drain some blood!") playsound(H, 'sound/items/drink.ogg', 30, 1, -2) - victim.integrating_blood = clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) + victim.blood_volume = clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) H.blood_volume = clamp(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM) if(!victim.blood_volume) to_chat(H, "You finish off [victim]'s blood supply!") diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 25c93fdaba..3725445023 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -574,7 +574,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(AmBloodsucker(C)) disgust_bloodsucker(FALSE, 1) //Bloodsuckers get SOME blood from it, for style reasons. if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.integrating_blood = min((BLOOD_VOLUME_NORMAL*C.blood_ratio), C.blood_volume + 3) //Bloody Mary quickly restores blood loss. + C.integrating_blood += 3 //Bloody Mary quickly restores blood loss. ..() /datum/reagent/consumable/ethanol/brave_bull diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 436ca1d98f..d5d4e733c4 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -411,7 +411,7 @@ var/amount_to_add = min(M.blood_volume, volume*5) var/new_blood_level = min(M.blood_volume + amount_to_add, maximum_reachable) last_added = new_blood_level - M.blood_volume - M.integrating_blood = new_blood_level + extra_regen + M.integrating_blood += extra_regen if(prob(33)) M.adjustBruteLoss(-0.5*REM, 0) M.adjustFireLoss(-0.5*REM, 0) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index d0c08b2326..4bd66d8982 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -48,7 +48,7 @@ var/mob/living/carbon/C = L var/blood_id = C.get_blood_id() if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) - C.integrating_blood = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM * C.blood_ratio) + C.integrating_blood += round(reac_volume, 0.1) // we don't care about bloodtype here, we're just refilling the mob if(reac_volume >= 10 && istype(L) && method != INJECT) From 28205f9dce7337fc58caa7bbf89fe054ab02ffc7 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 5 May 2021 17:41:37 +0300 Subject: [PATCH 03/16] More fixes to make it work --- .../antagonists/bloodsucker/bloodsucker_life.dm | 1 + code/modules/mob/living/blood.dm | 10 ++++++++-- code/modules/mob/living/carbon/human/species.dm | 2 +- .../reagents/chemistry/reagents/medicine_reagents.dm | 7 ++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm index 3e358cd795..29e64a4913 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm @@ -89,6 +89,7 @@ owner.current.adjustStaminaLoss(-1.5 + (actual_regen * -7) * mult, 0) // Humans lose stamina damage really quickly. Vamps should heal more. owner.current.adjustCloneLoss(-0.1 * (actual_regen * 2) * mult, 0) owner.current.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1 * (actual_regen * 4) * mult) + owner.current.integrating_blood = 0 // No Bleeding /*if(ishuman(owner.current)) //NOTE Current bleeding is horrible, not to count the amount of blood ballistics delete. var/mob/living/carbon/human/H = owner.current diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 41265c384a..5e25888851 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -39,12 +39,13 @@ return if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. + integrating_blood -- //Blood regeneration if there is some space if(blood_volume < BLOOD_VOLUME_NORMAL) var/nutrition_ratio = 0 if(integrating_blood) //Do we have blood to normalize in our system? - integrating_blood -- blood_volume ++ + //vomit(blood = TRUE) //Too much, just too much if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) switch(nutrition) if(0 to NUTRITION_LEVEL_STARVING) @@ -64,9 +65,14 @@ else if(integrating_blood) integrating_blood -- + if(integrating_blood > BLOOD_VOLUME_NORMAL) //Let's not allow too much + integrating_blood = BLOOD_VOLUME_NORMAL + if(integrating_blood > blood_volume) + integrating_blood = BLOOD_VOLUME_NORMAL - //Effects of bloodloss var/word = pick("dizzy","woozy","faint") - switch(blood_volume) + var/blood_effect_volume = blood_volume + integrating_blood + switch(blood_effect_volume) if(BLOOD_VOLUME_MAXIMUM to BLOOD_VOLUME_EXCESS) if(prob(10)) to_chat(src, "You feel terribly bloated.") diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index a65f84c7f4..7e47efdcad 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1365,7 +1365,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) /datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(chem.type == exotic_blood && !istype(exotic_blood, /datum/reagent/blood)) - H.integrating_blood += round(chem.volume, 0.1)) + H.integrating_blood += round(chem.volume, 0.1) H.reagents.del_reagent(chem.type) return TRUE return FALSE diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index d5d4e733c4..084c81f7d3 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -405,13 +405,10 @@ if((HAS_TRAIT(M, TRAIT_NOMARROW))) return if(last_added) - M.blood_volume -= last_added + M.integrating_blood -= min(M.integrating_blood, last_added) last_added = 0 if(M.blood_volume < maximum_reachable) //Can only up to double your effective blood level. - var/amount_to_add = min(M.blood_volume, volume*5) - var/new_blood_level = min(M.blood_volume + amount_to_add, maximum_reachable) - last_added = new_blood_level - M.blood_volume - M.integrating_blood += extra_regen + last_added = volume * 5 if(prob(33)) M.adjustBruteLoss(-0.5*REM, 0) M.adjustFireLoss(-0.5*REM, 0) From 35bfba1f6aa45b79a96588a102c127f9662e5ddf Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 5 May 2021 18:15:13 +0300 Subject: [PATCH 04/16] Redoes the variable changes into procs --- code/datums/diseases/advance/symptoms/oxygen.dm | 2 +- code/modules/antagonists/cult/cult_structures.dm | 2 +- .../antagonists/eldritch_cult/eldritch_magic.dm | 2 +- code/modules/mob/living/blood.dm | 16 +++++++--------- code/modules/mob/living/carbon/human/species.dm | 2 +- .../carbon/human/species_types/jellypeople.dm | 8 ++++---- code/modules/mob/living/living_defines.dm | 2 +- .../chemistry/reagents/alcohol_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 5 +++-- .../chemistry/reagents/other_reagents.dm | 12 ++++++------ .../research/nanites/nanite_programs/healing.dm | 2 +- .../xenobiology/crossbreeding/consuming.dm | 2 +- code/modules/research/xenobiology/xenobiology.dm | 2 +- code/modules/surgery/organs/lungs.dm | 2 +- .../modules/reagents/chemistry/reagents/SDGF.dm | 6 +++--- 15 files changed, 33 insertions(+), 34 deletions(-) diff --git a/code/datums/diseases/advance/symptoms/oxygen.dm b/code/datums/diseases/advance/symptoms/oxygen.dm index a035697a20..d00761dbf9 100644 --- a/code/datums/diseases/advance/symptoms/oxygen.dm +++ b/code/datums/diseases/advance/symptoms/oxygen.dm @@ -47,7 +47,7 @@ Bonus M.adjustOxyLoss(-7, 0) M.losebreath = max(0, M.losebreath - 4) if(regenerate_blood && M.blood_volume < (BLOOD_VOLUME_NORMAL * M.blood_ratio)) - M.integrating_blood += 1 + M.AddIntegrationBlood(1) else if(prob(base_message_chance)) to_chat(M, "[pick("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.")]") diff --git a/code/modules/antagonists/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm index 15b4ee13f6..21e19ef739 100644 --- a/code/modules/antagonists/cult/cult_structures.dm +++ b/code/modules/antagonists/cult/cult_structures.dm @@ -222,7 +222,7 @@ if(M.health < M.maxHealth) M.adjustHealth(-3) if(ishuman(L) && L.blood_volume < (BLOOD_VOLUME_NORMAL * L.blood_ratio)) - L.integrating_blood += 1.0 + L.AddIntegrationBlood(1) CHECK_TICK if(last_corrupt <= world.time) var/list/validturfs = list() diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm index 0dfedfceb4..bb37135155 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm @@ -147,7 +147,7 @@ carbon_target.blood_volume -= 20 if(carbon_user.blood_volume < BLOOD_VOLUME_MAXIMUM) //we dont want to explode after all - carbon_user.integrating_blood += 20 + carbon_user.AddIntegrationBlood(20) return /obj/effect/proc_holder/spell/pointed/blood_siphon/can_target(atom/target, mob/user, silent) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 5e25888851..e655e0c213 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -39,13 +39,13 @@ return if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. - integrating_blood -- + if(integrating_blood) + integrating_blood -- //Blood regeneration if there is some space if(blood_volume < BLOOD_VOLUME_NORMAL) var/nutrition_ratio = 0 if(integrating_blood) //Do we have blood to normalize in our system? blood_volume ++ - //vomit(blood = TRUE) //Too much, just too much if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) switch(nutrition) if(0 to NUTRITION_LEVEL_STARVING) @@ -62,13 +62,7 @@ nutrition_ratio *= 1.25 adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) - else - if(integrating_blood) - integrating_blood -- - if(integrating_blood > BLOOD_VOLUME_NORMAL) //Let's not allow too much - integrating_blood = BLOOD_VOLUME_NORMAL - if(integrating_blood > blood_volume) - integrating_blood = BLOOD_VOLUME_NORMAL - + //Effects of bloodloss var/word = pick("dizzy","woozy","faint") var/blood_effect_volume = blood_volume + integrating_blood @@ -386,3 +380,7 @@ if(ishuman(src)) var/mob/living/carbon/human/H = src H.handle_blood() + +/mob/living/proc/AddIntegrationBlood(value) + if(blood_volume + integrating_blood < BLOOD_VOLUME_NORMAL) + integrating_blood += value diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 7e47efdcad..41b04ca0bc 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1365,7 +1365,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) /datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(chem.type == exotic_blood && !istype(exotic_blood, /datum/reagent/blood)) - H.integrating_blood += round(chem.volume, 0.1) + H.AddIntegrationBlood(round(chem.volume, 0.1)) H.reagents.del_reagent(chem.type) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 345bc5a19d..772e128d67 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -59,13 +59,13 @@ if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for bloodsuckers return if(!H.blood_volume) - H.integrating_blood += 5 + H.AddIntegrationBlood(5) H.adjustBruteLoss(5) to_chat(H, "You feel empty!") if(H.blood_volume < (BLOOD_VOLUME_NORMAL * H.blood_ratio)) if(H.nutrition >= NUTRITION_LEVEL_STARVING) - H.integrating_blood += 3 + H.AddIntegrationBlood(3) H.nutrition -= 2.5 if(H.blood_volume < (BLOOD_VOLUME_OKAY*H.blood_ratio)) if(prob(5)) @@ -85,7 +85,7 @@ consumed_limb.drop_limb() to_chat(H, "Your [consumed_limb] is drawn back into your body, unable to maintain its shape!") qdel(consumed_limb) - H.integrating_blood += 20 + H.AddIntegrationBlood(20) ////////////////////////////////////////////////////////SLIMEPEOPLE/////////////////////////////////////////////////////////////////// @@ -154,7 +154,7 @@ if(prob(5)) to_chat(H, "You feel very bloated!") else if(H.nutrition >= NUTRITION_LEVEL_WELL_FED) - H.integrating_blood += 3 + H.AddIntegrationBlood(3) H.nutrition -= 2.5 ..() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index d743d2baea..d45d662de3 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -109,7 +109,7 @@ var/stun_absorption = null //converted to a list of stun absorption sources this mob has when one is added var/blood_volume = 0 //how much blood the mob has - var/integrating_blood = 0 //this is the variable you want to affect if you want to give the mob blood, this will slowly turn into normal blood, preventing some cheesyness + var/integrating_blood = 0 //this is the variable you want to affect if you want to give the mob blood, this will slowly turn into normal blood, preventing some cheesyness, use AddIntegrationBlood() instead of modifying directly var/blood_ratio = 1 //How much blood the mob needs, in terms of ratio (i.e 1.2 will require BLOOD_VOLUME_NORMAL of 672) DO NOT GO ABOVE 3.55 Well, actually you can but, then they can't get enough blood. var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 3725445023..a6bf499bc6 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -574,7 +574,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(AmBloodsucker(C)) disgust_bloodsucker(FALSE, 1) //Bloodsuckers get SOME blood from it, for style reasons. if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.integrating_blood += 3 //Bloody Mary quickly restores blood loss. + C.AddIntegrationBlood(3) //Bloody Mary quickly restores blood loss. ..() /datum/reagent/consumable/ethanol/brave_bull diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 084c81f7d3..e7b42c694f 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -409,6 +409,7 @@ last_added = 0 if(M.blood_volume < maximum_reachable) //Can only up to double your effective blood level. last_added = volume * 5 + M.AddIntegrationBlood(last_added) if(prob(33)) M.adjustBruteLoss(-0.5*REM, 0) M.adjustFireLoss(-0.5*REM, 0) @@ -1271,7 +1272,7 @@ M.adjustCloneLoss(-3*REM, FALSE) M.adjustStaminaLoss(-25*REM,FALSE) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.integrating_blood += 40 // blood fall out man bad + M.AddIntegrationBlood(40) // blood fall out man bad ..() . = 1 @@ -1292,7 +1293,7 @@ M.adjustCloneLoss(-1.25*REM, FALSE) M.adjustStaminaLoss(-4*REM,FALSE) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.integrating_blood += 3 + M.AddIntegrationBlood(3) ..() . = 1 diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 4bd66d8982..4f6550dc86 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -48,7 +48,7 @@ var/mob/living/carbon/C = L var/blood_id = C.get_blood_id() if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) - C.integrating_blood += round(reac_volume, 0.1) + C.AddIntegrationBlood(round(reac_volume, 0.1)) // we don't care about bloodtype here, we're just refilling the mob if(reac_volume >= 10 && istype(L) && method != INJECT) @@ -253,7 +253,7 @@ /datum/reagent/water/on_mob_life(mob/living/carbon/M) . = ..() if(M.blood_volume) - M.integrating_blood += 0.1 // water is good for you! + M.AddIntegrationBlood(0.1) // water is good for you! /* * Water reaction to turf @@ -368,7 +368,7 @@ /datum/reagent/water/holywater/on_mob_life(mob/living/carbon/M) if(M.blood_volume) - M.integrating_blood += 0.1 // water is good for you! + M.AddIntegrationBlood(0.1) // water is good for you! if(!data) data = list("misc" = 1) data["misc"]++ @@ -454,7 +454,7 @@ M.adjustBruteLoss(-2, FALSE) M.adjustFireLoss(-2, FALSE) if(ishuman(M) && M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.integrating_blood += 3 + M.AddIntegrationBlood(3) else // Will deal about 90 damage when 50 units are thrown M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, FALSE) @@ -1144,7 +1144,7 @@ if((HAS_TRAIT(C, TRAIT_NOMARROW))) return if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.integrating_blood += 0.25 + C.AddIntegrationBlood(0.25) ..() /datum/reagent/iron/reaction_mob(mob/living/M, method=TOUCH, reac_volume) @@ -2550,7 +2550,7 @@ M.adjustBruteLoss(-3, FALSE) M.adjustFireLoss(-3, FALSE) if(ishuman(M) && M.blood_volume < BLOOD_VOLUME_NORMAL) - M.integrating_blood += 3 + M.AddIntegrationBlood(3) else M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, FALSE) diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 46d7cb3501..bb36474565 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -107,7 +107,7 @@ /datum/nanite_program/blood_restoring/active_effect() if(iscarbon(host_mob)) var/mob/living/carbon/C = host_mob - C.integrating_blood += 2 + C.AddIntegrationBlood(2) /datum/nanite_program/repairing name = "Mechanical Repair" diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index c999a5de8e..26e2a63634 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -322,7 +322,7 @@ Consuming extracts: playsound(get_turf(M), 'sound/effects/splat.ogg', 10, 1) if(iscarbon(M)) var/mob/living/carbon/C = M - C.integrating_blood += 25 //Half a vampire drain. + C.AddIntegrationBlood(25) //Half a vampire drain. /obj/item/slimecross/consuming/green colour = "green" diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 1195f7e766..2340946c46 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -187,7 +187,7 @@ switch(activation_type) if(SLIME_ACTIVATE_MINOR) user.adjust_nutrition(50) - user.integrating_blood += 50 + user.AddIntegrationBlood(50) to_chat(user, "You activate [src], and your body is refilled with fresh slime jelly!") return 150 diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 7768b2c490..d40c7984f2 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -605,7 +605,7 @@ . = ..() if (breath) var/plasma_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/plasma)) - owner.integrating_blood += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. + owner.AddIntegrationBlood(0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. /obj/item/organ/lungs/yamerol name = "Yamerol lungs" diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 6b6c43b36f..be590ef4c3 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -226,7 +226,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING M.adjustCloneLoss(-10, 0) //I don't want to make Rezadone obsolete. M.adjustBruteLoss(-25, 0)// Note that this takes a long time to apply and makes you fat and useless when it's in you, I don't think this small burst of healing will be useful considering how long it takes to get there. M.adjustFireLoss(-25, 0) - M.integrating_blood += 250 + M.AddIntegrationBlood(250) M.heal_bodypart_damage(1,1) M.action_cooldown_mod = 1 if (M.nutrition < 1500) @@ -236,7 +236,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING to_chat(M, "the cells fail to hold enough mass to generate a clone, instead diffusing into your system.") M.adjustBruteLoss(-10, 0) M.adjustFireLoss(-10, 0) - M.integrating_blood += 100 + M.AddIntegrationBlood(100) M.action_cooldown_mod = 1 if (M.nutrition < 1500) M.adjust_nutrition(500) @@ -309,7 +309,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING /datum/reagent/fermi/SDGFheal/on_mob_life(mob/living/carbon/M)//Used to heal the clone after splitting, the clone spawns damaged. (i.e. insentivies players to make more than required, so their clone doesn't have to be treated) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.integrating_blood += 10 + M.AddIntegrationBlood(10) M.adjustCloneLoss(-2, 0) M.setOrganLoss(ORGAN_SLOT_BRAIN, -1) M.adjust_nutrition(10) From cc59e2c225b34bf1679367c50b4ac676ee78ae27 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 5 May 2021 20:40:52 +0300 Subject: [PATCH 05/16] feedback changes --- code/modules/mob/living/blood.dm | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index e655e0c213..1212bd695a 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -99,14 +99,22 @@ bleed(temp_bleed) //Makes a blood drop, leaking amt units of blood from the mob -/mob/living/carbon/proc/bleed(amt) - if(blood_volume) +/mob/living/carbon/proc/bleed(amt, force) + var/bled = FALSE //Have we bled amnt? + if(blood_volume > amnt) blood_volume = max(blood_volume - amt, 0) - if(isturf(src.loc)) //Blood loss still happens in locker, floor stays clean - if(amt >= 10) - add_splatter_floor(src.loc) - else - add_splatter_floor(src.loc, 1) + bled = TRUE + if(integrating_blood > amnt) + integrating_blood = max(integrating_blood - amt, 0) + bled = TRUE + if(!bled && !force) //If we are already cycling back through, don't do this again + bleed(amt, TRUE) //we cycle back through to try to bleed SOMETHING, not neccesarily the required amount + return + if(isturf(src.loc)) //Blood loss still happens in locker, floor stays clean + if(amt >= 10) + add_splatter_floor(src.loc) + else + add_splatter_floor(src.loc, TRUE) /mob/living/carbon/human/bleed(amt) amt *= physiology.bleed_mod @@ -119,6 +127,7 @@ /mob/living/proc/restore_blood() blood_volume = initial(blood_volume) + integrating_blood = 0 /mob/living/carbon/restore_blood() blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio) @@ -381,6 +390,9 @@ var/mob/living/carbon/human/H = src H.handle_blood() -/mob/living/proc/AddIntegrationBlood(value) - if(blood_volume + integrating_blood < BLOOD_VOLUME_NORMAL) +/mob/living/proc/AddIntegrationBlood(value, force) + var/species_maxblood = BLOOD_VOLUME_NORMAL + if(isslimeperson(src) || isvampire(src)) + species_maxblood = BLOOD_VOLUME_MAXIMUM + if(blood_volume + integrating_blood < species_maxblood || force) integrating_blood += value From 8a3dd8515ef6b654760d97630b975d8b4df9a9ac Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 5 May 2021 21:42:14 +0300 Subject: [PATCH 06/16] fixes bleeding properly --- code/modules/mob/living/blood.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 1212bd695a..e07f4df3ab 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -101,10 +101,10 @@ //Makes a blood drop, leaking amt units of blood from the mob /mob/living/carbon/proc/bleed(amt, force) var/bled = FALSE //Have we bled amnt? - if(blood_volume > amnt) + if(blood_volume > amt || force && blood_volume) blood_volume = max(blood_volume - amt, 0) bled = TRUE - if(integrating_blood > amnt) + if(integrating_blood > amt || force && integrating_blood) integrating_blood = max(integrating_blood - amt, 0) bled = TRUE if(!bled && !force) //If we are already cycling back through, don't do this again From b671b422b3e5e3400ed22b9a4d1ccd3adf80b3b5 Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 12 May 2021 22:50:45 +0300 Subject: [PATCH 07/16] let's actually make it possible to gain actual blood if you're at 1 integrating blud --- code/modules/mob/living/blood.dm | 39 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index e07f4df3ab..15871463e2 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -41,27 +41,26 @@ if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. if(integrating_blood) integrating_blood -- - //Blood regeneration if there is some space - if(blood_volume < BLOOD_VOLUME_NORMAL) - var/nutrition_ratio = 0 - if(integrating_blood) //Do we have blood to normalize in our system? + //Blood regeneration if there is some space + if(blood_volume < BLOOD_VOLUME_NORMAL) + var/nutrition_ratio = 0 blood_volume ++ - if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) - switch(nutrition) - if(0 to NUTRITION_LEVEL_STARVING) - nutrition_ratio = 0.2 - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - nutrition_ratio = 0.4 - if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) - nutrition_ratio = 0.6 - if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) - nutrition_ratio = 0.8 - else - nutrition_ratio = 1 - if(satiety > 80) - nutrition_ratio *= 1.25 - adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) - blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) + if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) + switch(nutrition) + if(0 to NUTRITION_LEVEL_STARVING) + nutrition_ratio = 0.2 + if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) + nutrition_ratio = 0.4 + if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) + nutrition_ratio = 0.6 + if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) + nutrition_ratio = 0.8 + else + nutrition_ratio = 1 + if(satiety > 80) + nutrition_ratio *= 1.25 + adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) + blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) //Effects of bloodloss var/word = pick("dizzy","woozy","faint") From 25371102f8deaf00c44bc521efb4ebee96272753 Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 14 May 2021 00:06:14 +0300 Subject: [PATCH 08/16] oh my god why are negatives truthy --- code/modules/mob/living/blood.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 15871463e2..812cf74424 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -39,8 +39,8 @@ return if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. - if(integrating_blood) - integrating_blood -- + if(integrating_blood > 0) + integrating_blood = max(integrating_blood - 1, 0) //Blood regeneration if there is some space if(blood_volume < BLOOD_VOLUME_NORMAL) var/nutrition_ratio = 0 From be1e9e4e04509bbebaf38b80fd477c57c15dc4b0 Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 23 Jul 2021 18:53:48 +0300 Subject: [PATCH 09/16] deals with conflicts --- code/modules/antagonists/cult/cult_structures.dm | 2 +- code/modules/surgery/organs/lungs.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/antagonists/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm index a0093e4da1..baf62fe6ad 100644 --- a/code/modules/antagonists/cult/cult_structures.dm +++ b/code/modules/antagonists/cult/cult_structures.dm @@ -219,7 +219,7 @@ if(M.health < M.maxHealth) M.adjustHealth(-3) if(ishuman(L) && L.blood_volume < (BLOOD_VOLUME_NORMAL * L.blood_ratio)) - L.blood_volume += 1.0 + L.AddIntegrationBlood(1.0) CHECK_TICK diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 536b70044f..00f154739c 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -533,7 +533,7 @@ var/total_moles = breath.total_moles() var/pressure = breath.return_pressure() var/plasma_pp = PP(breath, GAS_PLASMA) - owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. + owner.AddIntegrationBlood(0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. /obj/item/organ/lungs/yamerol name = "Yamerol lungs" From 67de120624e293f1cad7f96936785f48b1f9b1c6 Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 23 Jul 2021 18:58:42 +0300 Subject: [PATCH 10/16] Replaces a few more direct blood refillers --- code/modules/antagonists/abductor/equipment/glands/heal.dm | 2 +- code/modules/mob/living/carbon/alien/organs.dm | 2 +- code/modules/mob/living/simple_animal/hostile/cat_butcher.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index 5ea8f77d6c..7d7cf1c0a7 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -144,7 +144,7 @@ owner.Stun(15) owner.adjustToxLoss(-15, TRUE, TRUE) - owner.blood_volume = min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20) + owner.AddIntegrationBlood(min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20)) if(owner.blood_volume < BLOOD_VOLUME_NORMAL) keep_going = TRUE diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index 8e3966eb03..f8d9abd75b 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -85,7 +85,7 @@ owner.adjustOxyLoss(-heal_amt) owner.adjustCloneLoss(-heal_amt) if(owner.blood_volume && (owner.blood_volume < BLOOD_VOLUME_NORMAL)) - owner.blood_volume += 5 + owner.AddIntegrationBlood(5) else owner.adjustPlasma(plasma_rate * 0.1) diff --git a/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm b/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm index 6950c6409f..f9072f3934 100644 --- a/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm +++ b/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm @@ -94,7 +94,7 @@ L.SetUnconscious(0, FALSE) L.adjustOxyLoss(-50)// do CPR first if(L.blood_volume <= 500) //bandage them up and give em some blood if they're bleeding - L.blood_volume += 30 + L.AddIntegrationBlood(30) L.bleedsuppress = 0 if(L.getBruteLoss() >= 50)// first, did we beat them into crit? if so, heal that var/healing = min(L.getBruteLoss(), 120) From 2fec997e1fcb62a9a434735282c19a3d75851225 Mon Sep 17 00:00:00 2001 From: Artur <24881678+Arturlang@users.noreply.github.com> Date: Thu, 29 Jul 2021 20:12:38 +0300 Subject: [PATCH 11/16] No longer neccesary --- code/modules/reagents/chemistry/reagents/medicine_reagents.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 263bd15730..1ccda4812d 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -398,7 +398,6 @@ taste_description = "sweetness and salt" var/last_added = 0 var/maximum_reachable = BLOOD_VOLUME_NORMAL - 10 //So that normal blood regeneration can continue with salglu active - var/extra_regen = 0.25 // in addition to acting as temporary blood, also add this much to their actual blood per tick pH = 5.5 /datum/reagent/medicine/salglu_solution/on_mob_life(mob/living/carbon/M) From 6b5bdae1846be58b8747857f2fe72410c2525080 Mon Sep 17 00:00:00 2001 From: Artur <24881678+Arturlang@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:55:27 +0300 Subject: [PATCH 12/16] salglu works like normal now again and adds more sanity --- .../abductor/equipment/glands/heal.dm | 2 +- code/modules/antagonists/cult/blood_magic.dm | 6 +-- code/modules/mob/living/blood.dm | 48 +++++++++---------- code/modules/mob/living/carbon/carbon.dm | 3 ++ .../mob/living/carbon/human/human_helpers.dm | 5 ++ .../chemistry/reagents/medicine_reagents.dm | 12 +++-- 6 files changed, 43 insertions(+), 33 deletions(-) diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index 7d7cf1c0a7..1227f3bd78 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -144,7 +144,7 @@ owner.Stun(15) owner.adjustToxLoss(-15, TRUE, TRUE) - owner.AddIntegrationBlood(min(BLOOD_VOLUME_NORMAL, owner.blood_volume + 20)) + owner.AddIntegrationBlood(20) if(owner.blood_volume < BLOOD_VOLUME_NORMAL) keep_going = TRUE diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 568f01ab83..6f6f43cd96 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -687,10 +687,10 @@ if(H.stat == DEAD) to_chat(user,"Only a revive rune can bring back the dead!") return - if(H.blood_volume < (BLOOD_VOLUME_SAFE*H.blood_ratio)) + if(H.functional_blood() < (BLOOD_VOLUME_SAFE*H.blood_ratio)) var/restore_blood = (BLOOD_VOLUME_SAFE*H.blood_ratio) - H.blood_volume - if(uses*2 < restore_blood) - H.blood_volume += uses*2 + if(uses * 2 < restore_blood) + H.AddIntegrationBlood(uses * 2) to_chat(user,"You use the last of your blood rites to restore what blood you could!") uses = 0 return ..() diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 812cf74424..256f869198 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -40,27 +40,28 @@ if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. if(integrating_blood > 0) - integrating_blood = max(integrating_blood - 1, 0) - //Blood regeneration if there is some space - if(blood_volume < BLOOD_VOLUME_NORMAL) - var/nutrition_ratio = 0 + var/integrated_blood = max(integrating_blood - 1, 0) + integrating_blood = integrated_blood + if(blood_volume < BLOOD_VOLUME_MAXIMUM) blood_volume ++ - if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) - switch(nutrition) - if(0 to NUTRITION_LEVEL_STARVING) - nutrition_ratio = 0.2 - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - nutrition_ratio = 0.4 - if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) - nutrition_ratio = 0.6 - if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) - nutrition_ratio = 0.8 - else - nutrition_ratio = 1 - if(satiety > 80) - nutrition_ratio *= 1.25 - adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) - blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) + if(blood_volume < BLOOD_VOLUME_NORMAL) + var/nutrition_ratio = 0 + if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) + switch(nutrition) + if(0 to NUTRITION_LEVEL_STARVING) + nutrition_ratio = 0.2 + if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) + nutrition_ratio = 0.4 + if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) + nutrition_ratio = 0.6 + if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) + nutrition_ratio = 0.8 + else + nutrition_ratio = 1 + if(satiety > 80) + nutrition_ratio *= 1.25 + adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) + blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) //Effects of bloodloss var/word = pick("dizzy","woozy","faint") @@ -390,8 +391,7 @@ H.handle_blood() /mob/living/proc/AddIntegrationBlood(value, force) - var/species_maxblood = BLOOD_VOLUME_NORMAL - if(isslimeperson(src) || isvampire(src)) - species_maxblood = BLOOD_VOLUME_MAXIMUM - if(blood_volume + integrating_blood < species_maxblood || force) + if(value < 0 && integrating_blood < value) //Remove the normal blood of the carbon if we can't afford it with integrating_blood + blood_volume = min(blood_volume, value) + if(integrating_blood < blood_volume + BLOOD_VOLUME_NORMAL || force) integrating_blood += value diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 44379660b6..bd966599c8 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1273,3 +1273,6 @@ var/mob/living/carbon/C = usr if(I.can_give()) C.give(src) + +/mob/living/carbon/proc/functional_blood() + return blood_volume + integrating_blood diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 7e3b2ab015..c732a754fc 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -182,3 +182,8 @@ destination.underwear = underwear destination.undershirt = undershirt destination.socks = socks + +/mob/living/carbon/human/AddIntegrationBlood(value, force) + if(NOBLOOD in dna.species.species_traits) //Can't lose blood if your species doesn't have any + return + . = ..() diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 1ccda4812d..d1395c7386 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -396,19 +396,21 @@ metabolization_rate = 0.5 * REAGENTS_METABOLISM overdose_threshold = 60 taste_description = "sweetness and salt" + var/extra_regen = 0.25 // in addition to acting as temporary blood, also add this much to their actual blood per tick var/last_added = 0 var/maximum_reachable = BLOOD_VOLUME_NORMAL - 10 //So that normal blood regeneration can continue with salglu active pH = 5.5 -/datum/reagent/medicine/salglu_solution/on_mob_life(mob/living/carbon/M) +/datum/reagent/medicine/salglu_solution/on_mob_life(mob/living/carbon/human/M) if((HAS_TRAIT(M, TRAIT_NOMARROW))) return if(last_added) - M.integrating_blood -= min(M.integrating_blood, last_added) + M.AddIntegrationBlood(-last_added) last_added = 0 - if(M.blood_volume < maximum_reachable) //Can only up to double your effective blood level. - last_added = volume * 5 - M.AddIntegrationBlood(last_added) + if(M.functional_blood() < maximum_reachable) //Can only up to double your effective blood level. + var/new_blood_level = min(volume * 5, maximum_reachable) + last_added = new_blood_level + M.AddIntegrationBlood(new_blood_level + (extra_regen * REM)) if(prob(33)) M.adjustBruteLoss(-0.5*REM, 0) M.adjustFireLoss(-0.5*REM, 0) From 5acd7fef2dbafb9f7fdfd6196afb534980675f38 Mon Sep 17 00:00:00 2001 From: Artur <24881678+Arturlang@users.noreply.github.com> Date: Mon, 2 Aug 2021 21:54:47 +0300 Subject: [PATCH 13/16] makes salglu not deadly --- .../diseases/advance/symptoms/oxygen.dm | 2 +- code/game/objects/items/devices/scanners.dm | 17 +++++----- .../abductor/equipment/glands/heal.dm | 2 +- code/modules/antagonists/cult/blood_magic.dm | 2 +- .../antagonists/cult/cult_structures.dm | 2 +- .../eldritch_cult/eldritch_magic.dm | 2 +- code/modules/mob/living/blood.dm | 11 ++++--- .../modules/mob/living/carbon/alien/organs.dm | 2 +- .../mob/living/carbon/human/human_helpers.dm | 2 +- .../mob/living/carbon/human/species.dm | 2 +- .../carbon/human/species_types/jellypeople.dm | 8 ++--- code/modules/mob/living/living_defines.dm | 2 +- .../simple_animal/hostile/cat_butcher.dm | 2 +- .../chemistry/reagents/alcohol_reagents.dm | 4 +-- .../chemistry/reagents/medicine_reagents.dm | 31 ++++++++++++------- .../chemistry/reagents/other_reagents.dm | 12 +++---- .../nanites/nanite_programs/healing.dm | 2 +- .../xenobiology/crossbreeding/consuming.dm | 2 +- .../research/xenobiology/xenobiology.dm | 2 +- code/modules/surgery/organs/lungs.dm | 2 +- .../reagents/chemistry/reagents/SDGF.dm | 6 ++-- 21 files changed, 64 insertions(+), 53 deletions(-) diff --git a/code/datums/diseases/advance/symptoms/oxygen.dm b/code/datums/diseases/advance/symptoms/oxygen.dm index d00761dbf9..67e2a8c588 100644 --- a/code/datums/diseases/advance/symptoms/oxygen.dm +++ b/code/datums/diseases/advance/symptoms/oxygen.dm @@ -47,7 +47,7 @@ Bonus M.adjustOxyLoss(-7, 0) M.losebreath = max(0, M.losebreath - 4) if(regenerate_blood && M.blood_volume < (BLOOD_VOLUME_NORMAL * M.blood_ratio)) - M.AddIntegrationBlood(1) + M.adjust_integration_blood(1) else if(prob(base_message_chance)) to_chat(M, "[pick("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.")]") diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 9a477a8122..0bf7b13646 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -426,20 +426,21 @@ GENETICS SCANNER if(ishuman(C)) if(H.is_bleeding()) msg += "Subject is bleeding!\n" - var/blood_percent = round((C.scan_blood_volume() / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) + var/blood_percent = round((C.scan_blood_volume() / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) + var/integrated_blood_percent = round((C.integrating_blood / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) var/blood_type = C.dna.blood_type if(!(blood_typepath in GLOB.blood_reagent_types)) var/datum/reagent/R = GLOB.chemical_reagents_list[blood_typepath] if(R) blood_type = R.name - if(C.integrating_blood) - msg += "[C.integrating_blood] cl of blood is being integrated into their bloodstream\n" - if(C.scan_blood_volume() <= (BLOOD_VOLUME_SAFE*C.blood_ratio) && C.scan_blood_volume() > (BLOOD_VOLUME_OKAY*C.blood_ratio)) - msg += "LOW blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" - else if(C.scan_blood_volume() <= (BLOOD_VOLUME_OKAY*C.blood_ratio)) - msg += "CRITICAL blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" + + if((C.scan_blood_volume() + C.integrating_blood) <= (BLOOD_VOLUME_SAFE * C.blood_ratio) && (C.scan_blood_volume() + C.integrating_blood) > (BLOOD_VOLUME_OKAY*C.blood_ratio)) + msg += "LOW blood level [blood_percent] %, [C.scan_blood_volume()] cl[C.integrating_blood? ", with [integrated_blood_percent] % of it integrating, [C.integrating_blood] cl " : ""]. type: [blood_type]\n" + else if((C.scan_blood_volume() + C.integrating_blood) <= (BLOOD_VOLUME_OKAY * C.blood_ratio)) + msg += "CRITICAL blood level [blood_percent] %, [C.scan_blood_volume()] cl[C.integrating_blood? ", with [integrated_blood_percent] % of it integrating, [C.integrating_blood] cl " : ""]. type: [blood_type]\n" else - msg += "Blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" + msg += "Blood level [blood_percent] %, [C.scan_blood_volume()] cl[C.integrating_blood? ", with [integrated_blood_percent] % of it integrating, [C.integrating_blood] cl " : ""]. type: [blood_type]\n" + var/cyberimp_detect for(var/obj/item/organ/cyberimp/CI in C.internal_organs) diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index 1227f3bd78..8917e1661e 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -144,7 +144,7 @@ owner.Stun(15) owner.adjustToxLoss(-15, TRUE, TRUE) - owner.AddIntegrationBlood(20) + owner.adjust_integration_blood(20) if(owner.blood_volume < BLOOD_VOLUME_NORMAL) keep_going = TRUE diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 6f6f43cd96..9bd1030685 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -690,7 +690,7 @@ if(H.functional_blood() < (BLOOD_VOLUME_SAFE*H.blood_ratio)) var/restore_blood = (BLOOD_VOLUME_SAFE*H.blood_ratio) - H.blood_volume if(uses * 2 < restore_blood) - H.AddIntegrationBlood(uses * 2) + H.adjust_integration_blood(uses * 2) to_chat(user,"You use the last of your blood rites to restore what blood you could!") uses = 0 return ..() diff --git a/code/modules/antagonists/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm index baf62fe6ad..a2f283ec67 100644 --- a/code/modules/antagonists/cult/cult_structures.dm +++ b/code/modules/antagonists/cult/cult_structures.dm @@ -219,7 +219,7 @@ if(M.health < M.maxHealth) M.adjustHealth(-3) if(ishuman(L) && L.blood_volume < (BLOOD_VOLUME_NORMAL * L.blood_ratio)) - L.AddIntegrationBlood(1.0) + L.adjust_integration_blood(1.0) CHECK_TICK diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm index 00d43888a5..158acc0071 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm @@ -147,7 +147,7 @@ carbon_target.blood_volume -= 20 if(carbon_user.blood_volume < BLOOD_VOLUME_MAXIMUM) //we dont want to explode after all - carbon_user.AddIntegrationBlood(20) + carbon_user.adjust_integration_blood(20) return /obj/effect/proc_holder/spell/pointed/blood_siphon/can_target(atom/target, mob/user, silent) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 256f869198..c9dc42835b 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -390,8 +390,9 @@ var/mob/living/carbon/human/H = src H.handle_blood() -/mob/living/proc/AddIntegrationBlood(value, force) - if(value < 0 && integrating_blood < value) //Remove the normal blood of the carbon if we can't afford it with integrating_blood - blood_volume = min(blood_volume, value) - if(integrating_blood < blood_volume + BLOOD_VOLUME_NORMAL || force) - integrating_blood += value +/mob/living/proc/adjust_integration_blood(value, remove_actual_blood, force) + if(integrating_blood + value < 0 && remove_actual_blood) + blood_volume += value + integrating_blood + blood_volume = max(blood_volume, 0) + integrating_blood += value + integrating_blood = clamp(integrating_blood, 0, force ? INFINITY : (BLOOD_VOLUME_MAXIMUM - (integrating_blood + blood_volume))) diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index f8d9abd75b..4c897d5096 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -85,7 +85,7 @@ owner.adjustOxyLoss(-heal_amt) owner.adjustCloneLoss(-heal_amt) if(owner.blood_volume && (owner.blood_volume < BLOOD_VOLUME_NORMAL)) - owner.AddIntegrationBlood(5) + owner.adjust_integration_blood(5) else owner.adjustPlasma(plasma_rate * 0.1) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index c732a754fc..2e530226c8 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -183,7 +183,7 @@ destination.undershirt = undershirt destination.socks = socks -/mob/living/carbon/human/AddIntegrationBlood(value, force) +/mob/living/carbon/human/adjust_integration_blood(value, force) if(NOBLOOD in dna.species.species_traits) //Can't lose blood if your species doesn't have any return . = ..() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 69c232e210..190fae6952 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1364,7 +1364,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) /datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(chem.type == exotic_blood && !istype(exotic_blood, /datum/reagent/blood)) - H.AddIntegrationBlood(round(chem.volume, 0.1)) + H.adjust_integration_blood(round(chem.volume, 0.1)) H.reagents.del_reagent(chem.type) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index e12e3d7760..f353bfd675 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -56,13 +56,13 @@ if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for bloodsuckers return if(!H.blood_volume) - H.AddIntegrationBlood(5) + H.adjust_integration_blood(5) H.adjustBruteLoss(5) to_chat(H, "You feel empty!") if(H.blood_volume < (BLOOD_VOLUME_NORMAL * H.blood_ratio)) if(H.nutrition >= NUTRITION_LEVEL_STARVING) - H.AddIntegrationBlood(3) + H.adjust_integration_blood(3) H.nutrition -= 2.5 if(H.blood_volume < (BLOOD_VOLUME_OKAY*H.blood_ratio)) if(prob(5)) @@ -82,7 +82,7 @@ consumed_limb.drop_limb() to_chat(H, "Your [consumed_limb] is drawn back into your body, unable to maintain its shape!") qdel(consumed_limb) - H.AddIntegrationBlood(20) + H.adjust_integration_blood(20) ////////////////////////////////////////////////////////SLIMEPEOPLE/////////////////////////////////////////////////////////////////// @@ -151,7 +151,7 @@ if(prob(5)) to_chat(H, "You feel very bloated!") else if(H.nutrition >= NUTRITION_LEVEL_WELL_FED) - H.AddIntegrationBlood(3) + H.adjust_integration_blood(3) H.nutrition -= 2.5 ..() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 52e29ab3ec..7b07dfb487 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -112,7 +112,7 @@ var/stun_absorption = null //converted to a list of stun absorption sources this mob has when one is added var/blood_volume = 0 //how much blood the mob has - var/integrating_blood = 0 //this is the variable you want to affect if you want to give the mob blood, this will slowly turn into normal blood, preventing some cheesyness, use AddIntegrationBlood() instead of modifying directly + var/integrating_blood = 0 //this is the variable you want to affect if you want to give the mob blood, this will slowly turn into normal blood, preventing some cheesyness, use adjust_integration_blood() instead of modifying directly var/blood_ratio = 1 //How much blood the mob needs, in terms of ratio (i.e 1.2 will require BLOOD_VOLUME_NORMAL of 672) DO NOT GO ABOVE 3.55 Well, actually you can but, then they can't get enough blood. var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override diff --git a/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm b/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm index f9072f3934..78697cb4fe 100644 --- a/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm +++ b/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm @@ -94,7 +94,7 @@ L.SetUnconscious(0, FALSE) L.adjustOxyLoss(-50)// do CPR first if(L.blood_volume <= 500) //bandage them up and give em some blood if they're bleeding - L.AddIntegrationBlood(30) + L.adjust_integration_blood(30) L.bleedsuppress = 0 if(L.getBruteLoss() >= 50)// first, did we beat them into crit? if so, heal that var/healing = min(L.getBruteLoss(), 120) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 56d0306eab..12c91e145a 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -586,7 +586,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(AmBloodsucker(C)) disgust_bloodsucker(FALSE, 1) //Bloodsuckers get SOME blood from it, for style reasons. if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.AddIntegrationBlood(3) //Bloody Mary quickly restores blood loss. + C.adjust_integration_blood(3) //Bloody Mary quickly restores blood loss. ..() /datum/reagent/consumable/ethanol/brave_bull @@ -2593,7 +2593,7 @@ All effects don't start immediately, but rather get worse over time; the rate is alcohol_description = "sweet" else alcohol_description = "watery" //How the hell did you get negative boozepwr? - + var/list/fruits = list() if(names_in_order.len <= 3) fruits = names_in_order diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index d1395c7386..a07c5f7a2a 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -402,19 +402,28 @@ pH = 5.5 /datum/reagent/medicine/salglu_solution/on_mob_life(mob/living/carbon/human/M) - if((HAS_TRAIT(M, TRAIT_NOMARROW))) - return - if(last_added) - M.AddIntegrationBlood(-last_added) - last_added = 0 - if(M.functional_blood() < maximum_reachable) //Can only up to double your effective blood level. - var/new_blood_level = min(volume * 5, maximum_reachable) - last_added = new_blood_level - M.AddIntegrationBlood(new_blood_level + (extra_regen * REM)) if(prob(33)) M.adjustBruteLoss(-0.5*REM, 0) M.adjustFireLoss(-0.5*REM, 0) . = TRUE + if((HAS_TRAIT(M, TRAIT_NOMARROW))) + return ..() + if(last_added) + M.adjust_integration_blood(-last_added, TRUE) + last_added = 0 + if(M.functional_blood() < maximum_reachable) //Can only up to double your effective blood level. + var/new_blood_level = min(volume * 5, maximum_reachable) + last_added = new_blood_level + M.adjust_integration_blood(new_blood_level + (extra_regen * REM)) + if(prob(33)) + M.adjustBruteLoss(-0.5*REM, 0) + M.adjustFireLoss(-0.5*REM, 0) + . = TRUE + ..() + +/datum/reagent/medicine/salglu_solution/on_mob_delete(mob/living/carbon/human/M) + if(last_added) + M.adjust_integration_blood(-last_added, TRUE) ..() /datum/reagent/medicine/salglu_solution/overdose_process(mob/living/M) @@ -1294,7 +1303,7 @@ M.adjustCloneLoss(-3*REM, FALSE) M.adjustStaminaLoss(-25*REM,FALSE) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.AddIntegrationBlood(40) // blood fall out man bad + M.adjust_integration_blood(40) // blood fall out man bad ..() . = 1 @@ -1315,7 +1324,7 @@ M.adjustCloneLoss(-1.25*REM, FALSE) M.adjustStaminaLoss(-4*REM,FALSE) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.AddIntegrationBlood(3) + M.adjust_integration_blood(3) ..() . = 1 diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index f202d10377..bf93c933de 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -48,7 +48,7 @@ var/mob/living/carbon/C = L var/blood_id = C.get_blood_id() if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) - C.AddIntegrationBlood(round(reac_volume, 0.1)) + C.adjust_integration_blood(round(reac_volume, 0.1)) // we don't care about bloodtype here, we're just refilling the mob if(reac_volume >= 10 && istype(L) && method != INJECT) @@ -253,7 +253,7 @@ /datum/reagent/water/on_mob_life(mob/living/carbon/M) . = ..() if(M.blood_volume) - M.AddIntegrationBlood(0.1) // water is good for you! + M.adjust_integration_blood(0.1) // water is good for you! /* * Water reaction to turf @@ -370,7 +370,7 @@ /datum/reagent/water/holywater/on_mob_life(mob/living/carbon/M) if(M.blood_volume) - M.AddIntegrationBlood(0.1) // water is good for you! + M.adjust_integration_blood(0.1) // water is good for you! if(!data) data = list("misc" = 1) data["misc"]++ @@ -456,7 +456,7 @@ M.adjustBruteLoss(-2, FALSE) M.adjustFireLoss(-2, FALSE) if(ishuman(M) && M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.AddIntegrationBlood(3) + M.adjust_integration_blood(3) else // Will deal about 90 damage when 50 units are thrown M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, FALSE) @@ -1146,7 +1146,7 @@ if((HAS_TRAIT(C, TRAIT_NOMARROW))) return if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - C.AddIntegrationBlood(0.25) + C.adjust_integration_blood(0.25) ..() /datum/reagent/iron/reaction_mob(mob/living/M, method=TOUCH, reac_volume) @@ -2552,7 +2552,7 @@ M.adjustBruteLoss(-3, FALSE) M.adjustFireLoss(-3, FALSE) if(ishuman(M) && M.blood_volume < BLOOD_VOLUME_NORMAL) - M.AddIntegrationBlood(3) + M.adjust_integration_blood(3) else M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, FALSE) diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 286c4bfdae..81a837504a 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -109,7 +109,7 @@ /datum/nanite_program/blood_restoring/active_effect() if(iscarbon(host_mob)) var/mob/living/carbon/C = host_mob - C.AddIntegrationBlood(2) + C.adjust_integration_blood(2) /datum/nanite_program/repairing name = "Mechanical Repair" diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index 26e2a63634..8d80613be4 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -322,7 +322,7 @@ Consuming extracts: playsound(get_turf(M), 'sound/effects/splat.ogg', 10, 1) if(iscarbon(M)) var/mob/living/carbon/C = M - C.AddIntegrationBlood(25) //Half a vampire drain. + C.adjust_integration_blood(25) //Half a vampire drain. /obj/item/slimecross/consuming/green colour = "green" diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 2340946c46..70cd28718c 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -187,7 +187,7 @@ switch(activation_type) if(SLIME_ACTIVATE_MINOR) user.adjust_nutrition(50) - user.AddIntegrationBlood(50) + user.adjust_integration_blood(50) to_chat(user, "You activate [src], and your body is refilled with fresh slime jelly!") return 150 diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 00f154739c..93f88192e5 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -533,7 +533,7 @@ var/total_moles = breath.total_moles() var/pressure = breath.return_pressure() var/plasma_pp = PP(breath, GAS_PLASMA) - owner.AddIntegrationBlood(0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. + owner.adjust_integration_blood(0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. /obj/item/organ/lungs/yamerol name = "Yamerol lungs" diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 922285d6f9..3725e46b38 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -226,7 +226,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING M.adjustCloneLoss(-10, 0) //I don't want to make Rezadone obsolete. M.adjustBruteLoss(-25, 0)// Note that this takes a long time to apply and makes you fat and useless when it's in you, I don't think this small burst of healing will be useful considering how long it takes to get there. M.adjustFireLoss(-25, 0) - M.AddIntegrationBlood(250) + M.adjust_integration_blood(250) M.heal_bodypart_damage(1,1) M.action_cooldown_mod = 1 if (M.nutrition < 1500) @@ -236,7 +236,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING to_chat(M, "the cells fail to hold enough mass to generate a clone, instead diffusing into your system.") M.adjustBruteLoss(-10, 0) M.adjustFireLoss(-10, 0) - M.AddIntegrationBlood(100) + M.adjust_integration_blood(100) M.action_cooldown_mod = 1 if (M.nutrition < 1500) M.adjust_nutrition(500) @@ -309,7 +309,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING /datum/reagent/fermi/SDGFheal/on_mob_life(mob/living/carbon/M)//Used to heal the clone after splitting, the clone spawns damaged. (i.e. insentivies players to make more than required, so their clone doesn't have to be treated) if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) - M.AddIntegrationBlood(10) + M.adjust_integration_blood(10) M.adjustCloneLoss(-2, 0) M.setOrganLoss(ORGAN_SLOT_BRAIN, -1) M.adjust_nutrition(10) From 0ff2e0cee508041a435e770ab8dadfc750b5f137 Mon Sep 17 00:00:00 2001 From: Artur Date: Tue, 10 Aug 2021 15:00:12 +0300 Subject: [PATCH 14/16] makes the amount of integrated_blood lost equal to the blood_volume gained --- code/modules/mob/living/blood.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index c9dc42835b..6c1346ddeb 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -41,9 +41,10 @@ if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. if(integrating_blood > 0) var/integrated_blood = max(integrating_blood - 1, 0) + var/blood_diff = integrating_blood - integrated_blood integrating_blood = integrated_blood if(blood_volume < BLOOD_VOLUME_MAXIMUM) - blood_volume ++ + blood_volume += blood_diff if(blood_volume < BLOOD_VOLUME_NORMAL) var/nutrition_ratio = 0 if(!HAS_TRAIT(src, TRAIT_NOHUNGER)) From 09227544bed0645e830d57a9f83be1e03ec769a0 Mon Sep 17 00:00:00 2001 From: Artur <24881678+Arturlang@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:00:54 +0300 Subject: [PATCH 15/16] Name's too similar --- code/modules/mob/living/blood.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 6c1346ddeb..de9c5fac67 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -40,7 +40,7 @@ if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. if(integrating_blood > 0) - var/integrated_blood = max(integrating_blood - 1, 0) + var/blood_integrated = max(integrating_blood - 1, 0) var/blood_diff = integrating_blood - integrated_blood integrating_blood = integrated_blood if(blood_volume < BLOOD_VOLUME_MAXIMUM) From c7a17b0e842e4cffd9de42a026065ead2aed1082 Mon Sep 17 00:00:00 2001 From: Artur <24881678+Arturlang@users.noreply.github.com> Date: Tue, 10 Aug 2021 20:15:07 +0300 Subject: [PATCH 16/16] Didn't properly renamy my var --- code/modules/mob/living/blood.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index de9c5fac67..7615792028 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -41,8 +41,8 @@ if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. if(integrating_blood > 0) var/blood_integrated = max(integrating_blood - 1, 0) - var/blood_diff = integrating_blood - integrated_blood - integrating_blood = integrated_blood + var/blood_diff = integrating_blood - blood_integrated + integrating_blood = blood_integrated if(blood_volume < BLOOD_VOLUME_MAXIMUM) blood_volume += blood_diff if(blood_volume < BLOOD_VOLUME_NORMAL)