[MIRROR] Reworked blood loss effects on the user to be much more noticeable. (#28448)

* Reworked blood loss effects on the user to be much more noticeable. (#83874)

* Reworked blood loss effects on the user to be much more noticeable.

---------

Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-06-29 10:45:57 +05:30
committed by GitHub
co-authored by carlarctg
parent b3d954cfb7
commit cc0e77f543
4 changed files with 83 additions and 40 deletions
@@ -158,7 +158,7 @@
/// Return to skip default nutrition -> blood conversion
#define HANDLE_BLOOD_NO_NUTRITION_DRAIN (1<<1)
/// Return to skip oxyloss and similar effecst from blood level
#define HANDLE_BLOOD_NO_EFFECTS (1<<2)
#define HANDLE_BLOOD_NO_OXYLOSS (1<<2)
/// from /datum/status_effect/limp/proc/check_step(mob/whocares, OldLoc, Dir, forced) iodk where it shuld go
#define COMSIG_CARBON_LIMPING "mob_limp_check"
+5 -4
View File
@@ -16,10 +16,11 @@
#define BLOOD_VOLUME_MAXIMUM 1000 // SKYRAT EDIT - Blood volume balancing (mainly for Hemophages as nobody else really goes much above regular blood volume) - ORIGINAL VALUE: 2000
#define BLOOD_VOLUME_SLIME_SPLIT 1120
#define BLOOD_VOLUME_NORMAL 560
#define BLOOD_VOLUME_SAFE 475
#define BLOOD_VOLUME_OKAY 336
#define BLOOD_VOLUME_BAD 224
#define BLOOD_VOLUME_SURVIVE 122
#define BLOOD_VOLUME_SAFE (BLOOD_VOLUME_NORMAL * (1 - 0.15)) // Latter number is percentage of blood lost, for readability!
#define BLOOD_VOLUME_OKAY (BLOOD_VOLUME_NORMAL * (1 - 0.30))
#define BLOOD_VOLUME_RISKY (BLOOD_VOLUME_NORMAL * (1 - 0.45))
#define BLOOD_VOLUME_BAD (BLOOD_VOLUME_NORMAL * (1 - 0.60))
#define BLOOD_VOLUME_SURVIVE (BLOOD_VOLUME_NORMAL * (1 - 0.80))
/// How efficiently humans regenerate blood.
#define BLOOD_REGEN_FACTOR 0.25
+76 -34
View File
@@ -25,42 +25,12 @@
adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR * seconds_per_tick)
blood_volume = min(blood_volume + (BLOOD_REGEN_FACTOR * nutrition_ratio * seconds_per_tick), BLOOD_VOLUME_NORMAL)
//Effects of bloodloss
if(!(sigreturn & HANDLE_BLOOD_NO_EFFECTS))
var/word = pick("dizzy","woozy","faint")
switch(blood_volume)
if(BLOOD_VOLUME_MAX_LETHAL to INFINITY)
if(SPT_PROB(7.5, seconds_per_tick))
to_chat(src, span_userdanger("Blood starts to tear your skin apart. You're going to burst!"))
investigate_log("has been gibbed by having too much blood.", INVESTIGATE_DEATHS)
inflate_gib()
if(BLOOD_VOLUME_EXCESS to BLOOD_VOLUME_MAX_LETHAL)
if(SPT_PROB(5, seconds_per_tick))
to_chat(src, span_warning("You feel your skin swelling."))
if(BLOOD_VOLUME_MAXIMUM to BLOOD_VOLUME_EXCESS)
if(SPT_PROB(5, seconds_per_tick))
to_chat(src, span_warning("You feel terribly bloated."))
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
if(SPT_PROB(2.5, seconds_per_tick))
to_chat(src, span_warning("You feel [word]."))
adjustOxyLoss(round(0.005 * (BLOOD_VOLUME_NORMAL - blood_volume) * seconds_per_tick, 1))
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
adjustOxyLoss(round(0.01 * (BLOOD_VOLUME_NORMAL - blood_volume) * seconds_per_tick, 1))
if(SPT_PROB(2.5, seconds_per_tick))
set_eye_blur_if_lower(12 SECONDS)
to_chat(src, span_warning("You feel very [word]."))
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
adjustOxyLoss(2.5 * seconds_per_tick)
if(SPT_PROB(7.5, seconds_per_tick))
Unconscious(rand(20,60))
to_chat(src, span_warning("You feel extremely [word]."))
if(-INFINITY to BLOOD_VOLUME_SURVIVE)
if(!HAS_TRAIT(src, TRAIT_NODEATH))
investigate_log("has died of bloodloss.", INVESTIGATE_DEATHS)
death()
// Some effects are halved mid-combat.
var/determined_mod = has_status_effect(/datum/status_effect/determined) ? 0.5 : 0
//Bloodloss from wounds
var/temp_bleed = 0
//Bleeding out
for(var/obj/item/bodypart/iter_part as anything in bodyparts)
var/iter_bleed_rate = iter_part.get_modified_bleed_rate()
temp_bleed += iter_bleed_rate * seconds_per_tick
@@ -72,6 +42,78 @@
bleed(temp_bleed)
bleed_warn(temp_bleed)
//Effects of bloodloss
if(sigreturn & HANDLE_BLOOD_NO_OXYLOSS)
return
var/word = pick("dizzy","woozy","faint")
switch(blood_volume)
if(BLOOD_VOLUME_EXCESS to BLOOD_VOLUME_MAX_LETHAL)
if(SPT_PROB(7.5, seconds_per_tick))
to_chat(src, span_userdanger("Blood starts to tear your skin apart. You're going to burst!"))
investigate_log("has been gibbed by having too much blood.", INVESTIGATE_DEATHS)
inflate_gib()
// Way too much blood!
if(BLOOD_VOLUME_EXCESS to BLOOD_VOLUME_MAX_LETHAL)
if(SPT_PROB(5, seconds_per_tick))
to_chat(src, span_warning("You feel your skin swelling."))
// Too much blood
if(BLOOD_VOLUME_MAXIMUM to BLOOD_VOLUME_EXCESS)
if(SPT_PROB(5, seconds_per_tick))
to_chat(src, span_warning("You feel terribly bloated."))
// Low blood but not a big deal in the immediate
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
if(SPT_PROB(2.5, seconds_per_tick))
set_eye_blur_if_lower(2 SECONDS * determined_mod)
if(prob(50))
to_chat(src, span_danger("You feel [word]. It's getting a bit hard to breathe."))
losebreath += 0.5 * determined_mod * seconds_per_tick
else if(getStaminaLoss() < 25 * determined_mod)
to_chat(src, span_danger("You feel [word]. It's getting a bit hard to focus."))
adjustStaminaLoss(10 * determined_mod * REM * seconds_per_tick)
// Pretty low blood, getting dangerous!
if(BLOOD_VOLUME_RISKY to BLOOD_VOLUME_OKAY)
if(SPT_PROB(5, seconds_per_tick))
set_eye_blur_if_lower(2 SECONDS * determined_mod)
set_dizzy_if_lower(2 SECONDS * determined_mod)
if(prob(50))
to_chat(src, span_bolddanger("You feel very [word]. It's getting hard to breathe!"))
losebreath += 1 * determined_mod * seconds_per_tick
else if(getStaminaLoss() < 40 * determined_mod)
to_chat(src, span_bolddanger("You feel very [word]. It's getting hard to stay awake!"))
adjustStaminaLoss(15 * determined_mod * REM * seconds_per_tick)
// Very low blood, danger!!
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_RISKY)
if(SPT_PROB(5, seconds_per_tick))
set_eye_blur_if_lower(4 SECONDS * determined_mod)
set_dizzy_if_lower(4 SECONDS * determined_mod)
if(prob(50))
to_chat(src, span_userdanger("You feel extremely [word]! It's getting very hard to breathe!"))
losebreath += 1.5 * determined_mod * seconds_per_tick
else if(getStaminaLoss() < 80 * determined_mod)
to_chat(src, span_userdanger("You feel extremely [word]! It's getting very hard to stay awake!"))
adjustStaminaLoss(20 * determined_mod * REM * seconds_per_tick)
// Critically low blood, death is near! Adrenaline won't help you here.
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
if(SPT_PROB(7.5, seconds_per_tick))
Unconscious(rand(1 SECONDS, 2 SECONDS))
to_chat(src, span_userdanger("You black out for a moment!"))
// Instantly die upon this threshold
if(-INFINITY to BLOOD_VOLUME_SURVIVE)
if(!HAS_TRAIT(src, TRAIT_NODEATH))
investigate_log("has died of bloodloss.", INVESTIGATE_DEATHS)
death()
// Blood ratio! if you have 230 blood, this equals 0.5 as that's half of the current value, 560.
var/effective_blood_ratio = blood_volume/BLOOD_VOLUME_NORMAL
// If your ratio is less than one (you're missing any blood) and your oxyloss is under that ratio %, start getting oxy damage.
// This damage accrues faster the less blood you have.
// If KO or in hardcrit, the damage accrues even then to prevent being perma-KO.
if(((effective_blood_ratio < 1) && (getOxyLoss() < (effective_blood_ratio * 100))) || (stat in list(UNCONSCIOUS, HARD_CRIT)))
// At roughly half blood this equals to 3 oxyloss per tick. At 90% blood it's close to 0.5
var/rounded_oxyloss = round(0.01 * (BLOOD_VOLUME_NORMAL - blood_volume) * seconds_per_tick, 0.25)
adjustOxyLoss(rounded_oxyloss, updating_health = TRUE)
/// Has each bodypart update its bleed/wound overlay icon states
/mob/living/carbon/proc/update_bodypart_bleed_overlays()
for(var/obj/item/bodypart/iter_part as anything in bodyparts)
@@ -92,7 +92,7 @@
Cannibalize_Body(slime)
regenerate_limbs?.build_all_button_icons(UPDATE_BUTTON_STATUS)
return HANDLE_BLOOD_NO_NUTRITION_DRAIN|HANDLE_BLOOD_NO_EFFECTS
return HANDLE_BLOOD_NO_NUTRITION_DRAIN|HANDLE_BLOOD_NO_OXYLOSS
/datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H)
var/list/limbs_to_consume = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) - H.get_missing_limbs()