v0.6.0: fixed shop room placement
This commit is contained in:
parent
33dd5089f4
commit
278c0d6b66
|
@ -44,8 +44,11 @@ public class BranchesBuilder extends RegularBuilder {
|
|||
entrance.setPos(0, 0);
|
||||
branchable.add(entrance);
|
||||
|
||||
if (shop != null){
|
||||
placeRoom(branchable, entrance, shop, Random.Float(360f));
|
||||
}
|
||||
|
||||
ArrayList<Room> roomsToBranch = new ArrayList<>();
|
||||
if (shop != null) roomsToBranch.add(shop);
|
||||
roomsToBranch.addAll(multiConnections);
|
||||
if (exit != null) roomsToBranch.add(exit);
|
||||
roomsToBranch.addAll(singleConnections);
|
||||
|
|
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.builders;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.connection.ConnectionRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.ShopRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ExitRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||
|
@ -89,6 +90,8 @@ public abstract class RegularBuilder extends Builder {
|
|||
entrance = r;
|
||||
} else if (r instanceof ExitRoom) {
|
||||
exit = r;
|
||||
} else if (r instanceof ShopRoom && r.maxConnections(Room.ALL) == 1){
|
||||
shop = r;
|
||||
} else if (r.maxConnections(Room.ALL) > 1){
|
||||
multiConnections.add(r);
|
||||
} else if (r.maxConnections(Room.ALL) == 1){
|
||||
|
|
Loading…
Reference in New Issue
Block a user