From 9c4a20b628b4e9a407a13e9ce9a2973b05db62bc Mon Sep 17 00:00:00 2001 From: tom-overton Date: Tue, 4 Oct 2022 20:51:34 -0700 Subject: Pt/HGSS: Add option to update Rotom appliance types --- src/com/sneed/pkrandom/MiscTweak.java | 1 + src/com/sneed/pkrandom/newgui/Bundle.properties | 2 ++ src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form | 11 +++++++++++ src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java | 1 + src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java | 13 +++++++++++++ 5 files changed, 28 insertions(+) diff --git a/src/com/sneed/pkrandom/MiscTweak.java b/src/com/sneed/pkrandom/MiscTweak.java index f61dd37..5cbdda1 100755 --- a/src/com/sneed/pkrandom/MiscTweak.java +++ b/src/com/sneed/pkrandom/MiscTweak.java @@ -60,6 +60,7 @@ public class MiscTweak implements Comparable { public static final MiscTweak RUN_WITHOUT_RUNNING_SHOES = new MiscTweak(1 << 18, "runWithoutRunningShoes", 0); 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); /* @formatter:on */ private final int value; diff --git a/src/com/sneed/pkrandom/newgui/Bundle.properties b/src/com/sneed/pkrandom/newgui/Bundle.properties index d04e52d..6b5ec6b 100644 --- a/src/com/sneed/pkrandom/newgui/Bundle.properties +++ b/src/com/sneed/pkrandom/newgui/Bundle.properties @@ -517,6 +517,8 @@ CodeTweaks.fasterHpAndExpBars.toolTipText=Doubles the scrolling speed of t CodeTweaks.fasterHpAndExpBars.name=Faster HP and EXP Bars 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. 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 a518865..4b1ff5d 100644 --- a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form +++ b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.form @@ -3598,6 +3598,17 @@ + + + + + + + + + + + diff --git a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java index f2be409..5eecbe7 100644 --- a/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java +++ b/src/com/sneed/pkrandom/newgui/NewRandomizerGUI.java @@ -296,6 +296,7 @@ public class NewRandomizerGUI { private JComboBox tpComboBox; private JCheckBox tpBetterMovesetsCheckBox; private JCheckBox paEnsureTwoAbilitiesCheckbox; + private JCheckBox miscUpdateRotomFormeTypingCheckBox; private static JFrame frame; diff --git a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java index 19dcf80..7d12c47 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java @@ -5262,6 +5262,9 @@ public class Gen4RomHandler extends AbstractDSRomHandler { if (romEntry.tweakFiles.get("FastDistortionWorldTweak") != null) { available |= MiscTweak.FAST_DISTORTION_WORLD.getValue(); } + if (romEntry.romType == Gen4Constants.Type_Plat || romEntry.romType == Gen4Constants.Type_HGSS) { + available |= MiscTweak.UPDATE_ROTOM_FORME_TYPING.getValue(); + } return available; } @@ -5286,6 +5289,8 @@ public class Gen4RomHandler extends AbstractDSRomHandler { updateTypeEffectiveness(); } else if (tweak == MiscTweak.FAST_DISTORTION_WORLD) { applyFastDistortionWorld(); + } else if (tweak == MiscTweak.UPDATE_ROTOM_FORME_TYPING) { + updateRotomFormeTyping(); } } @@ -5517,6 +5522,14 @@ public class Gen4RomHandler extends AbstractDSRomHandler { scriptNarc.files.set(Gen4Constants.ptSpearPillarPortalScriptFile, spearPillarPortalScript); } + private void updateRotomFormeTyping() { + pokes[Species.Gen4Formes.rotomH].secondaryType = Type.FIRE; + pokes[Species.Gen4Formes.rotomW].secondaryType = Type.WATER; + pokes[Species.Gen4Formes.rotomFr].secondaryType = Type.ICE; + pokes[Species.Gen4Formes.rotomFa].secondaryType = Type.FLYING; + pokes[Species.Gen4Formes.rotomM].secondaryType = Type.GRASS; + } + @Override public void applyCorrectStaticMusic(Map specialMusicStaticChanges) { List replaced = new ArrayList<>(); -- cgit v1.2.3