v0.6.0: fixed shop room placement

This commit is contained in:
Evan Debenham 2017-05-03 23:24:47 -04:00
parent 33dd5089f4
commit 278c0d6b66
2 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -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){