Skip to content

Commit

Permalink
Some code cleanup + improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Nov 27, 2024
1 parent c2e9c83 commit 9a02821
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,24 @@
/datum/status_effect/his_grace/tick()
bloodlust = 0
var/graces = 0
for(var/obj/item/his_grace/HG in owner.held_items)
if(HG.bloodthirst > bloodlust)
bloodlust = HG.bloodthirst
if(HG.awakened)
for(var/obj/item/his_grace/his_grace in owner.held_items)
if(his_grace.bloodthirst > bloodlust)
bloodlust = his_grace.bloodthirst
if(his_grace.awakened)
graces++
if(!graces)
owner.apply_status_effect(/datum/status_effect/his_wrath)
qdel(src)
return
var/grace_heal = bloodlust * 0.05
owner.adjustBruteLoss(-grace_heal)
owner.adjustFireLoss(-grace_heal)
owner.adjustToxLoss(-grace_heal, TRUE, TRUE)
owner.adjustOxyLoss(-(grace_heal * 2))
owner.adjustCloneLoss(-grace_heal)
var/needs_update = FALSE // Optimization, if nothing changes then don't update our owner's health.
needs_update += owner.adjustBruteLoss(-grace_heal, updating_health = FALSE)
needs_update += owner.adjustFireLoss(-grace_heal, updating_health = FALSE)
needs_update += owner.adjustToxLoss(-grace_heal, updating_health = FALSE, forced = TRUE)
needs_update += owner.adjustOxyLoss(-(grace_heal * 2), updating_health = FALSE)
needs_update += owner.adjustCloneLoss(-grace_heal, updating_health = FALSE)
if(needs_update)
owner.updatehealth()


/datum/status_effect/wish_granters_gift //Fully revives after ten seconds.
Expand Down

0 comments on commit 9a02821

Please sign in to comment.