v3.3.0: fixed holy ward not applying to bone explosions or chalice

This commit is contained in:
Evan Debenham
2025-10-15 12:57:44 -04:00
parent ffeb28ea55
commit 0087edf62c
2 changed files with 28 additions and 14 deletions
@@ -25,8 +25,11 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWard;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.ShieldOfLight; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.ShieldOfLight;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@@ -95,22 +98,29 @@ public class Skeleton extends Mob {
damage -= (preDmg - damage); //apply the flat reduction twice damage -= (preDmg - damage); //apply the flat reduction twice
} }
ShieldOfLight.ShieldOfLightTracker shield = ch.buff( ShieldOfLight.ShieldOfLightTracker.class); if (ch.buff(MagicImmune.class) == null) {
if (shield != null && shield.object == id()){ ShieldOfLight.ShieldOfLightTracker shield = ch.buff(ShieldOfLight.ShieldOfLightTracker.class);
if (shield != null && shield.object == id()) {
int min = 1 + Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT); int min = 1 + Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT);
damage -= Random.NormalIntRange(min, 2*min); damage -= Random.NormalIntRange(min, 2 * min);
damage -= Random.NormalIntRange(min, 2*min); //apply twice damage -= Random.NormalIntRange(min, 2 * min); //apply twice
damage = Math.max(damage, 0); damage = Math.max(damage, 0);
} else if (ch == Dungeon.hero } else if (ch == Dungeon.hero
&& Dungeon.hero.heroClass != HeroClass.CLERIC && Dungeon.hero.heroClass != HeroClass.CLERIC
&& Dungeon.hero.hasTalent(Talent.SHIELD_OF_LIGHT) && Dungeon.hero.hasTalent(Talent.SHIELD_OF_LIGHT)
&& TargetHealthIndicator.instance.target() == this){ && TargetHealthIndicator.instance.target() == this) {
//33/50% //33/50%
if (Random.Int(6) < 1+Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT)){ if (Random.Int(6) < 1 + Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT)) {
damage -= 2; //doubled damage -= 2; //doubled
} }
} }
if (ch.buff(HolyWard.HolyArmBuff.class) != null){
//doubled
damage -= Dungeon.hero.subClass == HeroSubClass.PALADIN ? 6 : 2;
}
}
//apply DR twice (with 2 rolls for more consistency) //apply DR twice (with 2 rolls for more consistency)
damage = Math.max( 0, damage - (ch.drRoll() + ch.drRoll()) ); damage = Math.max( 0, damage - (ch.drRoll() + ch.drRoll()) );
ch.damage( damage, this ); ch.damage( damage, this );
@@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWard;
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText; import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@@ -129,7 +131,9 @@ public class ChaliceOfBlood extends Artifact {
damage = armor.absorb(damage); damage = armor.absorb(damage);
} }
if (hero.buff(MagicImmune.class) != null && hero.buff(HolyWard.HolyArmBuff.class) != null){
damage -= hero.subClass == HeroSubClass.PALADIN ? 3 : 1;
}
WandOfLivingEarth.RockArmor rockArmor = hero.buff(WandOfLivingEarth.RockArmor.class); WandOfLivingEarth.RockArmor rockArmor = hero.buff(WandOfLivingEarth.RockArmor.class);
if (rockArmor != null) { if (rockArmor != null) {