use of com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Gauntlet in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Monk method attackProc.
@Override
public int attackProc(Char enemy, int damage) {
damage = super.attackProc(enemy, damage);
if (enemy == Dungeon.hero) {
Hero hero = Dungeon.hero;
KindOfWeapon weapon = hero.belongings.weapon;
if (weapon != null && !(weapon instanceof Knuckles) && !(weapon instanceof Gauntlet) && !weapon.cursed) {
if (hitsToDisarm == 0)
hitsToDisarm = Random.NormalIntRange(4, 8);
if (--hitsToDisarm == 0) {
hero.belongings.weapon = null;
Dungeon.quickslot.convertToPlaceholder(weapon);
weapon.updateQuickslot();
Dungeon.level.drop(weapon, hero.pos).sprite.drop();
GLog.w(Messages.get(this, "disarm", weapon.name()));
}
}
}
return damage;
}
Aggregations