Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public GameState ApplyTargettedSkill(TargettedSkill skill, GameState state)
 {
     SkillsUsed.Add(skill.Skill);
     return(state);
 }