Search in sources :

Example 16 with Flare

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

the class ScrollOfDomination method doRead.

@Override
protected void doRead() {
    SpellSprite.show(getCurUser(), SpellSprite.DOMINATION);
    Sample.INSTANCE.play(Assets.SND_DOMINANCE);
    Invisibility.dispel(getCurUser());
    ArrayList<Mob> mobsInSight = new ArrayList<>();
    for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
        if (Dungeon.level.fieldOfView[mob.getPos()] && !(mob instanceof Boss) && !mob.isPet() && !(mob instanceof NPC)) {
            mobsInSight.add(mob);
        }
    }
    while (!mobsInSight.isEmpty()) {
        Mob pet = Random.element(mobsInSight);
        if (pet.canBePet()) {
            Mob.makePet(pet, getCurUser());
            new Flare(3, 32).show(pet.getSprite(), 2f);
            break;
        }
        mobsInSight.remove(pet);
    }
    Dungeon.observe();
    setKnown();
    getCurUser().spendAndNext(TIME_TO_READ);
}
Also used : NPC(com.watabou.pixeldungeon.actors.mobs.npcs.NPC) Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Boss(com.watabou.pixeldungeon.actors.mobs.Boss) Flare(com.watabou.pixeldungeon.effects.Flare) ArrayList(java.util.ArrayList)

Example 17 with Flare

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

the class Hero method die.

@Override
public void die(Object cause) {
    clearActions();
    DewVial.autoDrink(this);
    if (isAlive()) {
        new Flare(8, 32).color(0xFFFF66, true).show(getSprite(), 2f);
        return;
    }
    Actor.fixTime();
    super.die(cause);
    Ankh ankh = belongings.getItem(Ankh.class);
    if (ankh == null) {
        if (this.subClass == HeroSubClass.LICH && this.getSoulPoints() == this.getSoulPointsMax()) {
            this.setSoulPoints(0);
            Dungeon.deleteGame(false);
            GameScene.show(new WndResurrect(null, cause));
        } else {
            reallyDie(cause);
        }
    } else {
        Dungeon.deleteGame(false);
        while (belongings.removeItem(ankh)) {
        }
        GameScene.show(new WndResurrect(ankh, cause));
    }
}
Also used : WndResurrect(com.watabou.pixeldungeon.windows.WndResurrect) Flare(com.watabou.pixeldungeon.effects.Flare) Ankh(com.watabou.pixeldungeon.items.Ankh)

Example 18 with Flare

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

the class Rat method canAttack.

@Override
protected boolean canAttack(Char enemy) {
    if (enemy.hasBuff(RatSkull.RatterAura.class)) {
        setState(FLEEING);
        if (!hasBuff(Terror.class)) {
            new Flare(5, 32).color(0xFF0000, true).show(getSprite(), 2f);
            Terror terror = Buff.affect(this, Terror.class, Terror.DURATION);
            terror.source = enemy;
            return false;
        }
    }
    return super.canAttack(enemy);
}
Also used : Flare(com.watabou.pixeldungeon.effects.Flare) RatSkull(com.watabou.pixeldungeon.items.quest.RatSkull) Terror(com.watabou.pixeldungeon.actors.buffs.Terror)

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