Example #1
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> >();
        }
Example #2
0
        public JObject Save(IPandaQuest quest, Colony colony)
        {
            if (!CurrentCraftCount.ContainsKey(colony.ColonyID))
            {
                CurrentCraftCount[colony.ColonyID] = 0;
            }

            return(JObject.FromObject(CurrentCraftCount));
        }
        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);
            }
        }
Example #4
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);
            }
        }