v0.6.2: fixed multiple prizes of the same type appearing in vault rooms
This commit is contained in:
parent
fdc2293f00
commit
0c46963dee
|
@ -33,6 +33,9 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
import com.watabou.utils.PathFinder;
|
import com.watabou.utils.PathFinder;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class VaultRoom extends SpecialRoom {
|
public class VaultRoom extends SpecialRoom {
|
||||||
|
|
||||||
public void paint( Level level ) {
|
public void paint( Level level ) {
|
||||||
|
@ -45,6 +48,8 @@ public class VaultRoom extends SpecialRoom {
|
||||||
int cy = (top + bottom) / 2;
|
int cy = (top + bottom) / 2;
|
||||||
int c = cx + cy * level.width();
|
int c = cx + cy * level.width();
|
||||||
|
|
||||||
|
Random.shuffle(prizeClasses);
|
||||||
|
|
||||||
switch (Random.Int( 3 )) {
|
switch (Random.Int( 3 )) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -73,11 +78,12 @@ public class VaultRoom extends SpecialRoom {
|
||||||
level.addItemToSpawn( new IronKey( Dungeon.depth ) );
|
level.addItemToSpawn( new IronKey( Dungeon.depth ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Item prize( Level level ) {
|
private Item prize( Level level ) {
|
||||||
return Generator.random( Random.oneOf(
|
return Generator.random( prizeClasses.remove(0) );
|
||||||
Generator.Category.WAND,
|
}
|
||||||
|
|
||||||
|
private ArrayList<Generator.Category> prizeClasses = new ArrayList<>(
|
||||||
|
Arrays.asList(Generator.Category.WAND,
|
||||||
Generator.Category.RING,
|
Generator.Category.RING,
|
||||||
Generator.Category.ARTIFACT
|
Generator.Category.ARTIFACT));
|
||||||
) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user