예제 #1
0
        public void CompleteKillQuestTest()
        {
            IQuest quest = new QuestKill(1, "Welcome", "First Quest", itemReward, statReward, enemy_0, 5);

            quest.AcceptQuest(hero);

            Assert.AreEqual(true, quest.Active);
            Assert.AreEqual(false, quest.IsComplete());

            hero.Attack(enemy_0);
            hero.Attack(enemy_1);
            hero.Attack(enemy_2);
            hero.Attack(enemy_3);
            hero.Attack(enemy_4);

            Assert.AreEqual($"Kill Orc: 5/5", quest.GetConditions());
            Assert.AreEqual(true, hero.CompleteQuest(quest));

            Assert.AreEqual(hero.Inventory.Items.Count, 1);
            Assert.AreEqual(110f, ((RegenerationStat)hero.GetStat(StatType.Health)).MaxValue);
            Assert.AreEqual(105f, ((RegenerationStat)hero.GetStat(StatType.Energy)).MaxValue);
            Assert.AreEqual(105f, ((RegenerationStat)hero.GetStat(StatType.Stamina)).MaxValue);
            Assert.AreEqual(32f, hero.GetStat(StatType.Intelligence).Value);
            Assert.AreEqual(51f, hero.GetStat(StatType.Luck).Value);
        }
예제 #2
0
        public void AcceptKillQuestTest()
        {
            IQuest quest = new QuestKill(1, "Welcome", "First Quest", itemReward, statReward, enemy_0, 5);

            quest.AcceptQuest(hero);

            Assert.AreEqual(1, hero.QuestList.Count);
            Assert.AreEqual(true, quest.Active);
            Assert.AreEqual(false, quest.IsComplete());
            Assert.AreEqual($"Kill Orc: 0/5", quest.GetConditions());
        }
예제 #3
0
        public void AcceptManyQuestsTest()
        {
            IQuest quest_gather = new QuestGather(1, "Welcome part 2", "Second Quest", itemReward, statReward, item_0, 5);
            IQuest quest_kill   = new QuestKill(1, "Welcome part 1", "First Quest", itemReward, statReward, enemy_0, 5);

            quest_gather.AcceptQuest(hero);
            quest_kill.AcceptQuest(hero);

            Assert.AreEqual(2, hero.QuestList.Count);
            Assert.AreEqual(true, quest_gather.Active);
            Assert.AreEqual(true, quest_kill.Active);
        }
예제 #4
0
        public void UpdateKillQuestTest()
        {
            IQuest quest = new QuestKill(1, "Welcome", "First Quest", itemReward, statReward, enemy_0, 5);

            quest.AcceptQuest(hero);

            Assert.AreEqual(true, quest.Active);
            Assert.AreEqual(false, quest.IsComplete());

            hero.Attack(enemy_0);
            Assert.AreEqual($"Kill Orc: 1/5", quest.GetConditions());
            hero.Attack(enemy_1);
            Assert.AreEqual($"Kill Orc: 2/5", quest.GetConditions());
            hero.Attack(enemy_2);
            Assert.AreEqual($"Kill Orc: 3/5", quest.GetConditions());
            hero.Attack(enemy_3);
            Assert.AreEqual($"Kill Orc: 4/5", quest.GetConditions());

            Assert.AreEqual(false, hero.CompleteQuest(quest));
        }