Species specific blood pressure & pulse (#11875)

This commit is contained in:
Casper3667
2021-05-22 03:18:53 -03:00
committed by GitHub
parent 86bfde609d
commit 0d30c7f6e6
7 changed files with 68 additions and 29 deletions
+4 -7
View File
@@ -59,13 +59,10 @@
#define PULSE_MAX_BPM 250 // Highest, readable BPM by machines and humans.
// Blood pressure levels, simplified
#define BP_HIGH_SYSTOLIC 140
#define BP_PRE_HIGH_SYSTOLIC 125
#define BP_IDEAL_SYSTOLIC 80
#define BP_HIGH_DIASTOLIC 100
#define BP_PRE_HIGH_DIASTOLIC 85
#define BP_IDEAL_DIASTOLIC 60
#define HIGH_BP_MOD 20
#define PRE_HIGH_BP_MOD 5
#define BP_SYS_IDEAL_MOD 40
#define BP_DIS_IDEAL_MOD 20
#define BLOOD_PRESSURE_HIGH 4
#define BLOOD_PRESSURE_PRE_HIGH 3
+24 -22
View File
@@ -1815,13 +1815,13 @@
if(PULSE_NONE)
return 0
if(PULSE_SLOW)
return rand(40, 60)
return rand(species.low_pulse, species.norm_pulse)
if(PULSE_NORM)
return rand(60, 90)
return rand(species.norm_pulse, species.fast_pulse)
if(PULSE_FAST)
return rand(90, 120)
return rand(species.fast_pulse, species.v_fast_pulse)
if(PULSE_2FAST)
return rand(120, 160)
return rand(species.v_fast_pulse, species.max_pulse)
if(PULSE_THREADY)
return PULSE_MAX_BPM
return 0
@@ -1855,9 +1855,9 @@
//Get fluffy numbers
/mob/living/carbon/human/proc/blood_pressure()
if(status_flags & FAKEDEATH)
return list(Floor(120+rand(-5,5))*0.25, Floor(80+rand(-5,5)*0.25))
return list(Floor(species.bp_base_systolic+rand(-5,5))*0.25, Floor(species.bp_base_disatolic+rand(-5,5)*0.25))
var/blood_result = get_blood_circulation()
return list(Floor((120+rand(-5,5))*(blood_result/100)), Floor((80+rand(-5,5))*(blood_result/100)))
return list(Floor((species.bp_base_systolic+rand(-5,5))*(blood_result/100)), Floor((species.bp_base_disatolic+rand(-5,5))*(blood_result/100)))
//Formats blood pressure for text display
/mob/living/carbon/human/proc/get_blood_pressure()
@@ -1866,30 +1866,32 @@
//Works out blood pressure alert level -- not very accurate
/mob/living/carbon/human/proc/get_blood_pressure_alert()
var/list/bp = blood_pressure()
var/list/bp_list = blood_pressure()
// For a blood pressure, e.g. 120/80
var/systolic_alert // this is the top number '120' -- highest pressure when heart beats
var/diastolic_alert // this is the bottom number '80' -- lowest pressure when heart relaxes
switch(bp[1])
if(BP_HIGH_SYSTOLIC to INFINITY)
systolic_alert = BLOOD_PRESSURE_HIGH
if(BP_PRE_HIGH_SYSTOLIC to BP_HIGH_SYSTOLIC)
systolic_alert = BLOOD_PRESSURE_PRE_HIGH
if(BP_IDEAL_SYSTOLIC to BP_PRE_HIGH_SYSTOLIC)
var/blood_pressure_systolic = bp_list[1]
if (blood_pressure_systolic)
if (blood_pressure_systolic >= (species.bp_base_systolic - BP_SYS_IDEAL_MOD) && blood_pressure_systolic <= (species.bp_base_systolic + HIGH_BP_MOD))
systolic_alert = BLOOD_PRESSURE_IDEAL
if(-INFINITY to BP_IDEAL_SYSTOLIC)
else if (blood_pressure_systolic <= (species.bp_base_systolic - BP_SYS_IDEAL_MOD))
systolic_alert = BLOOD_PRESSURE_LOW
else if (blood_pressure_systolic >= (species.bp_base_systolic + PRE_HIGH_BP_MOD) && blood_pressure_systolic <= (species.bp_base_systolic + HIGH_BP_MOD))
systolic_alert = BLOOD_PRESSURE_PRE_HIGH
else if (blood_pressure_systolic >= (species.bp_base_systolic + HIGH_BP_MOD))
systolic_alert = BLOOD_PRESSURE_HIGH
switch(bp[2])
if(BP_HIGH_DIASTOLIC to INFINITY)
diastolic_alert = BLOOD_PRESSURE_HIGH
if(BP_PRE_HIGH_DIASTOLIC to BP_HIGH_DIASTOLIC)
diastolic_alert = BLOOD_PRESSURE_PRE_HIGH
if(BP_IDEAL_DIASTOLIC to BP_PRE_HIGH_DIASTOLIC)
var/blood_pressure_disatolic = bp_list[2]
if (blood_pressure_disatolic)
if(blood_pressure_disatolic >= (species.bp_base_disatolic - BP_DIS_IDEAL_MOD) && blood_pressure_disatolic <= (species.bp_base_disatolic + HIGH_BP_MOD))
diastolic_alert = BLOOD_PRESSURE_IDEAL
if(-INFINITY to BP_IDEAL_DIASTOLIC)
else if (blood_pressure_disatolic >= (species.bp_base_disatolic - BP_DIS_IDEAL_MOD))
diastolic_alert = BLOOD_PRESSURE_LOW
else if (blood_pressure_disatolic >= (species.bp_base_disatolic + PRE_HIGH_BP_MOD) && blood_pressure_disatolic <= (species.bp_base_disatolic + PRE_HIGH_BP_MOD))
diastolic_alert = BLOOD_PRESSURE_PRE_HIGH
else if (blood_pressure_disatolic >= (species.bp_base_disatolic + HIGH_BP_MOD))
diastolic_alert = BLOOD_PRESSURE_HIGH
if(systolic_alert == BLOOD_PRESSURE_HIGH || diastolic_alert == BLOOD_PRESSURE_HIGH)
return BLOOD_PRESSURE_HIGH
@@ -191,6 +191,17 @@
var/sprint_cost_factor = 0.9 // Multiplier on stamina cost for sprinting
var/exhaust_threshold = 50 // When stamina runs out, the mob takes oxyloss up til this value. Then collapses and drops to walk
// Pulse modifiers
var/low_pulse = 40
var/norm_pulse = 60
var/fast_pulse = 90
var/v_fast_pulse = 120
var/max_pulse = 160
// Blood pressure modifiers
var/bp_base_systolic = 120
var/bp_base_disatolic = 80
var/gluttonous = 0 // Can eat some mobs. Values can be GLUT_TINY, GLUT_SMALLER, GLUT_ANYTHING, GLUT_ITEM_TINY, GLUT_ITEM_NORMAL, GLUT_ITEM_ANYTHING, GLUT_PROJECTILE_VOMIT
var/stomach_capacity = 5 // How much stuff they can stick in their stomach
var/allowed_eat_types = TYPE_ORGANIC
@@ -70,6 +70,14 @@
stamina = 90
sprint_speed_factor = 1.25 //Evolved for rapid escapes from predators
bp_base_systolic = 100 // Default 120
bp_base_disatolic = 60 // Default 80
low_pulse = 30 // Default 40
norm_pulse = 50 // Default 60
fast_pulse = 70 // Default 90
v_fast_pulse = 90 // Default 120
max_pulse = 130 // Default 160
body_temperature = T0C + 27
default_h_style = "Skrell Short Tentacles"
@@ -42,6 +42,13 @@
stamina_recovery = 4
sprint_speed_factor = 0.65
sprint_cost_factor = 0.75
bp_base_systolic = 140 // Default 120
bp_base_disatolic = 90 // Default 80
low_pulse = 50 // Default 40
norm_pulse = 70 // Default 60
fast_pulse = 100 // Default 90
v_fast_pulse = 130// Default 120
max_pulse = 170// Default 160
blurb = "The Tajaran race is a species of feline-like bipeds hailing from the planet of Adhomai in the S'rendarr \
system. They have been brought up into the space age by the Humans and Skrell, who alledgedly influenced their \
@@ -41,6 +41,14 @@
sprint_cost_factor = 1.45
sprint_speed_factor = 3.2
exhaust_threshold = 65
bp_base_systolic = 80 // Default 120
bp_base_disatolic = 50 // Default 80
low_pulse = 20 // Default 40
norm_pulse = 40 // Default 60
fast_pulse = 60 // Default 90
v_fast_pulse = 80// Default 120
max_pulse = 100// Default 160
body_temperature = T0C + 24
rarity_value = 3
break_cuffs = TRUE
+6
View File
@@ -0,0 +1,6 @@
author: TheGreyWolf
delete-after: True
changes:
- rscadd: "Blood pressure & pulse is now different for several species. The affected species are: Tajara, Unathi & Skrell. The latter two also now have a lower body temperature."