예제 #1
0
파일: Hero.cs 프로젝트: jsnelcer/RpgCore
        public bool CompleteQuest(IQuest quest)
        {
            bool result = quest.CompleteQuest(this);

            if (result)
            {
                switch (quest.Type)
                {
                case QuestType.Kill:
                    KillEnemy -= quest.UpdateQuest;
                    break;

                case QuestType.Delivery:
                    break;

                case QuestType.Gather:
                    PickItem -= quest.UpdateQuest;
                    break;

                case QuestType.Escort:
                    break;

                case QuestType.Craft:
                    CraftItem -= quest.UpdateQuest;
                    break;

                default:
                    break;
                }
            }

            return(result);
        }
예제 #2
0
        public void CompleteQuest(IEntity questor, IQuest quest, bool force = false)
        {
            if (!quest.CompleteQuest(questor, force))
            {
                return;
            }

            GlobalConstants.ActionLog.Log(questor + " completed " + quest.ID);
            this.EntityQuests[questor.Guid].Remove(quest);
            GlobalConstants.GameManager.ItemHandler.CleanUpRewards();
        }