Skip to content

Commit

Permalink
Cleaned up some setting defaults and added a file detailing inaccessi…
Browse files Browse the repository at this point in the history
…ble items for seeds where not all items are accessible.
  • Loading branch information
thezerothcat committed Aug 30, 2017
1 parent cdd44ce commit b744e9c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 35 deletions.
10 changes: 6 additions & 4 deletions src/main/java/lmr/randomizer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,19 +335,19 @@ static class CheckboxPanel extends JPanel {
public CheckboxPanel() {
super(new MigLayout("wrap 2", "[sizegroup checkboxes]", "[]2[]"));

fullItemAccess = new JCheckBox("Require 100% item accessibility");
fullItemAccess = new JCheckBox("All items must be accessible (100% seed)");
fullItemAccess.setSelected(Settings.isFullItemAccess());
add(fullItemAccess);

enableDamageBoostRequirements = new JCheckBox("Allow damage-boosting requirements");
enableDamageBoostRequirements.setSelected(Settings.isRequireSoftwareComboForKeyFairy());
add(enableDamageBoostRequirements);

requireSoftwareComboForKeyFairy = new JCheckBox("Require software combo for key fairies");
requireSoftwareComboForKeyFairy = new JCheckBox("Key Fairy chests/doors expect miracle + mekuri");
requireSoftwareComboForKeyFairy.setSelected(Settings.isRequireSoftwareComboForKeyFairy());
add(requireSoftwareComboForKeyFairy);

randomizeForbiddenTreasure = new JCheckBox("Include Forbidden Treasure in randomized items");
randomizeForbiddenTreasure = new JCheckBox("Replace random non-Shrine map with Forbidden Treasure");
randomizeForbiddenTreasure.setSelected(Settings.isRandomizeForbiddenTreasure());
add(randomizeForbiddenTreasure);
}
Expand Down Expand Up @@ -579,7 +579,9 @@ private static void doTheThing() {
RcdWriter.writeRcd(rcdData);
DatWriter.writeDat(datInfo);

// accessChecker.outputRemaining(Settings.getStartingSeed(), attempt);
if(!Settings.isFullItemAccess()) {
accessChecker.outputRemaining(Settings.getStartingSeed(), attempt);
}

return;
} catch (Exception ex) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/lmr/randomizer/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ private Settings() {
startingSeed = new Random().nextInt(Integer.MAX_VALUE);
laMulanaBaseDir = "Please enter your La-Mulana install directory";

fullItemAccess = false;
fullItemAccess = true;
randomizeForbiddenTreasure = true;
enableDamageBoostRequirements = false;
requireSoftwareComboForKeyFairy = true;

bossDifficulty = BossDifficulty.HARD;
shopRandomization = ShopRandomizationEnum.EVERYTHING;

nonRandomizedItems.add("Holy Grail");
nonRandomizedItems.add("Hermes' Boots");
initiallyAvailableItems.add("Holy Grail");
initiallyAvailableItems.add("Hermes' Boots");

for(String filename : Arrays.asList("C:\\Games\\La-Mulana Remake 1.3.3.1", "C:\\GOG Games\\La-Mulana", "C:\\GOG Games\\La-Mulana",
"C:\\Steam\\steamapps\\common\\La-Mulana", "C:\\Program Files (x86)\\Steam\\steamapps\\common\\La-Mulana",
Expand Down
56 changes: 28 additions & 28 deletions src/main/java/lmr/randomizer/node/AccessChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,23 @@ public boolean isEnoughAnkhJewelsToDefeatAllAccessibleBosses() {
}

public void outputRemaining(long startingSeed, int attemptNumber) throws IOException {
BufferedWriter writer = FileUtils.getFileWriter(String.format("%s/inaccessible_%s.txt", startingSeed, attemptNumber));
if (writer == null) {
return;
}

NodeWithRequirements node;
for(String nodeName : mapOfNodeNameToRequirementsObject.keySet()) {
node = mapOfNodeNameToRequirementsObject.get(nodeName);
for(List<String> requirementSet : node.getAllRequirements()) {
writer.write(nodeName + " => " + requirementSet);
writer.newLine();
}
}
writer.flush();
writer.close();

writer = FileUtils.getFileWriter(String.format("%s/missing_item_%s.txt", startingSeed, attemptNumber));
// BufferedWriter writer = FileUtils.getFileWriter(String.format("%s/inaccessible_%s.txt", startingSeed, attemptNumber));
// if (writer == null) {
// return;
// }
//
// NodeWithRequirements node;
// for(String nodeName : mapOfNodeNameToRequirementsObject.keySet()) {
// node = mapOfNodeNameToRequirementsObject.get(nodeName);
// for(List<String> requirementSet : node.getAllRequirements()) {
// writer.write(nodeName + " => " + requirementSet);
// writer.newLine();
// }
// }
// writer.flush();
// writer.close();

BufferedWriter writer = FileUtils.getFileWriter(String.format("%s/excluded_items.txt", startingSeed));
if (writer == null) {
return;
}
Expand All @@ -237,17 +237,17 @@ public void outputRemaining(long startingSeed, int attemptNumber) throws IOExcep
writer.close();


writer = FileUtils.getFileWriter(String.format("%s/accessible_%s.txt", startingSeed, attemptNumber));
if (writer == null) {
return;
}

for(String item : accessedNodes) {
writer.write(item);
writer.newLine();
}
writer.flush();
writer.close();
// writer = FileUtils.getFileWriter(String.format("%s/accessible_%s.txt", startingSeed, attemptNumber));
// if (writer == null) {
// return;
// }
//
// for(String item : accessedNodes) {
// writer.write(item);
// writer.newLine();
// }
// writer.flush();
// writer.close();
}

public void setItemRandomizer(ItemRandomizer itemRandomizer) {
Expand Down

0 comments on commit b744e9c

Please sign in to comment.