use of com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Plant method wither.
public void wither() {
Dungeon.level.uproot(pos);
if (Dungeon.level.heroFOV[pos]) {
CellEmitter.get(pos).burst(LeafParticle.GENERAL, 6);
}
if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
int naturalismLevel = 0;
SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff(SandalsOfNature.Naturalism.class);
if (naturalism != null) {
naturalismLevel = naturalism.itemLevel() + 1;
}
if (Random.Int(5 - (naturalismLevel / 2)) == 0) {
Item seed = Generator.random(Generator.Category.SEED);
if (seed instanceof BlandfruitBush.Seed) {
if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
Dungeon.level.drop(seed, pos).sprite.drop();
Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
}
} else
Dungeon.level.drop(seed, pos).sprite.drop();
}
if (Random.Int(5 - naturalismLevel) == 0) {
Dungeon.level.drop(new Dewdrop(), pos).sprite.drop();
}
}
}
use of com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop in project shattered-pixel-dungeon-gdx by 00-Evan.
the class HighGrass method trample.
public static void trample(Level level, int pos, Char ch) {
Level.set(pos, Terrain.GRASS);
GameScene.updateMap(pos);
int naturalismLevel = 0;
if (ch != null) {
SandalsOfNature.Naturalism naturalism = ch.buff(SandalsOfNature.Naturalism.class);
if (naturalism != null) {
if (!naturalism.isCursed()) {
naturalismLevel = naturalism.itemLevel() + 1;
naturalism.charge();
} else {
naturalismLevel = -1;
}
}
}
if (naturalismLevel >= 0) {
// Seed, scales from 1/16 to 1/4
if (Random.Int(16 - ((int) (naturalismLevel * 3))) == 0) {
Item seed = Generator.random(Generator.Category.SEED);
if (seed instanceof BlandfruitBush.Seed) {
if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
level.drop(seed, pos).sprite.drop();
Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
}
} else
level.drop(seed, pos).sprite.drop();
}
// Dew, scales from 1/6 to 1/3
if (Random.Int(24 - naturalismLevel * 3) <= 3) {
level.drop(new Dewdrop(), pos).sprite.drop();
}
}
int leaves = 4;
if (ch instanceof Hero) {
Hero hero = (Hero) ch;
// Barkskin
if (hero.subClass == HeroSubClass.WARDEN) {
Buff.affect(ch, Barkskin.class).level(ch.HT / 3);
leaves += 4;
}
// Camouflage
if (hero.belongings.armor != null && hero.belongings.armor.hasGlyph(Camouflage.class)) {
Buff.affect(hero, Camouflage.Camo.class).set(3 + hero.belongings.armor.level());
leaves += 4;
}
}
CellEmitter.get(pos).burst(LeafParticle.LEVEL_SPECIFIC, leaves);
if (Dungeon.level.heroFOV[pos])
Dungeon.observe();
}
use of com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop in project shattered-pixel-dungeon-gdx by 00-Evan.
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.peek();
if (item.doPickUp(this)) {
heap.pickUp();
if (item instanceof Dewdrop || item instanceof TimekeepersHourglass.sandBag || item instanceof DriedRose.Petal || item instanceof Key) {
// Do Nothing
} else {
boolean important = ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll) item).isKnown()) || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion) item).isKnown());
if (important) {
GLog.p(Messages.get(this, "you_now_have", item.name()));
} else {
GLog.i(Messages.get(this, "you_now_have", item.name()));
}
}
curAction = null;
} else {
heap.sprite.drop();
ready();
}
} else {
ready();
}
return false;
} else if (getCloser(dst)) {
return true;
} else {
ready();
return false;
}
}
Aggregations