v0.9.1: fixed various effects rarely placing high grass over plants

This commit is contained in:
Evan Debenham 2020-11-25 21:15:06 -05:00
parent 52388f2d23
commit a0d43b00b5
4 changed files with 14 additions and 21 deletions

View File

@ -249,11 +249,10 @@ public enum Talent {
grassCells.remove(0); grassCells.remove(0);
} }
for (int cell : grassCells){ for (int cell : grassCells){
if (Dungeon.level.map[cell] == Terrain.EMPTY || int t = Dungeon.level.map[cell];
Dungeon.level.map[cell] == Terrain.EMBERS || if ((t == Terrain.EMPTY || t == Terrain.EMPTY_DECO || t == Terrain.EMBERS
Dungeon.level.map[cell] == Terrain.EMPTY_DECO || || t == Terrain.GRASS || t == Terrain.FURROWED_GRASS)
Dungeon.level.map[cell] == Terrain.GRASS || && Dungeon.level.plants.get(cell) == null){
Dungeon.level.map[cell] == Terrain.FURROWED_GRASS){
Level.set(cell, Terrain.HIGH_GRASS); Level.set(cell, Terrain.HIGH_GRASS);
GameScene.updateMap(cell); GameScene.updateMap(cell);
} }

View File

@ -67,19 +67,16 @@ public class RegrowthBomb extends Bomb {
for (int i = 0; i < PathFinder.distance.length; i++) { for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) { if (PathFinder.distance[i] < Integer.MAX_VALUE) {
Char ch = Actor.findChar(i); Char ch = Actor.findChar(i);
int t = Dungeon.level.map[cell];
if (ch != null){ if (ch != null){
if (ch.alignment == Dungeon.hero.alignment) { if (ch.alignment == Dungeon.hero.alignment) {
//same as a healing potion //same as a healing potion
PotionOfHealing.cure(ch); PotionOfHealing.cure(ch);
PotionOfHealing.heal(ch); PotionOfHealing.heal(ch);
} }
} else if ( Dungeon.level.map[i] == Terrain.EMPTY || } else if ((t == Terrain.EMPTY || t == Terrain.EMPTY_DECO || t == Terrain.EMBERS
Dungeon.level.map[i] == Terrain.EMBERS || || t == Terrain.GRASS || t == Terrain.FURROWED_GRASS || t == Terrain.HIGH_GRASS)
Dungeon.level.map[i] == Terrain.EMPTY_DECO || && Dungeon.level.plants.get(cell) == null){
Dungeon.level.map[i] == Terrain.GRASS ||
Dungeon.level.map[i] == Terrain.HIGH_GRASS ||
Dungeon.level.map[i] == Terrain.FURROWED_GRASS){
plantCandidates.add(i); plantCandidates.add(i);
} }
GameScene.add( Blob.seed( i, 10, Regrowth.class ) ); GameScene.add( Blob.seed( i, 10, Regrowth.class ) );

View File

@ -91,12 +91,8 @@ public class WandOfRegrowth extends Wand {
for (Iterator<Integer> i = cells.iterator(); i.hasNext();) { for (Iterator<Integer> i = cells.iterator(); i.hasNext();) {
int cell = i.next(); int cell = i.next();
int terr = Dungeon.level.map[cell]; int terr = Dungeon.level.map[cell];
if (!(terr == Terrain.EMPTY || if (!(terr == Terrain.EMPTY || terr == Terrain.EMBERS || terr == Terrain.EMPTY_DECO ||
terr == Terrain.EMBERS || terr == Terrain.GRASS || terr == Terrain.HIGH_GRASS || terr == Terrain.FURROWED_GRASS)) {
terr == Terrain.EMPTY_DECO ||
terr == Terrain.GRASS ||
terr == Terrain.HIGH_GRASS ||
terr == Terrain.FURROWED_GRASS)) {
i.remove(); i.remove();
} else if (Char.hasProp(Actor.findChar(cell), Char.Property.IMMOVABLE)) { } else if (Char.hasProp(Actor.findChar(cell), Char.Property.IMMOVABLE)) {
i.remove(); i.remove();

View File

@ -73,9 +73,10 @@ public class Blooming extends Weapon.Enchantment {
} }
private boolean plantGrass(int cell){ private boolean plantGrass(int cell){
int c = Dungeon.level.map[cell]; int t = Dungeon.level.map[cell];
if ( c == Terrain.EMPTY || c == Terrain.EMPTY_DECO if ((t == Terrain.EMPTY || t == Terrain.EMPTY_DECO || t == Terrain.EMBERS
|| c == Terrain.EMBERS || c == Terrain.GRASS){ || t == Terrain.GRASS || t == Terrain.FURROWED_GRASS)
&& Dungeon.level.plants.get(cell) == null){
Level.set(cell, Terrain.HIGH_GRASS); Level.set(cell, Terrain.HIGH_GRASS);
GameScene.updateMap(cell); GameScene.updateMap(cell);
CellEmitter.get( cell ).burst( LeafParticle.LEVEL_SPECIFIC, 4 ); CellEmitter.get( cell ).burst( LeafParticle.LEVEL_SPECIFIC, 4 );