v0.3.1: adjusted how special floors handle random respawn cell logic.

This commit is contained in:
Evan Debenham 2015-08-17 03:28:01 -04:00 committed by Evan Debenham
parent f4c93c369c
commit c3513b5870
8 changed files with 33 additions and 7 deletions

View File

@ -215,7 +215,11 @@ public class CavesBossLevel extends Level {
@Override
public int randomRespawnCell() {
return -1;
int cell = entrance + NEIGHBOURS8[Random.Int(8)];
while (!passable[cell]){
cell = entrance + NEIGHBOURS8[Random.Int(8)];
}
return cell;
}
@Override

View File

@ -169,7 +169,11 @@ public class CityBossLevel extends Level {
@Override
public int randomRespawnCell() {
return -1;
int cell = entrance + NEIGHBOURS8[Random.Int(8)];
while (!passable[cell]){
cell = entrance + NEIGHBOURS8[Random.Int(8)];
}
return cell;
}
@Override

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels;
import java.util.Arrays;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.watabou.utils.Random;
public class DeadEndLevel extends Level {
@ -88,6 +89,10 @@ public class DeadEndLevel extends Level {
protected void createMobs() {
}
public Actor respawner() {
return null;
}
@Override
protected void createItems() {
}

View File

@ -159,7 +159,11 @@ public class HallsBossLevel extends Level {
@Override
public int randomRespawnCell() {
return -1;
int cell = entrance + NEIGHBOURS8[Random.Int(8)];
while (!passable[cell]){
cell = entrance + NEIGHBOURS8[Random.Int(8)];
}
return cell;
}
@Override

View File

@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels;
import java.util.Arrays;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.watabou.noosa.Scene;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
@ -119,6 +120,10 @@ public class LastLevel extends Level {
protected void createMobs() {
}
public Actor respawner() {
return null;
}
@Override
protected void createItems() {
drop( new Amulet(), pedestal );
@ -126,7 +131,11 @@ public class LastLevel extends Level {
@Override
public int randomRespawnCell() {
return -1;
int cell = entrance + NEIGHBOURS8[Random.Int(8)];
while (!passable[cell]){
cell = entrance + NEIGHBOURS8[Random.Int(8)];
}
return cell;
}
@Override

View File

@ -176,7 +176,7 @@ public class LastShopLevel extends RegularLevel {
@Override
public int randomRespawnCell() {
return -1;
return roomEntrance.random();
}
@Override

View File

@ -357,7 +357,7 @@ public class PrisonBossLevel extends RegularLevel {
@Override
public int randomRespawnCell() {
return -1;
return roomEntrance.random();
}
@Override

View File

@ -237,7 +237,7 @@ public class SewerBossLevel extends RegularLevel {
@Override
public int randomRespawnCell() {
return -1;
return roomEntrance.random();
}