v3.1.0: mirror images now benefit from body form and holy weapon when hero is unarmed
This commit is contained in:
+17
@@ -31,9 +31,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
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.BodyForm;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
|
||||||
@@ -177,6 +182,18 @@ public class MirrorImage extends NPC {
|
|||||||
}
|
}
|
||||||
return damage;
|
return damage;
|
||||||
} else {
|
} else {
|
||||||
|
//hero benefits from holy weapon and body form when unarmed, so do mirror images
|
||||||
|
boolean wasEnemy = enemy.alignment == Alignment.ENEMY;
|
||||||
|
if (hero.buff(BodyForm.BodyFormBuff.class) != null
|
||||||
|
&& hero.buff(BodyForm.BodyFormBuff.class).enchant() != null){
|
||||||
|
damage = hero.buff(BodyForm.BodyFormBuff.class).enchant().proc(new WornShortsword(), this, enemy, damage);
|
||||||
|
}
|
||||||
|
if (!wasEnemy || enemy.alignment == Alignment.ENEMY) {
|
||||||
|
if (hero.buff(HolyWeapon.HolyWepBuff.class) != null) {
|
||||||
|
int dmg = hero.subClass == HeroSubClass.PALADIN ? 6 : 2;
|
||||||
|
enemy.damage(Math.round(dmg * Weapon.Enchantment.genericProcChanceMultiplier(this)), HolyWeapon.INSTANCE);
|
||||||
|
}
|
||||||
|
}
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user