예제 #1
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>
 public static void SetMarkings(this PKM pk)
 {
     if (pk.Format <= 3)
     {
         return; // no markings (gen3 only has 4; can't mark stats intelligently
     }
     pk.SetMarkings(pk.IVs);
 }
예제 #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>
        public static void SetMarkings(this PKM pk)
        {
            if (pk.Format <= 3)
            {
                return; // no markings (gen3 only has 4; can't mark stats intelligently
            }
            Span <int> IVs = stackalloc int[6];

            pk.GetIVs(IVs);
            pk.SetMarkings(IVs);
        }
예제 #3
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
            }
            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);
        }