Fixes for previous.

This commit is contained in:
Zuhayr
2016-02-08 14:10:08 +10:30
parent 2e83dfba51
commit 86fdd0c86b
13 changed files with 64 additions and 62 deletions

View File

@@ -273,7 +273,7 @@
"stoxin_amount" = H.reagents.get_reagent_amount("stoxin"),
"bicaridine_amount" = H.reagents.get_reagent_amount("bicaridine"),
"dermaline_amount" = H.reagents.get_reagent_amount("dermaline"),
"blood_amount" = round(H.vessel.get_reagent_amount("blood") / H.species.blood_volume)*100,
"blood_amount" = round((H.vessel.get_reagent_amount("blood") / H.species.blood_volume)*100),
"disabilities" = H.sdisabilities,
"lung_ruptured" = H.is_lung_ruptured(),
"external_organs" = H.organs.Copy(),

View File

@@ -110,7 +110,7 @@
return
// If the human is losing too much blood, beep.
if(T.vessel.get_reagent_amount("blood") < BLOOD_VOLUME_SAFE) if(prob(5))
if(((T.vessel.get_reagent_amount("blood")/T.species.blood_volume)*100) < BLOOD_VOLUME_SAFE)
visible_message("\The [src] beeps loudly.")
var/datum/reagent/B = T.take_blood(beaker,amount)

View File

@@ -61,7 +61,7 @@ REAGENT SCANNER
user.show_message("<span class='notice'>Analyzing Results for [M]:</span>")
user.show_message("<span class='notice'>Overall Status: dead</span>")
else
user.show_message("<span class='notice'>Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "dead" : "[M.health - M.halloss]% healthy"]</span>")
user.show_message("<span class='notice'>Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "dead" : "[round(M.health/M.maxHealth)*100]% healthy"]</span>")
user.show_message("<span class='notice'> Key: <font color='blue'>Suffocation</font>/<font color='green'>Toxin</font>/<font color='#FFA500'>Burns</font>/<font color='red'>Brute</font></span>", 1)
user.show_message("<span class='notice'> Damage Specifics: <font color='blue'>[OX]</font> - <font color='green'>[TX]</font> - <font color='#FFA500'>[BU]</font> - <font color='red'>[BR]</font></span>")
user.show_message("<span class='notice'>Body Temperature: [M.bodytemperature-T0C]&deg;C ([M.bodytemperature*1.8-459.67]&deg;F)</span>", 1)
@@ -158,10 +158,10 @@ REAGENT SCANNER
user.show_message(text("<span class='warning'>Internal bleeding detected. Advanced scanner required for location.</span>"), 1)
break
if(M:vessel)
var/blood_volume = round(M:vessel.get_reagent_amount("blood"))
var/blood_percent = round(blood_volume / H.species.blood_volume)*100
var/blood_type = M.dna.b_type
if(blood_percent <= BLOOD_VOLUME_SAFE && blood_percent > BLOOD_VOLUME_BAD)
var/blood_volume = H.vessel.get_reagent_amount("blood")
var/blood_percent = round((blood_volume / H.species.blood_volume)*100)
var/blood_type = H.dna.b_type
if((blood_percent <= BLOOD_VOLUME_SAFE) && (blood_percent > BLOOD_VOLUME_BAD))
user.show_message("<span class='danger'>Warning: Blood Level LOW: [blood_percent]% [blood_volume]cl.</span> <span class='notice'>Type: [blood_type]</span>")
else if(blood_percent <= BLOOD_VOLUME_BAD)
user.show_message("<span class='danger'><i>Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl.</i></span> <span class='notice'>Type: [blood_type]</span>")

View File

@@ -4,7 +4,6 @@
ingested = new/datum/reagents/metabolism(1000, src, CHEM_INGEST)
touching = new/datum/reagents/metabolism(1000, src, CHEM_TOUCH)
reagents = bloodstr
..()
/mob/living/carbon/Life()

View File

@@ -895,7 +895,7 @@
/mob/living/carbon/human/revive()
if(should_have_organ(O_HEART))
vessel.add_reagent("blood",560-vessel.total_volume)
vessel.add_reagent("blood",species.blood_volume-vessel.total_volume)
fixblood()
species.create_organs(src) // Reset our organs/limbs.
@@ -1113,7 +1113,10 @@
spawn(0)
regenerate_icons()
vessel.add_reagent("blood",560-vessel.total_volume)
if(vessel.total_volume < species.blood_volume)
vessel.add_reagent("blood", species.blood_volume - vessel.total_volume)
else if(vessel.total_volume > species.blood_volume)
vessel.remove_reagent("blood", vessel.total_volume - species.blood_volume)
fixblood()
// Rebuild the HUD. If they aren't logged in then login() should reinstantiate it for them.

View File

@@ -318,10 +318,10 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t
This function restores the subjects blood to max.
*/
/mob/living/carbon/human/proc/restore_blood()
if(should_have_organ(O_HEART))
var/blood_volume = vessel.get_reagent_amount("blood")
vessel.add_reagent("blood",560.0-blood_volume)
if(!should_have_organ(O_HEART))
return
if(vessel.total_volume < species.blood_volume)
vessel.add_reagent("blood", species.blood_volume - vessel.total_volume)
/*
This function restores all organs.

View File

@@ -31,7 +31,7 @@
var/show_ssd = "fast asleep"
var/virus_immune
var/short_sighted // Permanent weldervision.
var/blood_volume = 500 // Initial blood volume.
var/blood_volume = 560 // Initial blood volume.
var/hunger_factor = 0.05 // Multiplier for hunger.
// Language/culture vars.

View File

@@ -30,7 +30,7 @@
holder_type = /obj/item/weapon/holder/human
short_sighted = 1
gluttonous = 1
blood_volume = 300
blood_volume = 400
hunger_factor = 1.2
spawn_flags = CAN_JOIN | IS_WHITELISTED

View File

@@ -350,6 +350,6 @@
visible_message("<span class='warning'>With a hideous, rattling moan, [src] shudders back to life!</span>")
rejuvenate()
vessel.add_reagent("blood",560-vessel.total_volume)
restore_blood()
fixblood()
update_canmove()

View File

@@ -1,7 +1,7 @@
/****************************************************
BLOOD SYSTEM
****************************************************/
//Blood levels
//Blood levels. These are percentages based on the species blood_volume far.
var/const/BLOOD_VOLUME_SAFE = 85
var/const/BLOOD_VOLUME_OKAY = 75
var/const/BLOOD_VOLUME_BAD = 60
@@ -22,7 +22,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
if(!should_have_organ(O_HEART)) //We want the var for safety but we can do without the actual blood.
return
vessel.add_reagent("blood",(species.blood_volume * 0.95))
vessel.add_reagent("blood",species.blood_volume)
spawn(1)
fixblood()
@@ -44,10 +44,11 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
var/blood_volume = round(vessel.get_reagent_amount("blood")/species.blood_volume)*100 // Percentage.
var/blood_volume_raw = vessel.get_reagent_amount("blood")
var/blood_volume = round((blood_volume_raw/species.blood_volume)*100) // Percentage.
//Blood regeneration if there is some space
if(blood_volume < species.blood_volume && blood_volume)
if(blood_volume_raw < species.blood_volume)
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
if(B) // Make sure there's some blood at all
if(B.data["donor"] != src) //If it's not theirs, then we look for theirs
@@ -75,46 +76,45 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
blood_volume *= 0.3
//Effects of bloodloss
switch(blood_volume)
if(BLOOD_VOLUME_SAFE to 10000)
if(pale)
pale = 0
update_body()
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
if(!pale)
pale = 1
update_body()
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(prob(1))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(oxyloss < 20)
oxyloss += 3
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
if(!pale)
pale = 1
update_body()
eye_blurry = max(eye_blurry,6)
if(oxyloss < 50)
oxyloss += 10
oxyloss += 1
if(prob(15))
Paralyse(rand(1,3))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
oxyloss += 5
toxloss += 3
if(prob(15))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
if(0 to BLOOD_VOLUME_SURVIVE)
// There currently is a strange bug here. If the mob is not below -100 health
// when death() is called, apparently they will be just fine, and this way it'll
// spam deathgasp. Adjusting toxloss ensures the mob will stay dead.
toxloss += 300 // just to be safe!
death()
if(blood_volume >= BLOOD_VOLUME_SAFE)
if(pale)
pale = 0
update_body()
else if(blood_volume >= BLOOD_VOLUME_OKAY)
if(!pale)
pale = 1
update_body()
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(prob(1))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(oxyloss < 20)
oxyloss += 3
else if(blood_volume >= BLOOD_VOLUME_BAD)
if(!pale)
pale = 1
update_body()
eye_blurry = max(eye_blurry,6)
if(oxyloss < 50)
oxyloss += 10
oxyloss += 1
if(prob(15))
Paralyse(rand(1,3))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
else if(blood_volume >= BLOOD_VOLUME_SURVIVE)
oxyloss += 5
toxloss += 3
if(prob(15))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
else
// There currently is a strange bug here. If the mob is not below -100 health
// when death() is called, apparently they will be just fine, and this way it'll
// spam deathgasp. Adjusting toxloss ensures the mob will stay dead.
toxloss += 300 // just to be safe!
death()
// Without enough blood you slowly go hungry.
if(blood_volume < BLOOD_VOLUME_SAFE)

View File

@@ -117,7 +117,7 @@ var/list/organ_cache = list()
if(germ_level >= INFECTION_LEVEL_THREE)
die()
else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
else if(owner && owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
handle_rejection()