From 04e03caa7af46f9a676541b564ab969b5e79f143 Mon Sep 17 00:00:00 2001 From: Ajarmar Date: Thu, 28 May 2020 03:46:31 +0200 Subject: add chance of gui mascot image being shiny when loading a gen 5 rom --- src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java | 5 ----- src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java index 75b0800..9e4ab8a 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java @@ -325,11 +325,6 @@ public abstract class AbstractRomHandler implements RomHandler { return mainPokemonList.get(this.random.nextInt(mainPokemonList.size())); } - public Pokemon randomForme() { - checkPokemonRestrictions(); - return altFormesList.get(this.random.nextInt(altFormesList.size())); - } - @Override public Pokemon randomNonLegendaryPokemon() { checkPokemonRestrictions(); diff --git a/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java b/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java index 782d921..17a77b2 100755 --- a/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java +++ b/src/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java @@ -2626,7 +2626,12 @@ public class Gen5RomHandler extends AbstractDSRomHandler { NARCArchive pokespritesNARC = this.readNARC(romEntry.getString("PokemonGraphics")); // First prepare the palette, it's the easy bit - byte[] rawPalette = pokespritesNARC.files.get(pk.number * 20 + 18); + int palIndex = pk.number * 20 + 18; + if (random.nextInt(10) == 0) { + // shiny + palIndex++; + } + byte[] rawPalette = pokespritesNARC.files.get(palIndex); int[] palette = new int[16]; for (int i = 1; i < 16; i++) { palette[i] = GFXFunctions.conv16BitColorToARGB(readWord(rawPalette, 40 + i * 2)); -- cgit v1.2.3