v1.4.0: fixed shadow clone not benefiting from antimagic

This commit is contained in:
Evan Debenham
2022-08-16 14:27:41 -04:00
parent 95ab214283
commit 06e7e87256
3 changed files with 22 additions and 1 deletions

View File

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

View File

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

View File

@@ -36,6 +36,7 @@ public class Brimstone extends Armor.Glyph {
// GhostHero.isImmune
// Shadowclone.isImmune
// ArmoredStatue.isImmune
// PrismaticImage.isImmune
return damage;
}