Example #1
0
        private void VerifyIVsMystery(LegalityAnalysis data, MysteryGift g)
        {
            int[] IVs = g.IVs;
            if (IVs == null)
            {
                return;
            }

            var ivflag = Array.Find(IVs, iv => (byte)(iv - 0xFC) < 3);

            if (ivflag == 0) // Random IVs
            {
                bool valid = Legal.GetIsFixedIVSequenceValid(IVs, data.pkm);
                if (!valid)
                {
                    data.AddLine(GetInvalid(LEncGiftIVMismatch));
                }
            }
            else
            {
                int IVCount = ivflag - 0xFB;  // IV2/IV3
                VerifyIVsFlawless(data, IVCount);
            }
        }