Search in sources :

Example 1 with Gauntlet

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;
}
Also used : Knuckles(com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles) Gauntlet(com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Gauntlet) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero) KindOfWeapon(com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon)

Aggregations

Hero (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)1 KindOfWeapon (com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon)1 Gauntlet (com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Gauntlet)1 Knuckles (com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles)1