Пример #1
0
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (BlocksGoal == 0)
            {
                return(1);
            }

            var itemsPlaced = 0;

            foreach (var p in colony.Owners)
            {
                var ps = PlayerState.GetPlayerState(p);

                if (ps.ItemsPlaced.TryGetValue(ItemId.GetItemId(BlockName), out itemsPlaced) && itemsPlaced > 0)
                {
                    break;
                }
            }

            if (itemsPlaced == 0)
            {
                return(0);
            }
            else if (itemsPlaced == BlocksGoal)
            {
                return(1);
            }
            else
            {
                return(itemsPlaced / BlocksGoal);
            }
        }
Пример #2
0
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (GoalCount == 0)
            {
                return(1);
            }

            var jobs = colony.GetJobCounts();

            if (jobs.TryGetValue(NpcTypeKey, out var counts))
            {
                if (counts.TakenCount == 0)
                {
                    return(0);
                }

                if (counts.TakenCount == GoalCount)
                {
                    return(1);
                }
                else
                {
                    return(counts.TakenCount / GoalCount);
                }
            }
            else
            {
                return(0);
            }
        }
Пример #3
0
        public void Load(JObject node, IPandaQuest quest, Colony colony)
        {
            if (!CurrentCraftCount.ContainsKey(colony.ColonyID))
            {
                CurrentCraftCount[colony.ColonyID] = 0;
            }

            CurrentCraftCount = node.ToObject <Dictionary <int, int> >();
        }
Пример #4
0
        public bool MeetsPrerequisite(IPandaQuest quest, Colony colony)
        {
            if (!QuestingSystem.QuestPool.ContainsKey(QuestKey))
            {
                return(true);
            }

            return(QuestingSystem.CompletedQuests.TryGetValue(colony, out var quests) && quests.Contains(QuestKey));
        }
Пример #5
0
        public JObject Save(IPandaQuest quest, Colony colony)
        {
            if (!CurrentCraftCount.ContainsKey(colony.ColonyID))
            {
                CurrentCraftCount[colony.ColonyID] = 0;
            }

            return(JObject.FromObject(CurrentCraftCount));
        }
Пример #6
0
 public string GetPrerequisiteText(IPandaQuest quest, Colony colony, Players.Player player)
 {
     if (QuestingSystem.QuestPool.TryGetValue(QuestKey, out var requiredQuest))
     {
         return(string.Format(QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), requiredQuest.GetQuestTitle(colony, player)));
     }
     else
     {
         return(string.Format(QuestingSystem.LocalizationHelper.LocalizeOrDefault("QuestNotFound", player), QuestKey));
     }
 }
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);

            if (formatStr.Count(c => c == '{') == 2)
            {
                return(string.Format(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), StorageFactory.DefaultMax[colony], GoalCount));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #8
0
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);

            if (formatStr.Count(c => c == '{') == 2)
            {
                return(string.Format(formatStr, colony.BedTracker.BedCount, BedCount));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #9
0
        public string GetRewardText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);

            if (formatStr.Count(c => c == '{') == 1)
            {
                return(string.Format(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), Localization.GetSentence(player.LastKnownLocale, NPCType)));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #10
0
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);

            if (formatStr.Count(c => c == '{') == 3)
            {
                return(string.Format(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), colony.Stockpile.TotalFood, GoalCount));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #11
0
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);

            if (formatStr.Count(c => c == '{') == 2)
            {
                return(string.Format(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), colony.FollowerCount, ColonistGoal));
            }
            else
            {
                return(formatStr);
            }
        }
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (GoalCount == 0)
            {
                return(1);
            }

            if (!StorageFactory.DefaultMax.TryGetValue(colony, out var curMax) || curMax == 0)
            {
                return(0);
            }

            return(curMax / GoalCount);
        }
Пример #13
0
        public string GetRewardText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);
            var item      = ItemId.GetItemId(RecipeKey);

            if (formatStr.Count(c => c == '{') == 1)
            {
                return(string.Format(QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), LocalizationHelper.LocalizeOrDefault(RecipeKey, player)));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #14
0
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (!CurrentCraftCount.ContainsKey(colony.ColonyID))
            {
                CurrentCraftCount[colony.ColonyID] = 0;
            }

            if (CurrentCraftCount[colony.ColonyID] != 0)
            {
                return(CurrentCraftCount[colony.ColonyID] / CraftCount);
            }
            else
            {
                return(1);
            }
        }
Пример #15
0
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr   = LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);
            var ps          = PlayerState.GetPlayerState(player);
            var itemsPlaced = 0;

            ps.ItemsPlaced.TryGetValue(ItemId.GetItemId(BlockName), out itemsPlaced);

            if (formatStr.Count(c => c == '{') == 3)
            {
                return(string.Format(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), itemsPlaced, BlocksGoal, BlockName));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #16
0
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            if (!CurrentCraftCount.ContainsKey(colony.ColonyID))
            {
                CurrentCraftCount[colony.ColonyID] = 0;
            }

            var formatStr = LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);

            if (formatStr.Count(c => c == '{') == 3)
            {
                return(string.Format(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), CurrentCraftCount[colony.ColonyID], CraftCount, LocalizationHelper.LocalizeOrDefault(Item, player)));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #17
0
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (BedCount == 0)
            {
                return(1);
            }

            if (colony.BedTracker.BedCount == 0)
            {
                return(0);
            }
            else if (colony.BedTracker.BedCount == BedCount)
            {
                return(1);
            }
            else
            {
                return(colony.BedTracker.BedCount / BedCount);
            }
        }
Пример #18
0
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);
            var jobs      = colony.GetJobCounts();
            var jobCount  = 0;

            if (jobs.TryGetValue(NpcTypeKey, out var counts))
            {
                jobCount = counts.TakenCount;
            }

            if (formatStr.Count(c => c == '{') == 3)
            {
                return(string.Format(QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), jobCount, GoalCount, LocalizationHelper.LocalizeOrDefault(NpcTypeKey, player)));
            }
            else
            {
                return(formatStr);
            }
        }
Пример #19
0
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (GoalCount == 0)
            {
                return(1);
            }

            if (colony.Stockpile.TotalFood == GoalCount)
            {
                return(1);
            }
            else if (colony.Stockpile.TotalFood == 0)
            {
                return(0);
            }
            else
            {
                return(colony.Stockpile.TotalFood / GoalCount);
            }
        }
        public string GetObjectiveProgressText(IPandaQuest quest, Colony colony, Players.Player player)
        {
            var formatStr = QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player);
            int itemCount = 0;
            var item      = ItemId.GetItemId(ItemName);

            if (colony.Stockpile.Contains(item))
            {
                itemCount = colony.Stockpile.Items[item];
            }

            if (formatStr.Count(c => c == '{') == 3)
            {
                return(string.Format(QuestingSystem.LocalizationHelper.LocalizeOrDefault(LocalizationKey, player), itemCount, GoalCount, LocalizationHelper.LocalizeOrDefault(ItemName, player)));
            }
            else
            {
                return(formatStr);
            }
        }
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (ColonistGoal == 0)
            {
                return(1);
            }

            if (colony.FollowerCount == 0)
            {
                return(0);
            }
            else if (colony.FollowerCount == ColonistGoal)
            {
                return(1);
            }
            else
            {
                return(colony.FollowerCount / ColonistGoal);
            }
        }
Пример #22
0
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (GoalCount == 0)
            {
                return(1);
            }

            var total = colony.Stockpile.TotalMeals;

            if (total == GoalCount)
            {
                return(1);
            }
            else if (total == 0)
            {
                return(0);
            }
            else
            {
                return(total / GoalCount);
            }
        }
        public float GetProgress(IPandaQuest quest, Colony colony)
        {
            if (GoalCount == 0)
            {
                return(1);
            }

            var item      = ItemId.GetItemId(ItemName);
            int itemCount = 0;

            if (colony.Stockpile.Contains(item))
            {
                itemCount = colony.Stockpile.Items[item];
            }

            if (itemCount == 0)
            {
                return(0);
            }

            return(itemCount / GoalCount);
        }
Пример #24
0
 public void IssueReward(IPandaQuest quest, Colony colony)
 {
     colony.RecipeData.UnlockPartial(Recipe);
 }
Пример #25
0
 public bool MeetsPrerequisite(IPandaQuest quest, Colony colony)
 {
     return(colony.ScienceData.CompletedScience.Contains(new Science.ScienceKey(ScienceKey)));
 }
Пример #26
0
 public void IssueReward(IPandaQuest quest, Colony colony)
 {
 }
 public JObject Save(IPandaQuest quest, Colony colony)
 {
     return(null);
 }
 public void Load(JObject node, IPandaQuest quest, Colony colony)
 {
 }
Пример #29
0
 public string GetRewardText(IPandaQuest quest, Colony colony, Players.Player player)
 {
     return(LocalizationHelper.LocalizeOrDefault(LocalizationKey, player));
 }
Пример #30
0
        public void IssueReward(IPandaQuest quest, Colony colony)
        {
            var colonystate = ColonyState.GetColonyState(colony);

            colonystate.Stats[nameof(TimePeriod)] = (double)TimePeriod;
        }