diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java index cc7fec05b..7cda1fe17 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java @@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel; @@ -262,6 +263,20 @@ public class ShadowClone extends ArmorAbility { } } + @Override + public void damage(int dmg, Object src) { + + //TODO improve this when I have proper damage source logic + if (Random.Int(4) < Dungeon.hero.pointsInTalent(Talent.CLONED_ARMOR) + && Dungeon.hero.belongings.armor() != null + && Dungeon.hero.belongings.armor().hasGlyph(AntiMagic.class, this) + && AntiMagic.RESISTS.contains(src.getClass())){ + dmg -= AntiMagic.drRoll(Dungeon.hero.belongings.armor().buffedLvl()); + } + + super.damage(dmg, src); + } + @Override public float speed() { float speed = super.speed(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java index 1cc850723..f1b0e2c72 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java @@ -97,7 +97,12 @@ public class AntiMagic extends Armor.Glyph { @Override public int proc(Armor armor, Char attacker, Char defender, int damage) { - //no proc effect, see Hero.damage and GhostHero.damage and ArmoredStatue.damage + //no proc effect, see: + // Hero.damage + // GhostHero.damage + // Shadowclone.damage + // ArmoredStatue.damage + // PrismaticImage.damage return damage; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java index 1771dd902..6ba9ed514 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java @@ -36,6 +36,7 @@ public class Brimstone extends Armor.Glyph { // GhostHero.isImmune // Shadowclone.isImmune // ArmoredStatue.isImmune + // PrismaticImage.isImmune return damage; }