v2.4.0: fixed major errors in caves fissure transition rooms
This commit is contained in:
@@ -54,6 +54,7 @@ import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.Builder;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.FigureEightBuilder;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.builders.LoopBuilder;
|
||||
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.secret.SecretRoom;
|
||||
@@ -62,7 +63,9 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.PitRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.ShopRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SpecialRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.entrance.CavesFissureEntranceRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.entrance.EntranceRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.exit.CavesFissureExitRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.exit.ExitRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BlazingTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.BurningTrap;
|
||||
@@ -779,6 +782,29 @@ public abstract class RegularLevel extends Level {
|
||||
roomExit = r;
|
||||
}
|
||||
}
|
||||
|
||||
//This exists to fix an alpha bug =S, remove for release
|
||||
if (roomEntrance instanceof CavesFissureEntranceRoom){
|
||||
for (LevelTransition t : transitions){
|
||||
if (t.type == LevelTransition.Type.REGULAR_EXIT && roomEntrance.inside(t.center())){
|
||||
set(t.centerCell, Terrain.ENTRANCE, this);
|
||||
t.type = LevelTransition.Type.REGULAR_ENTRANCE;
|
||||
t.destDepth = Dungeon.depth-1;
|
||||
t.destType = LevelTransition.Type.REGULAR_EXIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (roomExit instanceof CavesFissureExitRoom){
|
||||
for (LevelTransition t : transitions){
|
||||
if (t.type == LevelTransition.Type.REGULAR_ENTRANCE && roomExit.inside(t.center())){
|
||||
set(t.centerCell, Terrain.EXIT, this);
|
||||
t.type = LevelTransition.Type.REGULAR_EXIT;
|
||||
t.destDepth = Dungeon.depth+1;
|
||||
t.destType = LevelTransition.Type.REGULAR_ENTRANCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,21 +44,21 @@ public class CavesFissureEntranceRoom extends CavesFissureRoom {
|
||||
public void paint(Level level) {
|
||||
super.paint(level);
|
||||
|
||||
int exit;
|
||||
int entrance;
|
||||
do {
|
||||
exit = level.pointToCell(random(2));
|
||||
entrance = level.pointToCell(random(2));
|
||||
|
||||
} while (level.map[exit] == Terrain.CHASM || level.map[exit] == Terrain.EMPTY_SP || level.findMob(exit) != null);
|
||||
} while (level.map[entrance] == Terrain.CHASM || level.map[entrance] == Terrain.EMPTY_SP || level.findMob(entrance) != null);
|
||||
|
||||
|
||||
for (int i : PathFinder.NEIGHBOURS8){
|
||||
if (level.map[exit+i] == Terrain.CHASM) {
|
||||
Painter.set(level, exit + i, Terrain.EMPTY);
|
||||
if (level.map[entrance+i] == Terrain.CHASM) {
|
||||
Painter.set(level, entrance + i, Terrain.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
Painter.set( level, exit, Terrain.EXIT );
|
||||
level.transitions.add(new LevelTransition(level, exit, LevelTransition.Type.REGULAR_EXIT));
|
||||
Painter.set( level, entrance, Terrain.ENTRANCE );
|
||||
level.transitions.add(new LevelTransition(level, entrance, LevelTransition.Type.REGULAR_ENTRANCE));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,23 +44,23 @@ public class CavesFissureExitRoom extends CavesFissureRoom {
|
||||
public void paint(Level level) {
|
||||
super.paint(level);
|
||||
|
||||
int entrance;
|
||||
int exit;
|
||||
do {
|
||||
entrance = level.pointToCell(random(2));
|
||||
exit = level.pointToCell(random(2));
|
||||
|
||||
} while (level.map[entrance] == Terrain.CHASM
|
||||
|| level.map[entrance] == Terrain.EMPTY_SP
|
||||
|| level.findMob(entrance) != null);
|
||||
} while (level.map[exit] == Terrain.CHASM
|
||||
|| level.map[exit] == Terrain.EMPTY_SP
|
||||
|| level.findMob(exit) != null);
|
||||
|
||||
|
||||
for (int i : PathFinder.NEIGHBOURS8){
|
||||
if (level.map[entrance+i] == Terrain.CHASM) {
|
||||
Painter.set(level, entrance + i, Terrain.EMPTY);
|
||||
if (level.map[exit+i] == Terrain.CHASM) {
|
||||
Painter.set(level, exit + i, Terrain.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
Painter.set( level, entrance, Terrain.ENTRANCE );
|
||||
level.transitions.add(new LevelTransition(level, entrance, LevelTransition.Type.REGULAR_ENTRANCE));
|
||||
Painter.set( level, exit, Terrain.EXIT );
|
||||
level.transitions.add(new LevelTransition(level, exit, LevelTransition.Type.REGULAR_EXIT));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -87,8 +87,8 @@ public class ExitRoom extends StandardRoom {
|
||||
rooms.add(ChasmBridgeExitRoom.class);
|
||||
rooms.add(PillarsExitRoom.class);
|
||||
|
||||
rooms.add(CavesFissureExitRoom.class);
|
||||
rooms.add(CaveExitRoom.class);
|
||||
rooms.add(CavesFissureExitRoom.class);
|
||||
|
||||
rooms.add(HallwayExitRoom.class);
|
||||
rooms.add(StatuesExitRoom.class);
|
||||
|
||||
Reference in New Issue
Block a user