public void TestChampionTalentAddedMechanism()
        {
            var champion = new ChampionTalent();

            this.playerThing.Behaviors.FindFirst<TalentsBehavior>().AddTalent(champion);

            var behavior = this.playerThing.Behaviors.FindFirst<TalentsBehavior>();

            Verify.IsTrue(behavior.ManagedTalents.Contains(champion));
            Verify.IsNotNull(behavior.FindFirst<ChampionTalent>().PlayerThing);

            behavior.RemoveTalent(champion);
        }
Beispiel #2
0
        public void TestChampionTalentAddedMechanism()
        {
            var champion = new ChampionTalent();

            this.playerThing.Behaviors.FindFirst <TalentsBehavior>().AddTalent(champion);

            var behavior = this.playerThing.Behaviors.FindFirst <TalentsBehavior>();

            Verify.IsTrue(behavior.ManagedTalents.Contains(champion));
            Verify.IsNotNull(behavior.FindFirst <ChampionTalent>().PlayerThing);

            behavior.RemoveTalent(champion);
        }
Beispiel #3
0
        public void AddTalentWithRulesBeforeBehaviorParentSetTest()
        {
            var testBehavior     = new TalentsBehavior(null);
            var warriorAttribute = new WarriorAttribute();
            var rogueAttribute   = new RogueAttribute();
            var mageAttribute    = new MageAttribute();
            var damageStat       = new DamageStat();
            var attackStat       = new AttackStat();

            warriorAttribute.Parent = this.playerThing;
            playerThing.AddAttribute(warriorAttribute);

            mageAttribute.Parent = this.playerThing;
            playerThing.AddAttribute(rogueAttribute);

            rogueAttribute.Parent = this.playerThing;
            playerThing.AddAttribute(mageAttribute);

            warriorAttribute.SetValue(10, playerThing);
            rogueAttribute.SetValue(10, playerThing);
            mageAttribute.SetValue(10, playerThing);

            playerThing.Stats.Add(damageStat.Name, damageStat);
            playerThing.Stats.Add(attackStat.Name, attackStat);

            var testTalent = new ChampionTalent();

            playerThing.Behaviors.Add(testBehavior);

            var behavior = playerThing.Behaviors.FindFirst <TalentsBehavior>();

            behavior.AddTalent(testTalent);

            Verify.IsTrue(behavior.ManagedTalents.Contains(testTalent));
            Verify.IsNotNull(testTalent.PlayerThing);

            behavior.RemoveTalent(testTalent);

            playerThing.Behaviors.Remove(testBehavior);
        }
Beispiel #4
0
        public void TestChampionTalentAutosetRule()
        {
            var champion = new ChampionTalent();

            var behavior = this.playerThing.Behaviors.FindFirst <TalentsBehavior>();

            var attackStat     = this.playerThing.FindGameStat("Attack");
            int oldAttackValue = attackStat.Value;

            var damageStat     = this.playerThing.FindGameStat("Damage");
            int oldDamageValue = damageStat.Value;

            behavior.AddTalent(champion);

            Verify.AreNotEqual(oldAttackValue, attackStat.Value);
            Verify.AreNotEqual(oldDamageValue, damageStat.Value);

            behavior.RemoveTalent(champion);

            Verify.AreEqual(oldAttackValue, attackStat.Value);
            Verify.AreEqual(oldDamageValue, damageStat.Value);
        }
        public void TestChampionTalentAutosetRule()
        {
            var champion = new ChampionTalent();

            var behavior = this.playerThing.Behaviors.FindFirst<TalentsBehavior>();

            var attackStat = this.playerThing.FindGameStat("Attack");
            int oldAttackValue = attackStat.Value;

            var damageStat = this.playerThing.FindGameStat("Damage");
            int oldDamageValue = damageStat.Value;

            behavior.AddTalent(champion);

            Verify.AreNotEqual(oldAttackValue, attackStat.Value);
            Verify.AreNotEqual(oldDamageValue, damageStat.Value);

            behavior.RemoveTalent(champion);

            Verify.AreEqual(oldAttackValue, attackStat.Value);
            Verify.AreEqual(oldDamageValue, damageStat.Value);
        }
        public void AddBehaviorBeforeTalentWithRulesParentSetTest()
        {
            var testBehavior = new TalentsBehavior(null);
            var warriorAttribute = new WarriorAttribute();
            var rogueAttribute = new RogueAttribute();
            var mageAttribute = new MageAttribute();
            var damageStat = new DamageStat();
            var attackStat = new AttackStat();

            warriorAttribute.Parent = this.playerThing;
            playerThing.AddAttribute(warriorAttribute);

            mageAttribute.Parent = this.playerThing;
            playerThing.AddAttribute(rogueAttribute);

            rogueAttribute.Parent = this.playerThing;
            playerThing.AddAttribute(mageAttribute);

            warriorAttribute.SetValue(10, playerThing);
            rogueAttribute.SetValue(10, playerThing);
            mageAttribute.SetValue(10, playerThing);

            playerThing.Stats.Add(damageStat.Name, damageStat);
            playerThing.Stats.Add(attackStat.Name, attackStat);

            var testTalent = new ChampionTalent();

            playerThing.Behaviors.Add(testBehavior);

            var behavior = playerThing.Behaviors.FindFirst<TalentsBehavior>();

            testBehavior.AddTalent(testTalent);

            Verify.IsTrue(behavior.ManagedTalents.Contains(testTalent));
            Verify.IsNotNull(testTalent.PlayerThing);

            behavior.RemoveTalent(testTalent);

            playerThing.Behaviors.Remove(testBehavior);
        }