/// <summary>
        /// Initializes the <see cref="RandSpec"/> according to the provided settings.
        /// </summary>
        /// <param name="settings">General settings</param>
        /// <param name="banlist">Optional extra: banned species</param>
        public void Initialize(SpeciesSettings settings, params int[] banlist)
        {
            s = settings;
            var list = s.GetSpecies(Game.MaxSpeciesID, Game.Generation).Except(banlist);

            RandSpec = new GenericRandomizer(list.ToArray());
        }
Exemple #2
0
        /// <summary>
        /// Initializes the <see cref="RandSpec"/> according to the provided settings.
        /// </summary>
        /// <param name="settings"></param>
        public void Initialize(SpeciesSettings settings)
        {
            s = settings;
            var list = s.GetSpecies(Game.MaxSpeciesID, Game.Generation);

            RandSpec = new GenericRandomizer(list);
        }
Exemple #3
0
        public MoveRandomizer(GameInfo config, IReadOnlyList <Move> moves, PersonalTable t)
        {
            Config = config;
            var maxMoveId = config.MaxMoveID;

            MoveData    = moves;
            SpeciesStat = t;
            RandMove    = new GenericRandomizer <int>(Enumerable.Range(1, maxMoveId - 1).ToArray());
        }
Exemple #4
0
        public void Initialize(TrainerRandSettings settings)
        {
            Settings = settings;

            IEnumerable <int> classes = Enumerable.Range(0, ClassCount).Except(CrashClasses);

            if (Settings.SkipSpecialClasses)
            {
                classes = classes.Except(SpecialClasses);
            }
            Class = new GenericRandomizer <int>(classes.ToArray());
        }
Exemple #5
0
        public void Initialize(MovesetRandSettings settings, int[] bannedMoves)
        {
            Settings = settings;

            var nanned = new List <int>();

            nanned.AddRange(new[] { 165, 621, 464 }.Concat(Legal.Z_Moves)); // Struggle, Hyperspace Fury, Dark Void
            if (Settings.BanFixedDamageMoves)
            {
                nanned.AddRange(FixedDamageMoves);
            }
            nanned.AddRange(bannedMoves);

            Settings.BannedMoves = nanned.ToArray();

            var all   = Enumerable.Range(1, Config.MaxMoveID - 1);
            var moves = all.Except(nanned);

            RandMove = new GenericRandomizer(moves.ToArray());
        }
Exemple #6
0
        public void Initialize(MovesetRandSettings settings, int[] bannedMoves)
        {
            Settings = settings;

            var banned = new List <int>();

            banned.AddRange(Legal.Taboo_Moves.Concat(Legal.Z_Moves).Concat(Legal.Max_Moves));
            if (Settings.BanFixedDamageMoves)
            {
                banned.AddRange(FixedDamageMoves);
            }
            banned.AddRange(bannedMoves);

            Settings.BannedMoves = banned.ToArray();

            var all   = Enumerable.Range(1, Config.MaxMoveID - 1);
            var moves = all.Except(banned);

            if (MoveData[0] is Move8Fake)
            {
                moves = moves.Where(z => ((Move8Fake)MoveData[z]).CanUseMove);
            }
            RandMove = new GenericRandomizer <int>(moves.ToArray());
        }