From 292b9979007f47938f1b89cf9a9451f723a37e44 Mon Sep 17 00:00:00 2001 From: YakumoChen Date: Wed, 23 Oct 2019 00:11:52 +0000 Subject: [PATCH] Update damage_procs.dm --- code/modules/mob/living/silicon/damage_procs.dm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm index 69d150b315..dd94e3e3f7 100644 --- a/code/modules/mob/living/silicon/damage_procs.dm +++ b/code/modules/mob/living/silicon/damage_procs.dm @@ -1,16 +1,17 @@ /mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE) var/hit_percent = (100-blocked)/100 - if(!damage || (hit_percent <= 0)) + if(!damage || (!forced && hit_percent <= 0)) return 0 + var/damage_amount = forced ? damage : damage * hit_percent switch(damagetype) if(BRUTE) - adjustBruteLoss(damage * hit_percent) + adjustBruteLoss(damage_amount, forced = forced) if(BURN) - adjustFireLoss(damage * hit_percent) + adjustFireLoss(damage_amount, forced = forced) if(OXY) - if(damage < 0) //we shouldn't be taking oxygen damage through this proc, but we'll let it heal. - adjustOxyLoss(damage * hit_percent) + if(damage < 0 || forced) //we shouldn't be taking oxygen damage through this proc, but we'll let it heal. + adjustOxyLoss(damage_amount, forced = forced) return 1 @@ -29,7 +30,7 @@ /mob/living/silicon/setCloneLoss(amount, updating_health = TRUE, forced = FALSE) return FALSE -/mob/living/silicon/adjustStaminaLoss(amount, updating_stamina = 1)//immune to stamina damage. +/mob/living/silicon/adjustStaminaLoss(amount, updating_stamina = 1, forced = FALSE)//immune to stamina damage. return FALSE /mob/living/silicon/setStaminaLoss(amount, updating_stamina = 1)