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();
}
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);
}
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;
}
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;
}
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;
}
Aggregations