salglu works like normal now again and adds more sanity

This commit is contained in:
Artur
2021-07-29 23:55:27 +03:00
parent 2fec997e1f
commit 6b5bdae184
6 changed files with 43 additions and 33 deletions
+24 -24
View File
@@ -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
+3
View File
@@ -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
@@ -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
. = ..()