Exemplo n.º 1
0
        public bool CheckIfComplete(IQuestInfo questData, ICompletionArgs completion)
        {
            int goal = int.Parse(this.Trigger.ToString());
            var ps   = this.GameMaster.Data.GetPlayerState();

            return(ps.recruited.Count >= goal);
        }
Exemplo n.º 2
0
 public void UpdateObjective(IQuestInfo questData, ref string objective)
 {
     if (this.RequiredCount > 1)
     {
         objective = $"{this.Objective} ({this.collectedCount.Value}/{this.RequiredCount})";
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Adds the quest.
 /// </summary>
 /// <param name="questInfo">The quest information.</param>
 public void AddQuest(IQuestInfo questInfo)
 {
     // TODO: Change QuestId to ushort
     AddUInt16((ushort)questInfo.QuestId);
     AddString(questInfo.Quest.Name);
     AddBoolean(questInfo.IsComplete);
 }
Exemplo n.º 4
0
        public virtual void UpdateObjective(IQuestInfo questData, ref string objective)
        {
            if (this.ItemsSold.Value == 0)
            {
                objective = this.Objective;
            }
            else
            {
                string itemName = Game1.objectInformation[this.ItemToSellIndex].Split('/')[4];

                objective = $"{this.ItemsSold.Value}/{this.Count} {itemName} sold.";
            }
        }
Exemplo n.º 5
0
        public bool CheckIfComplete(IQuestInfo questData, ICompletionArgs completion)
        {
            if (questData.VanillaQuest.completed.Value || completion.String != "money" || completion.Number1 <= 0)
            {
                return(false);
            }

            this.Earned.Value += completion.Number1;

            if (this.Earned.Value >= this.Goal)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
        public virtual bool CheckIfComplete(IQuestInfo questData, ICompletionArgs completion)
        {
            if (questData.VanillaQuest.completed.Value ||
                completion.String != "sell" ||
                completion.Item?.ParentSheetIndex != this.ItemToSellIndex ||
                completion.Number1 <= 0)
            {
                return(false);
            }

            this.ItemsSold.Value += completion.Number1;

            if (this.ItemsSold.Value >= this.Count)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 7
0
        public bool CheckIfComplete(IQuestInfo questData, ICompletionArgs completion)
        {
            if (questData.VanillaQuest.completed.Value)
                return false;

            if (this.TalkTo != null && completion.Npc != null && completion.Npc.isVillager() && this.TalkTo == completion.Npc.Name)
            {
                if (!string.IsNullOrEmpty(this.ReactionText))
                {
                    completion.Npc.CurrentDialogue.Push(new Dialogue(this.ReactionText, completion.Npc));
                    Game1.drawDialogue(completion.Npc);
                }

                if (Game1.activeClickableMenu is DialogueBox && Game1.currentSpeaker == completion.Npc)
                {
                    questData.VanillaQuest.questComplete();

                    return true;
                }
            }

            return false;
        }
Exemplo n.º 8
0
 public void UpdateTitle(IQuestInfo questData, ref string title)
 {
 }
Exemplo n.º 9
0
        public void UpdateObjective(IQuestInfo questData, ref string objective)
        {
            var ps = this.GameMaster.Data.GetPlayerState();

            objective = this.ContentLoader.LoadString($"Strings/Strings:questObjective.recruitment", ps.recruited.Count, this.Trigger);
        }
Exemplo n.º 10
0
 public void UpdateDescription(IQuestInfo questData, ref string description)
 {
 }
Exemplo n.º 11
0
 private void OnAccepted(object sender, IQuestInfo e)
 {
     this._taskRegistrationDirty = true;
 }
Exemplo n.º 12
0
 public void UpdateObjective(IQuestInfo questData, ref string objective)
 {
 }
Exemplo n.º 13
0
 public void UpdateObjective(IQuestInfo questData, ref string objective)
 {
     objective = $"{this.Goal - this.Earned.Value}g remains to earn.";
 }