From 9e18ff4022f8eeef41cb6bbb50daedf72d4b7635 Mon Sep 17 00:00:00 2001 From: tom-overton Date: Fri, 21 Oct 2022 10:47:03 -0700 Subject: Move guaranteed catches from misc tweak to minimum catch rate slider --- src/com/sneed/pkrandom/MiscTweak.java | 1 - src/com/sneed/pkrandom/Settings.java | 10 +++--- src/com/sneed/pkrandom/SettingsUpdater.java | 9 ++++- src/com/sneed/pkrandom/Version.java | 4 +-- src/com/sneed/pkrandom/newgui/Bundle.properties | 6 ++-- .../sneed/pkrandom/newgui/NewRandomizerGUI.form | 13 +------ .../sneed/pkrandom/newgui/NewRandomizerGUI.java | 1 - .../pkrandom/romhandlers/AbstractRomHandler.java | 42 ++++++++++++---------- .../sneed/pkrandom/romhandlers/Gen1RomHandler.java | 6 ++-- .../sneed/pkrandom/romhandlers/Gen2RomHandler.java | 8 ++--- .../sneed/pkrandom/romhandlers/Gen3RomHandler.java | 6 ++-- .../sneed/pkrandom/romhandlers/Gen4RomHandler.java | 6 ++-- .../sneed/pkrandom/romhandlers/Gen5RomHandler.java | 32 ++--------------- .../sneed/pkrandom/romhandlers/Gen6RomHandler.java | 7 ++-- .../sneed/pkrandom/romhandlers/Gen7RomHandler.java | 5 +-- src/com/sneed/pkrandom/romhandlers/RomHandler.java | 2 ++ 16 files changed, 55 insertions(+), 103 deletions(-) diff --git a/src/com/sneed/pkrandom/MiscTweak.java b/src/com/sneed/pkrandom/MiscTweak.java index 7391c30..5cbdda1 100755 --- a/src/com/sneed/pkrandom/MiscTweak.java +++ b/src/com/sneed/pkrandom/MiscTweak.java @@ -61,7 +61,6 @@ public class MiscTweak implements Comparable { public static final MiscTweak FASTER_HP_AND_EXP_BARS = new MiscTweak(1 << 19, "fasterHpAndExpBars", 0); public static final MiscTweak FAST_DISTORTION_WORLD = new MiscTweak(1 << 20, "fastDistortionWorld", 0); public static final MiscTweak UPDATE_ROTOM_FORME_TYPING = new MiscTweak(1 << 21, "updateRotomFormeTyping", 0); - public static final MiscTweak GUARANTEED_POKEMON_CATCHING = new MiscTweak(1 << 22, "guaranteedPokemonCatching", 0); /* @formatter:on */ private final int value; diff --git a/src/com/sneed/pkrandom/Settings.java b/src/com/sneed/pkrandom/Settings.java index 6088348..7bbff05 100644 --- a/src/com/sneed/pkrandom/Settings.java +++ b/src/com/sneed/pkrandom/Settings.java @@ -424,8 +424,7 @@ public class Settings { // 16 wild pokemon 2 out.write(makeByteSelected(useMinimumCatchRate, blockWildLegendaries, wildPokemonRestrictionMod == WildPokemonRestrictionMod.SIMILAR_STRENGTH, randomizeWildPokemonHeldItems, - banBadRandomWildPokemonHeldItems, false, false, balanceShakingGrass) - | ((minimumCatchRateLevel - 1) << 5)); + banBadRandomWildPokemonHeldItems, false, false, balanceShakingGrass)); // 17 static pokemon out.write(makeByteSelected(staticPokemonMod == StaticPokemonMod.UNCHANGED, @@ -580,8 +579,8 @@ public class Settings { pickupItemsMod == PickupItemsMod.UNCHANGED, banBadRandomPickupItems, banIrregularAltFormes)); - // 50 elite four unique pokemon (3 bits) - out.write(eliteFourUniquePokemonNumber); + // 50 elite four unique pokemon (3 bits) + catch rate level (3 bits) + out.write(eliteFourUniquePokemonNumber | ((minimumCatchRateLevel - 1) << 3)); try { byte[] romName = this.romName.getBytes("US-ASCII"); @@ -701,8 +700,6 @@ public class Settings { settings.setBlockWildLegendaries(restoreState(data[16], 1)); settings.setRandomizeWildPokemonHeldItems(restoreState(data[16], 3)); settings.setBanBadRandomWildPokemonHeldItems(restoreState(data[16], 4)); - - settings.setMinimumCatchRateLevel(((data[16] & 0x60) >> 5) + 1); settings.setBalanceShakingGrass(restoreState(data[16], 7)); settings.setStaticPokemonMod(restoreEnum(StaticPokemonMod.class, data[17], 0, // UNCHANGED @@ -872,6 +869,7 @@ public class Settings { settings.setBanIrregularAltFormes(restoreState(data[49], 3)); settings.setEliteFourUniquePokemonNumber(data[50] & 0x7); + settings.setMinimumCatchRateLevel(((data[50] & 0x38) >> 3) + 1); int romNameLength = data[LENGTH_OF_SETTINGS_DATA] & 0xFF; String romName = new String(data, LENGTH_OF_SETTINGS_DATA + 1, romNameLength, "US-ASCII"); diff --git a/src/com/sneed/pkrandom/SettingsUpdater.java b/src/com/sneed/pkrandom/SettingsUpdater.java index 5b638d4..b775814 100644 --- a/src/com/sneed/pkrandom/SettingsUpdater.java +++ b/src/com/sneed/pkrandom/SettingsUpdater.java @@ -292,7 +292,6 @@ public class SettingsUpdater { } if (oldVersion < 319) { - // 5-10 custom starters, offset by 1 because of new "Random" option int starter1 = FileFunctions.read2ByteInt(dataBlock, 5); int starter2 = FileFunctions.read2ByteInt(dataBlock, 7); @@ -310,6 +309,14 @@ public class SettingsUpdater { insertExtraByte(50, (byte) 0); } + if (oldVersion < 321) { + // Minimum Catch Rate got moved around to give it more space for Guaranteed Catch. + // Read the old one, clear it out, then write it to the new location. + int oldMinimumCatchRate = ((dataBlock[16] & 0x60) >> 5) + 1; + dataBlock[16] &= ~0x60; + dataBlock[50] |= ((oldMinimumCatchRate - 1) << 3); + } + // fix checksum CRC32 checksum = new CRC32(); checksum.update(dataBlock, 0, actualDataLength - 8); diff --git a/src/com/sneed/pkrandom/Version.java b/src/com/sneed/pkrandom/Version.java index c05394e..df30fe2 100644 --- a/src/com/sneed/pkrandom/Version.java +++ b/src/com/sneed/pkrandom/Version.java @@ -28,8 +28,8 @@ import java.util.HashMap; import java.util.Map; public class Version { - public static final int VERSION = 321; // Increment by 1 for new version. Updated for 4.5.2-dev. - public static final String VERSION_STRING = "4.5.2-dev"; + public static final int VERSION = 321; // Increment by 1 for new version. Updated for 4.6.0-dev. + public static final String VERSION_STRING = "4.6.0-dev"; public static final Map oldVersions = setupVersionsMap(); diff --git a/src/com/sneed/pkrandom/newgui/Bundle.properties b/src/com/sneed/pkrandom/newgui/Bundle.properties index e297729..573556b 100644 --- a/src/com/sneed/pkrandom/newgui/Bundle.properties +++ b/src/com/sneed/pkrandom/newgui/Bundle.properties @@ -232,7 +232,7 @@ GUI.wpARTypeThemeAreasRadioButton.text=Type Themed Areas GUI.wpUseTimeBasedEncountersCheckBox.toolTipText=This affects games that have either seasons or morning/day/night encounter sets.
If this is checked, each of these sets will be treated as a separate "area".
So you will have to visit each place in morning/day/night, or in each season, to collect the Pokemon.
If this isn't checked, all of morning/day/night and all seasons will use the same encounter data. GUI.wpUseTimeBasedEncountersCheckBox.text=Use Time Based Encounters GUI.wpDontUseLegendariesCheckBox.text=Don't Use Legendaries -GUI.wpSetMinimumCatchRateCheckBox.toolTipText=If this is selected, every Pokemon in the game with a catch rate below a certain level will have its catch rate increased.\n
The exact minimum catch rate level can be set using the slider to the right.\n
Level 1: "Normal" minimum catch rate from old versions (normal Pokemon 30% at low HP, legendaries 15%)\n
Level 2: "Buffed" minimum catch rate (normal Pokemon 50% at low HP, legendaries 25%)\n
Level 3: "Super" minimum catch rate (normal Pokemon 80% at low HP, legendaries 40%)\n
Level 4: "Maximum" minimum catch rate (everything 255 catch rate, the highest available without changing game code) +GUI.wpSetMinimumCatchRateCheckBox.toolTipText=If this is selected, every Pokemon in the game with a catch rate below a certain level will have its catch rate increased.\n
The exact minimum catch rate level can be set using the slider to the right.\n
The percentages below assume a normal Poke Ball is used while the wild Pokemon is at full health with no status condition.\n
Level 1: "Normal" minimum catch rate. ~10% (Gens 1-4)/~18% (Gens 5+) chance for normal Pokemon, ~5% (Gens 1-4)/~10% (Gens 5+) chance for legendary Pokemon.\n
Level 2: "Buffed" minimum catch rate. ~17% (Gens 1-4)/~26% (Gens 5+) chance for normal Pokemon, ~9% (Gens 1-4)/~16% (Gens 5+) chance for legendary Pokemon.\n
Level 3: "Super" minimum catch rate. ~27% (Gens 1-4)/~37% (Gens 5+) chance for normal Pokemon, ~14% (Gens 1-4)/~22% (Gens 5+) chance for legendary Pokemon.\n
Level 4: "Ultra" minimum catch rate. ~34% (Gens 1-4)/~44% (Gens 5+) chance for all Pokemon. \n
Level 5: Guaranteed catches (every Pokemon is guaranteed to be caught, so long as they are catchable in the first place). GUI.wpSetMinimumCatchRateCheckBox.text=Set Minimum Catch Rate: GUI.wpRandomizeHeldItemsCheckBox.toolTipText=Checking this will randomize the items held by Pokemon in the wild, including whether they can have one at all or not.
In some cases, these item definitions will also apply to static encounters with legendaries and the like. GUI.wpRandomizeHeldItemsCheckBox.text=Randomize Held Items @@ -243,7 +243,7 @@ GUI.wpBalanceShakingGrassPokemonCheckBox.text=Balance Shaking Grass Pokemon GUI.wpPercentageLevelModifierCheckBox.toolTipText=Checking this will enable a percentage-based level modifier for every wild Pokemon in the game. GUI.wpPercentageLevelModifierCheckBox.text=Percentage Level Modifier: GUI.wpPercentageLevelModifierSlider.toolTipText=Use this slider to select the percentage to change wild Pokemon levels by.
Negative percentages (-50 to 0) will decrease levels, and positive percentages will increase them. -GUI.wpSetMinimumCatchRateSlider.toolTipText=If Minimum Catch Rate is selected, allows you to set the level used.\n
Level 1: "Normal" minimum catch rate from old versions (normal Pokemon 30% at low HP, legendaries 15%)\n
Level 2: "Buffed" minimum catch rate (normal Pokemon 50% at low HP, legendaries 25%)\n
Level 3: "Super" minimum catch rate (normal Pokemon 80% at low HP, legendaries 40%)\n
Level 4: "Maximum" minimum catch rate (everything 255 catch rate, the highest available without changing game code) +GUI.wpSetMinimumCatchRateSlider.toolTipText=If Minimum Catch Rate is selected, allows you to set the level used. The percentages below assume a normal Poke Ball at full health.\n
Level 1: "Normal" minimum catch rate. ~10% (Gens 1-4)/~18% (Gens 5+) chance for normal Pokemon, ~5% (Gens 1-4)/~10% (Gens 5+) chance for legendary Pokemon.\n
Level 2: "Buffed" minimum catch rate. ~17% (Gens 1-4)/~26% (Gens 5+) chance for normal Pokemon, ~9% (Gens 1-4)/~16% (Gens 5+) chance for legendary Pokemon.\n
Level 3: "Super" minimum catch rate. ~27% (Gens 1-4)/~37% (Gens 5+) chance for normal Pokemon, ~14% (Gens 1-4)/~22% (Gens 5+) chance for legendary Pokemon.\n
Level 4: "Ultra" minimum catch rate. ~34% (Gens 1-4)/~44% (Gens 5+) chance for all Pokemon. \n
Level 5: Guaranteed catches (every Pokemon is guaranteed to be caught, so long as they are catchable in the first place). GUI.tmsHMsTutorsPanel.title=TM/HMs & Tutors GUI.tmPanel.title=TMs & HMs GUI.tmMovesPanel.title=TM/HM Moves @@ -519,8 +519,6 @@ CodeTweaks.fastDistortionWorld.name=Fast Distortion World CodeTweaks.fastDistortionWorld.toolTipText=Cuts out most of the Distortion World by instantly warping you to the Cyrus fight when you enter it. CodeTweaks.updateRotomFormeTyping.name=Update Rotom Appliance Typings CodeTweaks.updateRotomFormeTyping.toolTipText=Updates the typings of Rotom's alternate formes (i.e., the appliances) to match the typings they have in Gen 5 and onwards.
For example, Wash Rotom will change from Electric/Ghost to Electric/Water. -CodeTweaks.guaranteedPokemonCatching.name=Guaranteed Pokemon Catching -CodeTweaks.guaranteedPokemonCatching.toolTipText=Makes it so that any Poke Ball thrown at a wild Pokemon will be guaranteed to catch them, so long as the Pokemon is catchable in the first place. CustomNamesEditorDialog.trainerNamesSP.TabConstraints.tabTitle=Trainer Names CustomNamesEditorDialog.title=Custom Names Editor CustomNamesEditorDialog.closeBtn.text=Close diff --git a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form index 838994c..d7ae1f0 100644 --- a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form +++ b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form @@ -2429,7 +2429,7 @@ - + @@ -3609,17 +3609,6 @@ - - - - - - - - - - - diff --git a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java index a625e8c..5eecbe7 100644 --- a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java +++ b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java @@ -297,7 +297,6 @@ public class NewRandomizerGUI { private JCheckBox tpBetterMovesetsCheckBox; private JCheckBox paEnsureTwoAbilitiesCheckbox; private JCheckBox miscUpdateRotomFormeTypingCheckBox; - private JCheckBox miscGuaranteedPokemonCatchingCheckBox; private static JFrame frame; diff --git a/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java b/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java index f8f0f21..64b797d 100755 --- a/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java @@ -5795,26 +5795,30 @@ public abstract class AbstractRomHandler implements RomHandler { public void changeCatchRates(Settings settings) { int minimumCatchRateLevel = settings.getMinimumCatchRateLevel(); - int normalMin, legendaryMin; - switch (minimumCatchRateLevel) { - case 1: - default: - normalMin = 75; - legendaryMin = 37; - break; - case 2: - normalMin = 128; - legendaryMin = 64; - break; - case 3: - normalMin = 200; - legendaryMin = 100; - break; - case 4: - normalMin = legendaryMin = 255; - break; + if (minimumCatchRateLevel == 5) { + enableGuaranteedPokemonCatching(); + } else { + int normalMin, legendaryMin; + switch (minimumCatchRateLevel) { + case 1: + default: + normalMin = 75; + legendaryMin = 37; + break; + case 2: + normalMin = 128; + legendaryMin = 64; + break; + case 3: + normalMin = 200; + legendaryMin = 100; + break; + case 4: + normalMin = legendaryMin = 255; + break; + } + minimumCatchRate(normalMin, legendaryMin); } - minimumCatchRate(normalMin, legendaryMin); } @Override diff --git a/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java index 657df3e..bb55bb6 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java @@ -2107,7 +2107,6 @@ public class Gen1RomHandler extends AbstractGBCRomHandler { available |= MiscTweak.RANDOMIZE_CATCHING_TUTORIAL.getValue(); } - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); return available; } @@ -2131,8 +2130,6 @@ public class Gen1RomHandler extends AbstractGBCRomHandler { updateTypeEffectiveness(); } else if (tweak == MiscTweak.RANDOMIZE_CATCHING_TUTORIAL) { randomizeCatchingTutorial(); - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -2177,7 +2174,8 @@ public class Gen1RomHandler extends AbstractGBCRomHandler { } } - private void enableGuaranteedPokemonCatching() { + @Override + public void enableGuaranteedPokemonCatching() { int offset = find(rom, Gen1Constants.guaranteedCatchPrefix); if (offset > 0) { offset += Gen1Constants.guaranteedCatchPrefix.length() / 2; // because it was a prefix diff --git a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java index ba34e74..0ea60e0 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java @@ -2226,9 +2226,6 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { available |= MiscTweak.RANDOMIZE_CATCHING_TUTORIAL.getValue(); } available |= MiscTweak.BAN_LUCKY_EGG.getValue(); - if (romEntry.strings.containsKey("GuaranteedCatchPrefix")) { - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); - } return available; } @@ -2247,8 +2244,6 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { nonBadItems.banSingles(Gen2Items.luckyEgg); } else if (tweak == MiscTweak.UPDATE_TYPE_EFFECTIVENESS) { updateTypeEffectiveness(); - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -2376,7 +2371,8 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { } } - private void enableGuaranteedPokemonCatching() { + @Override + public void enableGuaranteedPokemonCatching() { String prefix = romEntry.getString("GuaranteedCatchPrefix"); int offset = find(rom, prefix); if (offset > 0) { diff --git a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java index 2000f7c..e27d0f2 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java @@ -4112,7 +4112,6 @@ public class Gen3RomHandler extends AbstractGBRomHandler { if (romEntry.romType == Gen3Constants.RomType_FRLG) { available |= MiscTweak.BALANCE_STATIC_LEVELS.getValue(); } - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); return available; } @@ -4142,8 +4141,6 @@ public class Gen3RomHandler extends AbstractGBRomHandler { } } else if (tweak == MiscTweak.UPDATE_TYPE_EFFECTIVENESS) { updateTypeEffectiveness(); - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -4332,7 +4329,8 @@ public class Gen3RomHandler extends AbstractGBRomHandler { } } - private void enableGuaranteedPokemonCatching() { + @Override + public void enableGuaranteedPokemonCatching() { int offset = find(rom, Gen3Constants.perfectOddsBranchLocator); if (offset > 0) { // In Cmd_handleballthrow, the middle of the function checks if the odds of catching a Pokemon diff --git a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java index a529d95..56b0147 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java @@ -5265,7 +5265,6 @@ public class Gen4RomHandler extends AbstractDSRomHandler { if (romEntry.romType == Gen4Constants.Type_Plat || romEntry.romType == Gen4Constants.Type_HGSS) { available |= MiscTweak.UPDATE_ROTOM_FORME_TYPING.getValue(); } - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); return available; } @@ -5292,8 +5291,6 @@ public class Gen4RomHandler extends AbstractDSRomHandler { applyFastDistortionWorld(); } else if (tweak == MiscTweak.UPDATE_ROTOM_FORME_TYPING) { updateRotomFormeTyping(); - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -5533,7 +5530,8 @@ public class Gen4RomHandler extends AbstractDSRomHandler { pokes[Species.Gen4Formes.rotomM].secondaryType = Type.GRASS; } - private void enableGuaranteedPokemonCatching() { + @Override + public void enableGuaranteedPokemonCatching() { try { byte[] battleOverlay = readOverlay(romEntry.getInt("BattleOvlNumber")); int offset = find(battleOverlay, Gen4Constants.perfectOddsBranchLocator); diff --git a/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java index 05081b5..26e6e29 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java @@ -67,32 +67,6 @@ public class Gen5RomHandler extends AbstractDSRomHandler { super(random, logStream); } - @Override - public void changeCatchRates(Settings settings) { - int minimumCatchRateLevel = settings.getMinimumCatchRateLevel(); - - int normalMin, legendaryMin; - switch (minimumCatchRateLevel) { - case 1: - default: - normalMin = 50; - legendaryMin = 25; - break; - case 2: - normalMin = 100; - legendaryMin = 45; - break; - case 3: - normalMin = 180; - legendaryMin = 75; - break; - case 4: - normalMin = legendaryMin = 255; - break; - } - minimumCatchRate(normalMin, legendaryMin); - } - private static class OffsetWithinEntry { private int entry; private int offset; @@ -2426,7 +2400,6 @@ public class Gen5RomHandler extends AbstractDSRomHandler { if (romEntry.romType == Gen5Constants.Type_BW2) { available |= MiscTweak.FORCE_CHALLENGE_MODE.getValue(); } - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); return available; } @@ -2462,8 +2435,6 @@ public class Gen5RomHandler extends AbstractDSRomHandler { updateTypeEffectiveness(); } else if (tweak == MiscTweak.FORCE_CHALLENGE_MODE) { forceChallengeMode(); - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -2642,7 +2613,8 @@ public class Gen5RomHandler extends AbstractDSRomHandler { } } - private void enableGuaranteedPokemonCatching() { + @Override + public void enableGuaranteedPokemonCatching() { try { byte[] battleOverlay = readOverlay(romEntry.getInt("BattleOvlNumber")); int offset = find(battleOverlay, Gen5Constants.perfectOddsBranchLocator); diff --git a/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java index ecbbc92..0017cdd 100644 --- a/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java @@ -2622,7 +2622,6 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { available |= MiscTweak.BAN_LUCKY_EGG.getValue(); available |= MiscTweak.RETAIN_ALT_FORMES.getValue(); available |= MiscTweak.NATIONAL_DEX_AT_START.getValue(); - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); return available; } @@ -2641,8 +2640,6 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { } } else if (tweak == MiscTweak.NATIONAL_DEX_AT_START) { patchForNationalDex(); - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -2734,8 +2731,8 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { } } - // TODO: Battle CRO for XY - private void enableGuaranteedPokemonCatching() { + @Override + public void enableGuaranteedPokemonCatching() { try { byte[] battleCRO = readFile(romEntry.getFile("Battle")); int offset = find(battleCRO, Gen6Constants.perfectOddsBranchLocator); diff --git a/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java index 6ed238c..f0d315b 100644 --- a/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java @@ -2397,7 +2397,6 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { available |= MiscTweak.BAN_LUCKY_EGG.getValue(); available |= MiscTweak.SOS_BATTLES_FOR_ALL.getValue(); available |= MiscTweak.RETAIN_ALT_FORMES.getValue(); - available |= MiscTweak.GUARANTEED_POKEMON_CATCHING.getValue(); return available; } @@ -2416,8 +2415,6 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { } catch (IOException e) { e.printStackTrace(); } - } else if (tweak == MiscTweak.GUARANTEED_POKEMON_CATCHING) { - enableGuaranteedPokemonCatching(); } } @@ -2454,7 +2451,7 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { } } - private void enableGuaranteedPokemonCatching() { + public void enableGuaranteedPokemonCatching() { try { byte[] battleCRO = readFile(romEntry.getFile("Battle")); int offset = find(battleCRO, Gen7Constants.perfectOddsBranchLocator); diff --git a/src/com/sneed/pkrandom/romhandlers/RomHandler.java b/src/com/sneed/pkrandom/romhandlers/RomHandler.java index 4078ead..167bded 100755 --- a/src/com/sneed/pkrandom/romhandlers/RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/RomHandler.java @@ -237,6 +237,8 @@ public interface RomHandler { void minimumCatchRate(int rateNonLegendary, int rateLegendary); + void enableGuaranteedPokemonCatching(); + // =============== // Trainer Pokemon // =============== -- cgit v1.2.3