Пример #1
0
 public void GivenTrainerIdEngineCanMakeNotShiny()
 {
     uint tID = 6;
     var p = new PersonalityEngine();
     var g = p.Generate();
     uint r = g ^ tID;
     Assert.IsFalse( ( ( r & 0xFFFF ) ^ ( r >> 16 ) ) < 8 );
 }
Пример #2
0
        public void GivenTrainerIdEngineCanMakeShiny()
        {
            uint tID = 6;
            var p = new PersonalityEngine { OriginalTrainer = tID };
            var g = p.Generate();

            uint r = g ^ tID;
            Assert.IsTrue( ( ( r & 0xFFFF ) ^ ( r >> 16 ) ) < 8 );
        }
Пример #3
0
        public void GivenTypeCanDecideGenderFemale( int type )
        {
            var gd = new GenderDecision( MonsterGender.F, (uint) type );

            var p = new PersonalityEngine { Gender = gd };
            var g = p.Generate();

            var t = MonsterList.Get( (uint) type );

            Assert.IsTrue( ( g & 0xff ) < t.Gender );
        }
Пример #4
0
        public void CanSpecifyShinyNatureAbilityEvolutionAtSameTime()
        {
            uint tID = 87373;
            var t = MonsterList.Get( 1 );
            var p = new PersonalityEngine( 444 )
            {
                Nature = MonsterNature.Lax,
                Ability = AbilityIndex.First,
                Evolution = EvolutionDirection.C,
                OriginalTrainer = tID,
                Gender = new GenderDecision( MonsterGender.F, 1 )
            };
            var g = p.Generate();

            Assert.AreEqual( 9, g % 25 );
            uint r = g ^ tID;
            Assert.IsTrue( ( ( r & 0xFFFF ) ^ ( r >> 16 ) ) < 8 );
            Assert.AreEqual( 0, g % 2 );
            Assert.IsFalse( ( g & 0xffff ) % 10 < 5 );
            Assert.IsTrue( ( g & 0xff ) < t.Gender );
        }
Пример #5
0
 public void GivenNatureEngineCanMakeNature()
 {
     var p = new PersonalityEngine { Nature = MonsterNature.Lax };
     var g = p.Generate();
     Assert.AreEqual( 9, g % 25 );
 }
Пример #6
0
        public void GivenTypeMOnlyDecisionIsIgnored()
        {
            var gd = new GenderDecision( MonsterGender.F, 32 );

            var p = new PersonalityEngine { Gender = gd };
            var g = p.Generate();
        }
Пример #7
0
 public void SetPersonality( PersonalityEngine engine )
 {
     Personality = engine.Generate();
 }