diff --git a/core/src/main/assets/custom_tiles/halls_special.png b/core/src/main/assets/custom_tiles/halls_special.png index e48bc1059..9eecf798e 100644 Binary files a/core/src/main/assets/custom_tiles/halls_special.png and b/core/src/main/assets/custom_tiles/halls_special.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index f424a6b3c..8335b81ed 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -46,7 +46,7 @@ import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.DeadEndLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.HallsBossLevel; +import com.shatteredpixel.shatteredpixeldungeon.levels.NewHallsBossLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.HallsLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.LastLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel; @@ -295,7 +295,7 @@ public class Dungeon { level = new HallsLevel(); break; case 25: - level = new HallsBossLevel(); + level = new NewHallsBossLevel(); break; case 26: level = new LastLevel(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index f01e79b9a..059596fe3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -135,6 +135,9 @@ public class ShatteredPixelDungeon extends Game { com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.levels.OldCityBossLevel.class, "com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel" ); + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.levels.OldHallsBossLevel.class, + "com.shatteredpixel.shatteredpixeldungeon.levels.HallsBossLevel" ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java new file mode 100644 index 000000000..eec60afea --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java @@ -0,0 +1,43 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2020 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; + + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; + +//TODO boss implementation +public class YogDzewa extends Yog { + + { + HP = HT = 1; + } + + @Override + public void die( Object cause ) { + + super.die( cause ); + + Dungeon.level.unseal(); + Dungeon.level.heaps.get(pos).destroy(); + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java index 32bc36096..c54804ec5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java @@ -22,13 +22,16 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.Amulet; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap; import com.watabou.noosa.Group; +import com.watabou.noosa.Tilemap; import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -40,6 +43,8 @@ public class LastLevel extends Level { { color1 = 0x801500; color2 = 0xa68521; + + viewDistance = Math.min(4, viewDistance); } private int pedestal; @@ -64,51 +69,67 @@ public class LastLevel extends Level { solid[i] = true; } } + for (int i = (height-ROOM_TOP+2)*width; i < length; i++){ + passable[i] = avoid[i] = false; + solid[i] = true; + } + for (int i = (height-ROOM_TOP+1)*width; i < length; i++){ + if (i % width < 4 || i % width > 12 || i >= (length-width)){ + discoverable[i] = false; + } else { + visited[i] = true; + } + } } + private static final int ROOM_TOP = 10; + @Override protected boolean build() { setSize(16, 64); Arrays.fill( map, Terrain.CHASM ); - int mid = width/2; + final int MID = width/2; Painter.fill( this, 0, height-1, width, 1, Terrain.WALL ); - Painter.fill( this, mid - 1, 10, 3, (height-11), Terrain.EMPTY); - Painter.fill( this, mid - 2, height - 3, 5, 1, Terrain.EMPTY); - Painter.fill( this, mid - 3, height - 2, 7, 1, Terrain.EMPTY); + Painter.fill( this, MID - 1, 10, 3, (height-11), Terrain.EMPTY); + Painter.fill( this, MID - 2, height - 3, 5, 1, Terrain.EMPTY); + Painter.fill( this, MID - 3, height - 2, 7, 1, Terrain.EMPTY); - Painter.fill( this, mid - 2, 9, 5, 7, Terrain.EMPTY); - Painter.fill( this, mid - 3, 10, 7, 5, Terrain.EMPTY); + Painter.fill( this, MID - 2, 9, 5, 7, Terrain.EMPTY); + Painter.fill( this, MID - 3, 10, 7, 5, Terrain.EMPTY); - entrance = (height-2) * width() + mid; + entrance = (height-ROOM_TOP) * width() + MID; + Painter.fill(this, 0, height - ROOM_TOP, width, 2, Terrain.WALL); map[entrance] = Terrain.ENTRANCE; + map[entrance+width] = Terrain.ENTRANCE; + Painter.fill(this, 0, height - ROOM_TOP + 2, width, 8, Terrain.EMPTY); + Painter.fill(this, MID-1, height - ROOM_TOP + 2, 3, 1, Terrain.ENTRANCE); - pedestal = 12*(width()) + mid; - map[pedestal] = Terrain.PEDESTAL; - map[pedestal-1-width()] = map[pedestal+1-width()] = map[pedestal-1+width()] = map[pedestal+1+width()] = Terrain.STATUE_SP; - + pedestal = 12*(width()) + MID; exit = pedestal; - int pos = pedestal; - - map[pos-width()] = map[pos-1] = map[pos+1] = map[pos-2] = map[pos+2] = Terrain.WATER; - pos+=width(); - map[pos] = map[pos-2] = map[pos+2] = map[pos-3] = map[pos+3] = Terrain.WATER; - pos+=width(); - map[pos-3] = map[pos-2] = map[pos-1] = map[pos] = map[pos+1] = map[pos+2] = map[pos+3] = Terrain.WATER; - pos+=width(); - map[pos-2] = map[pos+2] = Terrain.WATER; - for (int i=0; i < length(); i++) { - if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { + if (map[i] == Terrain.EMPTY && Random.Int( 5 ) == 0) { map[i] = Terrain.EMPTY_DECO; } } feeling = Feeling.NONE; + CustomTilemap vis = new CustomFloor(); + vis.setRect( 5, 0, 7, height - ROOM_TOP); + customTiles.add(vis); + + vis = new CenterPieceVisuals(); + vis.pos(0, height - ROOM_TOP); + customTiles.add(vis); + + vis = new CenterPieceWalls(); + vis.pos(0, height - ROOM_TOP-1); + customWalls.add(vis); + return true; } @@ -190,5 +211,109 @@ public class LastLevel extends Level { solid[i] = true; } } + for (int i = (height-ROOM_TOP+2)*width; i < length; i++){ + passable[i] = avoid[i] = false; + solid[i] = true; + } + for (int i = (height-ROOM_TOP+1)*width; i < length; i++){ + if (i % width < 4 || i % width > 12 || i >= (length-width)){ + discoverable[i] = false; + } else { + visited[i] = true; + } + } + } + + public static class CustomFloor extends CustomTilemap { + + { + texture = Assets.HALLS_SP; + } + + @Override + public Tilemap create() { + Tilemap v = super.create(); + int cell = tileX + tileY * Dungeon.level.width(); + int[] map = Dungeon.level.map; + int[] data = new int[tileW*tileH]; + for (int i = 0; i < data.length; i++){ + if (i % tileW == 0){ + cell = tileX + (tileY + i / tileW) * Dungeon.level.width(); + } + if (map[cell] == Terrain.EMPTY_DECO) { + data[i] = 27; + } else if (map[cell] == Terrain.EMPTY) { + data[i] = 19; + if (map[cell+Dungeon.level.width] == Terrain.CHASM) { + data[i+tileW] = 6; + } + } else if (data[i] == 0) { + data[i] = -1; + } + cell++; + } + v.map( data, tileW ); + return v; + } + + } + + public static class CenterPieceVisuals extends CustomTilemap { + + { + texture = Assets.HALLS_SP; + + tileW = 16; + tileH = 10; + } + + private static final int[] map = new int[]{ + -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1, -1, -1, -1, + 0, 0, 0, 0, 8, 9, 10, 11, 19, 11, 12, 13, 14, 0, 0, 0, + 0, 0, 0, 0, 16, 17, 18, 19, 19, 19, 20, 21, 22, 0, 0, 0, + 0, 0, 0, 0, 24, 25, 26, 27, 19, 27, 28, 29, 30, 0, 0, 0, + 0, 0, 0, 0, 24, 25, 26, 19, 19, 19, 28, 29, 30, 0, 0, 0, + 0, 0, 0, 0, 24, 25, 26, 27, 19, 27, 28, 29, 30, 0, 0, 0, + 0, 0, 0, 0, 24, 25, 34, 35, 35, 35, 34, 29, 30, 0, 0, 0, + 0, 0, 0, 0, 40, 41, 36, 36, 36, 36, 36, 40, 41, 0, 0, 0, + 0, 0, 0, 0, 48, 49, 36, 36, 36, 36, 36, 48, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + + @Override + public Tilemap create() { + Tilemap v = super.create(); + v.map(map, tileW); + return v; + } + } + + public static class CenterPieceWalls extends CustomTilemap { + + { + texture = Assets.HALLS_SP; + + tileW = 16; + tileH = 9; + } + + private static final int[] map = new int[]{ + 4, 4, 4, 4, 4, 4, 4, 5, 7, 3, 4, 4, 4, 4, 4, 4, + 0, 0, 0, 0, 0, 0, 0, 1, 15, 2, 0, 0, 0, 0, 0, 0, + -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 32, 33, -1, -1, -1, -1, -1, 32, 33, -1, -1, -1, + -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + }; + + @Override + public Tilemap create() { + Tilemap v = super.create(); + v.map(map, tileW); + return v; + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewHallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewHallsBossLevel.java new file mode 100644 index 000000000..bd6866187 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewHallsBossLevel.java @@ -0,0 +1,354 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2019 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.levels; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Bones; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogDzewa; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Yog; +import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; +import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap; +import com.watabou.noosa.Group; +import com.watabou.noosa.Tilemap; +import com.watabou.utils.PathFinder; +import com.watabou.utils.Random; + +public class NewHallsBossLevel extends Level { + + { + color1 = 0x801500; + color2 = 0xa68521; + + viewDistance = Math.min(4, viewDistance); + } + + private static final int WIDTH = 32; + private static final int HEIGHT = 32; + + private static final int ROOM_LEFT = WIDTH / 2 - 4; + private static final int ROOM_RIGHT = WIDTH / 2 + 4; + private static final int ROOM_TOP = 8; + private static final int ROOM_BOTTOM = ROOM_TOP + 8; + + @Override + public String tilesTex() { + return Assets.TILES_HALLS; + } + + @Override + public String waterTex() { + return Assets.WATER_HALLS; + } + + @Override + protected boolean build() { + + setSize(WIDTH, HEIGHT); + + for (int i = 0; i < 5; i++) { + + int top; + int bottom; + + if (i == 0 || i == 4){ + top = Random.IntRange(ROOM_TOP-1, ROOM_TOP+3); + bottom = Random.IntRange(ROOM_BOTTOM+2, ROOM_BOTTOM+6); + } else if (i == 1 || i == 3){ + top = Random.IntRange(ROOM_TOP-5, ROOM_TOP-1); + bottom = Random.IntRange(ROOM_BOTTOM+6, ROOM_BOTTOM+10); + } else { + top = Random.IntRange(ROOM_TOP-6, ROOM_TOP-3); + bottom = Random.IntRange(ROOM_BOTTOM+8, ROOM_BOTTOM+12); + } + + Painter.fill(this, 4 + i * 5, top, 5, bottom - top + 1, Terrain.EMPTY); + + if (i == 2) { + entrance = (6 + i * 5) + (bottom - 1) * width(); + } + + } + + boolean[] patch = Patch.generate(width, height, 0.20f, 0, true); + for (int i = 0; i < length(); i++) { + if (map[i] == Terrain.EMPTY && patch[i]) { + map[i] = Terrain.STATUE; + } + } + + map[entrance] = Terrain.ENTRANCE; + + Painter.fill(this, ROOM_LEFT-1, ROOM_TOP-1, 11, 11, Terrain.EMPTY ); + + patch = Patch.generate(width, height, 0.30f, 3, true); + for (int i = 0; i < length(); i++) { + if ((map[i] == Terrain.EMPTY || map[i] == Terrain.STATUE) && patch[i]) { + map[i] = Terrain.WATER; + } + } + + for (int i = 0; i < length(); i++) { + if (map[i] == Terrain.EMPTY && Random.Int(4) == 0) { + map[i] = Terrain.EMPTY_DECO; + } + } + + Painter.fill(this, ROOM_LEFT, ROOM_TOP, 9, 9, Terrain.EMPTY_SP ); + + Painter.fill(this, ROOM_LEFT, ROOM_TOP, 9, 2, Terrain.WALL_DECO ); + Painter.fill(this, ROOM_LEFT, ROOM_BOTTOM-1, 2, 2, Terrain.WALL_DECO ); + Painter.fill(this, ROOM_RIGHT-1, ROOM_BOTTOM-1, 2, 2, Terrain.WALL_DECO ); + + Painter.fill(this, ROOM_LEFT+3, ROOM_TOP+3, 3, 3, Terrain.EMPTY ); + + exit = width/2 + ((ROOM_TOP+1) * width); + //map[exit] = Terrain.EXIT; + + CustomTilemap vis = new CenterPieceVisuals(); + vis.pos(ROOM_LEFT, ROOM_TOP+1); + customTiles.add(vis); + + vis = new CenterPieceWalls(); + vis.pos(ROOM_LEFT, ROOM_TOP); + customWalls.add(vis); + + //basic version of building flag maps for the pathfinder test + for (int i = 0; i < length; i++){ + passable[i] = ( Terrain.flags[map[i]] & Terrain.PASSABLE) != 0; + } + + //ensures a path to the exit exists + return (PathFinder.getStep(entrance, exit, passable) != -1); + } + + @Override + protected void createMobs() { + } + + public Actor respawner() { + return null; + } + + @Override + protected void createItems() { + Item item = Bones.get(); + if (item != null) { + int pos; + do { + pos = Random.IntRange( ROOM_LEFT, ROOM_RIGHT ) + Random.IntRange( ROOM_TOP + 1, ROOM_BOTTOM ) * width(); + } while (pos == entrance); + drop( item, pos ).setHauntedIfCursed().type = Heap.Type.REMAINS; + } + } + + @Override + public int randomRespawnCell( Char ch ) { + int pos = entrance; + int cell; + do { + cell = pos + PathFinder.NEIGHBOURS8[Random.Int(8)]; + } while (!passable[cell] + || (Char.hasProp(ch, Char.Property.LARGE) && !openSpace[cell]) + || Actor.findChar(cell) != null); + return cell; + } + + @Override + public void occupyCell( Char ch ) { + super.occupyCell( ch ); + + if (map[entrance] == Terrain.ENTRANCE && map[exit] != Terrain.EXIT + && ch == Dungeon.hero && ch.pos != entrance) { + + seal(); + } + } + + @Override + public void seal() { + set( entrance, Terrain.EMPTY_SP ); + GameScene.updateMap( entrance ); + CellEmitter.get( entrance ).start( FlameParticle.FACTORY, 0.1f, 10 ); + + Dungeon.observe(); + + Yog boss = new YogDzewa(); + boss.pos = exit + width*3; + GameScene.add( boss ); + //boss.spawnFists(); + } + + @Override + public void unseal() { + set( entrance, Terrain.ENTRANCE ); + GameScene.updateMap( entrance ); + + set( exit, Terrain.EXIT ); + GameScene.updateMap( exit ); + + CellEmitter.get(exit-1).burst(ShadowParticle.UP, 25); + CellEmitter.get(exit).burst(ShadowParticle.UP, 100); + CellEmitter.get(exit+1).burst(ShadowParticle.UP, 25); + GameScene.flash(0); + for( CustomTilemap t : customTiles){ + if (t instanceof CenterPieceVisuals){ + ((CenterPieceVisuals) t).updateState(); + } + } + for( CustomTilemap t : customWalls){ + if (t instanceof CenterPieceWalls){ + ((CenterPieceWalls) t).updateState(); + } + } + + Dungeon.observe(); + } + + @Override + public String tileName( int tile ) { + switch (tile) { + case Terrain.WATER: + return Messages.get(HallsLevel.class, "water_name"); + case Terrain.GRASS: + return Messages.get(HallsLevel.class, "grass_name"); + case Terrain.HIGH_GRASS: + return Messages.get(HallsLevel.class, "high_grass_name"); + case Terrain.STATUE: + case Terrain.STATUE_SP: + return Messages.get(HallsLevel.class, "statue_name"); + default: + return super.tileName( tile ); + } + } + + @Override + public String tileDesc(int tile) { + switch (tile) { + case Terrain.WATER: + return Messages.get(HallsLevel.class, "water_desc"); + case Terrain.STATUE: + case Terrain.STATUE_SP: + return Messages.get(HallsLevel.class, "statue_desc"); + case Terrain.BOOKSHELF: + return Messages.get(HallsLevel.class, "bookshelf_desc"); + default: + return super.tileDesc( tile ); + } + } + + @Override + public Group addVisuals () { + super.addVisuals(); + HallsLevel.addHallsVisuals( this, visuals ); + return visuals; + } + + public static class CenterPieceVisuals extends CustomTilemap { + + { + texture = Assets.HALLS_SP; + + tileW = 9; + tileH = 8; + } + + private static final int[] map = new int[]{ + 8, 9, 10, 11, 11, 11, 12, 13, 14, + 16, 17, 18, 19, 19, 19, 20, 21, 22, + 24, 25, 26, 27, 19, 27, 28, 29, 30, + 24, 25, 26, 19, 19, 19, 28, 29, 30, + 24, 25, 26, 27, 19, 27, 28, 29, 30, + 24, 25, 34, 35, 35, 35, -1, 29, 30, + 40, 41, 36, 36, 36, 36, 36, 40, 41, + 48, 49, 36, 36, 36, 36, 36, 48, 49 + }; + + @Override + public Tilemap create() { + Tilemap v = super.create(); + updateState(); + return v; + } + + private void updateState(){ + if (vis != null){ + int[] data = map.clone(); + if (Dungeon.level.map[Dungeon.level.exit] == Terrain.EXIT) { + data[4] = 19; + } + vis.map(data, tileW); + } + } + } + + public static class CenterPieceWalls extends CustomTilemap { + + { + texture = Assets.HALLS_SP; + + tileW = 9; + tileH = 9; + } + + private static final int[] map = new int[]{ + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + 32, 33, -1, -1, -1, -1, -1, 32, 33, + 40, 41, -1, -1, -1, -1, -1, 40, 41, + }; + + @Override + public Tilemap create() { + Tilemap v = super.create(); + updateState(); + return v; + } + + private void updateState(){ + if (vis != null){ + int[] data = map.clone(); + if (Dungeon.level.map[Dungeon.level.exit] == Terrain.EXIT) { + data[3] = 1; + data[4] = 0; + data[5] = 2; + data[13] = 23; + } + vis.map(data, tileW); + } + } + + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldHallsBossLevel.java similarity index 99% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldHallsBossLevel.java index b6c1f6808..283a7e39d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldHallsBossLevel.java @@ -40,7 +40,7 @@ import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; -public class HallsBossLevel extends Level { +public class OldHallsBossLevel extends Level { { color1 = 0x801500; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java index 21532e17b..fec1e261a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java @@ -83,12 +83,16 @@ public class DemonSpawnerRoom extends SpecialRoom { @Override public Tilemap create() { Tilemap v = super.create(); - int top = tileX + tileY* Dungeon.level.width(); + int cell = tileX + tileY * Dungeon.level.width(); int[] map = Dungeon.level.map; int[] data = new int[tileW*tileH]; for (int i = 0; i < data.length; i++){ - if (map[i+top] == Terrain.EMPTY_DECO) data[i] = 1; - else data[i] = 0; + if (i % tileW == 0){ + cell = tileX + (tileY + i / tileW) * Dungeon.level.width(); + } + if (map[cell] == Terrain.EMPTY_DECO) data[i] = 27; + else data[i] = 19; + cell++; } v.map( data, tileW ); return v; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java index 3da9c7d38..6000f3af9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.tiles; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.levels.NewHallsBossLevel; import com.watabou.noosa.TextureFilm; import com.watabou.noosa.Tilemap; @@ -63,6 +64,14 @@ public class WallBlockingTilemap extends Tilemap { @Override public synchronized void updateMapCell(int cell) { + + //FIXME this is to address the wall blocking looking odd on the new yog floor. + // The true solution is to improve the fog of war so the blockers aren't necessary. + if (Dungeon.level instanceof NewHallsBossLevel){ + data[cell] = CLEARED; + super.updateMapCell(cell); + return; + } //TODO should doors be considered? currently the blocking is a bit permissive around doors