Exemple #1
0
 public void Add(IEnumerable <string> items)
 {
     foreach (string item in items.Select(i => LogicManager.RemoveDuplicateSuffix(i)))
     {
         if (!LogicManager.progressionBitMask.TryGetValue(item, out (int, int)a))
         {
             RandomizerMod.Instance.LogWarn("Could not find progression value corresponding to: " + item);
             return;
         }
         obtained[a.Item2] |= a.Item1;
         if (temp)
         {
             tempItems.Add(item);
         }
         if (share)
         {
             Share(item);
         }
     }
     RecalculateGrubs();
     RecalculateEssence();
     RecalculateFlames();
     RecalculateEggs();
     UpdateWaypoints();
 }
        public void Add(string item)
        {
            item = LogicManager.RemoveDuplicateSuffix(item);
            if (!LogicManager.progressionBitMask.TryGetValue(item, out (int, int)a))
            {
                RandomizerMod.Instance.LogWarn("Could not find progression value corresponding to: " + item);
                return;
            }
            obtained[a.Item2] |= a.Item1;
            if (temp)
            {
                tempItems.Add(item);
            }
            if (share)
            {
                Share(item);
            }

            // Take into account root essence found; this should only ever happen during helper log generation
            if (RandomizerMod.Instance.Settings.RandomizeWhisperingRoots && concealRandom)
            {
                if (LogicManager.TryGetItemDef(item, out ReqDef itemDef))
                {
                    if (itemDef.pool == "Root")
                    {
                        randomEssence += itemDef.geo;
                    }
                }
            }

            RecalculateGrubs();
            RecalculateEssence();
            RecalculateFlames();
            UpdateWaypoints();
        }
Exemple #3
0
 public bool Has(string item)
 {
     item = LogicManager.RemoveDuplicateSuffix(item);
     if (!LogicManager.progressionBitMask.TryGetValue(item, out (int, int)a))
     {
         RandomizerMod.Instance.LogWarn("Could not find progression value corresponding to: " + item);
         return(false);
     }
     return((obtained[a.Item2] & a.Item1) == a.Item1);
 }
 public void Remove(string item)
 {
     item = LogicManager.RemoveDuplicateSuffix(item);
     if (!LogicManager.progressionBitMask.TryGetValue(item, out (int, int)a))
     {
         RandomizerMod.Instance.LogWarn("Could not find progression value corresponding to: " + item);
         return;
     }
     obtained[a.Item2] &= ~a.Item1;
     if (LogicManager.grubProgression.Contains(item))
     {
         RecalculateGrubs();
     }
     if (LogicManager.essenceProgression.Contains(item))
     {
         RecalculateEssence();
     }
 }