Mostly fixes stamina by making knockdown() apply its staminaloss to the chest, giving adjuststaminaloss() new args, disabling limb-specific stamina regen for the chest, and disabling head stamina (#7596)
* fixes stamina (hopefully) * makes adjuststaminaloss() apply to the chest by default, makes it possible to target specific zones with adjuststaminaloss. * i dropped out of first grade dont bulli * REE * be patient im a dum * come on
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = FALSE)
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!damage || hit_percent <= 0)
|
||||
if(hit_percent <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/BP = null
|
||||
@@ -18,13 +18,13 @@
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
if(BP)
|
||||
if(BP.receive_damage(damage * hit_percent, 0))
|
||||
if(damage > 0 ? BP.receive_damage(damage * hit_percent, 0) : BP.heal_damage(abs(damage * hit_percent), 0))
|
||||
update_damage_overlays()
|
||||
else //no bodypart, we deal damage with a more general method.
|
||||
adjustBruteLoss(damage * hit_percent)
|
||||
if(BURN)
|
||||
if(BP)
|
||||
if(BP.receive_damage(0, damage * hit_percent))
|
||||
if(damage > 0 ? BP.receive_damage(0, damage * hit_percent) : BP.heal_damage(0, abs(damage * hit_percent)))
|
||||
update_damage_overlays()
|
||||
else
|
||||
adjustFireLoss(damage * hit_percent)
|
||||
@@ -36,7 +36,7 @@
|
||||
adjustCloneLoss(damage * hit_percent)
|
||||
if(STAMINA)
|
||||
if(BP)
|
||||
if(BP.receive_damage(0, 0, damage * hit_percent))
|
||||
if(damage > 0 ? BP.receive_damage(0, 0, damage * hit_percent) : BP.heal_damage(0, 0, abs(damage * hit_percent)))
|
||||
update_damage_overlays()
|
||||
else
|
||||
adjustStaminaLoss(damage * hit_percent)
|
||||
|
||||
@@ -1600,7 +1600,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H)
|
||||
var/hit_percent = (100-(blocked+armor))/100
|
||||
hit_percent = (hit_percent * (100-H.physiology.damage_resistance))/100
|
||||
if(!damage || hit_percent <= 0)
|
||||
if(hit_percent <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/BP = null
|
||||
@@ -1617,14 +1617,14 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
if(BRUTE)
|
||||
H.damageoverlaytemp = 20
|
||||
if(BP)
|
||||
if(BP.receive_damage(damage * hit_percent * brutemod * H.physiology.brute_mod, 0))
|
||||
if(damage > 0 ? BP.receive_damage(damage * hit_percent * brutemod * H.physiology.brute_mod, 0) : BP.heal_damage(abs(damage * hit_percent * brutemod * H.physiology.brute_mod), 0))
|
||||
H.update_damage_overlays()
|
||||
else//no bodypart, we deal damage with a more general method.
|
||||
H.adjustBruteLoss(damage * hit_percent * brutemod * H.physiology.brute_mod)
|
||||
if(BURN)
|
||||
H.damageoverlaytemp = 20
|
||||
if(BP)
|
||||
if(BP.receive_damage(0, damage * hit_percent * burnmod * H.physiology.burn_mod))
|
||||
if(damage > 0 ? BP.receive_damage(0, damage * hit_percent * burnmod * H.physiology.burn_mod) : BP.heal_damage(0, abs(damage * hit_percent * burnmod * H.physiology.burn_mod)))
|
||||
H.update_damage_overlays()
|
||||
else
|
||||
H.adjustFireLoss(damage * hit_percent * burnmod * H.physiology.burn_mod)
|
||||
@@ -1636,7 +1636,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
H.adjustCloneLoss(damage * hit_percent * H.physiology.clone_mod)
|
||||
if(STAMINA)
|
||||
if(BP)
|
||||
if(BP.receive_damage(0, 0, damage * hit_percent * H.physiology.stamina_mod))
|
||||
if(damage > 0 ? BP.receive_damage(0, 0, damage * hit_percent * H.physiology.stamina_mod) : BP.heal_damage(0, 0, abs(damage * hit_percent * H.physiology.stamina_mod)))
|
||||
H.update_stamina()
|
||||
else
|
||||
H.adjustStaminaLoss(damage * hit_percent * H.physiology.stamina_mod)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
var/stamina_dam = 0
|
||||
var/max_stamina_damage = 0
|
||||
var/max_damage = 0
|
||||
var/stam_heal_tick = 3 //per Life().
|
||||
var/stam_heal_tick = 0 //per Life(). Defaults to 0 due to citadel changes
|
||||
|
||||
var/brute_reduction = 0 //Subtracted to brute damage taken
|
||||
var/burn_reduction = 0 //Subtracted to burn damage taken
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
//Return TRUE to get whatever mob this is in to update health.
|
||||
/obj/item/bodypart/proc/on_life()
|
||||
if(stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life.
|
||||
if(stam_heal_tick && stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life.
|
||||
if(heal_damage(brute = 0, burn = 0, stamina = stam_heal_tick, only_robotic = FALSE, only_organic = FALSE, updating_health = FALSE))
|
||||
. |= BODYPART_LIFE_UPDATE_HEALTH
|
||||
|
||||
@@ -441,7 +441,7 @@
|
||||
px_x = 0
|
||||
px_y = 0
|
||||
stam_damage_coeff = 1
|
||||
max_stamina_damage = 100
|
||||
max_stamina_damage = 200
|
||||
var/obj/item/cavity_item
|
||||
|
||||
/obj/item/bodypart/chest/Destroy()
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
px_x = 0
|
||||
px_y = -8
|
||||
stam_damage_coeff = 1
|
||||
max_stamina_damage = 100
|
||||
max_stamina_damage = 0 //Setting this to 0 since this has the same exact effects as the chest when disabled
|
||||
|
||||
var/mob/living/brain/brainmob = null //The current occupant.
|
||||
var/obj/item/organ/brain/brain = null //The brain organ
|
||||
|
||||
Reference in New Issue
Block a user