v1.4.0: fixed shadow clone not benefiting from antimagic
This commit is contained in:
+15
@@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
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.armor.glyphs.Brimstone;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel;
|
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
|
@Override
|
||||||
public float speed() {
|
public float speed() {
|
||||||
float speed = super.speed();
|
float speed = super.speed();
|
||||||
|
|||||||
+6
-1
@@ -97,7 +97,12 @@ public class AntiMagic extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
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;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -36,6 +36,7 @@ public class Brimstone extends Armor.Glyph {
|
|||||||
// GhostHero.isImmune
|
// GhostHero.isImmune
|
||||||
// Shadowclone.isImmune
|
// Shadowclone.isImmune
|
||||||
// ArmoredStatue.isImmune
|
// ArmoredStatue.isImmune
|
||||||
|
// PrismaticImage.isImmune
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user