v0.2.4: reworked final floor

This commit is contained in:
Evan Debenham 2015-02-22 02:26:30 -05:00
parent be563be012
commit cb5cd807b3
3 changed files with 64 additions and 28 deletions

View File

@ -994,8 +994,10 @@ public class Hero extends Char {
if (Actor.findChar( target ) == null) { if (Actor.findChar( target ) == null) {
if (Level.pit[target] && !flying && !Chasm.jumpConfirmed) { if (Level.pit[target] && !flying && !Chasm.jumpConfirmed) {
Chasm.heroJump( this ); if (!Level.solid[target]) {
interrupt(); Chasm.heroJump(this);
interrupt();
}
return false; return false;
} }
if (Level.passable[target] || Level.avoid[target]) { if (Level.passable[target] || Level.avoid[target]) {

View File

@ -63,9 +63,9 @@ public class DeadEndLevel extends Level {
entrance = SIZE * WIDTH + SIZE / 2 + 1; entrance = SIZE * WIDTH + SIZE / 2 + 1;
map[entrance] = Terrain.ENTRANCE; map[entrance] = Terrain.ENTRANCE;
exit = -1; exit = (SIZE / 2 + 1) * (WIDTH + 1);
map[(SIZE / 2 + 1) * (WIDTH + 1)] = Terrain.SIGN; map[exit] = Terrain.SIGN;
return true; return true;
} }

View File

@ -27,52 +27,85 @@ import com.watabou.utils.Random;
public class LastLevel extends Level { public class LastLevel extends Level {
private static final int SIZE = 7; private static final int SIZE = 30;
{ {
color1 = 0x801500; color1 = 0x801500;
color2 = 0xa68521; color2 = 0xa68521;
viewDistance = 8;
} }
private int pedestal; private int pedestal;
@Override @Override
public String tilesTex() { public String tilesTex() {
return Assets.TILES_HALLS; return Assets.TILES_HALLS;
} }
@Override @Override
public String waterTex() { public String waterTex() {
return Assets.WATER_HALLS; return Assets.WATER_HALLS;
} }
@Override
public void create() {
super.create();
for (int i=0; i < LENGTH; i++) {
int flags = Terrain.flags[map[i]];
if ((flags & Terrain.PIT) != 0){
passable[i] = avoid[i] = false;
solid[i] = true;
}
}
}
@Override @Override
protected boolean build() { protected boolean build() {
Arrays.fill( map, Terrain.WALL ); Arrays.fill( map, Terrain.CHASM );
Painter.fill( this, 1, 1, SIZE, SIZE, Terrain.WATER );
Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY ); Painter.fill( this, 7, 31, 19, 1, Terrain.WALL );
Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP ); Painter.fill( this, 15, 10, 3, 21, Terrain.EMPTY);
Painter.fill( this, 13, 30, 7, 1, Terrain.EMPTY);
Painter.fill( this, 14, 29, 5, 1, Terrain.EMPTY);
Painter.fill( this, 14, 9, 5, 7, Terrain.EMPTY);
Painter.fill( this, 13, 10, 7, 5, Terrain.EMPTY);
//Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY );
//Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP );
entrance = SIZE * WIDTH + SIZE / 2 + 1; entrance = SIZE * WIDTH + SIZE / 2 + 1;
map[entrance] = Terrain.ENTRANCE; map[entrance] = Terrain.ENTRANCE;
exit = entrance - WIDTH * SIZE; pedestal = (SIZE / 2 + 1) * (WIDTH + 1) - 4*WIDTH;
map[exit] = Terrain.LOCKED_EXIT;
pedestal = (SIZE / 2 + 1) * (WIDTH + 1);
map[pedestal] = Terrain.PEDESTAL; map[pedestal] = Terrain.PEDESTAL;
map[pedestal-1] = map[pedestal+1] = Terrain.STATUE_SP; map[pedestal-1-WIDTH] = map[pedestal+1-WIDTH] = map[pedestal-1+WIDTH] = map[pedestal+1+WIDTH] = Terrain.STATUE_SP;
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;
feeling = Feeling.NONE; feeling = Feeling.NONE;
viewDistance = 8;
return true; return true;
} }
@Override @Override
protected void decorate() { protected void decorate() {
for (int i=0; i < LENGTH; i++) { for (int i=0; i < LENGTH; i++) {
if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) {
map[i] = Terrain.EMPTY_DECO; map[i] = Terrain.EMPTY_DECO;
} }
} }
@ -86,7 +119,7 @@ public class LastLevel extends Level {
protected void createItems() { protected void createItems() {
drop( new Amulet(), pedestal ); drop( new Amulet(), pedestal );
} }
@Override @Override
public int randomRespawnCell() { public int randomRespawnCell() {
return -1; return -1;
@ -108,7 +141,7 @@ public class LastLevel extends Level {
return super.tileName( tile ); return super.tileName( tile );
} }
} }
@Override @Override
public String tileDesc(int tile) { public String tileDesc(int tile) {
switch (tile) { switch (tile) {
@ -116,14 +149,15 @@ public class LastLevel extends Level {
return "It looks like lava, but it's cold and probably safe to touch."; return "It looks like lava, but it's cold and probably safe to touch.";
case Terrain.STATUE: case Terrain.STATUE:
case Terrain.STATUE_SP: case Terrain.STATUE_SP:
return "The pillar is made of real humanoid skulls. Awesome."; return "The pillar is made of real humanoid skulls. Awesome.";
default: default:
return super.tileDesc( tile ); return super.tileDesc( tile );
} }
} }
@Override @Override
public void addVisuals( Scene scene ) { public void addVisuals( Scene scene ) {
super.addVisuals( scene );
HallsLevel.addVisuals( this, scene ); HallsLevel.addVisuals( this, scene );
} }
} }