mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-02 05:23:01 +00:00
Added blood volume and hunger variables for species.
This commit is contained in:
@@ -50,9 +50,9 @@
|
||||
/var/list/economic_species_modifier = list(
|
||||
/datum/species/human = 10,
|
||||
/datum/species/skrell = 12,
|
||||
/datum/species/teshari = 9, // Skrell sponsored!
|
||||
/datum/species/tajaran = 7,
|
||||
/datum/species/unathi = 7,
|
||||
/datum/species/teshari = 9, // Skrell sponsored!
|
||||
/datum/species/vox = 1
|
||||
)
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
if(src.nutrition && src.stat != 2)
|
||||
src.nutrition -= HUNGER_FACTOR/10
|
||||
src.nutrition -= DEFAULT_HUNGER_FACTOR/10
|
||||
if(src.m_intent == "run")
|
||||
src.nutrition -= HUNGER_FACTOR/10
|
||||
src.nutrition -= DEFAULT_HUNGER_FACTOR/10
|
||||
if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360)
|
||||
src.bodytemperature += 2
|
||||
|
||||
|
||||
@@ -896,7 +896,7 @@
|
||||
|
||||
// nutrition decrease
|
||||
if (nutrition > 0 && stat != 2)
|
||||
nutrition = max (0, nutrition - HUNGER_FACTOR)
|
||||
nutrition = max (0, nutrition - species.hunger_factor)
|
||||
|
||||
if (nutrition > 450)
|
||||
if(overeatduration < 600) //capped so people don't take forever to unfat
|
||||
@@ -1303,7 +1303,7 @@
|
||||
var/base_temperature = species.body_temperature
|
||||
if(base_temperature == null) //some species don't have a set metabolic temperature
|
||||
base_temperature = (species.heat_level_1 + species.cold_level_1)/2
|
||||
|
||||
|
||||
var/temp_step
|
||||
if (bodytemperature >= base_temperature)
|
||||
temp_step = (species.heat_level_1 - base_temperature)/4
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
var/mob_size = MOB_MEDIUM
|
||||
var/show_ssd = "fast asleep"
|
||||
var/virus_immune
|
||||
var/short_sighted
|
||||
var/short_sighted // Permanent weldervision.
|
||||
var/blood_volume = 500 // Initial blood volume.
|
||||
var/hunger_factor = 0.05 // Multiplier for hunger.
|
||||
|
||||
// Language/culture vars.
|
||||
var/default_language = "Galactic Common" // Default language is used when 'say' is used without modifiers.
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
holder_type = /obj/item/weapon/holder/human
|
||||
short_sighted = 1
|
||||
gluttonous = 1
|
||||
blood_volume = 300
|
||||
hunger_factor = 1.2
|
||||
|
||||
spawn_flags = CAN_JOIN | IS_WHITELISTED
|
||||
appearance_flags = HAS_HAIR_COLOR | HAS_SKIN_COLOR | HAS_EYE_COLOR
|
||||
|
||||
@@ -385,4 +385,4 @@
|
||||
/mob/living/carbon/slime/cannot_use_vents()
|
||||
if(Victim)
|
||||
return "You cannot ventcrawl while feeding."
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
BLOOD SYSTEM
|
||||
****************************************************/
|
||||
//Blood levels
|
||||
var/const/BLOOD_VOLUME_SAFE = 501
|
||||
var/const/BLOOD_VOLUME_OKAY = 336
|
||||
var/const/BLOOD_VOLUME_BAD = 224
|
||||
var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
var/const/BLOOD_VOLUME_SAFE = 85
|
||||
var/const/BLOOD_VOLUME_OKAY = 75
|
||||
var/const/BLOOD_VOLUME_BAD = 60
|
||||
var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
|
||||
/mob/living/carbon/human/var/datum/reagents/vessel //Container for blood and BLOOD ONLY. Do not transfer other chems here.
|
||||
/mob/living/carbon/human/var/var/pale = 0 //Should affect how mob sprite is drawn, but currently doesn't.
|
||||
/mob/living/carbon/human/var/datum/reagents/vessel // Container for blood and BLOOD ONLY. Do not transfer other chems here.
|
||||
/mob/living/carbon/human/var/var/pale = 0 // Should affect how mob sprite is drawn, but currently doesn't.
|
||||
|
||||
//Initializes blood vessels
|
||||
/mob/living/carbon/human/proc/make_blood()
|
||||
@@ -16,13 +16,13 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(vessel)
|
||||
return
|
||||
|
||||
vessel = new/datum/reagents(600)
|
||||
vessel = new/datum/reagents(species.blood_volume)
|
||||
vessel.my_atom = src
|
||||
|
||||
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",560)
|
||||
vessel.add_reagent("blood",(species.blood_volume * 0.95))
|
||||
spawn(1)
|
||||
fixblood()
|
||||
|
||||
@@ -44,10 +44,10 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
|
||||
if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
|
||||
|
||||
var/blood_volume = round(vessel.get_reagent_amount("blood"))
|
||||
var/blood_volume = round(vessel.get_reagent_amount("blood")/species.blood_volume)*100 // Percentage.
|
||||
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
if(blood_volume < species.blood_volume && 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
|
||||
@@ -205,7 +205,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
var/list/chems = list()
|
||||
chems = params2list(injected.data["trace_chem"])
|
||||
for(var/C in chems)
|
||||
src.reagents.add_reagent(C, (text2num(chems[C]) / 560) * amount)//adds trace chemicals to owner's blood
|
||||
src.reagents.add_reagent(C, (text2num(chems[C]) / species.blood_volume) * amount)//adds trace chemicals to owner's blood
|
||||
reagents.update_total()
|
||||
|
||||
//Transfers blood from reagents to vessel, respecting blood types compatability.
|
||||
|
||||
Reference in New Issue
Block a user