diff --git a/core/src/main/assets/terrain_features.png b/core/src/main/assets/terrain_features.png index 60a6bdb1f..942e749a7 100644 Binary files a/core/src/main/assets/terrain_features.png and b/core/src/main/assets/terrain_features.png differ diff --git a/core/src/main/assets/tiles_caves.png b/core/src/main/assets/tiles_caves.png index cb4823fe8..34ac960e5 100644 Binary files a/core/src/main/assets/tiles_caves.png and b/core/src/main/assets/tiles_caves.png differ diff --git a/core/src/main/assets/tiles_city.png b/core/src/main/assets/tiles_city.png index f4caff233..e05e2a209 100644 Binary files a/core/src/main/assets/tiles_city.png and b/core/src/main/assets/tiles_city.png differ diff --git a/core/src/main/assets/tiles_halls.png b/core/src/main/assets/tiles_halls.png index f204158dd..bd68f69de 100644 Binary files a/core/src/main/assets/tiles_halls.png and b/core/src/main/assets/tiles_halls.png differ diff --git a/core/src/main/assets/tiles_prison.png b/core/src/main/assets/tiles_prison.png index d492f3511..7c06eab14 100644 Binary files a/core/src/main/assets/tiles_prison.png and b/core/src/main/assets/tiles_prison.png differ diff --git a/core/src/main/assets/tiles_sewers.png b/core/src/main/assets/tiles_sewers.png index 9725036d0..d467e3b36 100644 Binary files a/core/src/main/assets/tiles_sewers.png and b/core/src/main/assets/tiles_sewers.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java index 7cd0b690e..89552f104 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java @@ -46,8 +46,9 @@ public class Regrowth extends Blob { int c = Dungeon.level.map[cell]; int c1 = c; if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) { - c1 = cur[cell] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS; - } else if (c == Terrain.GRASS && cur[cell] > 9 && Dungeon.level.plants.get(cell) == null ) { + 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 ) { c1 = Terrain.HIGH_GRASS; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 8f5865908..66c5d2ee4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -277,6 +277,8 @@ public abstract class Level implements Bundlable { createMobs(); createItems(); + buildFlagMaps(); + Random.seed(); } @@ -861,6 +863,10 @@ public abstract class Level implements Bundlable { if (plant != null) { plant.trigger(); } + + if ( map[cell] == Terrain.HIGH_GRASS){ + HighGrass.trample( this, cell, mob ); + } } public void updateFieldOfView( Char c, boolean[] fieldOfView ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index b7b504406..13cc80bdd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -602,6 +602,8 @@ public abstract class RegularLevel extends Level { if (findMob(mob.pos) == null && Level.passable[mob.pos]) { mobsToSpawn--; mobs.add(mob); + if (map[mob.pos] == Terrain.HIGH_GRASS) + map[mob.pos] = Terrain.GRASS; //TODO: perhaps externalize this logic into a method. Do I want to make mobs more likely to clump deeper down? if (mobsToSpawn > 0 && Random.Int(4) == 0){ @@ -611,6 +613,8 @@ public abstract class RegularLevel extends Level { if (findMob(mob.pos) == null && Level.passable[mob.pos]) { mobsToSpawn--; mobs.add(mob); + if (map[mob.pos] == Terrain.HIGH_GRASS) + map[mob.pos] = Terrain.GRASS; } } } @@ -691,7 +695,9 @@ public abstract class RegularLevel extends Level { default: type = Heap.Type.HEAP; } - drop( Generator.random(), randomDropCell() ).type = type; + int cell = randomDropCell(); + if (map[cell] == Terrain.HIGH_GRASS) map[cell] = Terrain.GRASS; + drop( Generator.random(), cell ).type = type; } for (Item item : itemsToSpawn) { @@ -710,11 +716,14 @@ public abstract class RegularLevel extends Level { } } while (traps.get(cell) instanceof ExplosiveTrap); drop( item, cell ).type = Heap.Type.HEAP; + if (map[cell] == Terrain.HIGH_GRASS) map[cell] = Terrain.GRASS; } Item item = Bones.get(); if (item != null) { - drop( item, randomDropCell() ).type = Heap.Type.REMAINS; + int cell = randomDropCell(); + if (map[cell] == Terrain.HIGH_GRASS) map[cell] = Terrain.GRASS; + drop( item, cell ).type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java index c99cfe27e..b4b320a23 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java @@ -97,7 +97,8 @@ public class Chasm { hero.sprite.burst( hero.sprite.blood(), 10 ); Camera.main.shake( 4, 0.2f ); - + + Dungeon.level.press( hero.pos, hero ); Buff.prolong( hero, Cripple.class, Cripple.DURATION ); Buff.affect( hero, Bleeding.class).set( hero.HT / 6 ); hero.damage( Random.NormalIntRange( hero.HP / 4, hero.HT / 4 ), new Hero.Doom() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java index 7b2ca4501..1ca159a22 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTerrainTilemap.java @@ -75,6 +75,10 @@ public class DungeonTerrainTilemap extends DungeonTilemap { return DungeonTileSheet.RAISED_STATUE_SP; } else if (tile == Terrain.BARRICADE) { return DungeonTileSheet.RAISED_BARRICADE; + } else if (tile == Terrain.HIGH_GRASS) { + return DungeonTileSheet.getVisualWithAlts( + DungeonTileSheet.RAISED_HIGH_GRASS, + pos); } else { return DungeonTileSheet.NULL_TILE; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java index f4a1daeab..035b897c7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java @@ -49,19 +49,17 @@ public class DungeonTileSheet { private static final int GROUND = xy(1, 1); //32 slots public static final int FLOOR = GROUND +0; public static final int FLOOR_DECO = GROUND +1; - public static final int HIGH_GRASS = GROUND +2; - public static final int GRASS = GROUND +3; - public static final int EMBERS = GROUND +4; - public static final int FLOOR_SP = GROUND +5; + public static final int GRASS = GROUND +2; + public static final int EMBERS = GROUND +3; + public static final int FLOOR_SP = GROUND +4; - public static final int FLOOR_ALT_1 = GROUND +7; - public static final int FLOOR_DECO_ALT = GROUND +8; - public static final int HIGH_GRASS_ALT = GROUND +9; - public static final int GRASS_ALT = GROUND +10; - public static final int EMBERS_ALT = GROUND +11; - public static final int FLOOR_SP_ALT = GROUND +12; + public static final int FLOOR_ALT_1 = GROUND +6; + public static final int FLOOR_DECO_ALT = GROUND +7; + public static final int GRASS_ALT = GROUND +8; + public static final int EMBERS_ALT = GROUND +9; + public static final int FLOOR_SP_ALT = GROUND +10; - public static final int FLOOR_ALT_2 = GROUND +14; + public static final int FLOOR_ALT_2 = GROUND +12; public static final int ENTRANCE = GROUND +16; public static final int EXIT = GROUND +17; @@ -173,6 +171,9 @@ public class DungeonTileSheet { public static final int FLAT_STATUE = FLAT_OTHER+1; public static final int FLAT_STATUE_SP = FLAT_OTHER+2; public static final int FLAT_BARRICADE = FLAT_OTHER+3; + public static final int FLAT_HIGH_GRASS = FLAT_OTHER+4; + + public static final int FLAT_HIGH_GRASS_ALT = FLAT_OTHER+6; /********************************************************************** @@ -254,6 +255,9 @@ public class DungeonTileSheet { public static final int RAISED_STATUE = RAISED_OTHER+1; public static final int RAISED_STATUE_SP = RAISED_OTHER+2; public static final int RAISED_BARRICADE = RAISED_OTHER+3; + public static final int RAISED_HIGH_GRASS = RAISED_OTHER+4; + + public static final int RAISED_HIGH_GRASS_ALT = RAISED_OTHER+6; @@ -309,6 +313,9 @@ public class DungeonTileSheet { public static final int STATUE_OVERHANG = WALL_OVERHANG+26; public static final int BARRICADE_OVERHANG = WALL_OVERHANG+27; + public static final int HIGH_GRASS_OVERHANG = WALL_OVERHANG+28; + + public static final int HIGH_GRASS_OVERHANG_ALT = WALL_OVERHANG+30; /********************************************************************** * Logic for the selection of tile visuals @@ -325,7 +332,6 @@ public class DungeonTileSheet { directVisuals.put(Terrain.EMBERS, EMBERS); directVisuals.put(Terrain.PEDESTAL, PEDESTAL); directVisuals.put(Terrain.EMPTY_SP, FLOOR_SP); - directVisuals.put(Terrain.HIGH_GRASS, HIGH_GRASS); directVisuals.put(Terrain.SECRET_TRAP, directVisuals.get(Terrain.EMPTY)); directVisuals.put(Terrain.TRAP, directVisuals.get(Terrain.EMPTY)); @@ -352,6 +358,7 @@ public class DungeonTileSheet { directFlatVisuals.put(Terrain.STATUE, FLAT_STATUE); directFlatVisuals.put(Terrain.STATUE_SP, FLAT_STATUE_SP); directFlatVisuals.put(Terrain.BARRICADE, FLAT_BARRICADE); + directFlatVisuals.put(Terrain.HIGH_GRASS, FLAT_HIGH_GRASS); directFlatVisuals.put(Terrain.SECRET_DOOR, directFlatVisuals.get(Terrain.WALL)); } @@ -380,13 +387,17 @@ public class DungeonTileSheet { commonAltVisuals.put(EMBERS, EMBERS_ALT); commonAltVisuals.put(FLAT_WALL_DECO, FLAT_WALL_DECO_ALT); commonAltVisuals.put(FLOOR_SP, FLOOR_SP_ALT); - commonAltVisuals.put(HIGH_GRASS, HIGH_GRASS_ALT); commonAltVisuals.put(FLOOR_DECO, FLOOR_DECO_ALT); + commonAltVisuals.put(FLAT_BOOKSHELF, FLAT_BOOKSHELF_ALT); + commonAltVisuals.put(FLAT_HIGH_GRASS, FLAT_HIGH_GRASS_ALT); commonAltVisuals.put(RAISED_WALL, RAISED_WALL_ALT); commonAltVisuals.put(RAISED_WALL_DECO, RAISED_WALL_DECO_ALT); commonAltVisuals.put(RAISED_WALL_BOOKSHELF, RAISED_WALL_BOOKSHELF_ALT); + + commonAltVisuals.put(RAISED_HIGH_GRASS, RAISED_HIGH_GRASS_ALT); + commonAltVisuals.put(HIGH_GRASS_OVERHANG, HIGH_GRASS_OVERHANG_ALT); } //These alt visuals trigger 5% of the time (and also override common alts when they show up) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java index 7b8ba71e2..3c01489a7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonWallsTilemap.java @@ -83,6 +83,8 @@ public class DungeonWallsTilemap extends DungeonTilemap { return DungeonTileSheet.STATUE_OVERHANG; } else if (pos + mapWidth < size && map[pos+mapWidth] == Terrain.BARRICADE){ return DungeonTileSheet.BARRICADE_OVERHANG; + } else if (pos + mapWidth < size && map[pos+mapWidth] == Terrain.HIGH_GRASS){ + return DungeonTileSheet.getVisualWithAlts(DungeonTileSheet.HIGH_GRASS_OVERHANG, pos + mapWidth); } return -1; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/GridTileMap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/GridTileMap.java index 7a595b09a..6cc6fc592 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/GridTileMap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/GridTileMap.java @@ -24,7 +24,7 @@ public class GridTileMap extends DungeonTilemap { protected int getTileVisual(int pos, int tile, boolean flat) { if (gridSetting == -1 || pos % 2 != (pos / mapWidth) % 2){ return -1; - } else if (DungeonTileSheet.floorTile(tile)) { + } else if (DungeonTileSheet.floorTile(tile) || tile == Terrain.HIGH_GRASS) { return gridSetting; } else if (DungeonTileSheet.doorTile(tile)){ if (DungeonTileSheet.wallStitcheable(map[pos - mapWidth])){