diff --git a/data/layouts/PitArenaBeach03/map.bin b/data/layouts/PitArenaBeach03/map.bin index 069df6edc6d5..cb6084ac2f70 100644 Binary files a/data/layouts/PitArenaBeach03/map.bin and b/data/layouts/PitArenaBeach03/map.bin differ diff --git a/data/layouts/PitArenaWater04/map.bin b/data/layouts/PitArenaWater04/map.bin index 12918905d4f0..048a08f0afd9 100644 Binary files a/data/layouts/PitArenaWater04/map.bin and b/data/layouts/PitArenaWater04/map.bin differ diff --git a/data/maps/PitArenaBeach03/map.json b/data/maps/PitArenaBeach03/map.json index 0337de816d55..6f2e2c3c5ae4 100644 --- a/data/maps/PitArenaBeach03/map.json +++ b/data/maps/PitArenaBeach03/map.json @@ -16,12 +16,12 @@ "object_events": [ { "graphics_id": "OBJ_EVENT_GFX_VAR_0", - "x": 12, + "x": 14, "y": 14, "elevation": 0, - "movement_type": "MOVEMENT_TYPE_WANDER_UP_AND_DOWN", - "movement_range_x": 0, - "movement_range_y": 3, + "movement_type": "MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT", + "movement_range_x": 3, + "movement_range_y": 0, "trainer_type": "TRAINER_TYPE_NORMAL", "trainer_sight_or_berry_tree_id": "3", "script": "PitArena_TrainerBattle", @@ -68,7 +68,7 @@ }, { "graphics_id": "OBJ_EVENT_GFX_VAR_0", - "x": 12, + "x": 14, "y": 14, "elevation": 0, "movement_type": "MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT", @@ -159,8 +159,8 @@ }, { "graphics_id": "OBJ_EVENT_GFX_ZIGZAGOON_2", - "x": 9, - "y": 16, + "x": 12, + "y": 10, "elevation": 0, "movement_type": "MOVEMENT_TYPE_WANDER_AROUND", "movement_range_x": 2, diff --git a/data/maps/PitArenaWater04/map.json b/data/maps/PitArenaWater04/map.json index d2981b7a567f..e5870e619840 100644 --- a/data/maps/PitArenaWater04/map.json +++ b/data/maps/PitArenaWater04/map.json @@ -55,8 +55,8 @@ }, { "graphics_id": "OBJ_EVENT_GFX_VAR_3", - "x": 7, - "y": 6, + "x": 8, + "y": 7, "elevation": 0, "movement_type": "MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT", "movement_range_x": 3, @@ -107,8 +107,8 @@ }, { "graphics_id": "OBJ_EVENT_GFX_VAR_3", - "x": 7, - "y": 6, + "x": 8, + "y": 7, "elevation": 0, "movement_type": "MOVEMENT_TYPE_WANDER_LEFT_AND_RIGHT", "movement_range_x": 3, diff --git a/include/global.h b/include/global.h index ed978c72f05c..c453ecb54d09 100644 --- a/include/global.h +++ b/include/global.h @@ -579,7 +579,7 @@ struct SaveBlock2 // end of u16 u16 mode50Floors:1; u16 modeBossHeal:1; - u16 modeChoiceEvoStage:2; //0 = All, 1 = basic pokemon, 2 = fully evolved + u16 modeChoiceEvoStage:3; //0 = All, 1 = basic pokemon, 2 = fully evolved, 3 = prog u16 modeChoiceItemReward:2; //0 = Random, 1 = always 1, 2 = always 3 u16 modeSpeciesArray:1; //0 = Random, 1 = progressive u16 padding2:9; // uncommented because its free padding space diff --git a/include/pit.h b/include/pit.h index ae8ee0ad4445..d557d789da9b 100644 --- a/include/pit.h +++ b/include/pit.h @@ -49,7 +49,10 @@ void Task_PokemonAvatar_HandleBob(u8 taskId); u32 GetMaxNumberOfSpeciesAvatars(void); void ClearAllRandomBossEncounters(void); -u32 GetSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies); +u32 GetTrainerSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies); +u32 GetPlayerSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies); +u32 GetMaxPlayerNumberOfSpecies(bool8 forceAllSpecies); +void ClearGeneratedMons(void); struct RandomTrainerNPC { @@ -91,12 +94,17 @@ struct RandomTrainerNPC #define EVOSTAGE_ALL 0 #define EVOSTAGE_BASIC 1 #define EVOSTAGE_FULL 2 +#define EVOSTAGE_PROG 3 #define ARRAY_RANDOM 0 #define ARRAY_PROG 1 #define ITEM_DROPS_RAND 0 #define ITEM_DROPS_1 1 #define ITEM_DROPS_3 2 +#define TRAINER_MONS 0 +#define PLAYER_MONS 1 +#define ALL_MONS 2 + //Autosave defines #define SAVE_NO 0 #define SAVE_5_FLOORS 1 diff --git a/include/pokemon.h b/include/pokemon.h index 69604dc95a7f..fdac21dcd638 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -897,16 +897,16 @@ u16 GetRandomMoveNotSeeded(u16 move, u16 species); u8 GetRandomType(void); u8 EvolutionBlockedByEvoLimit(u16 species); u16 GetSpeciesRandomSeeded(u16 species); -u16 GetSpeciesRandomNotSeeded(u16 species); +u16 GetSpeciesRandomNotSeeded(u16 monType); u8 GetNumberOfEggMoves(struct Pokemon *mon); u8 GetEggMoveTutorMoves(struct Pokemon *mon, u16 *moves); u8 GetNumberOfTutorMoves(struct Pokemon *mon); u8 GetTutorMoves(struct Pokemon *mon, u16 *moves); u8 GetStaticTutorMoves(u16 *moves); u16 GetMegaStone(u32 species); -u32 GetMaxNumberOfSpecies(bool8 forceAllSpecies); +u32 GetMaxTrainerNumberOfSpecies(bool8 forceAllSpecies); void DebugTestRandomness(void); -u16 GetRandomSpeciesFlattenedCurve(void); +u16 GetRandomSpeciesFlattenedCurve(u16 monType); u16 GetAverageEVsFromParty(void); void ForceIncrementMonLevel(struct Pokemon *mon); u16 GetRandomValidMovesCount(void); diff --git a/src/battle_main.c b/src/battle_main.c index 7b128d665890..a01d810fdb5f 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2110,7 +2110,7 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer else if (monLevel == 100 || monLevel % 25 == 0) { // = fully evolved mons for every trainer from Floor 100 on and for bosses! - u16 newSpecies = GetRandomSpeciesFlattenedCurve(); + u16 newSpecies = GetRandomSpeciesFlattenedCurve(ALL_MONS); const struct Evolution *evolutions = GetSpeciesEvolutions(newSpecies); while (evolutions != NULL) { @@ -2130,7 +2130,7 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer } else { - CreateMon(&party[i], GetRandomSpeciesFlattenedCurve(), monLevel, 0, TRUE, personalityValue, otIdType, fixedOtId); + CreateMon(&party[i], GetRandomSpeciesFlattenedCurve(TRAINER_MONS), monLevel, 0, TRUE, personalityValue, otIdType, fixedOtId); //test line below for forced test encounters //CreateMon(&party[i], SPECIES_RAYQUAZA, monLevel, 0, TRUE, personalityValue, otIdType, fixedOtId); } diff --git a/src/pit_randomizer.c b/src/pit_randomizer.c index c119a87f6c73..d9d7e61ada4f 100644 --- a/src/pit_randomizer.c +++ b/src/pit_randomizer.c @@ -1374,14 +1374,14 @@ bool8 IsSpeciesParadoxMon(u16 species) u16 AccessValidSpeciesArrayIndex(u16 index) { - return GetSpeciesFromRandomArray(index % GetMaxNumberOfSpecies(FALSE), FALSE); + return GetTrainerSpeciesFromRandomArray(index % GetMaxTrainerNumberOfSpecies(TRUE), TRUE); } u16 GetIndexOfSpeciesInValidSpeciesArray(u16 species) { - for(int i = 0; i < GetMaxNumberOfSpecies(FALSE); i++) + for(int i = 0; i < GetMaxTrainerNumberOfSpecies(TRUE); i++) { - if(GetSpeciesFromRandomArray(i, FALSE) == species) + if(GetTrainerSpeciesFromRandomArray(i, TRUE) == species) { return i; } @@ -1391,57 +1391,56 @@ u16 GetIndexOfSpeciesInValidSpeciesArray(u16 species) u16 GetSpeciesRandomSeeded(u16 species) { - return GetSpeciesFromRandomArray(RandomSeededModulo2(species, GetMaxNumberOfSpecies(FALSE)), FALSE); + return GetTrainerSpeciesFromRandomArray(RandomSeededModulo2(species, GetMaxTrainerNumberOfSpecies(TRUE)), TRUE); } -u16 GetSpeciesRandomNotSeeded(u16 species) +u16 GetSpeciesRandomNotSeeded(u16 monType) { - return GetSpeciesFromRandomArray(RandomModulo(species, GetMaxNumberOfSpecies(FALSE)), FALSE); -} + switch(monType) + { + case TRAINER_MONS: + return GetTrainerSpeciesFromRandomArray(RandomModulo(0, GetMaxTrainerNumberOfSpecies(FALSE)), FALSE); + case PLAYER_MONS: + return GetPlayerSpeciesFromRandomArray(RandomModulo(0, GetMaxPlayerNumberOfSpecies(FALSE)), FALSE); + case ALL_MONS: + return GetTrainerSpeciesFromRandomArray(RandomModulo(0, GetMaxTrainerNumberOfSpecies(TRUE)), TRUE); + } -u8 GetCurrentMaxMonGeneratedCount(void) -{ - u32 speciesCountReduced = ((GetMaxNumberOfSpecies(FALSE) * 15) / 16); - return (gSaveBlock3Ptr->monsGeneratedCount / (speciesCountReduced)) + 1; + // Default Should Never Reach + return GetTrainerSpeciesFromRandomArray(RandomModulo(0, GetMaxTrainerNumberOfSpecies(FALSE)), FALSE); } -u16 GetRandomSpeciesFlattenedCurve(void) +u16 GetRandomSpeciesFlattenedCurve(u16 monType) { u16 randomSpecies = 0; - u16 largestMonCount = gSaveBlock3Ptr->largestMonCount; u16 notChosen = TRUE; - u8 maxChosenNumber = 0; u16 breakOut = 0; - gSaveBlock3Ptr->monsGeneratedCount += 1; - maxChosenNumber = GetCurrentMaxMonGeneratedCount(); - - //SeedRngWithRtc(); - while(notChosen) { - randomSpecies = GetSpeciesRandomNotSeeded(0); - if(gSaveBlock3Ptr->monRolledCounts[randomSpecies] < maxChosenNumber) + randomSpecies = GetSpeciesRandomNotSeeded(monType); + if(gSaveBlock3Ptr->monRolledCounts[randomSpecies] == 0) notChosen = FALSE; breakOut++; - if(breakOut > 100000) - notChosen = FALSE; + if(breakOut > 700) + { + // Looping too much is intentionally used as the new Clear method because the arrays are broken apart, looping through this function is very fast, + // it will maybe slow down a trainer generation by 0.2 seconds every now and then, but thats not a big deal imo, + // the alternative is very complicated logic and thousands of bytes more of save space + ClearGeneratedMons(); + breakOut = 0; + } } gSaveBlock3Ptr->monRolledCounts[randomSpecies] += 1; - if(gSaveBlock3Ptr->monRolledCounts[randomSpecies] > largestMonCount) - gSaveBlock3Ptr->largestMonCount = gSaveBlock3Ptr->monRolledCounts[randomSpecies] + 1; - return randomSpecies; - } void ClearGeneratedMons(void) { u16 i = 0; - gSaveBlock3Ptr->monsGeneratedCount = 0; - for(i = 0; i < GetMaxNumberOfSpecies(FALSE); i++) + for(i = 0; i < GetMaxTrainerNumberOfSpecies(TRUE); i++) { gSaveBlock3Ptr->monRolledCounts[i] = 0; } @@ -1463,7 +1462,7 @@ void GenerateRandomSpeciesRewards(u16 *sRolledSpeciesPtr) { counter = 0; counter2 = 0; - species = GetRandomSpeciesFlattenedCurve(); + species = GetRandomSpeciesFlattenedCurve(PLAYER_MONS); do { @@ -1472,9 +1471,9 @@ void GenerateRandomSpeciesRewards(u16 *sRolledSpeciesPtr) //legendary check if (gSaveBlock2Ptr->modeLegendaries == OPTIONS_OFF || (sRolledLegendAlready && (Random() % 10))) //reroll in case any legendaries, mythics or ultra beasts are determined { - while (((IsSpeciesLegendary(species) || IsSpeciesMythical(species) || IsSpeciesUltraBeast(species) || IsSpeciesParadoxMon(species))) && counter < 30) + while (((IsSpeciesLegendary(species) || IsSpeciesMythical(species) || IsSpeciesUltraBeast(species) || IsSpeciesParadoxMon(species))) && counter < 100) { - species = GetRandomSpeciesFlattenedCurve(); + species = GetRandomSpeciesFlattenedCurve(PLAYER_MONS); counter++; } } @@ -1545,7 +1544,7 @@ void GenerateRandomSpeciesRewards(u16 *sRolledSpeciesPtr) } - if (counter2 == 20) //exit in case of infinite loop + if (counter2 == 100) //exit in case of infinite loop { rerollMon = FALSE; //DebugPrintf("no valid species found. Default: %d", species); @@ -1554,7 +1553,7 @@ void GenerateRandomSpeciesRewards(u16 *sRolledSpeciesPtr) if (rerollMon) { counter2++; - species = GetRandomSpeciesFlattenedCurve(); + species = GetRandomSpeciesFlattenedCurve(PLAYER_MONS); counter = 0; } } @@ -1587,7 +1586,7 @@ void DebugTestRandomness(void) { for(partyNum = 0; partyNum < 5; partyNum++) { - GetRandomSpeciesFlattenedCurve(); + GetRandomSpeciesFlattenedCurve(ALL_MONS); } } } @@ -1595,7 +1594,7 @@ void DebugTestRandomness(void) } //DebugPrintf("\n\n\nDebugTestRandomness New"); - for(i = 0; i < GetMaxNumberOfSpecies(TRUE); i++) + for(i = 0; i < GetMaxTrainerNumberOfSpecies(TRUE); i++) { StringCopy(gStringVar1, GetSpeciesName(i)); //DebugPrintf("Species %S: %d", &gStringVar1, gSaveBlock3Ptr->monRolledCounts[i]); @@ -1931,11 +1930,11 @@ u16 RandomItemId(u16 itemId) else if (ItemId_GetPocket(itemId) != POCKET_KEY_ITEMS) { randomItemCategory = Random32() % 1000; - if(randomItemCategory < 100) + if(randomItemCategory < 70) itemId = sRandomXItems[RandomModulo(itemId + VarGet(VAR_PIT_FLOOR) + gSaveBlock1Ptr->pos.x, RANDOM_X_ITEM_COUNT)]; else if(randomItemCategory < 700) itemId = sRandomConsumableValidItems[RandomModulo(itemId + VarGet(VAR_PIT_FLOOR) + gSaveBlock1Ptr->pos.x, RANDOM_CONSUMABLE_ITEM_COUNT)]; - else if(randomItemCategory < 900) + else if(randomItemCategory < 920) itemId = sRandomHeldValidItems[RandomModulo(itemId + VarGet(VAR_PIT_FLOOR) + gSaveBlock1Ptr->pos.x, RANDOM_HELD_ITEM_COUNT)]; else itemId = sRandomBerryValidItems[RandomModulo(itemId + VarGet(VAR_PIT_FLOOR) + gSaveBlock1Ptr->pos.x, RANDOM_BERRY_ITEM_COUNT)]; diff --git a/src/pit_species_lists.c b/src/pit_species_lists.c index d0b6072b048f..3bf2d4325eb4 100644 --- a/src/pit_species_lists.c +++ b/src/pit_species_lists.c @@ -5271,7 +5271,7 @@ static const u16 sRandomDynamicSpecies_76_100[] = #endif }; -u32 GetMaxNumberOfSpecies(bool8 forceAllSpecies) +u32 GetMaxTrainerNumberOfSpecies(bool8 forceAllSpecies) { u8 floor = VarGet(VAR_PIT_FLOOR); @@ -5294,7 +5294,7 @@ u32 GetMaxNumberOfSpecies(bool8 forceAllSpecies) } } -u32 GetSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies) +u32 GetTrainerSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies) { u8 floor = VarGet(VAR_PIT_FLOOR); @@ -5316,3 +5316,35 @@ u32 GetSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies) return sRandomDynamicSpecies_76_100[index]; } } + +u32 GetMaxPlayerNumberOfSpecies(bool8 forceAllSpecies) +{ + u8 floor = VarGet(VAR_PIT_FLOOR); + + if (gSaveBlock2Ptr->modeChoiceEvoStage != EVOSTAGE_PROG || forceAllSpecies) + return RANDOM_DYNAMIC_SPECIES_COUNT_76_100; + else + { // The Player Only Gets 4 Mon Options So They're Weighted Better Than Opponents Slightly. Can Update if you Want. + if (floor <= 25) + return RANDOM_DYNAMIC_SPECIES_COUNT_16_25; + if (floor <= 50) + return RANDOM_DYNAMIC_SPECIES_COUNT_51_75; + return RANDOM_DYNAMIC_SPECIES_COUNT_76_100; + } +} + +u32 GetPlayerSpeciesFromRandomArray(u16 index, bool8 forceAllSpecies) +{ + u8 floor = VarGet(VAR_PIT_FLOOR); + + if (gSaveBlock2Ptr->modeChoiceEvoStage != EVOSTAGE_PROG || forceAllSpecies) // If Not Prog, The Evo Stage Basic/Evolved Is Handled By Rerolls In GenerateRandomSpeciesRewards() + return sRandomDynamicSpecies_76_100[index]; + else + { // The Player Only Gets 4 Mon Options So They're Weighted Better Than Opponents Slightly. Can Update if you Want. + if (floor <= 25) + return sRandomDynamicSpecies_16_25[index]; + if (floor <= 50) + return sRandomDynamicSpecies_51_75[index]; + return sRandomDynamicSpecies_76_100[index]; + } +} diff --git a/src/pokedex_plus_hgss.c b/src/pokedex_plus_hgss.c index c8c83182face..b3e523bcae45 100644 --- a/src/pokedex_plus_hgss.c +++ b/src/pokedex_plus_hgss.c @@ -8904,7 +8904,7 @@ bool8 isDexCompleted(u8 mode) { u16 i, k; u16 maxSpecies = NUM_SPECIES; - u16 maxSpeciesPit = GetMaxNumberOfSpecies(TRUE); + u16 maxSpeciesPit = GetMaxTrainerNumberOfSpecies(TRUE); u16 invalidSpecies = 0; u8 baseSpeciesHandled[NATIONAL_DEX_COUNT] = {0}; @@ -8948,7 +8948,7 @@ bool8 isDexCompleted(u8 mode) // void printNatDex(void) // { // u16 i; -// u16 maxSpeciesPit = GetMaxNumberOfSpecies(TRUE); +// u16 maxSpeciesPit = GetMaxTrainerNumberOfSpecies(TRUE); // for (i = 0; i < maxSpeciesPit; i++) // DebugPrintf("i=%d, %d, %S, %d", i, SpeciesToNationalPokedexNum(AccessValidSpeciesArrayIndex(i)), gSpeciesInfo[AccessValidSpeciesArrayIndex(i)].speciesName, AccessValidSpeciesArrayIndex(i)); diff --git a/src/pokemon.c b/src/pokemon.c index b93b05feac12..fd680f12ed15 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5195,7 +5195,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s if (gSaveBlock2Ptr->randomEvos == OPTIONS_ON && (targetSpecies != SPECIES_NONE)) { - targetSpecies = GetSpeciesRandomNotSeeded(targetSpecies); + targetSpecies = GetRandomSpeciesFlattenedCurve(ALL_MONS); } return targetSpecies; diff --git a/src/scrcmd.c b/src/scrcmd.c index 0689f29a7c88..a0f516e194f5 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -829,10 +829,13 @@ bool8 ScrCmd_warpteleport(struct ScriptContext *ctx) y = 9; //only show move tutor on 10er levels FlagClear(FLAG_HIDE_MOVE_TUTOR); - if (VarGet(VAR_PIT_FLOOR) % 10 != 0) + + if (VarGet(VAR_PIT_FLOOR) % 10 != 0) // Hide if on a multiple of 10 FlagSet(FLAG_HIDE_MOVE_TUTOR); - if (VarGet(VAR_PIT_FLOOR) % 25 != 0) + + if (VarGet(VAR_PIT_FLOOR) % 25 == 0) // Show Tutor if on 25 FlagClear(FLAG_HIDE_MOVE_TUTOR); + if (gSaveBlock2Ptr->modeXP == 2) // If No Exp Mode, Always Spawn Tutor FlagClear(FLAG_HIDE_MOVE_TUTOR); } diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 7224cd9353c9..bbd192e20477 100644 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -456,7 +456,7 @@ u32 ScriptGiveMon(u16 species, u8 level, u16 item) MAX_PER_STAT_IVS + 1, MAX_PER_STAT_IVS + 1, MAX_PER_STAT_IVS + 1}; // ScriptGiveMonParameterized won't touch the stats' IV. u16 moves[MAX_MON_MOVES] = {MOVE_NONE, MOVE_NONE, MOVE_NONE, MOVE_NONE}; - species = GetSpeciesRandomNotSeeded(species); + species = GetRandomSpeciesFlattenedCurve(PLAYER_MONS); return ScriptGiveMonParameterized(species, level, item, ITEM_POKE_BALL, NUM_NATURES, NUM_ABILITY_PERSONALITY, MON_GENDERLESS, evs, ivs, moves, FALSE, NUMBER_OF_MON_TYPES, FALSE); } @@ -508,7 +508,7 @@ void ScrCmd_createmon(struct ScriptContext *ctx) u16 moves[MAX_MON_MOVES] = {move1, move2, move3, move4}; if(!FlagGet(FLAG_DONT_RANDOMIZE_NEXT_MON)) - species = GetSpeciesRandomNotSeeded(species); + species = GetRandomSpeciesFlattenedCurve(PLAYER_MONS); gSpecialVar_Result = ScriptGiveMonParameterized(species, level, item, ball, nature, abilityNum, gender, evs, ivs, moves, ggMaxFactor, teraType, isShiny); } diff --git a/src/wonder_trade.c b/src/wonder_trade.c index a7b7368f1ba4..08c370e8f9bd 100644 --- a/src/wonder_trade.c +++ b/src/wonder_trade.c @@ -85,7 +85,7 @@ static u32 ReturnRandomSpecies() u8 partyCount; int i; - species = GetRandomSpeciesFlattenedCurve(); + species = GetRandomSpeciesFlattenedCurve(ALL_MONS); //species = SPECIES_GROUDON; //Test setting for reroll tests do @@ -94,10 +94,10 @@ static u32 ReturnRandomSpecies() //reroll in case any legendaries, mythics or ultra beasts are determined if (gSaveBlock2Ptr->modeLegendaries == OPTIONS_OFF) { - while (((IsSpeciesLegendary(species) || IsSpeciesMythical(species) || IsSpeciesUltraBeast(species) || IsSpeciesParadoxMon(species)) || species > GetMaxNumberOfSpecies(TRUE)) && counter < 10) + while (((IsSpeciesLegendary(species) || IsSpeciesMythical(species) || IsSpeciesUltraBeast(species) || IsSpeciesParadoxMon(species)) || species > GetMaxTrainerNumberOfSpecies(TRUE)) && counter < 10) { // +counter to handle edge cases - species = GetRandomSpeciesFlattenedCurve(); + species = GetRandomSpeciesFlattenedCurve(ALL_MONS); counter ++; //DebugPrintf("%d, rerolled non-legend species = %d", counter, species); } @@ -127,7 +127,7 @@ static u32 ReturnRandomSpecies() if (rerollMon) { counter2++; - species = GetRandomSpeciesFlattenedCurve(); + species = GetRandomSpeciesFlattenedCurve(ALL_MONS); counter = 0; //reset counter for legendary rerolls //DebugPrintf("--- reroll ---"); }