Skip to content

Commit

Permalink
Don't mess randomizing Unown
Browse files Browse the repository at this point in the history
  • Loading branch information
xCrystal committed Jun 17, 2017
1 parent 658b6a9 commit c5c28d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/engine/RandomizePokemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class RandomizePokemon {

static byte getRandomMatchingPokemon(byte mon_in, boolean isTrainer) {

if (mon_in == 0) return 0;
if (mon_in == 0 || mon_in == (byte) Pokemon.UNOWN.ordinal() + 1) return mon_in;

int strength_in = Pokemon.values()[(mon_in - 1) & 0xff].getStrength();
if (!isTrainer && strength_in >= 4) strength_in = 4;
Expand All @@ -20,7 +20,7 @@ static byte getRandomMatchingPokemon(byte mon_in, boolean isTrainer) {
mon_out = Rng.randomRange(Pokemon.BULBASAUR.ordinal(), Pokemon.CELEBI.ordinal());
strength_out = Pokemon.values()[mon_out].getStrength();
if (!isTrainer && strength_out >= 4) strength_out = 4;
} while (strength_out != strength_in);
} while (strength_out != strength_in || mon_out == Pokemon.UNOWN.ordinal());

return (byte) (mon_out + 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/Trainers.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void randomizeParties(ByteBuffer buf) {

int[] paramsNames = {1, 0, 1};
int[] paramsWithoutItem = {1, 1, 1};
int[] paramsWithItem = { 1, 1, 1, 1, 0, 1};
int[] paramsWithItem = {1, 1, 1, 1, 0, 1};

for (int i = 0; i < Constants.NUM_TRAINERS; i ++) {
buf = RandomizePokemon.randomize(buf, paramsNames, (byte) 0x50, 1, true);
Expand Down

0 comments on commit c5c28d7

Please sign in to comment.