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

View File

@@ -25,8 +25,11 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
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.HeroSubClass;
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.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@@ -95,19 +98,26 @@ public class Skeleton extends Mob {
damage -= (preDmg - damage); //apply the flat reduction twice
}
ShieldOfLight.ShieldOfLightTracker shield = ch.buff( ShieldOfLight.ShieldOfLightTracker.class);
if (shield != null && shield.object == id()){
int min = 1 + Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT);
damage -= Random.NormalIntRange(min, 2*min);
damage -= Random.NormalIntRange(min, 2*min); //apply twice
damage = Math.max(damage, 0);
} else if (ch == Dungeon.hero
&& Dungeon.hero.heroClass != HeroClass.CLERIC
&& Dungeon.hero.hasTalent(Talent.SHIELD_OF_LIGHT)
&& TargetHealthIndicator.instance.target() == this){
//33/50%
if (Random.Int(6) < 1+Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT)){
damage -= 2; //doubled
if (ch.buff(MagicImmune.class) == null) {
ShieldOfLight.ShieldOfLightTracker shield = ch.buff(ShieldOfLight.ShieldOfLightTracker.class);
if (shield != null && shield.object == id()) {
int min = 1 + Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT);
damage -= Random.NormalIntRange(min, 2 * min);
damage -= Random.NormalIntRange(min, 2 * min); //apply twice
damage = Math.max(damage, 0);
} else if (ch == Dungeon.hero
&& Dungeon.hero.heroClass != HeroClass.CLERIC
&& Dungeon.hero.hasTalent(Talent.SHIELD_OF_LIGHT)
&& TargetHealthIndicator.instance.target() == this) {
//33/50%
if (Random.Int(6) < 1 + Dungeon.hero.pointsInTalent(Talent.SHIELD_OF_LIGHT)) {
damage -= 2; //doubled
}
}
if (ch.buff(HolyWard.HolyArmBuff.class) != null){
//doubled
damage -= Dungeon.hero.subClass == HeroSubClass.PALADIN ? 6 : 2;
}
}

View File

@@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
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.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@@ -129,7 +131,9 @@ public class ChaliceOfBlood extends Artifact {
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);
if (rockArmor != null) {