Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main/java/communicationmod/ChoiceScreenUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,24 @@ public static boolean bossNodeAvailable() {
return (currMapNode.y == 14 || (AbstractDungeon.id.equals(TheEnding.ID) && currMapNode.y == 2));
}

/**
* Return the room with the emeraldKey containing a "flame elite".
* @return MapRoomNode|null The map screen state object
*/
public static MapRoomNode findEmeraldKeyNode() {
ArrayList<ArrayList<MapRoomNode>> map = AbstractDungeon.map;

for (ArrayList<MapRoomNode> layer : map) {
for (MapRoomNode node : layer) {
if (node.hasEmeraldKey) {
return node;
}
}
}

return null;
}

public static ArrayList<String> getMapScreenChoices() {
ArrayList<String> choices = new ArrayList<>();
MapRoomNode currMapNode = AbstractDungeon.getCurrMapNode();
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/communicationmod/GameStateConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ private static HashMap<String, Object> getCombatRewardState() {
/**
* The map screen state object contains:
* "current_node" (object): The node object for the currently selected node, if applicable
* "emerald_key_node" (object): The node object for the emerald key node, if available
* "next_nodes" (list): A list of nodes that can be chosen next
* "first_node_chosen" (boolean): Whether the first node in the act has already been chosen
* "boss_available" (boolean): Whether the next node choice is a boss
Expand All @@ -309,6 +310,10 @@ private static HashMap<String, Object> getMapScreenState() {
if (AbstractDungeon.getCurrMapNode() != null) {
state.put("current_node", convertMapRoomNodeToJson(AbstractDungeon.getCurrMapNode()));
}
final MapRoomNode emeraldKeyNode = ChoiceScreenUtils.findEmeraldKeyNode();
if (emeraldKeyNode != null) {
state.put("emerald_key_node", convertMapRoomNodeToJson(emeraldKeyNode));
}
ArrayList<Object> nextNodesJson = new ArrayList<>();
for(MapRoomNode node : ChoiceScreenUtils.getMapScreenNodeChoices()) {
nextNodesJson.add(convertMapRoomNodeToJson(node));
Expand Down