Beispiel #1
0
    private static void ParseMovesWasEggPreRelearn(PKM pk, CheckMoveResult[] parse, IReadOnlyList <int> currentMoves, LegalInfo info, EncounterEgg e)
    {
        // Level up moves could not be inherited if Ditto is parent,
        // that means genderless species and male only species (except Nidoran-M and Volbeat; they breed with Nidoran-F and Illumise) could not have level up moves as an egg
        var pi           = pk.PersonalInfo;
        var AllowLevelUp = !pi.Genderless && !(pi.OnlyMale && Breeding.MixedGenderBreeding.Contains(e.Species));
        int BaseLevel    = AllowLevelUp ? 100 : e.LevelMin;
        var LevelUp      = MoveList.GetBaseEggMoves(pk, e.Species, e.Form, e.Version, BaseLevel);

        var TradebackPreevo      = pk.Format == 2 && e.Species > 151;
        var NonTradebackLvlMoves = TradebackPreevo
            ? MoveList.GetExclusivePreEvolutionMoves(pk, e.Species, info.EvoChainsAllGens.Gen2, 2, e.Version).Where(m => m > Legal.MaxMoveID_1).ToArray()
            : Array.Empty <int>();

        var Egg = MoveEgg.GetEggMoves(pk.PersonalInfo, e.Species, e.Form, e.Version, e.Generation);

        if (info.Generation < 3 && pk.Format >= 7 && pk.VC1)
        {
            Egg = Array.FindAll(Egg, m => m <= Legal.MaxMoveID_1);
        }

        var specialMoves = e.CanHaveVoltTackle ? new[] { (int)Move.VoltTackle } : Array.Empty <int>(); // Volt Tackle for bred Pichu line

        var source = new MoveParseSource
        {
            CurrentMoves             = currentMoves,
            SpecialSource            = specialMoves,
            NonTradeBackLevelUpMoves = NonTradebackLvlMoves,

            EggLevelUpSource = LevelUp,
            EggMoveSource    = Egg,
        };

        ParseMoves(pk, source, info, parse);
    }
Beispiel #2
0
    private static void ParseMovesForSmeargle(PKM pk, CheckMoveResult[] parse, int[] currentMoves, LegalInfo info)
    {
        if (!pk.IsEgg)
        {
            ParseMovesSketch(pk, parse, currentMoves);
            return;
        }

        // can only know sketch as egg
        var levelup = new int[info.EvoChainsAllGens.Length][];

        levelup[pk.Format]  = new[] { (int)Move.Sketch };
        info.EncounterMoves = new ValidEncounterMoves(levelup);
        var source = new MoveParseSource {
            CurrentMoves = currentMoves
        };

        ParseMoves(pk, source, info, parse);
    }