v0.7.1: adjusted wand of regrowth to work with furrowed grass

Also removed now-unnecessary checks for blandfruit seeds
This commit is contained in:
Evan Debenham 2018-11-22 19:00:01 -05:00
parent a3b9fefc65
commit 97483b8062
4 changed files with 15 additions and 36 deletions

View File

@ -49,7 +49,8 @@ public class Regrowth extends Blob {
if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
c1 = (cur[cell] > 9 && Actor.findChar( cell ) == null)
? Terrain.HIGH_GRASS : Terrain.GRASS;
} else if (c == Terrain.GRASS && cur[cell] > 9 && Dungeon.level.plants.get(cell) == null && Actor.findChar( cell ) == null ) {
} else if ((c == Terrain.GRASS || c == Terrain.FURROWED_GRASS)
&& cur[cell] > 9 && Dungeon.level.plants.get(cell) == null && Actor.findChar( cell ) == null ) {
c1 = Terrain.HIGH_GRASS;
}

View File

@ -35,7 +35,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.shatteredpixel.shatteredpixeldungeon.plants.Starflower;
import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass;
@ -117,10 +116,14 @@ public class WandOfRegrowth extends Wand {
processSoulMark(ch, chargesPerCast());
}
if (Random.Int(50) < overLimit){
GameScene.add( Blob.seed( i, 9, Regrowth.class ) );
if (Random.Int(50) < overLimit) {
if (Dungeon.level.map[i] == Terrain.GRASS) {
Level.set( i, Terrain.FURROWED_GRASS );
GameScene.updateMap( i );
}
GameScene.add(Blob.seed(i, 9, Regrowth.class));
} else {
GameScene.add( Blob.seed( i, 10, Regrowth.class ) );
GameScene.add(Blob.seed(i, 10, Regrowth.class));
}
}
@ -139,7 +142,7 @@ public class WandOfRegrowth extends Wand {
}
private void spreadRegrowth(int cell, float strength){
if (strength >= 0 && Dungeon.level.passable[cell] && !Dungeon.level.losBlocking[cell]){
if (strength >= 0 && Dungeon.level.passable[cell]){
affectedCells.add(cell);
if (strength >= 1.5f) {
spreadRegrowth(cell + PathFinder.CIRCLE8[left(direction)], strength - 1.5f);
@ -148,7 +151,7 @@ public class WandOfRegrowth extends Wand {
} else {
visualCells.add(cell);
}
} else if (!Dungeon.level.passable[cell] || Dungeon.level.losBlocking[cell])
} else if (!Dungeon.level.passable[cell])
visualCells.add(cell);
}
@ -158,14 +161,7 @@ public class WandOfRegrowth extends Wand {
while(cells.hasNext() && Random.Float() <= numPlants){
Plant.Seed seed = (Plant.Seed) Generator.random(Generator.Category.SEED);
if (seed instanceof BlandfruitBush.Seed) {
if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
floor.plant(seed, cells.next());
Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
}
} else
floor.plant(seed, cells.next());
floor.plant(seed, cells.next());
numPlants --;
}
@ -229,7 +225,7 @@ public class WandOfRegrowth extends Wand {
float strength = maxDist;
for (int c : bolt.subPath(1, dist)) {
strength--; //as we start at dist 1, not 0.
if (!Dungeon.level.losBlocking[c]) {
if (Dungeon.level.passable[c]) {
affectedCells.add(c);
spreadRegrowth(c + PathFinder.CIRCLE8[left(direction)], strength - 1);
spreadRegrowth(c + PathFinder.CIRCLE8[direction], strength - 1);

View File

@ -32,12 +32,10 @@ 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.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.utils.Random;
@ -84,15 +82,7 @@ public class HighGrass {
if (naturalismLevel >= 0) {
// Seed, scales from 1/20 to 1/4
if (Random.Int(20 - (naturalismLevel * 4)) == 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();
level.drop(Generator.random(Generator.Category.SEED), pos).sprite.drop();
}
// Dew, scales from 1/6 to 1/3

View File

@ -88,15 +88,7 @@ public abstract class Plant implements Bundlable {
}
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();
Dungeon.level.drop(Generator.random(Generator.Category.SEED), pos).sprite.drop();
}
if (Random.Int( 5 - naturalismLevel ) == 0) {
Dungeon.level.drop( new Dewdrop(), pos ).sprite.drop();