From 5024931e40513d06caaecc7df7b31fa979f54e54 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 8 Nov 2021 15:52:33 -0500 Subject: [PATCH] v1.1.0: moved endure and challenge arena on-damage logic so they activate before other hero-exclusive on-damage effects --- .../shatteredpixeldungeon/actors/Char.java | 12 +----------- .../shatteredpixeldungeon/actors/hero/Hero.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 20522edf8..7ea9a8c0d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -594,17 +594,6 @@ public abstract class Char extends Actor { if (alignment != Alignment.ALLY && this.buff(DeathMark.DeathMarkTracker.class) != null){ dmg *= 1.25f; } - Endure.EndureTracker endure = buff(Endure.EndureTracker.class); - if (!(src instanceof Char)){ - //reduce damage here if it isn't coming from a character (if it is we already reduced it) - if (endure != null){ - dmg = endure.adjustDamageTaken(dmg); - } - //the same also applies to challenge scroll damage reduction - if (buff(ScrollOfChallenge.ChallengeArena.class) != null){ - dmg *= 0.67f; - } - } Class srcClass = src.getClass(); if (isImmune( srcClass )) { @@ -623,6 +612,7 @@ public abstract class Char extends Actor { buff( Paralysis.class ).processDamage(dmg); } + Endure.EndureTracker endure = buff(Endure.EndureTracker.class); if (endure != null){ dmg = endure.enforceDamagetakenLimit(dmg); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 670d99303..356a1344b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -101,6 +101,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfMight; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfTenacity; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLivingEarth; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; @@ -1194,6 +1195,18 @@ public class Hero extends Char { GLog.w( Messages.get(this, "pain_resist") ); } + Endure.EndureTracker endure = buff(Endure.EndureTracker.class); + if (!(src instanceof Char)){ + //reduce damage here if it isn't coming from a character (if it is we already reduced it) + if (endure != null){ + dmg = endure.adjustDamageTaken(dmg); + } + //the same also applies to challenge scroll damage reduction + if (buff(ScrollOfChallenge.ChallengeArena.class) != null){ + dmg *= 0.67f; + } + } + CapeOfThorns.Thorns thorns = buff( CapeOfThorns.Thorns.class ); if (thorns != null) { dmg = thorns.proc(dmg, (src instanceof Char ? (Char)src : null), this);