#include "battle_script_commands.h"
#include "new_game.h"
#include "random_party.h"
#include "reverse_evolution.h"
#include "constants/pokemon.h"
//imports for printing to the console
#include "mgba.h"
#include "printf.h"
#include "../gflib/string_util.h"
static void SeedPkmnGenRng(u32 randomness);
static u8 CustomRnd(void);
static void ShuffleTypes(void);
static u32 PickRndSpecies(u8 partyIndex, u8 trainerClass, u8 teamLevel);
const struct TrainerPkmnTypes gTrainerTypeTable[] =
{
{TRAINER_CLASS_LASS, TYPE_NONE, TYPE_NONE, TYPE_NONE} // <-- intentionally removed comma; doesn't produce error
{TRAINER_CLASS_BUG_CATCHER, TYPE_BUG, TYPE_NONE, TYPE_NONE},
//...
{TRAINER_CLASS_HIKER, TYPE_GROUND, TYPE_ROCK, TYPE_NONE},
{TRAINER_CLASS_YOUNG_COUPLE, TYPE_NONE, TYPE_NONE, TYPE_NONE},
{TRAINER_CLASS_WINSTRATE, TYPE_DRAGON, TYPE_NONE, TYPE_NONE},
{TRAINER_CLASS_PKMN_TRAINER_2, TYPE_NONE, TYPE_NONE, TYPE_NONE},
{0xFF, TYPE_NONE, TYPE_NONE, TYPE_NONE},
};
//...other constants
#define TYPE_PROB_LEN 24
EWRAM_DATA u8 gPartyTypes[PARTY_SIZE] = {1};
const u8 gTypeProbabilityList[TYPE_PROB_LEN] =
{
TYPE_FIRE,
TYPE_WATER,
//...
};
#define NUM_SEEDS 6
EWRAM_DATA u32 sRandSeed[NUM_SEEDS] = {0};
static u8 CustomRnd(void)
{
u8 retval;
u8 seedIndex = (sRandIndex / 4) % NUM_SEEDS;
u8 byteIndex = sRandIndex % 4;
u32 bitMask = 0xFF << (byteIndex * 8);
retval = (sRandSeed[seedIndex] & bitMask) >> (byteIndex * 8);
sRandIndex++;
mgba_printf(MGBA_LOG_ERROR, "CustomRnd %u 0x%X", retval, retval);
mgba_printf(MGBA_LOG_DEBUG, "sRandIndex: %u; seed-value: 0x%X", sRandIndex, sRandSeed[seedIndex]);
mgba_printf(MGBA_LOG_DEBUG, "seedIndex: %u; byteIndex: %u; bitMask: 0x%X", seedIndex, byteIndex, bitMask);
return retval;
}
//...other functions