use of com.watabou.pixeldungeon.items.Dewdrop in project pixel-dungeon by watabou.
the class Plant method wither.
public void wither() {
Dungeon.level.uproot(pos);
sprite.kill();
if (Dungeon.visible[pos]) {
CellEmitter.get(pos).burst(LeafParticle.GENERAL, 6);
}
if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
if (Random.Int(5) == 0) {
Dungeon.level.drop(Generator.random(Generator.Category.SEED), pos).sprite.drop();
}
if (Random.Int(5) == 0) {
Dungeon.level.drop(new Dewdrop(), pos).sprite.drop();
}
}
}
use of com.watabou.pixeldungeon.items.Dewdrop in project pixel-dungeon by watabou.
the class Hero method actPickUp.
private boolean actPickUp(HeroAction.PickUp action) {
int dst = action.dst;
if (pos == dst) {
Heap heap = Dungeon.level.heaps.get(pos);
if (heap != null) {
Item item = heap.pickUp();
if (item.doPickUp(this)) {
if (item instanceof Dewdrop) {
// Do nothing
} else {
boolean important = ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfEnchantment) && ((Scroll) item).isKnown()) || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion) item).isKnown());
if (important) {
GLog.p(TXT_YOU_NOW_HAVE, item.name());
} else {
GLog.i(TXT_YOU_NOW_HAVE, item.name());
}
}
if (!heap.isEmpty()) {
GLog.i(TXT_SOMETHING_ELSE);
}
curAction = null;
} else {
Dungeon.level.drop(item, pos).sprite.drop();
ready();
}
} else {
ready();
}
return false;
} else if (getCloser(dst)) {
return true;
} else {
ready();
return false;
}
}
use of com.watabou.pixeldungeon.items.Dewdrop in project pixel-dungeon by watabou.
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)) {
level.drop(Generator.random(Generator.Category.SEED), pos).sprite.drop();
}
// Dew
if (herbalismLevel >= 0 && Random.Int(6) <= Random.Int(herbalismLevel + 1)) {
level.drop(new Dewdrop(), pos).sprite.drop();
}
}
int leaves = 4;
// Warlock's barkskin
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN) {
Buff.affect(ch, Barkskin.class).level(ch.HT / 3);
leaves = 8;
}
CellEmitter.get(pos).burst(LeafParticle.LEVEL_SPECIFIC, leaves);
Dungeon.observe();
}
Aggregations