Blood commit.
This commit is contained in:
@@ -18,10 +18,10 @@
|
||||
/mob/living/carbon/monkey/handle_blood()
|
||||
if(bodytemperature >= TCRYO && !(has_trait(TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood.
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < BLOOD_VOLUME_NORMAL)
|
||||
if(blood_volume < (BLOOD_VOLUME_NORMAL * blood_ratio))
|
||||
blood_volume += 0.1 // regenerate blood VERY slowly
|
||||
if(blood_volume < BLOOD_VOLUME_OKAY)
|
||||
adjustOxyLoss(round((BLOOD_VOLUME_NORMAL - blood_volume) * 0.02, 1))
|
||||
if(blood_volume < (BLOOD_VOLUME_OKAY * blood_ratio))
|
||||
adjustOxyLoss(round(((BLOOD_VOLUME_NORMAL * blood_ratio) - blood_volume) * 0.02, 1))
|
||||
|
||||
// Takes care blood loss and regeneration
|
||||
/mob/living/carbon/human/handle_blood()
|
||||
@@ -33,7 +33,7 @@
|
||||
if(bodytemperature >= TCRYO && !(has_trait(TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood.
|
||||
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < BLOOD_VOLUME_NORMAL && !has_trait(TRAIT_NOHUNGER))
|
||||
if(blood_volume < (BLOOD_VOLUME_NORMAL * blood_ratio) && !has_trait(TRAIT_NOHUNGER))
|
||||
var/nutrition_ratio = 0
|
||||
switch(nutrition)
|
||||
if(0 to NUTRITION_LEVEL_STARVING)
|
||||
@@ -49,26 +49,26 @@
|
||||
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)
|
||||
blood_volume = min((BLOOD_VOLUME_NORMAL * blood_ratio), 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((BLOOD_VOLUME_OKAY * blood_ratio) to (BLOOD_VOLUME_SAFE * blood_ratio))
|
||||
if(prob(5))
|
||||
to_chat(src, "<span class='warning'>You feel [word].</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))
|
||||
adjustOxyLoss(round(((BLOOD_VOLUME_NORMAL * blood_ratio) - blood_volume) * 0.01, 1))
|
||||
if((BLOOD_VOLUME_BAD * blood_ratio) to (BLOOD_VOLUME_OKAY*blood_ratio))
|
||||
adjustOxyLoss(round(((BLOOD_VOLUME_NORMAL * blood_ratio) - blood_volume) * 0.02, 1))
|
||||
if(prob(5))
|
||||
blur_eyes(6)
|
||||
to_chat(src, "<span class='warning'>You feel very [word].</span>")
|
||||
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
|
||||
if((BLOOD_VOLUME_SURVIVE * blood_ratio) to (BLOOD_VOLUME_BAD * blood_ratio))
|
||||
adjustOxyLoss(5)
|
||||
if(prob(15))
|
||||
Unconscious(rand(20,60))
|
||||
to_chat(src, "<span class='warning'>You feel extremely [word].</span>")
|
||||
if(-INFINITY to BLOOD_VOLUME_SURVIVE)
|
||||
if(-INFINITY to (BLOOD_VOLUME_SURVIVE * blood_ratio))
|
||||
if(!has_trait(TRAIT_NODEATH))
|
||||
death()
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
blood_volume = initial(blood_volume)
|
||||
|
||||
/mob/living/carbon/human/restore_blood()
|
||||
blood_volume = BLOOD_VOLUME_NORMAL
|
||||
blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio)
|
||||
bleed_rate = 0
|
||||
|
||||
/****************************************************
|
||||
@@ -122,7 +122,7 @@
|
||||
/mob/living/proc/transfer_blood_to(atom/movable/AM, amount, forced)
|
||||
if(!blood_volume || !AM.reagents)
|
||||
return 0
|
||||
if(blood_volume < BLOOD_VOLUME_BAD && !forced)
|
||||
if(blood_volume < (BLOOD_VOLUME_BAD * blood_ratio) && !forced)
|
||||
return 0
|
||||
|
||||
if(blood_volume < amount)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
create_reagents(1000)
|
||||
update_body_parts() //to update the carbon's new bodyparts appearance
|
||||
GLOB.carbon_list += src
|
||||
blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio)
|
||||
|
||||
/mob/living/carbon/Destroy()
|
||||
//This must be done first, so the mob ghosts correctly before DNA etc is nulled
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
if(DISGUST_LEVEL_DISGUSTED to INFINITY)
|
||||
msg += "[t_He] look[p_s()] extremely disgusted.\n"
|
||||
|
||||
if(blood_volume < BLOOD_VOLUME_SAFE)
|
||||
if(blood_volume < (BLOOD_VOLUME_SAFE*blood_ratio))
|
||||
msg += "[t_He] [t_has] pale skin.\n"
|
||||
|
||||
if(bleedsuppress)
|
||||
|
||||
@@ -46,14 +46,14 @@
|
||||
H.adjustBruteLoss(5)
|
||||
to_chat(H, "<span class='danger'>You feel empty!</span>")
|
||||
|
||||
if(H.blood_volume < BLOOD_VOLUME_NORMAL)
|
||||
if(H.blood_volume < (BLOOD_VOLUME_NORMAL * H.blood_ratio))
|
||||
if(H.nutrition >= NUTRITION_LEVEL_STARVING)
|
||||
H.blood_volume += 3
|
||||
H.nutrition -= 2.5
|
||||
if(H.blood_volume < BLOOD_VOLUME_OKAY)
|
||||
if(H.blood_volume < (BLOOD_VOLUME_OKAY*H.blood_ratio))
|
||||
if(prob(5))
|
||||
to_chat(H, "<span class='danger'>You feel drained!</span>")
|
||||
if(H.blood_volume < BLOOD_VOLUME_BAD)
|
||||
if(H.blood_volume < (BLOOD_VOLUME_BAD*H.blood_ratio))
|
||||
Cannibalize_Body(H)
|
||||
if(regenerate_limbs)
|
||||
regenerate_limbs.UpdateButtonIcon()
|
||||
@@ -85,7 +85,7 @@
|
||||
var/list/limbs_to_heal = H.get_missing_limbs()
|
||||
if(limbs_to_heal.len < 1)
|
||||
return 0
|
||||
if(H.blood_volume >= BLOOD_VOLUME_OKAY+40)
|
||||
if(H.blood_volume >= (BLOOD_VOLUME_OKAY*H.blood_ratio)+40)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -96,13 +96,13 @@
|
||||
to_chat(H, "<span class='notice'>You feel intact enough as it is.</span>")
|
||||
return
|
||||
to_chat(H, "<span class='notice'>You focus intently on your missing [limbs_to_heal.len >= 2 ? "limbs" : "limb"]...</span>")
|
||||
if(H.blood_volume >= 40*limbs_to_heal.len+BLOOD_VOLUME_OKAY)
|
||||
if(H.blood_volume >= 40*limbs_to_heal.len+(BLOOD_VOLUME_OKAY*H.blood_ratio))
|
||||
H.regenerate_limbs()
|
||||
H.blood_volume -= 40*limbs_to_heal.len
|
||||
to_chat(H, "<span class='notice'>...and after a moment you finish reforming!</span>")
|
||||
return
|
||||
else if(H.blood_volume >= 40)//We can partially heal some limbs
|
||||
while(H.blood_volume >= BLOOD_VOLUME_OKAY+40)
|
||||
while(H.blood_volume >= (BLOOD_VOLUME_OKAY*H.blood_ratio)+40)
|
||||
var/healed_limb = pick(limbs_to_heal)
|
||||
H.regenerate_limb(healed_limb)
|
||||
limbs_to_heal -= healed_limb
|
||||
@@ -136,7 +136,7 @@
|
||||
bodies -= C // This means that the other bodies maintain a link
|
||||
// so if someone mindswapped into them, they'd still be shared.
|
||||
bodies = null
|
||||
C.blood_volume = min(C.blood_volume, BLOOD_VOLUME_NORMAL)
|
||||
C.blood_volume = min(C.blood_volume, (BLOOD_VOLUME_NORMAL*C.blood_ratio))
|
||||
..()
|
||||
|
||||
/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species)
|
||||
@@ -727,4 +727,4 @@
|
||||
to_chat(H, "<span class='notice'>You connect [target]'s mind to your slime link!</span>")
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You can't seem to link [target]'s mind...</span>")
|
||||
to_chat(target, "<span class='warning'>The foreign presence leaves your mind.</span>")
|
||||
to_chat(target, "<span class='warning'>The foreign presence leaves your mind.</span>")
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
C.adjustCloneLoss(-4)
|
||||
return
|
||||
C.blood_volume -= 0.75
|
||||
if(C.blood_volume <= BLOOD_VOLUME_SURVIVE)
|
||||
if(C.blood_volume <= (BLOOD_VOLUME_SURVIVE*C.blood_ratio))
|
||||
to_chat(C, "<span class='danger'>You ran out of blood!</span>")
|
||||
C.dust()
|
||||
var/area/A = get_area(C)
|
||||
|
||||
@@ -525,7 +525,7 @@
|
||||
var/trail_type = getTrail()
|
||||
if(trail_type)
|
||||
var/brute_ratio = round(getBruteLoss() / maxHealth, 0.1)
|
||||
if(blood_volume && blood_volume > max(BLOOD_VOLUME_NORMAL*(1 - brute_ratio * 0.25), 0))//don't leave trail if blood volume below a threshold
|
||||
if(blood_volume && blood_volume > max((BLOOD_VOLUME_NORMAL*blood_ratio)*(1 - brute_ratio * 0.25), 0))//don't leave trail if blood volume below a threshold
|
||||
blood_volume = max(blood_volume - max(1, brute_ratio * 2), 0) //that depends on our brute damage.
|
||||
var/newdir = get_dir(target_turf, start)
|
||||
if(newdir != direction)
|
||||
|
||||
@@ -79,6 +79,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/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
|
||||
|
||||
var/see_override = 0 //0 for no override, sets see_invisible = see_override in silicon & carbon life process via update_sight()
|
||||
|
||||
Reference in New Issue
Block a user