Exemplo n.º 1
0
        public void WillNotChoseNonOwnedSkill()
        {
            CharacterBehavior characterBehavior = CreateTestsBehavior(new BehaviorSkill[] { new BehaviorSkill("Heal"), new BehaviorSkill("Damage") });
            GameState         state             = CreateTestState(new Skill[] { Factory.DamageSkill });

            TargettedSkill targettedSkill = characterBehavior.Act(state, CharacterResolver.Create(state.Party[0], state));

            Assert.Equal("Damage", targettedSkill.Skill.CosmeticName);
        }
Exemplo n.º 2
0
        public void WillChooseReasonableDamageTarget()
        {
            CharacterBehavior characterBehavior = CreateTestsBehavior(new BehaviorSkill[] { new BehaviorSkill("Damage") });
            GameState         state             = CreateMultiTargetTestState(new Skill[] { Factory.DamageSkill });

            TargettedSkill targettedSkill = characterBehavior.Act(state, CharacterResolver.Create(state.Party[0], state));

            Assert.Equal("Damage", targettedSkill.Skill.CosmeticName);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.InvokerID);
            Assert.Equal(state.Enemies[1].ID, targettedSkill.TargetInfo.TargetID);
        }
Exemplo n.º 3
0
        public void AcceptsSkillWithCosmeticName()
        {
            CharacterBehavior characterBehavior = CreateTestsBehavior(new BehaviorSkill[] { new BehaviorSkill("Damage") });
            GameState         state             = CreateMultiTargetTestState(new Skill[] { new Skill(IDs.Next(), "Scratch", "Damage", Factory.DamageAction, true, 0, 0) });

            TargettedSkill targettedSkill = characterBehavior.Act(state, CharacterResolver.Create(state.Party[0], state));

            Assert.Equal("Scratch", targettedSkill.Skill.CosmeticName);
            Assert.Equal("Damage", targettedSkill.Skill.SkillName);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.InvokerID);
            Assert.Equal(state.Enemies[1].ID, targettedSkill.TargetInfo.TargetID);
        }
Exemplo n.º 4
0
        public void WillOverrideWhenCondition()
        {
            CharacterBehavior characterBehavior = CreateTestsBehavior(new BehaviorSkill[] { new BehaviorSkill("Damage"), new BehaviorSkill("Heal", GameCondition.PartyHealthLow) });
            GameState         state             = CreateTestState(new Skill[] { Factory.DamageSkill, Factory.HealSkill });

            state = state.UpdateCharacter(state.Party[0].WithHealth(new Health(1, 10)));

            TargettedSkill targettedSkill = characterBehavior.Act(state, CharacterResolver.Create(state.Party[0], state));

            Assert.Equal("Heal", targettedSkill.Skill.CosmeticName);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.InvokerID);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.TargetID);
        }
Exemplo n.º 5
0
        public void WillChooseFirstAvailableSkill()
        {
            CharacterBehavior characterBehavior = CreateTestsBehavior(new BehaviorSkill [] { new BehaviorSkill("Damage"), new BehaviorSkill("Heal") });
            GameState         state             = CreateTestState(new Skill [] { Factory.DamageSkill, Factory.HealSkill });

            TargettedSkill targettedSkill = characterBehavior.Act(state, CharacterResolver.Create(state.Party[0], state));

            Assert.Equal("Damage", targettedSkill.Skill.CosmeticName);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.InvokerID);
            Assert.Equal(state.Enemies[0].ID, targettedSkill.TargetInfo.TargetID);

            state          = state.UpdateCharacter(state.Party[0].WithUpdatedSkill(state.Party[0].Skills[0].WithAvailable(false)));
            targettedSkill = characterBehavior.Act(state, CharacterResolver.Create(state.Party[0], state));
            Assert.Equal("Heal", targettedSkill.Skill.CosmeticName);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.InvokerID);
            Assert.Equal(state.Party[0].ID, targettedSkill.TargetInfo.TargetID);
        }