Refactors blood regeneration from nutriment (#839)
* Refactors blood regeneration from nutriment * Update blood.dm * Delete blood.dm.rej * Update blood.dm
This commit is contained in:
committed by
Poojawa
parent
4740d2fd67
commit
cd122501fc
@@ -31,25 +31,41 @@
|
||||
if(bodytemperature >= 225 && !(disabilities & NOCLONE)) //cryosleep or husked people do not pump the blood.
|
||||
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < BLOOD_VOLUME_NORMAL)
|
||||
blood_volume += 0.1 // regenerate blood VERY slowly
|
||||
if(blood_volume < BLOOD_VOLUME_NORMAL && !(NOHUNGER in dna.species.species_traits))
|
||||
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
|
||||
nutrition = max(0, 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")
|
||||
switch(blood_volume)
|
||||
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
|
||||
if(prob(5))
|
||||
to_chat(src, "<span class='warning'>You feel [word].</span>")
|
||||
to_chat(src, "<span class='warning'>You feel [pick("dizzy","woozy","faint")].</span>")
|
||||
adjustOxyLoss(round((BLOOD_VOLUME_NORMAL - blood_volume) * 0.01, 1))
|
||||
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
|
||||
adjustOxyLoss(round((BLOOD_VOLUME_NORMAL - blood_volume) * 0.02, 1))
|
||||
if(prob(5))
|
||||
blur_eyes(6)
|
||||
var/word = pick("dizzy","woozy","faint")
|
||||
to_chat(src, "<span class='warning'>You feel very [word].</span>")
|
||||
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
|
||||
adjustOxyLoss(5)
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
var/word = pick("dizzy","woozy","faint")
|
||||
to_chat(src, "<span class='warning'>You feel extremely [word].</span>")
|
||||
if(0 to BLOOD_VOLUME_SURVIVE)
|
||||
death()
|
||||
@@ -69,7 +85,7 @@
|
||||
|
||||
bleed_rate = max(bleed_rate - 0.5, temp_bleed)//if no wounds, other bleed effects (heparin) naturally decreases
|
||||
|
||||
if(bleed_rate && !bleedsuppress && !(status_flags & FAKEDEATH))
|
||||
if(bleed_rate && !bleedsuppress)
|
||||
bleed(bleed_rate)
|
||||
|
||||
//Makes a blood drop, leaking amt units of blood from the mob
|
||||
|
||||
@@ -29,16 +29,11 @@
|
||||
|
||||
var/brute_heal = 1
|
||||
var/burn_heal = 0
|
||||
var/blood_gain = 0.4
|
||||
|
||||
/datum/reagent/consumable/nutriment/on_mob_life(mob/living/M)
|
||||
if(prob(50))
|
||||
M.heal_bodypart_damage(brute_heal,burn_heal, 0)
|
||||
. = 1
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
if(C.blood_volume < BLOOD_VOLUME_NORMAL)
|
||||
C.blood_volume += blood_gain
|
||||
..()
|
||||
|
||||
/datum/reagent/consumable/nutriment/on_new(list/supplied_data)
|
||||
@@ -82,7 +77,6 @@
|
||||
|
||||
brute_heal = 1
|
||||
burn_heal = 1
|
||||
blood_gain = 0.5
|
||||
|
||||
/datum/reagent/consumable/nutriment/vitamin/on_mob_life(mob/living/M)
|
||||
if(M.satiety < 600)
|
||||
|
||||
Reference in New Issue
Block a user