Search in sources :

Example 1 with Shuriken

use of com.watabou.pixeldungeon.items.weapon.missiles.Shuriken in project pixel-dungeon by watabou.

the class HuntressArmor method doSpecial.

@Override
public void doSpecial() {
    Item proto = new Shuriken();
    for (Mob mob : Dungeon.level.mobs) {
        if (Level.fieldOfView[mob.pos]) {
            Callback callback = new Callback() {

                @Override
                public void call() {
                    curUser.attack(targets.get(this));
                    targets.remove(this);
                    if (targets.isEmpty()) {
                        curUser.spendAndNext(curUser.attackDelay());
                    }
                }
            };
            ((MissileSprite) curUser.sprite.parent.recycle(MissileSprite.class)).reset(curUser.pos, mob.pos, proto, callback);
            targets.put(callback, mob);
        }
    }
    if (targets.size() == 0) {
        GLog.w(TXT_NO_ENEMIES);
        return;
    }
    curUser.HP -= (curUser.HP / 3);
    curUser.sprite.zap(curUser.pos);
    curUser.busy();
}
Also used : Item(com.watabou.pixeldungeon.items.Item) Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Callback(com.watabou.utils.Callback) Shuriken(com.watabou.pixeldungeon.items.weapon.missiles.Shuriken) MissileSprite(com.watabou.pixeldungeon.sprites.MissileSprite)

Example 2 with Shuriken

use of com.watabou.pixeldungeon.items.weapon.missiles.Shuriken in project pixel-dungeon by watabou.

the class TenguSprite method attack.

@Override
public void attack(int cell) {
    if (!Level.adjacent(cell, ch.pos)) {
        ((MissileSprite) parent.recycle(MissileSprite.class)).reset(ch.pos, cell, new Shuriken(), new Callback() {

            @Override
            public void call() {
                ch.onAttackComplete();
            }
        });
        play(cast);
        turnTo(ch.pos, cell);
    } else {
        super.attack(cell);
    }
}
Also used : Callback(com.watabou.utils.Callback) Shuriken(com.watabou.pixeldungeon.items.weapon.missiles.Shuriken)

Aggregations

Shuriken (com.watabou.pixeldungeon.items.weapon.missiles.Shuriken)2 Callback (com.watabou.utils.Callback)2 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 Item (com.watabou.pixeldungeon.items.Item)1 MissileSprite (com.watabou.pixeldungeon.sprites.MissileSprite)1