summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAjarmar <axel.jarmar@gmail.com>2020-05-28 03:46:31 +0200
committerAjarmar <axel.jarmar@gmail.com>2020-05-28 03:46:31 +0200
commit04e03caa7af46f9a676541b564ab969b5e79f143 (patch)
tree8d32e455cd1f35e30d8f5a7d00f89e9b0a7932df /src
parent59c88a3394f879dbee4b5e8645549dfb27bc2cde (diff)
add chance of gui mascot image being shiny when loading a gen 5 rom
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/dabomstew/pkrandom/romhandlers/AbstractRomHandler.java5
-rwxr-xr-xsrc/com/dabomstew/pkrandom/romhandlers/Gen5RomHandler.java7
2 files changed, 6 insertions, 6 deletions
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));