Search in sources :

Example 6 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project shattered-pixel-dungeon-gdx by 00-Evan.

the class CharSprite method add.

public void add(State state) {
    switch(state) {
        case BURNING:
            burning = emitter();
            burning.pour(FlameParticle.FACTORY, 0.06f);
            if (visible) {
                Sample.INSTANCE.play(Assets.SND_BURNING);
            }
            break;
        case LEVITATING:
            levitation = emitter();
            levitation.pour(Speck.factory(Speck.JET), 0.02f);
            break;
        case INVISIBLE:
            if (invisible != null) {
                invisible.killAndErase();
            }
            invisible = new AlphaTweener(this, 0.4f, 0.4f);
            if (parent != null) {
                parent.add(invisible);
            } else
                alpha(0.4f);
            break;
        case PARALYSED:
            paused = true;
            break;
        case FROZEN:
            iceBlock = IceBlock.freeze(this);
            paused = true;
            break;
        case ILLUMINATED:
            GameScene.effect(halo = new TorchHalo(this));
            break;
        case CHILLED:
            chilled = emitter();
            chilled.pour(SnowParticle.FACTORY, 0.1f);
            break;
        case DARKENED:
            darkBlock = DarkBlock.darken(this);
            break;
        case MARKED:
            marked = emitter();
            marked.pour(ShadowParticle.UP, 0.1f);
            break;
        case HEALING:
            healing = emitter();
            healing.pour(Speck.factory(Speck.HEALING), 0.5f);
    }
}
Also used : TorchHalo(com.shatteredpixel.shatteredpixeldungeon.effects.TorchHalo) AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Example 7 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project shattered-pixel-dungeon-gdx by 00-Evan.

the class CityBossLevel method press.

@Override
public void press(int cell, Char hero) {
    super.press(cell, hero);
    if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) {
        enteredArena = true;
        seal();
        for (Mob m : mobs) {
            // bring the first ally with you
            if (m.alignment == Char.Alignment.ALLY) {
                m.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
                m.sprite.place(m.pos);
                break;
            }
        }
        King boss = new King();
        boss.state = boss.WANDERING;
        int count = 0;
        do {
            boss.pos = Random.Int(length());
        } while (!passable[boss.pos] || !outsideEntraceRoom(boss.pos) || (heroFOV[boss.pos] && count++ < 20));
        GameScene.add(boss);
        if (heroFOV[boss.pos]) {
            boss.notice();
            boss.sprite.alpha(0);
            boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f));
        }
        set(arenaDoor, Terrain.LOCKED_DOOR);
        GameScene.updateMap(arenaDoor);
        Dungeon.observe();
    }
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob) King(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King) AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Example 8 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon-remix by NYRDS.

the class DungeonTilemap method discover.

public void discover(int pos) {
    final Image tile = tile(pos);
    if (tile == null) {
        return;
    }
    tile.point(tileToWorld(pos));
    // For bright mode
    tile.rm = tile.gm = tile.bm = rm;
    tile.ra = tile.ga = tile.ba = ra;
    getParent().add(tile);
    getParent().add(new AlphaTweener(tile, 0, 0.6f) {

        protected void onComplete() {
            tile.killAndErase();
            killAndErase();
        }
    });
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener) Image(com.watabou.noosa.Image)

Example 9 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon-remix by NYRDS.

the class Wraith method spawnAt.

public static Wraith spawnAt(int pos) {
    if (Dungeon.level.passable[pos] && Actor.findChar(pos) == null) {
        Wraith w = new Wraith();
        w.adjustStats(Dungeon.depth);
        w.setPos(pos);
        w.setState(w.HUNTING);
        Dungeon.level.spawnMob(w, SPAWN_DELAY);
        w.getSprite().alpha(0);
        w.getSprite().getParent().add(new AlphaTweener(w.getSprite(), 1, 0.5f));
        w.getSprite().emitter().burst(ShadowParticle.CURSE, 5);
        return w;
    } else {
        return null;
    }
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Example 10 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon by watabou.

the class Wraith method spawnAt.

public static Wraith spawnAt(int pos) {
    if (Level.passable[pos] && Actor.findChar(pos) == null) {
        Wraith w = new Wraith();
        w.adjustStats(Dungeon.depth);
        w.pos = pos;
        w.state = w.HUNTING;
        GameScene.add(w, SPAWN_DELAY);
        w.sprite.alpha(0);
        w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f));
        w.sprite.emitter().burst(ShadowParticle.CURSE, 5);
        return w;
    } else {
        return null;
    }
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Aggregations

AlphaTweener (com.watabou.noosa.tweeners.AlphaTweener)20 Image (com.watabou.noosa.Image)6 ArrayList (java.util.ArrayList)3 Buff (com.watabou.pixeldungeon.actors.buffs.Buff)2 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)2 SparseArray (com.watabou.utils.SparseArray)2 Buff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff)1 Bee (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee)1 King (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King)1 Mob (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)1 Pushing (com.shatteredpixel.shatteredpixeldungeon.effects.Pushing)1 TorchHalo (com.shatteredpixel.shatteredpixeldungeon.effects.TorchHalo)1 WndInfoBuff (com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoBuff)1 Bee (com.watabou.pixeldungeon.actors.mobs.npcs.Bee)1 Pushing (com.watabou.pixeldungeon.effects.Pushing)1 Level (com.watabou.pixeldungeon.levels.Level)1 Point (com.watabou.utils.Point)1