Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,27 @@ private ConsoleCommandInterpreter() {
System.out.println("POI Names - Types\n" + String.join("\n", poiNames));
return "POI lists dumped to stdout.";
});
registerCommand(new String[]{"reveal", "caves", "dungeons"}, s -> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be rewritten to take in the PointOfInterest type as an argument instead of being hardcoded to caves and dungeons. This way we could reveal cities and capitals as well.

WorldSave save = WorldSave.getCurrentSave();
if (save == null || save.getWorld() == null) {
return "No world loaded.";
}
int revealed = 0;
for (PointOfInterest poi : save.getWorld().getAllPointOfInterest()) {
PointOfInterestData data = poi.getData();
if (data == null || data.type == null) {
continue;
}
if (!"cave".equalsIgnoreCase(data.type) && !"dungeon".equalsIgnoreCase(data.type)) {
continue;
}
if (!save.getPointOfInterestChanges(poi.getID()).isVisited()) {
save.getPointOfInterestChanges(poi.getID()).visit();
revealed++;
}
}
return "Revealed " + revealed + " cave/dungeon names on the map.";
});
registerCommand(new String[]{"setColorID"}, s -> {
if (s.length < 1)
return "Please specify color ID: Valid choices: B, G, R, U, W, C. Example:\n\"setColorID G\"";
Expand Down