mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Swaps species.total_health for getMaxHealth() (#11940)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
70a02e5054
commit
af56c35214
@@ -75,7 +75,7 @@
|
|||||||
to fade to black...")))
|
to fade to black...")))
|
||||||
//to_world("Predicted hardcrit.")
|
//to_world("Predicted hardcrit.")
|
||||||
return 1
|
return 1
|
||||||
else if(predicted_damage >= victim.species.total_health / 2) // Or perhaps we're gonna go into 'oxy crit'.
|
else if(predicted_damage >= victim.getMaxHealth() / 2) // Or perhaps we're gonna go into 'oxy crit'.
|
||||||
to_chat(victim, span_danger("You feel really light-headed, and everything seems to be fading..."))
|
to_chat(victim, span_danger("You feel really light-headed, and everything seems to be fading..."))
|
||||||
//to_world("Predicted oxycrit.")
|
//to_world("Predicted oxycrit.")
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -1258,7 +1258,7 @@
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
//UNCONSCIOUS. NO-ONE IS HOME
|
//UNCONSCIOUS. NO-ONE IS HOME
|
||||||
if((getOxyLoss() > (species.total_health/2)) || (health <= (get_crit_point() * species.crit_mod)))
|
if((getOxyLoss() > (getMaxHealth()/2)) || (health <= (get_crit_point() * species.crit_mod)))
|
||||||
Paralyse(3)
|
Paralyse(3)
|
||||||
|
|
||||||
if(hallucination)
|
if(hallucination)
|
||||||
@@ -1280,11 +1280,11 @@
|
|||||||
if(oxyloss >= (getMaxHealth() * 0.3) && prob(5)) // If oxyloss exceeds 30% of your max health, you can take brain damage.
|
if(oxyloss >= (getMaxHealth() * 0.3) && prob(5)) // If oxyloss exceeds 30% of your max health, you can take brain damage.
|
||||||
adjustBrainLoss(brainOxPercent * oxyloss)
|
adjustBrainLoss(brainOxPercent * oxyloss)
|
||||||
|
|
||||||
if(halloss >= species.total_health)
|
if(halloss >= getMaxHealth())
|
||||||
to_chat(src, span_notice("You're in too much pain to keep going..."))
|
to_chat(src, span_notice("You're in too much pain to keep going..."))
|
||||||
src.visible_message(span_infoplain(span_bold("[src]") + " slumps to the ground, too weak to continue fighting."))
|
src.visible_message(span_infoplain(span_bold("[src]") + " slumps to the ground, too weak to continue fighting."))
|
||||||
Paralyse(10)
|
Paralyse(10)
|
||||||
setHalLoss(species.total_health - 1)
|
setHalLoss(getMaxHealth() - 1)
|
||||||
|
|
||||||
if(tiredness) //tiredness for vore drain
|
if(tiredness) //tiredness for vore drain
|
||||||
tiredness = (tiredness - 1)
|
tiredness = (tiredness - 1)
|
||||||
@@ -1532,6 +1532,48 @@
|
|||||||
else
|
else
|
||||||
clear_fullscreen("fear")
|
clear_fullscreen("fear")
|
||||||
|
|
||||||
|
if(healths)
|
||||||
|
if(chem_effects[CE_PAINKILLER] > 100)
|
||||||
|
healths.icon_state = "health_numb"
|
||||||
|
else
|
||||||
|
// Generate a by-limb health display.
|
||||||
|
var/mutable_appearance/healths_ma = new(healths)
|
||||||
|
healths_ma.icon_state = "blank"
|
||||||
|
healths_ma.overlays = null
|
||||||
|
healths_ma.plane = PLANE_PLAYER_HUD
|
||||||
|
|
||||||
|
var/no_damage = 1
|
||||||
|
var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
|
||||||
|
if(!(species.flags & NO_PAIN))
|
||||||
|
trauma_val = max(traumatic_shock,halloss)/getMaxHealth()
|
||||||
|
var/limb_trauma_val = trauma_val*0.3
|
||||||
|
// Collect and apply the images all at once to avoid appearance churn.
|
||||||
|
var/list/health_images = list()
|
||||||
|
for(var/obj/item/organ/external/E in organs)
|
||||||
|
if(no_damage && (E.brute_dam || E.burn_dam))
|
||||||
|
no_damage = 0
|
||||||
|
health_images += E.get_damage_hud_image(limb_trauma_val)
|
||||||
|
|
||||||
|
// Apply a fire overlay if we're burning.
|
||||||
|
if(on_fire || get_hallucination_component()?.get_hud_state() == HUD_HALLUCINATION_ONFIRE)
|
||||||
|
health_images += image('icons/mob/OnFire.dmi',"[get_fire_icon_state()]")
|
||||||
|
|
||||||
|
// Show a general pain/crit indicator if needed.
|
||||||
|
if(get_hallucination_component()?.get_hud_state() == HUD_HALLUCINATION_CRIT)
|
||||||
|
trauma_val = 2
|
||||||
|
if(trauma_val)
|
||||||
|
if(!(species.flags & NO_PAIN))
|
||||||
|
if(trauma_val > 0.7)
|
||||||
|
health_images += image('icons/mob/screen1_health.dmi',"softcrit")
|
||||||
|
if(trauma_val >= 1)
|
||||||
|
health_images += image('icons/mob/screen1_health.dmi',"hardcrit")
|
||||||
|
else if(no_damage)
|
||||||
|
health_images += image('icons/mob/screen1_health.dmi',"fullhealth")
|
||||||
|
|
||||||
|
healths_ma.add_overlay(health_images)
|
||||||
|
healths.appearance = healths_ma
|
||||||
|
|
||||||
|
|
||||||
var/fat_alert = /atom/movable/screen/alert/fat
|
var/fat_alert = /atom/movable/screen/alert/fat
|
||||||
var/hungry_alert = /atom/movable/screen/alert/hungry
|
var/hungry_alert = /atom/movable/screen/alert/hungry
|
||||||
var/starving_alert = /atom/movable/screen/alert/starving
|
var/starving_alert = /atom/movable/screen/alert/starving
|
||||||
|
|||||||
@@ -197,7 +197,7 @@
|
|||||||
if(100)
|
if(100)
|
||||||
C.nutrition = (C.nutrition + T.nutrition)
|
C.nutrition = (C.nutrition + T.nutrition)
|
||||||
T.nutrition = 0 //Completely drained of everything.
|
T.nutrition = 0 //Completely drained of everything.
|
||||||
var/damage_to_be_applied = T.species.total_health //Get their max health.
|
var/damage_to_be_applied = T.getMaxHealth() //Get their max health.
|
||||||
T.apply_damage(damage_to_be_applied, HALLOSS) //Knock em out.
|
T.apply_damage(damage_to_be_applied, HALLOSS) //Knock em out.
|
||||||
C.absorbing_prey = FALSE
|
C.absorbing_prey = FALSE
|
||||||
to_chat(C, span_notice("You have completely drained [T], causing them to pass out."))
|
to_chat(C, span_notice("You have completely drained [T], causing them to pass out."))
|
||||||
@@ -267,7 +267,7 @@
|
|||||||
to_chat(T, span_danger("You feel completely drained as [src] finishes draining you and begins to move onto draining you lethally, but you are too strong for them to do so!"))
|
to_chat(T, span_danger("You feel completely drained as [src] finishes draining you and begins to move onto draining you lethally, but you are too strong for them to do so!"))
|
||||||
nutrition = (nutrition + T.nutrition)
|
nutrition = (nutrition + T.nutrition)
|
||||||
T.nutrition = 0 //Completely drained of everything.
|
T.nutrition = 0 //Completely drained of everything.
|
||||||
var/damage_to_be_applied = T.species.total_health //Get their max health.
|
var/damage_to_be_applied = T.getMaxHealth() //Get their max health.
|
||||||
T.apply_damage(damage_to_be_applied, HALLOSS) //Knock em out.
|
T.apply_damage(damage_to_be_applied, HALLOSS) //Knock em out.
|
||||||
absorbing_prey = 0 //Clean this up before we return
|
absorbing_prey = 0 //Clean this up before we return
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
if(armor < 60)
|
if(armor < 60)
|
||||||
to_chat(target, span_danger("You feel extreme pain!"))
|
to_chat(target, span_danger("You feel extreme pain!"))
|
||||||
|
|
||||||
var/max_halloss = round(target.species.total_health * 0.8) //up to 80% of passing out
|
var/max_halloss = round(target.getMaxHealth() * 0.8) //up to 80% of passing out
|
||||||
affecting.adjustHalLoss(CLAMP(max_halloss - affecting.halloss, 0, 30))
|
affecting.adjustHalLoss(CLAMP(max_halloss - affecting.halloss, 0, 30))
|
||||||
|
|
||||||
/obj/item/grab/proc/attack_eye(mob/living/carbon/human/target, mob/living/carbon/human/attacker)
|
/obj/item/grab/proc/attack_eye(mob/living/carbon/human/target, mob/living/carbon/human/attacker)
|
||||||
|
|||||||
@@ -971,7 +971,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
|||||||
var/use_blood_colour = data.get_species_blood_colour(owner)
|
var/use_blood_colour = data.get_species_blood_colour(owner)
|
||||||
|
|
||||||
removed(null, ignore_children)
|
removed(null, ignore_children)
|
||||||
victim?.traumatic_shock += 60
|
victim?.shock_stage += 60
|
||||||
|
|
||||||
if(parent_organ)
|
if(parent_organ)
|
||||||
var/datum/wound/lost_limb/W = new (src, disintegrate, clean)
|
var/datum/wound/lost_limb/W = new (src, disintegrate, clean)
|
||||||
|
|||||||
Reference in New Issue
Block a user