Search in sources :

Example 1 with Knuckles

use of com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles 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)

Example 2 with Knuckles

use of com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles in project shattered-pixel-dungeon-gdx by 00-Evan.

the class DisarmingTrap method activate.

@Override
public void activate() {
    Heap heap = Dungeon.level.heaps.get(pos);
    if (heap != null) {
        int cell = Dungeon.level.randomRespawnCell();
        if (cell != -1) {
            Item item = heap.pickUp();
            Dungeon.level.drop(item, cell).seen = true;
            for (int i : PathFinder.NEIGHBOURS9) Dungeon.level.visited[cell + i] = true;
            GameScene.updateFog();
            Sample.INSTANCE.play(Assets.SND_TELEPORT);
            CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4);
        }
    }
    if (Dungeon.hero.pos == pos) {
        Hero hero = Dungeon.hero;
        KindOfWeapon weapon = hero.belongings.weapon;
        if (weapon != null && !(weapon instanceof Knuckles) && !weapon.cursed) {
            int cell = Dungeon.level.randomRespawnCell();
            if (cell != -1) {
                hero.belongings.weapon = null;
                Dungeon.quickslot.clearItem(weapon);
                weapon.updateQuickslot();
                Dungeon.level.drop(weapon, cell).seen = true;
                for (int i : PathFinder.NEIGHBOURS9) Dungeon.level.visited[cell + i] = true;
                GameScene.updateFog();
                GLog.w(Messages.get(this, "disarm"));
                Sample.INSTANCE.play(Assets.SND_TELEPORT);
                CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4);
            }
        }
    }
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Knuckles(com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero) KindOfWeapon(com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon) Heap(com.shatteredpixel.shatteredpixeldungeon.items.Heap)

Aggregations

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