Skip to content

Commit

Permalink
[MIRROR] Fix some attack effects not playing / Fix apply_damage ret…
Browse files Browse the repository at this point in the history
…urning innacurate values (#1114)

* Fix some attack effects not playing / Fix `apply_damage` returning innacurate values

* Update damage_procs.dm

---------

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Mal <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Feb 24, 2024
1 parent 2834330 commit 66c5038
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions code/modules/mob/living/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
update_damage_overlays()
damage_dealt = actual_hit.get_damage() - delta // Unfortunately bodypart receive_damage doesn't return damage dealt so we do it manually
else
damage_dealt = adjustBruteLoss(damage_amount, forced = forced)
damage_dealt = -1 * adjustBruteLoss(damage_amount, forced = forced)
INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living, adjust_pain), damage_amount) // NOVA EDIT ADDITION - ERP Pain
if(BURN)
if(isbodypart(def_zone))
Expand All @@ -78,18 +78,18 @@
damage_source = attacking_item,
))
update_damage_overlays()
damage_dealt = delta - actual_hit.get_damage() // See above
damage_dealt = actual_hit.get_damage() - delta // See above
else
damage_dealt = adjustFireLoss(damage_amount, forced = forced)
damage_dealt = -1 * adjustFireLoss(damage_amount, forced = forced)
INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living, adjust_pain), damage_amount) // NOVA EDIT ADDITION - ERP Pain
if(TOX)
damage_dealt = adjustToxLoss(damage_amount, forced = forced)
damage_dealt = -1 * adjustToxLoss(damage_amount, forced = forced)
if(OXY)
damage_dealt = adjustOxyLoss(damage_amount, forced = forced)
damage_dealt = -1 * adjustOxyLoss(damage_amount, forced = forced)
if(STAMINA)
damage_dealt = adjustStaminaLoss(damage_amount, forced = forced)
damage_dealt = -1 * adjustStaminaLoss(damage_amount, forced = forced)
if(BRAIN)
damage_dealt = adjustOrganLoss(ORGAN_SLOT_BRAIN, damage_amount)
damage_dealt = -1 * adjustOrganLoss(ORGAN_SLOT_BRAIN, damage_amount)

SEND_SIGNAL(src, COMSIG_MOB_AFTER_APPLY_DAMAGE, damage_dealt, damagetype, def_zone, blocked, wound_bonus, bare_wound_bonus, sharpness, attack_direction, attacking_item)
return damage_dealt
Expand Down

0 comments on commit 66c5038

Please sign in to comment.