Пример #1
0
        public IEnumerable <BingoVariant> RelevantVariants()
        {
            var checkpoint = BingoMonitor.AtCheckpoint();

            if (checkpoint == null)
            {
                yield break;
            }
            var area = SaveData.Instance.CurrentSession.Area;

            var seen = new HashSet <BingoVariant>();

            foreach (var square in Instance.Board)
            {
                if (!BingoMonitor.ObjectiveVariants.TryGetValue(square.Text, out var variants))
                {
                    continue;
                }

                foreach (var entry in variants)
                {
                    if ((entry.Item1 == area.ID || entry.Item1 == -1) &&
                        (entry.Item2 == (int)area.Mode || entry.Item2 == -1) &&
                        (entry.Item3 == checkpoint || entry.Item3 == -1) &&
                        !seen.Contains(entry.Item4))
                    {
                        seen.Add(entry.Item4);
                        yield return(entry.Item4);
                    }
                }
            }
        }
Пример #2
0
 private void OnExit(Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow)
 {
     foreach (BingoVariant variant in typeof(BingoVariant).GetEnumValues())
     {
         BingoMonitor.SetVariantEnabled(variant, false);
     }
 }
Пример #3
0
        private static void OnTransition(Level level, LevelData next, Vector2 direction)
        {
            var player = level.Tracker.GetEntity <Player>();
            var area   = level.Session.Area;
            var prev   = level.Session.MapData.GetAt(player.Position - direction * 16) ?? next;

            var checkpoint = BingoMonitor.IsCheckpointRoom(next.Name);

            UpdateOnCheckpoint(level.Session.Area, checkpoint);

            if (checkpoint == 2 && area == new AreaKey(3) && (BingoClient.Instance.ModSession.CheckpointStartedVariant ?? 2) < 2 && BingoMonitor.IsVariantEnabled(BingoVariant.NoGrab))
            {
                BingoClient.Instance.ModSaveData.AddFlag("grabless_huge_mess_with_heart");
            }

            switch (next.Name)
            {
            case "b-00c" when area == new AreaKey(6):
                BingoClient.Instance.ModSaveData.AddFlag("room:easteregg");
                break;

            case "09" when area == new AreaKey(6):     // 0
            case "11" when area == new AreaKey(6):     // 1
            case "13" when area == new AreaKey(6):     // 2
            case "15" when area == new AreaKey(6):     // 3
            case "17" when area == new AreaKey(6):     // 4
            case "19" when area == new AreaKey(6):     // 5
                var idx  = (int.Parse(next.Name) - 9) / 2;
                var from = prev.Name.EndsWith("b") ? "top" : "bottom";
                level.Session.SetFlag($"hollows:{idx}:{from}");
                if (new[] { "hollows:0:bottom", "hollows:1:bottom", "hollows:2:bottom", "hollows:3:bottom", "hollows:4:bottom", "hollows:5:bottom" }.All(f => level.Session.GetFlag(f)))
                {
                    BingoClient.Instance.ModSaveData.AddFlag("room:hollows:bottom");
                }
                if (new[] { "hollows:0:top", "hollows:1:top", "hollows:2:top", "hollows:3:top", "hollows:4:top", "hollows:5:top" }.All(f => level.Session.GetFlag(f)))
                {
                    BingoClient.Instance.ModSaveData.AddFlag("room:hollows:top");
                }
                break;

            case "d-00" when prev.Name == "c-10" && area == new AreaKey(4):
                BingoClient.Instance.ModSaveData.AddFlag("room:oldtrailsecret");
                break;

            case "h-05" when prev.Name == "h-04b" && area == new AreaKey(10):
                BingoClient.Instance.ModSaveData.AddFlag("room:determinationdemo");
                break;

            case "secret" when area == new AreaKey(8):
                BingoClient.Instance.ModSaveData.AddFlag("room:birdnest");
                break;

            case "g-00" when area == new AreaKey(7):
                level.Session.SetFlag("usedOrb", false);
                break;
            }
        }
Пример #4
0
        private static void OnComplete(Level level)
        {
            var checkpoint = BingoMonitor.CountCheckpoints(level.Session.Area);

            UpdateOnCheckpoint(level.Session.Area, checkpoint);

            if (level.Session.Area == new AreaKey(7) && !level.Session.GetFlag("usedOrb"))
            {
                BingoClient.Instance.ModSaveData.AddFlag("orbless_3000m");
            }
        }
Пример #5
0
        public static void UpdateOnCheckpoint(AreaKey area, int?checkpoint)
        {
            if (checkpoint == null || BingoClient.Instance.ModSession.CheckpointStartedVariant == null)
            {
                return;
            }

            if (BingoClient.Instance.ModSession.CheckpointStartedVariant < checkpoint)
            {
                foreach (var variant in BingoMonitor.EnabledVariants())
                {
                    BingoClient.Instance.ModSaveData.AddCheckpointVariant(area.ID, (int)area.Mode, checkpoint.Value - 1, variant);
                }
            }
        }
Пример #6
0
        public ObjectiveStatus GetObjectiveStatus(int i)
        {
            if (this.Board == null || this.Board.Count <= i || this.Board[i] == null || this.ObjectivesCompleted == null)
            {
                return(ObjectiveStatus.Nothing);
            }

            if (this.Board[i].Colors.Contains(this.ModSettings.PlayerColor) || (this.IsLockout && this.Board[i].Colors.Count != 0))
            {
                return(ObjectiveStatus.Claimed);
            }

            if (this.ObjectivesCompleted[i])
            {
                return(ObjectiveStatus.Completed);
            }

            if (SaveData.Instance == null)
            {
                return(ObjectiveStatus.Nothing);
            }

            if (!BingoMonitor.Objectives.ContainsKey(this.Board[i].Text))
            {
                return(ObjectiveStatus.Unknown);
            }

            var progress = BingoMonitor.ObjectiveProgress(this.Board[i].Text);

            if (progress < 0.001f)
            {
                return(ObjectiveStatus.Nothing);
            }

            if (progress > 0.999f)
            {
                return(ObjectiveStatus.Completed);
            }

            return(ObjectiveStatus.Progress);
        }