SetPrev() public method

public SetPrev ( ) : PokePRNG
return PokePRNG
        public static bool IsValidNature( uint pid1seed, uint nature )
        {
            PokePRNG rand = new PokePRNG( pid1seed ); //PID_LOW (FULL SEED)

            bool cont = true;

            do
            {
                uint newseed = rand.PrevNum(); //POSSIBLE SEED POINTER

                uint newhigh = rand.SetPrev().HighBits; //PID2
                uint newlow = rand.SetPrev().HighBits; //PID1

                uint newpid = ( newhigh << 0x10 ) | newlow;

                if ( (newseed / 0xA3E) == nature || (newseed >> 15 == 0) )
                    return true;
                else if ( (newpid % 25) == nature )
                    cont = false;
            }
            while ( cont );

            return false;
        }
示例#2
0
		public static bool IsValidNature( uint pid1seed, uint nature )
		{
			PokePRNG rand = new PokePRNG( pid1seed ); //PID_LOW (FULL SEED)

			bool cont = true;

			do
			{
				uint newseed = rand.PrevNum(); //POSSIBLE SEED POINTER

				uint newhigh = rand.SetPrev().HighBits; //PID2
				uint newlow = rand.SetPrev().HighBits; //PID1

				uint newpid = ( newhigh << 0x10 ) | newlow;

				if ( (newseed / 0xA3E) == nature || (newseed >> 15 == 0) )
					return true;
				else if ( (newpid % 25) == nature )
					cont = false;
			}
			while ( cont );

			return false;
		}
        public static bool ValidGlitchZig( uint pid, uint tid, int oivs1, int oivs2 )
        {
            PokePRNG rand = new PokePRNG();
            for ( uint i = 0; i < 2; ++i )
            {
                for ( uint j = 0; j < 0x10000; j++ )
                {
                    rand.Seed = (i << 31) + ((uint)oivs2 << 16) + j;
                    uint iv1 = rand.Seed;
                    uint second = ( rand.SetPrev().Seed >> 0x10 ) & 0x7FFF;
                    uint iv2 = rand.Seed;
                    if ( second == (uint)oivs1 )
                    {
                        uint afull = rand.PrevNum(); //Variance
                        uint a = rand.HighBits;
                        uint bfull = rand.PrevNum(); //Unknown (Gender Check?)
                        uint b = rand.HighBits;
                        uint cfull = rand.PrevNum(); //High PID
                        uint c = rand.HighBits;
                        uint dfull = rand.PrevNum(); //Seed
                        uint d = rand.HighBits;

                        if ( d == 0 && (dfull & 0xFFFF) <= 0xFF )
                        {
                            uint calcshiny = c ^ tid ^ 0;
                            uint var = ( ( calcshiny ^ a ) & 0x7 );
                            uint calclowpid = calcshiny ^ var;
                            if ( ( ( c << 0x10 ) | calclowpid ) == pid )
                                return true;
                        }
                    }
                }
            }
            return false;
        }