v0.8.0: added initial custom visuals for demon spawner rooms
This commit is contained in:
parent
7266415984
commit
9b7fbbf0f6
BIN
core/src/main/assets/custom_tiles/halls_special.png
Normal file
BIN
core/src/main/assets/custom_tiles/halls_special.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 302 B |
|
@ -136,6 +136,7 @@ public class Assets {
|
||||||
public static final String PRISON_EXIT_NEW = "custom_tiles/prison_exit_new.png";
|
public static final String PRISON_EXIT_NEW = "custom_tiles/prison_exit_new.png";
|
||||||
public static final String CAVES_BOSS = "custom_tiles/caves_boss.png";
|
public static final String CAVES_BOSS = "custom_tiles/caves_boss.png";
|
||||||
public static final String CITY_BOSS = "custom_tiles/city_boss.png";
|
public static final String CITY_BOSS = "custom_tiles/city_boss.png";
|
||||||
|
public static final String HALLS_SP = "custom_tiles/halls_special.png";
|
||||||
|
|
||||||
public static final String BUFFS_SMALL = "buffs.png";
|
public static final String BUFFS_SMALL = "buffs.png";
|
||||||
public static final String BUFFS_LARGE = "large_buffs.png";
|
public static final String BUFFS_LARGE = "large_buffs.png";
|
||||||
|
|
|
@ -21,15 +21,17 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DemonSpawner;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DemonSpawner;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RipperDemon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||||
|
import com.watabou.noosa.Tilemap;
|
||||||
import com.watabou.utils.Point;
|
import com.watabou.utils.Point;
|
||||||
import com.watabou.utils.Random;
|
|
||||||
|
|
||||||
public class DemonSpawnerRoom extends SpecialRoom {
|
public class DemonSpawnerRoom extends SpecialRoom {
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,6 +51,10 @@ public class DemonSpawnerRoom extends SpecialRoom {
|
||||||
spawner.pos = cx + cy * level.width();
|
spawner.pos = cx + cy * level.width();
|
||||||
level.mobs.add( spawner );
|
level.mobs.add( spawner );
|
||||||
|
|
||||||
|
CustomFloor vis = new CustomFloor();
|
||||||
|
vis.setRect(left+1, top+1, width()-2, height()-2);
|
||||||
|
level.customTiles.add(vis);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,4 +63,36 @@ public class DemonSpawnerRoom extends SpecialRoom {
|
||||||
if (room instanceof EntranceRoom) return false;
|
if (room instanceof EntranceRoom) return false;
|
||||||
else return super.connect(room);
|
else return super.connect(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceTrap(Point p) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceWater(Point p) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class CustomFloor extends CustomTilemap {
|
||||||
|
|
||||||
|
{
|
||||||
|
texture = Assets.HALLS_SP;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tilemap create() {
|
||||||
|
Tilemap v = super.create();
|
||||||
|
int top = 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;
|
||||||
|
}
|
||||||
|
v.map( data, tileW );
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user