Search in sources :

Example 16 with Emitter

use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.

the class HighGrass method trample.

public static void trample(Level level, int pos, Char ch) {
    level.set(pos, Terrain.GRASS);
    GameScene.updateMap(pos);
    if (!Dungeon.isChallenged(Challenges.NO_HERBALISM)) {
        int herbalismLevel = 0;
        if (ch != null) {
            Herbalism herbalism = ch.buff(Herbalism.class);
            if (herbalism != null) {
                herbalismLevel = herbalism.level;
            }
        }
        // Seed
        if (herbalismLevel >= 0 && Random.Int(18) <= Random.Int(herbalismLevel + 1)) {
            ItemSprite is = level.drop(Generator.random(Generator.Category.SEED), pos).sprite;
            if (is != null) {
                is.drop();
            }
        }
        // Dew
        if (herbalismLevel >= 0 && Random.Int(6) <= Random.Int(herbalismLevel + 1)) {
            ItemSprite is = level.drop(new Dewdrop(), pos).sprite;
            if (is != null) {
                is.drop();
            }
        }
    }
    int leaves = 4;
    // Barkskin
    if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN) {
        Buff.affect(ch, Barkskin.class).level(ch.ht() / 3);
        leaves = 8;
    }
    if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.SCOUT) {
        Buff.prolong(ch, Invisibility.class, 5);
        leaves = 2;
    }
    Emitter emitter = CellEmitter.get(pos);
    if (emitter != null) {
        emitter.burst(LeafParticle.LEVEL_SPECIFIC, leaves);
    }
    Dungeon.observe();
}
Also used : CellEmitter(com.watabou.pixeldungeon.effects.CellEmitter) Emitter(com.watabou.noosa.particles.Emitter) Dewdrop(com.watabou.pixeldungeon.items.Dewdrop) Hero(com.watabou.pixeldungeon.actors.hero.Hero) Barkskin(com.watabou.pixeldungeon.actors.buffs.Barkskin) Herbalism(com.watabou.pixeldungeon.items.rings.RingOfHerbalism.Herbalism) ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite)

Example 17 with Emitter

use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.

the class ItemSlot method createChildren.

@Override
protected void createChildren() {
    super.createChildren();
    icon = new ItemSprite();
    add(icon);
    emitter = new Emitter();
    add(emitter);
    topLeft = new BitmapText(PixelScene.font1x);
    topLeft.setScale(0.8f, 0.8f);
    add(topLeft);
    topRight = new BitmapText(PixelScene.font1x);
    topRight.setScale(0.8f, 0.8f);
    add(topRight);
    bottomRight = new BitmapText(PixelScene.font1x);
    bottomRight.setScale(0.8f, 0.8f);
    add(bottomRight);
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) BitmapText(com.watabou.noosa.BitmapText) ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite)

Example 18 with Emitter

use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.

the class CharSprite method emitter.

public Emitter emitter() {
    Emitter emitter = GameScene.emitter();
    emitter.pos(this);
    return emitter;
}
Also used : Emitter(com.watabou.noosa.particles.Emitter)

Example 19 with Emitter

use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.

the class CharSprite method centerEmitter.

public Emitter centerEmitter() {
    Emitter emitter = GameScene.emitter();
    emitter.pos(center());
    return emitter;
}
Also used : Emitter(com.watabou.noosa.particles.Emitter)

Example 20 with Emitter

use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.

the class CellEmitter method center.

public static Emitter center(int cell) {
    PointF p = DungeonTilemap.tileToWorld(cell);
    Emitter emitter = GameScene.emitter();
    emitter.pos(p.x + DungeonTilemap.SIZE / 2, p.y + DungeonTilemap.SIZE / 2);
    return emitter;
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) PointF(com.watabou.utils.PointF)

Aggregations

Emitter (com.watabou.noosa.particles.Emitter)48 PointF (com.watabou.utils.PointF)9 Image (com.watabou.noosa.Image)6 Group (com.watabou.noosa.Group)4 BitmapText (com.watabou.noosa.BitmapText)2 BlobEmitter (com.watabou.pixeldungeon.effects.BlobEmitter)2 ItemSprite (com.watabou.pixeldungeon.sprites.ItemSprite)2 WndHeroSpells (com.nyrds.pixeldungeon.windows.WndHeroSpells)1 BlobEmitter (com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter)1 CellEmitter (com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter)1 Touch (com.watabou.input.Touchscreen.Touch)1 CompositeTextureImage (com.watabou.noosa.CompositeTextureImage)1 NinePatch (com.watabou.noosa.NinePatch)1 TouchArea (com.watabou.noosa.TouchArea)1 BitmaskEmitter (com.watabou.noosa.particles.BitmaskEmitter)1 Barkskin (com.watabou.pixeldungeon.actors.buffs.Barkskin)1 Hero (com.watabou.pixeldungeon.actors.hero.Hero)1 CellEmitter (com.watabou.pixeldungeon.effects.CellEmitter)1 Dewdrop (com.watabou.pixeldungeon.items.Dewdrop)1 Herbalism (com.watabou.pixeldungeon.items.rings.RingOfHerbalism.Herbalism)1