コード例 #1
0
        public static bool Verify <T>(this T raid, PK8 pk8, ulong seed) where T : EncounterStatic8Nest <T>
        {
            var pi    = PersonalTable.SWSH.GetFormEntry(raid.Species, raid.Form);
            var ratio = pi.Gender;
            var abil  = RemapAbilityToParam(raid.Ability);
            var IVs   = raid.IVs.Count == 0 ? GetBlankIVTemplate() : PKX.ReorderSpeedLast((int[])((int[])raid.IVs).Clone());

            return(Verify(pk8, seed, IVs, raid.FlawlessIVCount, abil, ratio));
        }
コード例 #2
0
        /// <summary>
        /// Sets the <see cref="PKM.Markings"/> to indicate flawless (or near-flawless) <see cref="PKM.IVs"/>.
        /// </summary>
        /// <param name="pk">Pokémon to modify.</param>
        /// <param name="ivs"><see cref="PKM.IVs"/> to use (if already known). Will fetch the current <see cref="PKM.IVs"/> if not provided.</param>
        public static void SetMarkings(this PKM pk, int[] ivs)
        {
            if (pk.Format <= 3)
            {
                return; // no markings (gen3 only has 4; can't mark stats intelligently
            }
            var markings = ivs.Select(MarkingMethod(pk)).ToArray();

            pk.Markings = PKX.ReorderSpeedLast(markings);
        }
コード例 #3
0
        public static void ApplyDetailsTo <T>(this T raid, PK8 pk8, ulong seed) where T : EncounterStatic8Nest <T>
        {
            // Ensure the species-form is set correctly (nature)
            pk8.Species = raid.Species;
            pk8.Form    = raid.Form;
            var pi    = PersonalTable.SWSH.GetFormEntry(raid.Species, raid.Form);
            var ratio = pi.Gender;
            var abil  = RemapAbilityToParam(raid.Ability);
            var IVs   = raid.IVs.Count == 0 ? GetBlankIVTemplate() : PKX.ReorderSpeedLast((int[])((int[])raid.IVs).Clone());

            ApplyDetailsTo(pk8, seed, IVs, raid.FlawlessIVCount, abil, ratio);
        }
コード例 #4
0
ファイル: RaidRNG.cs プロジェクト: ZeroX1ng/PKHeX
 private static void LoadIVs <T>(T raid, Span <int> IVs) where T : EncounterStatic8Nest <T>
 {
     if (raid.IVs.Count == 0)
     {
         IVs.Fill(-1);
     }
     else
     {
         ((int[])raid.IVs).CopyTo(IVs);
         PKX.ReorderSpeedLast(IVs);
     }
 }
コード例 #5
0
ファイル: MarkingApplicator.cs プロジェクト: zekroman/PKHeX
        /// <summary>
        /// Sets the <see cref="PKM.Markings"/> to indicate flawless (or near-flawless) <see cref="PKM.IVs"/>.
        /// </summary>
        /// <param name="pk">Pokémon to modify.</param>
        /// <param name="ivs"><see cref="PKM.IVs"/> to use (if already known). Will fetch the current <see cref="PKM.IVs"/> if not provided.</param>
        public static void SetMarkings(this PKM pk, int[] ivs)
        {
            if (pk.Format <= 3)
            {
                return; // no markings (gen3 only has 4; can't mark stats intelligently
            }
            Span <int> markings = stackalloc int[ivs.Length];
            var        method   = MarkingMethod(pk);

            for (int i = 0; i < markings.Length; i++)
            {
                markings[i] = method(ivs[i], i);
            }
            PKX.ReorderSpeedLast(markings);
            pk.SetMarkings(markings);
        }