V0.2.0: Initial implementation for Sandals of Nature

This commit is contained in:
Evan Debenham
2014-09-08 15:41:09 -04:00
parent 33a6533d08
commit e8b3365f08
3 changed files with 141 additions and 12 deletions
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfHerbalism.Herbalism;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@@ -40,24 +41,25 @@ public class HighGrass {
Level.set( pos, Terrain.GRASS );
GameScene.updateMap( pos );
int herbalismLevel = 0;
if (ch != null) {
Herbalism herbalism = ch.buff( Herbalism.class );
if (herbalism != null) {
herbalismLevel = herbalism.level;
}
}
int naturalismLevel = 0;
if (ch != null) {
SandalsOfNature.Naturalism naturalism = ch.buff( SandalsOfNature.Naturalism.class );
if (naturalism != null) {
naturalismLevel = naturalism.level()+1;
naturalism.charge();
}
}
// Seed
if (herbalismLevel >= 0 && Random.Int( 18 ) <= Random.Int( herbalismLevel + 1 )) {
if (Random.Int(18-((int)(naturalismLevel*3.34))) == 0) {
level.drop( Generator.random( Generator.Category.SEED ), pos ).sprite.drop();
}
// Dew
if (herbalismLevel >= 0 && Random.Int( 6 ) <= Random.Int( herbalismLevel + 1 )) {
if (Random.Int( 6-naturalismLevel ) == 0) {
level.drop( new Dewdrop(), pos ).sprite.drop();
}
int leaves = 4;
// Barkskin