mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 06:28:01 +01:00
Proper MaxHealth checks and Crit Point (#17704)
* Fixes maxhealth checks not including modifiers and mxHP Death at: W/ 100max hp: https://i.imgur.com/nR8DtzG.png W/ 125max hp: https://i.imgur.com/87eD2hW.png W/ 25max hp: https://i.imgur.com/SP6rPWc.png * Crit Point * small xenochimera fix * Update game_options.txt
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
blinded = 1
|
||||
silent = 0
|
||||
else //ALIVE. LIGHTS ARE ON
|
||||
if( !container && (health < CONFIG_GET(number/health_threshold_dead) || ((world.time - timeofhostdeath) > CONFIG_GET(number/revival_brain_life))) )
|
||||
if( !container && (health < -getMaxHealth() || ((world.time - timeofhostdeath) > CONFIG_GET(number/revival_brain_life))) )
|
||||
death()
|
||||
blinded = 1
|
||||
silent = 0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
//Start of a breath chain, calls breathe()
|
||||
/mob/living/carbon/handle_breathing()
|
||||
if(SSair.current_cycle%4==2 || failed_last_breath || (health < CONFIG_GET(number/health_threshold_crit))) //First, resolve location and get a breath
|
||||
if(SSair.current_cycle%4==2 || failed_last_breath || (health < get_crit_point())) //First, resolve location and get a breath
|
||||
breathe()
|
||||
|
||||
/mob/living/carbon/proc/breathe()
|
||||
@@ -12,7 +12,7 @@
|
||||
var/datum/gas_mixture/breath = null
|
||||
|
||||
//First, check if we can breathe at all
|
||||
if(health < CONFIG_GET(number/health_threshold_crit) && !(CE_STABLE in chem_effects)) //crit aka circulatory shock
|
||||
if(health < get_crit_point() && !(CE_STABLE in chem_effects)) //crit aka circulatory shock
|
||||
AdjustLosebreath(1)
|
||||
|
||||
if(losebreath>0) //Suffocating so do not take a breath
|
||||
|
||||
@@ -165,11 +165,11 @@
|
||||
return shock_damage
|
||||
|
||||
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
|
||||
if (src.health >= CONFIG_GET(number/health_threshold_crit))
|
||||
if (health >= get_crit_point())
|
||||
if(src == M && ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
var/datum/gender/T = GLOB.gender_datums[H.get_visible_gender()]
|
||||
src.visible_message( \
|
||||
visible_message( \
|
||||
span_notice("[src] examines [T.himself]."), \
|
||||
span_notice("You check yourself for injuries.") \
|
||||
)
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
return FALSE;
|
||||
|
||||
//todo: make this whole CPR check into it's own individual proc instead of hogging up attack_hand_help_intent
|
||||
if((istype(H) && (health < CONFIG_GET(number/health_threshold_crit)) || stat == DEAD) && !on_fire) //Only humans can do CPR.
|
||||
if((istype(H) && (health < get_crit_point()) || stat == DEAD) && !on_fire) //Only humans can do CPR.
|
||||
if(!H.check_has_mouth())
|
||||
to_chat(H, span_danger("You don't have a mouth, you cannot perform CPR!"))
|
||||
return FALSE
|
||||
@@ -576,7 +576,7 @@
|
||||
chest.fracture()
|
||||
|
||||
// standard CPR ahead, adjust oxy and refresh health
|
||||
if(health > CONFIG_GET(number/health_threshold_crit) && prob(10))
|
||||
if(health > get_crit_point() && prob(10))
|
||||
if(get_xenochimera_component())
|
||||
visible_message(span_danger("\The [src]'s body twitches and gurgles a bit."))
|
||||
to_chat(reviver, span_danger("You get the feeling [src] can't be revived by CPR alone."))
|
||||
@@ -628,7 +628,7 @@
|
||||
// A bit of sanity.
|
||||
var/brain_damage = between(getBrainLoss(), damage_calc, brain.max_damage)
|
||||
setBrainLoss(brain_damage)
|
||||
else if(health > CONFIG_GET(number/health_threshold_dead))
|
||||
else if(health > -getMaxHealth())
|
||||
adjustOxyLoss(-(min(getOxyLoss(), 5)))
|
||||
updatehealth()
|
||||
to_chat(src, span_notice("You feel a breath of fresh air enter your lungs. It feels good."))
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
health = getMaxHealth() - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
||||
|
||||
//TODO: fix husking
|
||||
if( ((getMaxHealth() - total_burn) < CONFIG_GET(number/health_threshold_dead) * huskmodifier) && stat == DEAD)
|
||||
if( ((getMaxHealth() - total_burn) < (-getMaxHealth()) * huskmodifier) && stat == DEAD)
|
||||
ChangeToHusk()
|
||||
return
|
||||
|
||||
|
||||
@@ -609,7 +609,7 @@
|
||||
|
||||
if(!breath || (breath.total_moles == 0))
|
||||
failed_last_breath = 1
|
||||
if(health > CONFIG_GET(number/health_threshold_crit))
|
||||
if(health > get_crit_point())
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
else
|
||||
adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS)
|
||||
@@ -1293,7 +1293,7 @@
|
||||
else //ALIVE. LIGHTS ARE ON
|
||||
updatehealth() //TODO
|
||||
|
||||
if(health <= CONFIG_GET(number/health_threshold_dead) || (should_have_organ(O_BRAIN) && !has_brain()))
|
||||
if(health <= (-getMaxHealth()) || (should_have_organ(O_BRAIN) && !has_brain()))
|
||||
death()
|
||||
blinded = 1
|
||||
silent = 0
|
||||
@@ -1301,7 +1301,7 @@
|
||||
return 1
|
||||
|
||||
//UNCONSCIOUS. NO-ONE IS HOME
|
||||
if((getOxyLoss() > (species.total_health/2)) || (health <= (CONFIG_GET(number/health_threshold_crit) * species.crit_mod)))
|
||||
if((getOxyLoss() > (species.total_health/2)) || (health <= (get_crit_point() * species.crit_mod)))
|
||||
Paralyse(3)
|
||||
|
||||
if(hallucination)
|
||||
@@ -2106,7 +2106,7 @@
|
||||
if(stat == DEAD)
|
||||
holder.icon_state = "-100" // X_X
|
||||
else
|
||||
holder.icon_state = RoundHealth((health-CONFIG_GET(number/health_threshold_crit))/(getMaxHealth()-CONFIG_GET(number/health_threshold_crit))*100)
|
||||
holder.icon_state = RoundHealth((health-get_crit_point())/(getMaxHealth()-get_crit_point())*100)
|
||||
if(block_hud)
|
||||
holder.icon_state = "hudblank"
|
||||
health_us.icon_state = holder.icon_state
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
|
||||
H.maxHealth = total_health
|
||||
|
||||
H.health = H.maxHealth
|
||||
H.health = H.getMaxHealth()
|
||||
|
||||
/datum/species/shadekin/produceCopy(var/list/traits, var/mob/living/carbon/human/H, var/custom_base, var/reset_dna = TRUE) // Traitgenes reset_dna flag required, or genes get reset on resleeve
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
if(!breath || (breath.total_moles == 0))
|
||||
H.failed_last_breath = 1
|
||||
if(H.health > CONFIG_GET(number/health_threshold_crit))
|
||||
if(H.health > H.get_crit_point())
|
||||
H.adjustOxyLoss(ALRAUNE_MAX_OXYLOSS)
|
||||
else
|
||||
H.adjustOxyLoss(ALRAUNE_CRIT_MAX_OXYLOSS)
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
pseudodead = 1
|
||||
|
||||
/datum/species/protean/handle_environment_special(var/mob/living/carbon/human/H)
|
||||
if((H.getActualBruteLoss() + H.getActualFireLoss()) > H.maxHealth*0.5 && isturf(H.loc)) //So, only if we're not a blob (we're in nullspace) or in someone (or a locker, really, but whatever)
|
||||
if((H.getActualBruteLoss() + H.getActualFireLoss()) > H.getMaxHealth()*0.5 && isturf(H.loc)) //So, only if we're not a blob (we're in nullspace) or in someone (or a locker, really, but whatever)
|
||||
return ..() //Any instakill shot runtimes since there are no organs after this. No point to not skip these checks, going to nullspace anyway.
|
||||
|
||||
var/obj/item/organ/internal/nano/refactory/refactory = locate() in H.internal_organs
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
amount *= M.incoming_healing_percent
|
||||
|
||||
if(tf_mob_holder && tf_mob_holder.loc == src)
|
||||
var/dmgmultiplier = tf_mob_holder.maxHealth / maxHealth
|
||||
var/dmgmultiplier = tf_mob_holder.getMaxHealth() / getMaxHealth()
|
||||
dmgmultiplier *= amount
|
||||
tf_mob_holder.adjustBruteLoss(dmgmultiplier)
|
||||
|
||||
@@ -358,7 +358,7 @@
|
||||
if(!isnull(M.incoming_healing_percent))
|
||||
amount *= M.incoming_healing_percent
|
||||
if(tf_mob_holder && tf_mob_holder.loc == src)
|
||||
var/dmgmultiplier = tf_mob_holder.maxHealth / maxHealth
|
||||
var/dmgmultiplier = tf_mob_holder.getMaxHealth() / getMaxHealth()
|
||||
dmgmultiplier *= amount
|
||||
tf_mob_holder.adjustFireLoss(dmgmultiplier)
|
||||
fireloss = min(max(fireloss + amount, 0),(getMaxHealth()*2))
|
||||
@@ -442,6 +442,16 @@
|
||||
result *= M.max_health_percent
|
||||
return result
|
||||
|
||||
///Use this proc to get the damage in which the mob will be put into critical condition (hardcrit)
|
||||
/mob/living/proc/get_crit_point()
|
||||
return -(getMaxHealth()*0.5)
|
||||
|
||||
/mob/living/carbon/human/get_crit_point()
|
||||
var/crit_point = -(getMaxHealth()*0.5)
|
||||
if(species.crit_mod)
|
||||
crit_point *= species.crit_mod
|
||||
return crit_point
|
||||
|
||||
/mob/living/proc/setMaxHealth(var/newMaxHealth)
|
||||
var/h_mult = maxHealth / newMaxHealth //Calculate change multiplier
|
||||
if(bruteloss) //In case a damage value is 0, divide by 0 bad
|
||||
@@ -1240,7 +1250,7 @@
|
||||
add_attack_logs(src,M,"Thrown via grab to [end_T.x],[end_T.y],[end_T.z]")
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/N = M
|
||||
if((N.health + N.halloss) < CONFIG_GET(number/health_threshold_crit) || N.stat == DEAD)
|
||||
if((N.health + N.halloss) < N.get_crit_point() || N.stat == DEAD)
|
||||
N.adjustBruteLoss(rand(10,30))
|
||||
src.drop_from_inventory(G)
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
// Returns percentage of AI's remaining hardware integrity (maxhealth - (bruteloss + fireloss))
|
||||
/mob/living/silicon/ai/proc/hardware_integrity()
|
||||
return (health - CONFIG_GET(number/health_threshold_dead)) / 2
|
||||
return (health - (-getMaxHealth())) / 2
|
||||
|
||||
// Shows capacitor charge and hardware integrity information to the AI in Status tab.
|
||||
/mob/living/silicon/ai/show_system_integrity()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
if (src.stat == 2)
|
||||
return
|
||||
else
|
||||
if (src.health <= CONFIG_GET(number/health_threshold_dead) && src.stat != 2)
|
||||
if (src.health <= (-getMaxHealth()) && src.stat != 2)
|
||||
death()
|
||||
return
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
//if(resting) // VOREStation edit. Our borgos would rather not.
|
||||
// Weaken(5)
|
||||
|
||||
if(health < CONFIG_GET(number/health_threshold_dead) && stat != 2) //die only once
|
||||
if(health < (-getMaxHealth()) && stat != 2) //die only once
|
||||
death()
|
||||
|
||||
if (stat != 2) //Alive.
|
||||
@@ -242,7 +242,7 @@
|
||||
healths.icon_state = "health3"
|
||||
else if(health >= 0)
|
||||
healths.icon_state = "health4"
|
||||
else if(health >= CONFIG_GET(number/health_threshold_dead))
|
||||
else if(health >= (-getMaxHealth()))
|
||||
healths.icon_state = "health5"
|
||||
else
|
||||
healths.icon_state = "health6"
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
for(var/i = 1 to spiderling_count)
|
||||
if(prob(swarmling_prob) && src)
|
||||
var/mob/living/simple_mob/animal/giant_spider/swarmling = new swarmling_type(src.loc)
|
||||
var/swarm_health = FLOOR(swarmling.maxHealth * 0.4, 1)
|
||||
var/swarm_health = FLOOR(swarmling.getMaxHealth() * 0.4, 1)
|
||||
var/swarm_dam_lower = FLOOR(melee_damage_lower * 0.4, 1)
|
||||
var/swarm_dam_upper = FLOOR(melee_damage_upper * 0.4, 1)
|
||||
swarmling.name = "spiderling"
|
||||
|
||||
@@ -237,7 +237,7 @@ GLOBAL_LIST_EMPTY(wounds_being_tended_by_drakes)
|
||||
return critter.health < (critter.getMaxHealth() * critter.sap_heal_threshold)
|
||||
|
||||
// Other animals just need to be injured.
|
||||
return (friend.health < friend.maxHealth)
|
||||
return (friend.health < friend.getMaxHealth())
|
||||
|
||||
/mob/living/simple_mob/animal/sif/grafadreka/Initialize(mapload)
|
||||
|
||||
@@ -435,12 +435,12 @@ GLOBAL_LIST_EMPTY(wounds_being_tended_by_drakes)
|
||||
|
||||
if(!can_tend_wounds(friend))
|
||||
if(friend == src)
|
||||
if(health == maxHealth)
|
||||
if(health == getMaxHealth())
|
||||
to_chat(src, span_warning("You are unwounded."))
|
||||
else
|
||||
to_chat(src, span_warning("You cannot tend any of your wounds."))
|
||||
else
|
||||
if(friend.health == friend.maxHealth)
|
||||
if(friend.health == friend.getMaxHealth())
|
||||
return ..()
|
||||
to_chat(src, span_warning("You cannot tend any of \the [friend]'s wounds."))
|
||||
return TRUE
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
// return FALSE
|
||||
//VOREStation add start
|
||||
else if(forgive_resting && !isbelly(holder.loc)) //Doing it this way so we only think about the other conditions if the var is actually set
|
||||
if((holder.health == holder.maxHealth) && !hostile && (L.resting || L.weakened || L.stunned)) //If our health is full, no one is fighting us, we can forgive
|
||||
if((holder.health == holder.getMaxHealth()) && !hostile && (L.resting || L.weakened || L.stunned)) //If our health is full, no one is fighting us, we can forgive
|
||||
var/mob/living/simple_mob/vore/eater = holder
|
||||
if(!eater.will_eat(L)) //We forgive people we can eat by eating them
|
||||
set_stance(STANCE_IDLE)
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
set_stance(STANCE_FLEE)
|
||||
return
|
||||
|
||||
if((holder.health < (holder.maxHealth / 4)) && !used_invis)
|
||||
if((holder.health < (holder.getMaxHealth() / 4)) && !used_invis)
|
||||
holder.cloak()
|
||||
used_invis = 1
|
||||
step_away(holder, target, 8)
|
||||
|
||||
@@ -939,7 +939,7 @@ I think I covered everything.
|
||||
return
|
||||
if(P.suiciding)
|
||||
return
|
||||
if(P.health <= (P.maxHealth * 0.95)) //Nom em'
|
||||
if(P.health <= (P.getMaxHealth() * 0.95)) //Nom em'
|
||||
if(vocal)
|
||||
if(last_speak + 30 SECONDS < world.time)
|
||||
var/message_options = list(
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
// return FALSE
|
||||
//VOREStation add start
|
||||
else if(forgive_resting && !isbelly(holder.loc)) //Doing it this way so we only think about the other conditions if the var is actually set
|
||||
if((holder.health == holder.maxHealth) && !hostile && (L.resting || L.weakened || L.stunned)) //If our health is full, no one is fighting us, we can forgive
|
||||
if((holder.health == holder.getMaxHealth()) && !hostile && (L.resting || L.weakened || L.stunned)) //If our health is full, no one is fighting us, we can forgive
|
||||
var/mob/living/simple_mob/vore/eater = holder
|
||||
if(!eater.will_eat(L)) //We forgive people we can eat by eating them
|
||||
set_stance(STANCE_IDLE)
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
/mob/living/simple_mob/shadekin/Found(var/atom/A)
|
||||
if(specific_targets && isliving(A)) //Healing!
|
||||
var/mob/living/L = A
|
||||
var/health_percent = (L.health/L.maxHealth)*100
|
||||
var/health_percent = (L.health/L.getMaxHealth())*100
|
||||
if(health_percent <= 50 && will_eat(A))
|
||||
return A
|
||||
. = ..()
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
// return FALSE
|
||||
//VOREStation add start
|
||||
else if(forgive_resting && !isbelly(holder.loc)) //Doing it this way so we only think about the other conditions if the var is actually set
|
||||
if((holder.health == holder.maxHealth) && !hostile && (L.resting || L.weakened || L.stunned)) //If our health is full, no one is fighting us, we can forgive
|
||||
if((holder.health == holder.getMaxHealth()) && !hostile && (L.resting || L.weakened || L.stunned)) //If our health is full, no one is fighting us, we can forgive
|
||||
var/mob/living/simple_mob/vore/eater = holder
|
||||
if(!eater.will_eat(L)) //We forgive people we can eat by eating them
|
||||
set_stance(STANCE_IDLE)
|
||||
|
||||
Reference in New Issue
Block a user