示例#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();
        }