v1.1.0: moved endure and challenge arena on-damage logic so they activate before other hero-exclusive on-damage effects

This commit is contained in:
Evan Debenham 2021-11-08 15:52:33 -05:00
parent 94facc9bf5
commit 5024931e40
2 changed files with 14 additions and 11 deletions

View File

@ -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);
}

View File

@ -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);