v3.3.4: added a new simple rooms to vault area and increased base size
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.levels;
|
package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
@@ -30,106 +29,42 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.TrinketCatalyst;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.Builder;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.Builder;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.GridBuilder;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.GridBuilder;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ChasmRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultCircleRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EmptyRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultCrossRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.RegionDecoLineRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultEntranceRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.SegmentedRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultFinalRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.WaterBridgeRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultLongRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.entrance.EntranceRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultQuadrantsRoom;
|
||||||
import com.watabou.utils.Point;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault.VaultRingRoom;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class VaultLevel extends CityLevel {
|
public class VaultLevel extends CityLevel {
|
||||||
|
|
||||||
public static class VaultEntrance extends EntranceRoom {
|
|
||||||
@Override
|
|
||||||
public int maxConnections(int direction) {
|
|
||||||
if (direction == LEFT || direction == TOP) return 0;
|
|
||||||
return super.maxConnections(direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class VaultSegmentedRoom extends SegmentedRoom {
|
|
||||||
@Override
|
|
||||||
public float[] sizeCatProbs() {
|
|
||||||
return new float[]{1, 0, 0};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class VaultRegionDecoLineRoom extends RegionDecoLineRoom{
|
|
||||||
@Override
|
|
||||||
public float[] sizeCatProbs() {
|
|
||||||
return new float[]{0, 0, 1};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isExit() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int maxConnections(int direction) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPlaceItem(Point p, Level l) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ArrayList<Room> initRooms() {
|
protected ArrayList<Room> initRooms() {
|
||||||
ArrayList<Room> initRooms = new ArrayList<>();
|
ArrayList<Room> initRooms = new ArrayList<>();
|
||||||
|
|
||||||
initRooms.add(roomEntrance = new VaultEntrance());
|
initRooms.add(roomEntrance = new VaultEntranceRoom());
|
||||||
|
|
||||||
for (int i = 0; i < 18; i++){
|
for (int i = 0; i < 4; i++){
|
||||||
initRooms.add(new VaultSegmentedRoom());
|
initRooms.add(new VaultRingRoom());
|
||||||
|
initRooms.add(new VaultCircleRoom());
|
||||||
|
initRooms.add(new VaultCrossRoom());
|
||||||
|
initRooms.add(new VaultQuadrantsRoom());
|
||||||
}
|
}
|
||||||
|
|
||||||
initRooms.add(new EmptyRoom(){
|
initRooms.add(new VaultLongRoom());
|
||||||
@Override
|
initRooms.add(new VaultLongRoom());
|
||||||
public int minWidth() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public int maxWidth() {
|
|
||||||
return 20;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
initRooms.add(new EmptyRoom(){
|
|
||||||
@Override
|
|
||||||
public int minHeight() {
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public int maxHeight() {
|
|
||||||
return 20;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
initRooms.add(new VaultRegionDecoLineRoom());
|
initRooms.add(new VaultFinalRoom());
|
||||||
return initRooms;
|
return initRooms;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,56 +78,6 @@ public class VaultLevel extends CityLevel {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean build() {
|
|
||||||
for (int i = 0; i < 20; i++){
|
|
||||||
Item item = Generator.randomUsingDefaults(Random.oneOf(
|
|
||||||
Generator.Category.WEAPON, Generator.Category.WEAPON, Generator.Category.WEAPON,
|
|
||||||
Generator.Category.ARMOR,
|
|
||||||
Generator.Category.WAND,
|
|
||||||
Generator.Category.RING));
|
|
||||||
//regrowth is disallowed as it can be used to farm HP regen
|
|
||||||
if (item instanceof WandOfRegrowth){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (item.cursed){
|
|
||||||
item.cursed = false;
|
|
||||||
if (item instanceof MeleeWeapon && ((MeleeWeapon) item).hasCurseEnchant()){
|
|
||||||
((MeleeWeapon) item).enchant(null);
|
|
||||||
} else if (item instanceof Armor && ((Armor) item).hasCurseGlyph()){
|
|
||||||
((Armor) item).inscribe(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//not true ID, prevents extra info about rings leaking to main game
|
|
||||||
item.levelKnown = item.cursedKnown = true;
|
|
||||||
addItemToSpawn(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!super.build()){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Room finalRoom = room(RegionDecoLineRoom.class);
|
|
||||||
for (Point p : finalRoom.getPoints()){
|
|
||||||
int cell = pointToCell(p);
|
|
||||||
if (map[cell] == Terrain.REGION_DECO){
|
|
||||||
set(cell, Terrain.REGION_DECO_ALT, this);
|
|
||||||
} else if (map[cell] == Terrain.EMPTY || map[cell] == Terrain.EMPTY_DECO || map[cell] == Terrain.WATER || map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.GRASS){
|
|
||||||
set(cell, Terrain.EMPTY_SP, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
set(entrance(), Terrain.EMPTY, this);
|
|
||||||
transitions.add(new LevelTransition(this,
|
|
||||||
entrance(),
|
|
||||||
LevelTransition.Type.BRANCH_ENTRANCE,
|
|
||||||
Dungeon.depth,
|
|
||||||
0,
|
|
||||||
LevelTransition.Type.BRANCH_EXIT));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activateTransition(Hero hero, LevelTransition transition) {
|
public boolean activateTransition(Hero hero, LevelTransition transition) {
|
||||||
//walking onto transitions does nothing, need to use crystal
|
//walking onto transitions does nothing, need to use crystal
|
||||||
@@ -214,20 +99,33 @@ public class VaultLevel extends CityLevel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createItems() {
|
protected void createItems() {
|
||||||
|
for (int i = 0; i < 20; i++){
|
||||||
|
Item item = Generator.randomUsingDefaults(Random.oneOf(
|
||||||
|
Generator.Category.WEAPON, Generator.Category.WEAPON, Generator.Category.WEAPON,
|
||||||
|
Generator.Category.ARMOR,
|
||||||
|
Generator.Category.WAND,
|
||||||
|
Generator.Category.RING));
|
||||||
|
//regrowth is disallowed as it can be used to farm HP regen
|
||||||
|
if (item instanceof WandOfRegrowth){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (item.cursed){
|
||||||
|
item.cursed = false;
|
||||||
|
if (item instanceof MeleeWeapon && ((MeleeWeapon) item).hasCurseEnchant()){
|
||||||
|
((MeleeWeapon) item).enchant(null);
|
||||||
|
} else if (item instanceof Armor && ((Armor) item).hasCurseGlyph()){
|
||||||
|
((Armor) item).inscribe(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//not true ID, prevents extra info about rings leaking to main game
|
||||||
|
item.levelKnown = item.cursedKnown = true;
|
||||||
|
addItemToSpawn(item);
|
||||||
|
}
|
||||||
|
|
||||||
//copypasta from super.createItems
|
//copypasta from super.createItems
|
||||||
for (Item item : itemsToSpawn) {
|
for (Item item : itemsToSpawn) {
|
||||||
int cell = randomDropCell();
|
int cell = randomDropCell();
|
||||||
if (item instanceof TrinketCatalyst){
|
drop( item, cell ).type = Heap.Type.HEAP;
|
||||||
drop( item, cell ).type = Heap.Type.LOCKED_CHEST;
|
|
||||||
int keyCell = randomDropCell();
|
|
||||||
drop( new GoldenKey(Dungeon.depth), keyCell ).type = Heap.Type.HEAP;
|
|
||||||
if (map[keyCell] == Terrain.HIGH_GRASS || map[keyCell] == Terrain.FURROWED_GRASS) {
|
|
||||||
map[keyCell] = Terrain.GRASS;
|
|
||||||
losBlocking[keyCell] = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
drop( item, cell ).type = Heap.Type.HEAP;
|
|
||||||
}
|
|
||||||
if (map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.FURROWED_GRASS) {
|
if (map[cell] == Terrain.HIGH_GRASS || map[cell] == Terrain.FURROWED_GRASS) {
|
||||||
map[cell] = Terrain.GRASS;
|
map[cell] = Terrain.GRASS;
|
||||||
losBlocking[cell] = false;
|
losBlocking[cell] = false;
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ import java.util.ArrayList;
|
|||||||
//TODO extend regular builder?
|
//TODO extend regular builder?
|
||||||
public class GridBuilder extends Builder {
|
public class GridBuilder extends Builder {
|
||||||
|
|
||||||
public static int ROOM_SIZE = 9;
|
//TODO this shouldn't be static, could be a parameter
|
||||||
|
public static int ROOM_SIZE = 11;
|
||||||
|
|
||||||
//each adjacency is processed twice, so this gives a ~50% chance to connect two adjacent rooms
|
//each adjacency is processed twice, so this gives a ~50% chance to connect two adjacent rooms
|
||||||
protected float extraConnectionChance = 0.30f;
|
protected float extraConnectionChance = 0.30f;
|
||||||
@@ -103,19 +104,19 @@ public class GridBuilder extends Builder {
|
|||||||
int nIdx = keys[Random.Int(keys.length)];
|
int nIdx = keys[Random.Int(keys.length)];
|
||||||
Room n = gridCells.get(nIdx, null);
|
Room n = gridCells.get(nIdx, null);
|
||||||
int rIdx = nIdx;
|
int rIdx = nIdx;
|
||||||
//currently always pulls down and to the right
|
//currently always pulls up and to the right
|
||||||
switch (Random.Int(10)){
|
switch (Random.Int(10)){
|
||||||
case 0: case 4: case 5: case 6:
|
case 0: case 4: case 5: case 6:
|
||||||
rIdx += 1;
|
rIdx += 1;
|
||||||
break;
|
break;
|
||||||
case 1: case 7: case 8: case 9:
|
case 1: case 7: case 8: case 9:
|
||||||
rIdx += 1000;
|
rIdx -= 1000;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
rIdx -= 1;
|
rIdx -= 1;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
rIdx -= 1000;
|
rIdx += 1000;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//-100 to cancel offsets
|
//-100 to cancel offsets
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class VaultCircleRoom extends StandardRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] sizeCatProbs() {
|
||||||
|
return new float[]{0, 1, 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
Painter.fill( level, this, 2, Terrain.EMPTY );
|
||||||
|
|
||||||
|
Painter.fill( level, this, 4, 1, 4, 1, Terrain.EMPTY );
|
||||||
|
Painter.fill( level, this, 1, 4, 1, 4, Terrain.EMPTY );
|
||||||
|
|
||||||
|
Painter.set( level, center(), Terrain.STATUE);
|
||||||
|
|
||||||
|
for (Door door : connected.values()) {
|
||||||
|
door.set( Door.Type.REGULAR );
|
||||||
|
Painter.drawInside(level, this, door, 4, Terrain.EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class VaultCrossRoom extends StandardRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] sizeCatProbs() {
|
||||||
|
return new float[]{0, 1, 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
|
||||||
|
Painter.fill( level, this, 4, 1, 4, 1, Terrain.EMPTY );
|
||||||
|
Painter.fill( level, this, 1, 4, 1, 4, Terrain.EMPTY );
|
||||||
|
|
||||||
|
Painter.set( level, center(), Terrain.STATUE);
|
||||||
|
|
||||||
|
//TODO only shapes for sides with doors?
|
||||||
|
|
||||||
|
for (Door door : connected.values()) {
|
||||||
|
door.set( Door.Type.REGULAR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canConnect(Point p) {
|
||||||
|
Point c = center();
|
||||||
|
return (c.x == p.x || c.y == p.y) && super.canConnect(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.entrance.EntranceRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class VaultEntranceRoom extends StandardRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] sizeCatProbs() {
|
||||||
|
return new float[]{0, 1, 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL);
|
||||||
|
Painter.fill( level, this, 1, Terrain.EMPTY );
|
||||||
|
|
||||||
|
for (Room.Door door : connected.values()) {
|
||||||
|
door.set( Room.Door.Type.REGULAR );
|
||||||
|
}
|
||||||
|
|
||||||
|
int entrance;
|
||||||
|
do {
|
||||||
|
entrance = level.pointToCell(random(2));
|
||||||
|
} while (level.findMob(entrance) != null);
|
||||||
|
|
||||||
|
level.transitions.add(new LevelTransition(level,
|
||||||
|
entrance,
|
||||||
|
LevelTransition.Type.BRANCH_ENTRANCE,
|
||||||
|
Dungeon.depth,
|
||||||
|
0,
|
||||||
|
LevelTransition.Type.BRANCH_EXIT));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEntrance() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxConnections(int direction) {
|
||||||
|
//only up and right right now
|
||||||
|
if (direction == LEFT || direction == BOTTOM) return 0;
|
||||||
|
return super.maxConnections(direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SpecialRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class VaultFinalRoom extends SpecialRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int minWidth() {
|
||||||
|
return 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxWidth() {
|
||||||
|
return 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int minHeight() {
|
||||||
|
return 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxHeight(){
|
||||||
|
return 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isExit() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
Painter.fill( level, this, 1 , Terrain.REGION_DECO_ALT );
|
||||||
|
Painter.fill( level, this, 2 , Terrain.EMPTY_SP );
|
||||||
|
|
||||||
|
for (Door door : connected.values()) {
|
||||||
|
door.set( Door.Type.REGULAR );
|
||||||
|
Painter.drawInside(level, this, door, 2, Terrain.EMPTY_SP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceItem(Point p, Level l) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
|
public class VaultLongRoom extends StandardRoom {
|
||||||
|
|
||||||
|
private boolean wide = Random.Int(2) == 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] sizeCatProbs() {
|
||||||
|
return new float[]{0, 0, 1};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int minWidth() {
|
||||||
|
return wide ? 21 : 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxWidth() {
|
||||||
|
return minWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int minHeight() {
|
||||||
|
return wide ? 11: 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int maxHeight() {
|
||||||
|
return minHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
Painter.fill( level, this, 1 , Terrain.EMPTY );
|
||||||
|
|
||||||
|
Painter.fill(level, this, 4, Terrain.WALL);
|
||||||
|
|
||||||
|
if (wide){
|
||||||
|
Painter.fill(level, this, 8, 4, 8, 4, Terrain.EMPTY);
|
||||||
|
} else {
|
||||||
|
Painter.fill(level, this, 4, 8, 4, 8, Terrain.EMPTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Door door : connected.values()) {
|
||||||
|
door.set( Door.Type.REGULAR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class VaultQuadrantsRoom extends StandardRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] sizeCatProbs() {
|
||||||
|
return new float[]{0, 1, 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
Painter.fill( level, this, 1, Terrain.EMPTY );
|
||||||
|
|
||||||
|
Point c = center();
|
||||||
|
Painter.drawInside( level, this, new Point(left, c.y), 3, Terrain.WALL);
|
||||||
|
Painter.drawInside( level, this, new Point(right, c.y), 3, Terrain.WALL);
|
||||||
|
Painter.drawInside( level, this, new Point(c.x, top), 3, Terrain.WALL);
|
||||||
|
Painter.drawInside( level, this, new Point(c.x, bottom), 3, Terrain.WALL);
|
||||||
|
|
||||||
|
Painter.set( level, c, Terrain.STATUE);
|
||||||
|
|
||||||
|
for (Room.Door door : connected.values()) {
|
||||||
|
door.set( Room.Door.Type.REGULAR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canConnect(Point p) {
|
||||||
|
Point c = center();
|
||||||
|
return c.x != p.x && c.y != p.y && super.canConnect(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.vault;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
|
import com.watabou.utils.Point;
|
||||||
|
|
||||||
|
public class VaultRingRoom extends StandardRoom {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] sizeCatProbs() {
|
||||||
|
return new float[]{0, 1, 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Level level) {
|
||||||
|
Painter.fill( level, this, Terrain.WALL );
|
||||||
|
Painter.fill( level, this, 1 , Terrain.EMPTY );
|
||||||
|
|
||||||
|
Painter.fill(level, this, 4, Terrain.WALL);
|
||||||
|
|
||||||
|
for (Door door : connected.values()) {
|
||||||
|
door.set( Door.Type.REGULAR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user