diff options
author | Ajarmar <axel.jarmar@gmail.com> | 2021-03-03 19:37:21 +0100 |
---|---|---|
committer | Ajarmar <axel.jarmar@gmail.com> | 2021-03-03 19:37:21 +0100 |
commit | 2d5a752b49a7d4895dd1c278b81c595ba90e74f0 (patch) | |
tree | 65d8ff0d0863042e3abac1c0328d9a120491feec | |
parent | 596bb6de30b36f8474d2d9e504f94ce6f838cf8e (diff) |
changed "limit musketeers" to "limit main-game legendaries"
19 files changed, 122 insertions, 81 deletions
diff --git a/src/com/dabomstew/pkrandom/Randomizer.java b/src/com/dabomstew/pkrandom/Randomizer.java index e3dc776..9597a9d 100644 --- a/src/com/dabomstew/pkrandom/Randomizer.java +++ b/src/com/dabomstew/pkrandom/Randomizer.java @@ -993,17 +993,17 @@ public class Randomizer { if (romHandler.canChangeStaticPokemon()) {
List<StaticEncounter> oldStatics = romHandler.getStaticPokemon();
if (settings.getStaticPokemonMod() == Settings.StaticPokemonMod.RANDOM_MATCHING) { // Legendary for L
- romHandler.randomizeStaticPokemon(true, false,settings.isLimitMusketeers(),
+ romHandler.randomizeStaticPokemon(true, false,settings.isLimitMainGameLegendaries(),
settings.isLimit600(), settings.isAllowStaticAltFormes(), settings.isSwapStaticMegaEvos(),
settings.getAbilitiesMod() == Settings.AbilitiesMod.RANDOMIZE,
settings.isStaticLevelModified() ? settings.getStaticLevelModifier() : 0);
} else if (settings.getStaticPokemonMod() == Settings.StaticPokemonMod.COMPLETELY_RANDOM) {
- romHandler.randomizeStaticPokemon(false, false,settings.isLimitMusketeers(),
+ romHandler.randomizeStaticPokemon(false, false,settings.isLimitMainGameLegendaries(),
settings.isLimit600(), settings.isAllowStaticAltFormes(), settings.isSwapStaticMegaEvos(),
settings.getAbilitiesMod() == Settings.AbilitiesMod.RANDOMIZE,
settings.isStaticLevelModified() ? settings.getStaticLevelModifier() : 0);
} else if (settings.getStaticPokemonMod() == Settings.StaticPokemonMod.SIMILAR_STRENGTH) {
- romHandler.randomizeStaticPokemon(false, true,settings.isLimitMusketeers(),
+ romHandler.randomizeStaticPokemon(false, true,settings.isLimitMainGameLegendaries(),
settings.isLimit600(), settings.isAllowStaticAltFormes(), settings.isSwapStaticMegaEvos(),
settings.getAbilitiesMod() == Settings.AbilitiesMod.RANDOMIZE,
settings.isStaticLevelModified() ? settings.getStaticLevelModifier() : 0);
diff --git a/src/com/dabomstew/pkrandom/Settings.java b/src/com/dabomstew/pkrandom/Settings.java index e585dbe..66e3f51 100644 --- a/src/com/dabomstew/pkrandom/Settings.java +++ b/src/com/dabomstew/pkrandom/Settings.java @@ -106,7 +106,7 @@ public class Settings { // offset from the dropdown index from RandomizerGUI by 1
private int[] customStarters = new int[3];
private boolean randomizeStartersHeldItems;
- private boolean limitMusketeers;
+ private boolean limitMainGameLegendaries;
private boolean limit600;
private boolean banBadRandomStarterHeldItems;
@@ -414,7 +414,7 @@ public class Settings { staticPokemonMod == StaticPokemonMod.RANDOM_MATCHING,
staticPokemonMod == StaticPokemonMod.COMPLETELY_RANDOM,
staticPokemonMod == StaticPokemonMod.SIMILAR_STRENGTH,
- limitMusketeers, limit600, allowStaticAltFormes, swapStaticMegaEvos));
+ limitMainGameLegendaries, limit600, allowStaticAltFormes, swapStaticMegaEvos));
// 18 tm randomization
// new stuff 162
@@ -671,7 +671,7 @@ public class Settings { 3 // SIMILAR_STRENGTH
));
- settings.setLimitMusketeers(restoreState(data[17], 4));
+ settings.setLimitMainGameLegendaries(restoreState(data[17], 4));
settings.setLimit600(restoreState(data[17], 5));
settings.setAllowStaticAltFormes(restoreState(data[17], 6));
settings.setSwapStaticMegaEvos(restoreState(data[17], 7));
@@ -1725,12 +1725,12 @@ public class Settings { this.staticPokemonMod = staticPokemonMod;
}
- public boolean isLimitMusketeers() {
- return limitMusketeers;
+ public boolean isLimitMainGameLegendaries() {
+ return limitMainGameLegendaries;
}
- public void setLimitMusketeers(boolean limitMusketeers) {
- this.limitMusketeers = limitMusketeers;
+ public void setLimitMainGameLegendaries(boolean limitMainGameLegendaries) {
+ this.limitMainGameLegendaries = limitMainGameLegendaries;
}
public boolean isLimit600() {
diff --git a/src/com/dabomstew/pkrandom/config/gen3_offsets.ini b/src/com/dabomstew/pkrandom/config/gen3_offsets.ini index 3f0db98..4decb72 100755 --- a/src/com/dabomstew/pkrandom/config/gen3_offsets.ini +++ b/src/com/dabomstew/pkrandom/config/gen3_offsets.ini @@ -81,6 +81,7 @@ TMText[]=[41,9,3,13,0x2F,That’s, like, TM41, you know? Hey, it’s [move], you TMText[]=[42,8,1,1,0x48F,DAD: TM42 contains [move].\pIt might be able to turn a bad situation into an advantage.] TMText[]=[47,24,10,1,0x19,STEVEN: Okay, thank you.\pYou went through all this trouble to deliver that. I need to thank you.\pLet me see... I’ll give you this TM.\pIt contains my favorite move, [move].] TMText[]=[50,4,1,1,0x7F,That TM50 contains [move].] +MainGameLegendaries=[383] [Ruby (E)] Game=AXVE @@ -180,6 +181,7 @@ StaticPokemon{}={Species=[0x1A04AE, 0x1A04B5], Level=[0x1A04B0]} // Electrode 2 StaticPokemon{}={Species=[0x14E72E]} // Wynaut Egg StaticPokemon{}={Species=[0x15AA3F, 0x15AA4F], Level=[0x15AA41]} // Beldum StaticPokemon{}={Species=[0x163D29], Level=[0x163D2B]} // Castform +MainGameLegendaries=[382] [Sapphire (E)] Game=AXPE diff --git a/src/com/dabomstew/pkrandom/config/gen4_offsets.ini b/src/com/dabomstew/pkrandom/config/gen4_offsets.ini index a0e0a06..1f80afc 100755 --- a/src/com/dabomstew/pkrandom/config/gen4_offsets.ini +++ b/src/com/dabomstew/pkrandom/config/gen4_offsets.ini @@ -77,6 +77,7 @@ ShopCount=28 SkipShops=[12,13,15,16,17,18,19,20,21,22,23] MainGameShops=[0,1,2,3,4,5,6,7,8,9,10,11,14,24,25,26,27] StaticEggPokemonOffsets=[11, 12] +MainGameLegendaries=[483] [Pearl (U)] Game=APAE @@ -88,6 +89,7 @@ WildPokemon=fielddata/encountdata/p_enc_data.narc PokedexAreaData=application/zukanlist/zkn_data/zukan_enc_pearl.narc HoneyTreeOffsets=[5, 6, 7] NationalDexAtStartTweak=dp_national_dex +MainGameLegendaries=[484] [Platinum (U)] Game=CPUE @@ -165,6 +167,7 @@ ShopCount=29 SkipShops=[13,15,16,17,18,19,20,21,22,23,24] MainGameShops=[0,1,2,3,4,5,6,7,8,9,10,11,12,14,25,26,27,28] StaticEggPokemonOffsets=[13, 16] +MainGameLegendaries=[487] [HeartGold (U)] Game=IPKE @@ -274,6 +277,7 @@ ShopCount=40 SkipShops=[17,18,22,23,24,25,26,27,28,29,30,37,39] MainGameShops=[0,2,5,6,7,12,14,16,19,31,33,34,36] StaticEggPokemonOffsets=[34, 35, 36] +MainGameLegendaries=[250] [SoulSilver (U)] Game=IPGE @@ -283,6 +287,7 @@ CopyFrom=IPKE WildPokemon=a/1/3/6 FastestTextTweak=hgss_instant_text NationalDexAtStartTweak=hgss_national_dex +MainGameLegendaries=[249] [Pearl (J)] Game=APAJ diff --git a/src/com/dabomstew/pkrandom/config/gen5_offsets.ini b/src/com/dabomstew/pkrandom/config/gen5_offsets.ini index 76f5a4f..83a1123 100755 --- a/src/com/dabomstew/pkrandom/config/gen5_offsets.ini +++ b/src/com/dabomstew/pkrandom/config/gen5_offsets.ini @@ -95,6 +95,7 @@ TradeScript[]=[686:0x76:0x71] // Boldore/Emolga TradeScript[]=[830:0xB3:0xAE, 830:0xEA:0xE5, 830:0x114:0x10F] // Cinccino/Munchlax
TradeScript[]=[764:0x43:0x3E] // Ditto/Rotom
StaticEggPokemonOffsets=[5]
+MainGameLegendaries=[643,644]
[White (U)]
Game=IRAO
@@ -203,6 +204,7 @@ StaticPokemon{}={Species=[1273:0xC7]} // Amoonguss StaticPokemon{}={Species=[208:0x5A6], Level=[208:0x5A8]} // Zorua
IngameTradePersonTextOffsets=[529, 555, 193, 594, 628, 628]
StaticEggPokemonOffsets=[29]
+MainGameLegendaries=[638,639,640]
[White 2 (U)]
Game=IRDO
diff --git a/src/com/dabomstew/pkrandom/config/gen6_offsets.ini b/src/com/dabomstew/pkrandom/config/gen6_offsets.ini index 4dbf879..a98ad6c 100644 --- a/src/com/dabomstew/pkrandom/config/gen6_offsets.ini +++ b/src/com/dabomstew/pkrandom/config/gen6_offsets.ini @@ -63,6 +63,7 @@ UpdateStringOffset=25 BoxLegendaryOffsets=[2, 12] BoxLegendaryScriptOffsets=[4658, 5430, 16798] LinkedStaticEncounterOffsets=[1:3, 2:12] +MainGameLegendaries=[716] [Y] Game=CTR-P-EK2A @@ -72,6 +73,7 @@ Acronym=Y CopyFrom=CTR-P-EKJA BoxLegendaryOffsets=[1, 3] BoxLegendaryScriptOffsets=[4670, 5456, 17266] +MainGameLegendaries=[717] [Omega Ruby] Game=CTR-P-ECRA @@ -136,10 +138,12 @@ UpdateStringOffset=22 RayquazaEncounterNumber=28 RayquazaEncounterScriptNumber=31 LinkedStaticEncounterOffsets=[26:49, 27:50, 29:58, 80:56, 81:57, 75:76] +MainGameLegendaries=[381,383] [Alpha Sapphire] Game=CTR-P-ECLA TitleId=000400000011C500 Type=ORAS Acronym=AS -CopyFrom=CTR-P-ECRA
\ No newline at end of file +CopyFrom=CTR-P-ECRA +MainGameLegendaries=[380,382]
\ No newline at end of file diff --git a/src/com/dabomstew/pkrandom/config/gen7_offsets.ini b/src/com/dabomstew/pkrandom/config/gen7_offsets.ini index 4a7cc7d..55a7c83 100644 --- a/src/com/dabomstew/pkrandom/config/gen7_offsets.ini +++ b/src/com/dabomstew/pkrandom/config/gen7_offsets.ini @@ -53,6 +53,7 @@ RegularShops=[0,1,2,3,4,5,6,7] DoublesTrainerClasses=[172, 173, 174, 174, 175, 176, 177, 178, 179, 181, 182] CosmoemEvolutionNumber=791 LinkedStaticEncounterOffsets=[112:113, 120:131, 124:130] // UBs probably need to be added to this too +MainGameLegendaries=[791] [Moon] Game=CTR-P-BNEA @@ -62,6 +63,7 @@ Acronym=Mo CopyFrom=CTR-P-BNDA WildPokemon=a/0/8/3 CosmoemEvolutionNumber=792 +MainGameLegendaries=[792] [Ultra Sun] Game=CTR-P-A2AA @@ -118,6 +120,7 @@ RegularShops=[0,1,2,3,4,5,6,7] DoublesTrainerClasses=[172, 173, 174, 174, 175, 176, 177, 178, 179, 181, 182, 211, 212, 213, 214, 215] CosmoemEvolutionNumber=791 LinkedStaticEncounterOffsets=[127:128, 135:146, 139:145] // Unused SM UBs need to be added to this, probably other stuff too +MainGameLegendaries=[800] [Ultra Moon] Game=CTR-P-A2BA diff --git a/src/com/dabomstew/pkrandom/newgui/Bundle.properties b/src/com/dabomstew/pkrandom/newgui/Bundle.properties index 56fc225..0812177 100644 --- a/src/com/dabomstew/pkrandom/newgui/Bundle.properties +++ b/src/com/dabomstew/pkrandom/newgui/Bundle.properties @@ -105,8 +105,8 @@ GUI.stpRandomCompletelyRadioButton.toolTipText=<html>Selecting this will replace GUI.stpRandomCompletelyRadioButton.text=Random (completely) GUI.stpRandomSimilarStrengthRadioButton.toolTipText=<html>Selecting this will replace every static Pokemon encounter with a Pokemon of similar strength GUI.stpRandomSimilarStrengthRadioButton.text=Random (similar strength) -GUI.stpLimitMusketeersCheckBox.toolTipText=<html>Check this to limit the upper BST on newly randomized pokemon at Musketeers' location to their original BST (580) -GUI.stpLimitMusketeersCheckBox.text=Limit Musketeers +GUI.stpLimitMainGameLegendariesCheckBox.toolTipText=<html>Selecting this will set an upper BST limit on what main-game Legendary Pokemon can be randomized into, and also expand the window for what counts <br />as "Similar Strength" for those Pokemon.<br /><br />This only applies to main-game Legendary Pokemon that are catchable and that are directly in your way during the main game, so some Pokemon<br />like Kyurem-B/Kyurem-W in BW2 (not catchable) and Rayquaza in Emerald (have to go out of your way to catch) are not included. +GUI.stpLimitMainGameLegendariesCheckBox.text=Limit Main-Game Legendaries GUI.stpRandomize600BSTCheckBox.toolTipText=<html>Check this to enforce pure random on all static Pokemon with 600+ BST GUI.stpRandomize600BSTCheckBox.text=Randomize 600+ BST GUI.igtPanel.title=In-Game Trades diff --git a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.form b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.form index 3be2fd5..22a5693 100644 --- a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.form +++ b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.form @@ -1018,15 +1018,15 @@ <toolTipText resource-bundle="com/dabomstew/pkrandom/newgui/Bundle" key="GUI.stpAllowAltFormesCheckBox.toolTipText"/> </properties> </component> - <component id="cde9e" class="javax.swing.JCheckBox" binding="stpLimitMusketeersCheckBox"> + <component id="cde9e" class="javax.swing.JCheckBox" binding="stpLimitMainGameLegendariesCheckBox"> <constraints> <grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <gridbag weightx="1.0" weighty="0.0"/> </constraints> <properties> <enabled value="false"/> - <text resource-bundle="com/dabomstew/pkrandom/newgui/Bundle" key="GUI.stpLimitMusketeersCheckBox.text"/> - <toolTipText resource-bundle="com/dabomstew/pkrandom/newgui/Bundle" key="GUI.stpLimitMusketeersCheckBox.toolTipText"/> + <text resource-bundle="com/dabomstew/pkrandom/newgui/Bundle" key="GUI.stpLimitMainGameLegendariesCheckBox.text"/> + <toolTipText resource-bundle="com/dabomstew/pkrandom/newgui/Bundle" key="GUI.stpLimitMainGameLegendariesCheckBox.toolTipText"/> </properties> </component> </children> diff --git a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java index 92d0793..c5ff2fb 100644 --- a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java +++ b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java @@ -41,8 +41,6 @@ import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import java.io.*; -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryPoolMXBean; import java.net.HttpURLConnection; import java.net.URI; import java.net.URL; @@ -53,9 +51,6 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import static com.dabomstew.pkrandom.pokemon.ExpCurve.MEDIUM_FAST; -import static com.dabomstew.pkrandom.pokemon.ExpCurve.MEDIUM_SLOW; - public class NewRandomizerGUI { private JTabbedPane tabbedPane1; private JCheckBox raceModeCheckBox; @@ -106,7 +101,7 @@ public class NewRandomizerGUI { private JRadioButton stpSwapLegendariesSwapStandardsRadioButton; private JRadioButton stpRandomCompletelyRadioButton; private JRadioButton stpRandomSimilarStrengthRadioButton; - private JCheckBox stpLimitMusketeersCheckBox; + private JCheckBox stpLimitMainGameLegendariesCheckBox; private JCheckBox stpRandomize600BSTCheckBox; private JRadioButton igtUnchangedRadioButton; private JRadioButton igtRandomizeGivenPokemonOnlyRadioButton; @@ -1397,7 +1392,7 @@ public class NewRandomizerGUI { .setSelected(settings.getStaticPokemonMod() == Settings.StaticPokemonMod.COMPLETELY_RANDOM); stpRandomSimilarStrengthRadioButton .setSelected(settings.getStaticPokemonMod() == Settings.StaticPokemonMod.SIMILAR_STRENGTH); - stpLimitMusketeersCheckBox.setSelected(settings.isLimitMusketeers()); + stpLimitMainGameLegendariesCheckBox.setSelected(settings.isLimitMainGameLegendaries()); stpRandomize600BSTCheckBox.setSelected(settings.isLimit600()); stpAllowAltFormesCheckBox.setSelected(settings.isAllowStaticAltFormes()); stpSwapMegaEvosCheckBox.setSelected(settings.isSwapStaticMegaEvos()); @@ -1596,7 +1591,7 @@ public class NewRandomizerGUI { settings.setStaticPokemonMod(stpUnchangedRadioButton.isSelected(), stpSwapLegendariesSwapStandardsRadioButton.isSelected(), stpRandomCompletelyRadioButton.isSelected(), stpRandomSimilarStrengthRadioButton.isSelected()); - settings.setLimitMusketeers(stpLimitMusketeersCheckBox.isSelected() && stpLimitMusketeersCheckBox.isVisible()); + settings.setLimitMainGameLegendaries(stpLimitMainGameLegendariesCheckBox.isSelected() && stpLimitMainGameLegendariesCheckBox.isVisible()); settings.setLimit600(stpRandomize600BSTCheckBox.isSelected()); settings.setAllowStaticAltFormes(stpAllowAltFormesCheckBox.isSelected() && stpAllowAltFormesCheckBox.isVisible()); settings.setSwapStaticMegaEvos(stpSwapMegaEvosCheckBox.isSelected() && stpSwapMegaEvosCheckBox.isVisible()); @@ -1940,9 +1935,9 @@ public class NewRandomizerGUI { stpPercentageLevelModifierSlider.setVisible(true); stpPercentageLevelModifierSlider.setEnabled(false); stpPercentageLevelModifierSlider.setValue(0); - stpLimitMusketeersCheckBox.setVisible(true); - stpLimitMusketeersCheckBox.setEnabled(false); - stpLimitMusketeersCheckBox.setSelected(false); + stpLimitMainGameLegendariesCheckBox.setVisible(true); + stpLimitMainGameLegendariesCheckBox.setEnabled(false); + stpLimitMainGameLegendariesCheckBox.setSelected(false); stpRandomize600BSTCheckBox.setVisible(true); stpRandomize600BSTCheckBox.setEnabled(false); stpRandomize600BSTCheckBox.setSelected(false); @@ -2482,7 +2477,8 @@ public class NewRandomizerGUI { stpSwapLegendariesSwapStandardsRadioButton.setEnabled(true); stpRandomCompletelyRadioButton.setEnabled(true); stpRandomSimilarStrengthRadioButton.setEnabled(true); - stpLimitMusketeersCheckBox.setVisible(pokemonGeneration == 5); + stpLimitMainGameLegendariesCheckBox.setVisible(pokemonGeneration >= 3); + stpLimitMainGameLegendariesCheckBox.setEnabled(false); stpAllowAltFormesCheckBox.setVisible(romHandler.hasStaticAltFormes()); stpSwapMegaEvosCheckBox.setVisible(pokemonGeneration == 6 && !romHandler.forceSwapStaticMegaEvos()); stpPercentageLevelModifierCheckBox.setVisible(pokemonGeneration >= 3); @@ -2494,7 +2490,7 @@ public class NewRandomizerGUI { stpRandomCompletelyRadioButton.setVisible(false); stpRandomSimilarStrengthRadioButton.setVisible(false); stpRandomize600BSTCheckBox.setVisible(false); - stpLimitMusketeersCheckBox.setVisible(false); + stpLimitMainGameLegendariesCheckBox.setVisible(false); stpPercentageLevelModifierCheckBox.setVisible(false); stpPercentageLevelModifierSlider.setVisible(false); } @@ -2833,8 +2829,6 @@ public class NewRandomizerGUI { } if (stpUnchangedRadioButton.isSelected()) { - stpLimitMusketeersCheckBox.setEnabled(false); - stpLimitMusketeersCheckBox.setSelected(false); stpRandomize600BSTCheckBox.setEnabled(false); stpRandomize600BSTCheckBox.setSelected(false); stpAllowAltFormesCheckBox.setEnabled(false); @@ -2842,12 +2836,18 @@ public class NewRandomizerGUI { stpSwapMegaEvosCheckBox.setEnabled(false); stpSwapMegaEvosCheckBox.setSelected(false); } else { - stpLimitMusketeersCheckBox.setEnabled(true); stpRandomize600BSTCheckBox.setEnabled(true); stpAllowAltFormesCheckBox.setEnabled(true); stpSwapMegaEvosCheckBox.setEnabled(true); } + if (stpRandomSimilarStrengthRadioButton.isSelected()) { + stpLimitMainGameLegendariesCheckBox.setEnabled(true); + } else { + stpLimitMainGameLegendariesCheckBox.setEnabled(false); + stpLimitMainGameLegendariesCheckBox.setSelected(false); + } + if (stpPercentageLevelModifierCheckBox.isSelected()) { stpPercentageLevelModifierSlider.setEnabled(true); } else { diff --git a/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java index 448d77a..87a3a11 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java @@ -2900,7 +2900,7 @@ public abstract class AbstractRomHandler implements RomHandler { }
@Override
- public void randomizeStaticPokemon(boolean swapLegendaries, boolean similarStrength, boolean limitMusketeers,
+ public void randomizeStaticPokemon(boolean swapLegendaries, boolean similarStrength, boolean limitMainGameLegendaries,
boolean limit600, boolean allowAltFormes, boolean swapMegaEvos,
boolean abilitiesAreRandomized, int levelModifier) {
// Load
@@ -3011,6 +3011,7 @@ public abstract class AbstractRomHandler implements RomHandler { .collect(Collectors.toList());
List<Pokemon> pokemonLeft = new ArrayList<>(!allowAltFormes ? mainPokemonList : listInclFormesExclCosmetics);
pokemonLeft.removeAll(banned);
+ List<Integer> mainGameLegendaries = getMainGameLegendaries();
for (StaticEncounter old : currentStaticPokemon) {
StaticEncounter newStatic = cloneStaticEncounter(old);
Pokemon newPK;
@@ -3031,52 +3032,45 @@ public abstract class AbstractRomHandler implements RomHandler { }
setPokemonAndFormeForStaticEncounter(newStatic, newPK);
} else {
- if ((oldPK.number == 638 || oldPK.number == 639 || oldPK.number == 640) && limitMusketeers) {
- newPK = pickStaticPowerLvlReplacement(
- pokemonLeft,
- oldPK,
- true,
- replacements.stream().map(enc -> enc.pkmn).collect(Collectors.toList()),
- true);
- } else {
- if (reallySwapMegaEvos && old.canMegaEvolve()) {
- List<Pokemon> megaEvoPokemonLeft =
+ boolean limitBST = oldPK.baseForme == null ?
+ limitMainGameLegendaries && mainGameLegendaries.contains(oldPK.number) :
+ limitMainGameLegendaries && mainGameLegendaries.contains(oldPK.baseForme.number);
+ if (reallySwapMegaEvos && old.canMegaEvolve()) {
+ List<Pokemon> megaEvoPokemonLeft =
+ megaEvolutionsList
+ .stream()
+ .filter(mega -> mega.method == 1)
+ .map(mega -> mega.from)
+ .distinct()
+ .filter(pokemonLeft::contains)
+ .collect(Collectors.toList());
+ if (megaEvoPokemonLeft.isEmpty()) {
+ megaEvoPokemonLeft =
megaEvolutionsList
.stream()
.filter(mega -> mega.method == 1)
.map(mega -> mega.from)
.distinct()
- .filter(pokemonLeft::contains)
+ .filter(mainPokemonList::contains)
.collect(Collectors.toList());
- if (megaEvoPokemonLeft.isEmpty()) {
- megaEvoPokemonLeft =
- megaEvolutionsList
- .stream()
- .filter(mega -> mega.method == 1)
- .map(mega -> mega.from)
- .distinct()
- .filter(mainPokemonList::contains)
- .collect(Collectors.toList());
- }
- boolean limitBST = generationOfPokemon() == 6 && (oldPK.number == 380 || oldPK.number == 381);
- newPK = pickStaticPowerLvlReplacement(
- megaEvoPokemonLeft,
- oldPK,
- true,
- replacements.stream().map(enc -> enc.pkmn).collect(Collectors.toList()),
- limitBST);
- newStatic.heldItem = newPK
- .megaEvolutionsFrom
- .get(this.random.nextInt(newPK.megaEvolutionsFrom.size()))
- .argument;
- } else {
- newPK = pickStaticPowerLvlReplacement(
- pokemonLeft,
- oldPK,
- true,
- replacements.stream().map(enc -> enc.pkmn).collect(Collectors.toList()),
- false);
}
+ newPK = pickStaticPowerLvlReplacement(
+ megaEvoPokemonLeft,
+ oldPK,
+ true,
+ replacements.stream().map(enc -> enc.pkmn).collect(Collectors.toList()),
+ limitBST);
+ newStatic.heldItem = newPK
+ .megaEvolutionsFrom
+ .get(this.random.nextInt(newPK.megaEvolutionsFrom.size()))
+ .argument;
+ } else {
+ newPK = pickStaticPowerLvlReplacement(
+ pokemonLeft,
+ oldPK,
+ true,
+ replacements.stream().map(enc -> enc.pkmn).collect(Collectors.toList()),
+ limitBST);
}
pokemonLeft.remove(newPK);
setPokemonAndFormeForStaticEncounter(newStatic, newPK);
diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen1RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen1RomHandler.java index b729047..6dcb015 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen1RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen1RomHandler.java @@ -1289,6 +1289,11 @@ public class Gen1RomHandler extends AbstractGBCRomHandler { }
@Override
+ public List<Integer> getMainGameLegendaries() {
+ return new ArrayList<>();
+ }
+
+ @Override
public List<TotemPokemon> getTotemPokemon() {
return new ArrayList<>();
}
diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen2RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen2RomHandler.java index bc0954a..7325ca0 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen2RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen2RomHandler.java @@ -1125,6 +1125,11 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { }
@Override
+ public List<Integer> getMainGameLegendaries() {
+ return new ArrayList<>();
+ }
+
+ @Override
public List<TotemPokemon> getTotemPokemon() {
return new ArrayList<>();
}
diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen3RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen3RomHandler.java index 055f3ce..1063902 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen3RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen3RomHandler.java @@ -29,6 +29,7 @@ import java.io.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import java.util.zip.CRC32;
import com.dabomstew.pkrandom.FileFunctions;
@@ -2586,6 +2587,11 @@ public class Gen3RomHandler extends AbstractGBRomHandler { }
@Override
+ public List<Integer> getMainGameLegendaries() {
+ return Arrays.stream(romEntry.arrayEntries.get("MainGameLegendaries")).boxed().collect(Collectors.toList());
+ }
+
+ @Override
public List<TotemPokemon> getTotemPokemon() {
return new ArrayList<>();
}
diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen4RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen4RomHandler.java index 50e3ace..db8e56a 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen4RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen4RomHandler.java @@ -2895,6 +2895,11 @@ public class Gen4RomHandler extends AbstractDSRomHandler { }
@Override
+ public List<Integer> getMainGameLegendaries() {
+ return Arrays.stream(romEntry.arrayEntries.get("MainGameLegendaries")).boxed().collect(Collectors.toList());
+ }
+
+ @Override
public List<TotemPokemon> getTotemPokemon() {
return new ArrayList<>();
}
diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java index 1355772..f2c2b61 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java @@ -32,6 +32,7 @@ import java.io.PrintStream; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import java.util.stream.IntStream;
import com.dabomstew.pkrandom.pokemon.*;
@@ -1556,6 +1557,11 @@ public class Gen5RomHandler extends AbstractDSRomHandler { }
@Override
+ public List<Integer> getMainGameLegendaries() {
+ return Arrays.stream(romEntry.arrayEntries.get("MainGameLegendaries")).boxed().collect(Collectors.toList());
+ }
+
+ @Override
public List<TotemPokemon> getTotemPokemon() {
return new ArrayList<>();
}
diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen6RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen6RomHandler.java index a2bfcba..445fc58 100644 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen6RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen6RomHandler.java @@ -258,14 +258,6 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { try { stringsGarc = readGARC(romEntry.getString("TextStrings"),true); - GARCArchive encounterGarc = readGARC(romEntry.getString("WildPokemon"), false); - byte[] boxLegendaryRoomData = encounterGarc.getFile(227); - AMX localScript = new AMX(boxLegendaryRoomData, 1); - byte[] data = localScript.decData; - File output = new File("C:\\Users\\Tom\\Desktop\\1.amx"); - try (FileOutputStream outputStream = new FileOutputStream(output)) { - outputStream.write(data); - } } catch (IOException e) { throw new RandomizerIOException(e); } @@ -2540,6 +2532,11 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { } @Override + public List<Integer> getMainGameLegendaries() { + return Arrays.stream(romEntry.arrayEntries.get("MainGameLegendaries")).boxed().collect(Collectors.toList()); + } + + @Override public List<TotemPokemon> getTotemPokemon() { return new ArrayList<>(); } diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen7RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen7RomHandler.java index 965283e..097e331 100644 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen7RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen7RomHandler.java @@ -1725,6 +1725,11 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { } @Override + public List<Integer> getMainGameLegendaries() { + return Arrays.stream(romEntry.arrayEntries.get("MainGameLegendaries")).boxed().collect(Collectors.toList()); + } + + @Override public List<TotemPokemon> getTotemPokemon() { List<TotemPokemon> totems = new ArrayList<>(); try { diff --git a/src/com/dabomstew/pkrandom/romhandlers/RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/RomHandler.java index 451a615..bad3020 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/RomHandler.java @@ -268,7 +268,7 @@ public interface RomHandler { boolean setStaticPokemon(List<StaticEncounter> staticPokemon);
- void randomizeStaticPokemon(boolean swapLegendaries, boolean similarStrength, boolean limitMusketeers,
+ void randomizeStaticPokemon(boolean swapLegendaries, boolean similarStrength, boolean limitMainGameLegendaries,
boolean limit600, boolean allowAltFormes, boolean swapMegaEvos1,
boolean abilitiesAreRandomized, int levelModifier);
@@ -282,6 +282,8 @@ public interface RomHandler { void onlyChangeStaticLevels(int levelModifier);
+ List<Integer> getMainGameLegendaries();
+
// Randomizer: Totem Pokemon
List<TotemPokemon> getTotemPokemon();
|