Search in sources :

Example 6 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.

the class ScrollOfTerror method doRead.

@Override
protected void doRead() {
    new Flare(5, 32).color(0xFF0000, true).show(getCurUser().getSprite(), 2f);
    Sample.INSTANCE.play(Assets.SND_READ);
    Invisibility.dispel(getCurUser());
    int count = 0;
    Mob affected = null;
    for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
        if (Dungeon.level.fieldOfView[mob.getPos()]) {
            Terror terror = Buff.affect(mob, Terror.class, Terror.DURATION);
            terror.source = getCurUser();
            count++;
            affected = mob;
        }
    }
    switch(count) {
        case 0:
            GLog.i(Game.getVar(R.string.ScrollOfTerror_Info1));
            break;
        case 1:
            GLog.i(Utils.format(Game.getVar(R.string.ScrollOfTerror_Info2), affected.getName()));
            break;
        default:
            GLog.i(Game.getVar(R.string.ScrollOfTerror_Info3));
    }
    setKnown();
    getCurUser().spendAndNext(TIME_TO_READ);
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Flare(com.watabou.pixeldungeon.effects.Flare) Terror(com.watabou.pixeldungeon.actors.buffs.Terror)

Example 7 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.

the class GnollArmor method doSpecial.

@Override
public void doSpecial() {
    SpellSprite.show(getCurUser(), SpellSprite.DOMINATION);
    Sample.INSTANCE.play(Assets.SND_DOMINANCE);
    int mobsDominated = 0;
    for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
        if (Dungeon.level.fieldOfView[mob.getPos()]) {
            if (mob.canBePet()) {
                Mob.makePet(mob, getCurUser());
                new Flare(3, 32).show(mob.getSprite(), 2f);
            }
            if (mobsDominated > getCurUser().lvl() / 10) {
                break;
            }
        }
    }
    getCurUser().spend(Actor.TICK);
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Flare(com.watabou.pixeldungeon.effects.Flare)

Example 8 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.

the class King method summon.

private void summon() {
    lastPedestal = targetPedestal;
    getSprite().centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2);
    Sample.INSTANCE.play(Assets.SND_CHALLENGE);
    int undeadsToSummon = maxArmySize() - Undead.count;
    Level level = Dungeon.level;
    for (int i = 0; i < undeadsToSummon; i++) {
        int pos = level.getEmptyCellNextTo(lastPedestal);
        if (level.cellValid(pos)) {
            Mob servant = new Undead();
            servant.setPos(pos);
            level.spawnMob(servant, 0);
            WandOfBlink.appear(servant, pos);
            new Flare(3, 32).color(0x000000, false).show(servant.getSprite(), 2f);
            Actor.addDelayed(new Pushing(servant, lastPedestal, servant.getPos()), -1);
        }
    }
    yell(Game.getVar(R.string.King_Info2));
}
Also used : UndeadMob(com.nyrds.pixeldungeon.mobs.necropolis.UndeadMob) Flare(com.watabou.pixeldungeon.effects.Flare) Pushing(com.watabou.pixeldungeon.effects.Pushing) Level(com.watabou.pixeldungeon.levels.Level)

Example 9 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.

the class King method summon.

private void summon() {
    nextPedestal = !nextPedestal;
    sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2);
    Sample.INSTANCE.play(Assets.SND_CHALLENGE);
    boolean[] passable = Level.passable.clone();
    for (Actor actor : Actor.all()) {
        if (actor instanceof Char) {
            passable[((Char) actor).pos] = false;
        }
    }
    int undeadsToSummon = maxArmySize() - Undead.count;
    PathFinder.buildDistanceMap(pos, passable, undeadsToSummon);
    PathFinder.distance[pos] = Integer.MAX_VALUE;
    int dist = 1;
    undeadLabel: for (int i = 0; i < undeadsToSummon; i++) {
        do {
            for (int j = 0; j < Level.LENGTH; j++) {
                if (PathFinder.distance[j] == dist) {
                    Undead undead = new Undead();
                    undead.pos = j;
                    GameScene.add(undead);
                    WandOfBlink.appear(undead, j);
                    new Flare(3, 32).color(0x000000, false).show(undead.sprite, 2f);
                    PathFinder.distance[j] = Integer.MAX_VALUE;
                    continue undeadLabel;
                }
            }
            dist++;
        } while (dist < undeadsToSummon);
    }
    yell("Arise, slaves!");
}
Also used : Flare(com.watabou.pixeldungeon.effects.Flare) Char(com.watabou.pixeldungeon.actors.Char) Actor(com.watabou.pixeldungeon.actors.Actor)

Example 10 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.

the class ScrollOfTerror method doRead.

@Override
protected void doRead() {
    new Flare(5, 32).color(0xFF0000, true).show(curUser.sprite, 2f);
    Sample.INSTANCE.play(Assets.SND_READ);
    Invisibility.dispel();
    int count = 0;
    Mob affected = null;
    for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
        if (Level.fieldOfView[mob.pos]) {
            Buff.affect(mob, Terror.class, Terror.DURATION).object = curUser.id();
            count++;
            affected = mob;
        }
    }
    switch(count) {
        case 0:
            GLog.i("The scroll emits a brilliant flash of red light");
            break;
        case 1:
            GLog.i("The scroll emits a brilliant flash of red light and the " + affected.name + " flees!");
            break;
        default:
            GLog.i("The scroll emits a brilliant flash of red light and the monsters flee!");
    }
    setKnown();
    readAnimation();
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Flare(com.watabou.pixeldungeon.effects.Flare)

Aggregations

Flare (com.watabou.pixeldungeon.effects.Flare)18 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)7 Image (com.watabou.noosa.Image)4 BitmapTextMultiline (com.watabou.noosa.BitmapTextMultiline)2 Group (com.watabou.noosa.Group)2 SkinnedBlock (com.watabou.noosa.SkinnedBlock)2 Text (com.watabou.noosa.Text)2 FogOfWar (com.watabou.pixeldungeon.FogOfWar)2 Blob (com.watabou.pixeldungeon.actors.blobs.Blob)2 Terror (com.watabou.pixeldungeon.actors.buffs.Terror)2 Ankh (com.watabou.pixeldungeon.items.Ankh)2 Item (com.watabou.pixeldungeon.items.Item)2 Level (com.watabou.pixeldungeon.levels.Level)2 RegularLevel (com.watabou.pixeldungeon.levels.RegularLevel)2 Archs (com.watabou.pixeldungeon.ui.Archs)2 AttackIndicator (com.watabou.pixeldungeon.ui.AttackIndicator)2 BusyIndicator (com.watabou.pixeldungeon.ui.BusyIndicator)2 ExitButton (com.watabou.pixeldungeon.ui.ExitButton)2 GameLog (com.watabou.pixeldungeon.ui.GameLog)2 HealthIndicator (com.watabou.pixeldungeon.ui.HealthIndicator)2