示例#1
0
        public override Pokemon.Individual Generate(uint seed, ILvGenerator lvGenerator, IIVsGenerator ivsGenerator, INatureGenerator natureGenerator, IGenderGenerator genderGenerator, out uint finSeed)
        {
            var lv = lvGenerator.GenerateLv(ref seed, basicLv, variableLv);

            // 性格決定は行わない.

            // HIDから先に生成する.
            var pid = (seed.GetRand() << 16) | seed.GetRand();

            // 形状が一致するまで再計算.
            while (GetUnownForm(pid) != pokemon.FormName)
            {
                pid = (seed.GetRand() << 16) | seed.GetRand();
            }

            var IVs = ivsGenerator.GenerateIVs(ref seed);

            finSeed = seed;
            return(pokemon.GetIndividual(lv, IVs, pid));
        }
示例#2
0
        public virtual Pokemon.Individual Generate(uint seed, ILvGenerator lvGenerator, IIVsGenerator ivsGenerator, INatureGenerator natureGenerator, IGenderGenerator genderGenerator, out uint finSeed)
        {
            var lv = lvGenerator.GenerateLv(ref seed, basicLv, variableLv);

            // このあたり継承で分けてしまってもよさそう
            var gender = pokemon.GenderRatio.IsFixed() ? Gender.Genderless : genderGenerator.GenerateGender(ref seed);
            var nature = natureGenerator.GenerateFixedNature(ref seed);

            var pid = seed.GetRand() | (seed.GetRand() << 16);

            while (!(pid.CheckGender(pokemon.GenderRatio, gender) && pid.CheckNature(nature)))
            {
                pid = seed.GetRand() | (seed.GetRand() << 16);
            }

            var IVs = ivsGenerator.GenerateIVs(ref seed);

            finSeed = seed;
            return(pokemon.GetIndividual(lv, IVs, pid));
        }