示例#1
0
    // Use this for initialization
    // ReSharper disable once UnusedMember.Local
    private void Start()
    {
        StartCoroutine(TwitchPlays.Refresh());
        _modSettings = new ModSettings(BombModule);
        _modSettings.ReadSettings();
        _movements = gameObject.AddComponent <CoroutineQueue>();
        BombModule.GenerateLogFriendlyName();

        Locations.Shuffle();
        SetMaze(0); //Hide the walls now.

        BombModule.OnActivate += Activate;
        FakeStatusLight        = Instantiate(FakeStatusLight);

        if (BombModule != null)
        {
            FakeStatusLight.Module = BombModule;
        }

        FakeStatusLight.PassColor          = _modSettings.Settings.SolvedState;
        FakeStatusLight.FailColor          = _modSettings.Settings.StrikeState;
        FakeStatusLight.OffColor           = _modSettings.Settings.OffState;
        FakeStatusLight.MorseTransmitColor = _modSettings.Settings.MorseXmitState;


        FakeStatusLight.GetStatusLights(StatusLight);
        FakeStatusLight.SetInActive();

        _currentLocation = Locations[0];
        _destination     = Locations[1];
        StartCoroutine(MoveStatusLightToStart());
    }
示例#2
0
 void Start()
 {
     DistractionPicker = UnityEngine.Random.Range(0, Distractions.Count());
     FakeStatusLight   = Instantiate(FakeStatusLight);
     FakeStatusLight.transform.SetParent(transform, false);
     if (GetComponent <KMBombModule>() != null)
     {
         FakeStatusLight.Module = GetComponent <KMBombModule>();
     }
     FakeStatusLight.GetStatusLights(StatusLight);
     FakeStatusLight.SetInActive();
 }
    // Use this for initialization
    private void Start()
    {
        MorseAMazeRuleGenerator.GenerateRules(RuleSeed.GetRNG());
        StartCoroutine(TwitchPlays.Refresh());
        _modSettings = new ModSettings(BombModule);
        _modSettings.ReadSettings();
        BombModule.GenerateLogFriendlyName();

        Locations.Shuffle();
        SetMaze(0); //Hide the walls now.

        BombModule.OnActivate += Activate;
        FakeStatusLight        = Instantiate(FakeStatusLight);
        FakeStatusLight.transform.SetParent(transform, false);

        if (BombModule != null)
        {
            FakeStatusLight.Module = BombModule;
        }

        EnableColorblindMode(GetComponent <KMColorblindMode>().ColorblindModeActive);


        FakeStatusLight.GetStatusLights(StatusLight);
        FakeStatusLight.SetInActive();

        _currentLocation = Locations[0];
        _destination     = Locations[1];
        StartCoroutine(MoveStatusLightToStart());

        var pass   = _forcedSolvePassword.ToList();
        var offset = 0;

        foreach (var c in BombInfo.GetSerialNumber())
        {
            if (c >= 'A' && c <= 'Z')
            {
                pass.Insert(c - 'A' + offset + 1, c);
            }
            else
            {
                pass.Insert(c - '0' + offset, c);
            }
            offset += 5;
        }
        _forcedSolvePassword = string.Join("", pass.Select(x => x.ToString()).ToArray());
    }
示例#4
0
    void Start()
    {
        if (Colorblind.ColorblindModeActive)
        {
            ToggleCB();
        }
        DistractionPicker = UnityEngine.Random.Range(0, Distractions.Count());
        //DistractionPicker = Distractions.Count - 1; //Debug line
        FakeStatusLight = Instantiate(FakeStatusLight);
        FakeStatusLight.transform.SetParent(transform, false);
        if (GetComponent <KMBombModule>() != null)
        {
            FakeStatusLight.Module = GetComponent <KMBombModule>();
        }
        FakeStatusLight.GetStatusLights(StatusLight);
        FakeStatusLight.SetInActive();

        GetColorOrder();
    }
示例#5
0
    void Start()
    {
        _colorblind = ColorblindMode.ColorblindModeActive;
        if (_colorblind)
        {
            ColorblindTextObject.SetActive(true);
        }
        if (_ignoredModules == null)
        {
            _ignoredModules = BossHandler.GetIgnoredModules("The Twin", new string[] {
                "14",
                "Cruel Purgatory",
                "Forget Enigma",
                "Forget Everything",
                "Forget It Not",
                "Forget Me Later",
                "Forget Me Not",
                "Forget Perspective",
                "Forget The Color",
                "Forget Them All",
                "Forget This",
                "Forget Us Not",
                "Organization",
                "Purgatory",
                "RPS Judging",
                "Simon's Stages",
                "Souvenir",
                "Tallordered Keys",
                "The Time Keeper",
                "Timing is Everything",
                "The Troll",
                "The Twin",
                "Turn The Key",
                "Übermodule",
                "Ültimate Custom Night",
                "The Very Annoying Button"
            });
        }
        for (int index = 0; index < ButtonObjects.Length; index++)
        {
            int j = index;
            _isPressed[j] = false;
            ButtonSelectables[index].OnInteract += delegate() { PressButton(j); return(false); };
        }

        FakeStatusLight = Instantiate(FakeStatusLight);
        FakeStatusLight.transform.SetParent(transform, false);
        if (Module != null)
        {
            FakeStatusLight.Module = Module;
        }

        FakeStatusLight.GetStatusLights(StatusLight);
        FakeStatusLight.SetInActive();

        var serialNumber = Info.GetSerialNumber();

        if (!_TheTwinInfos.ContainsKey(serialNumber))
        {
            _TheTwinInfos[serialNumber] = new TheTwinBombInfo();
        }
        _TheTwinInfo = _TheTwinInfos[serialNumber];
        _TheTwinInfo.Modules.Add(this);
        _modulePairId = (_TheTwinInfo.Modules.Count() + 1) / 2;
        Debug.LogFormat("[The Twin #{0}] The pair ID is {1}.", _moduleId, _modulePairId);
        if (_TheTwinInfo.Modules.Count() % 2 == 0)
        {
            ModuleObject.transform.localScale      = new Vector3(-1f, 1f, 1f);
            ScreensAndButtons.transform.localScale = new Vector3(-1f, 1f, 1f);
            Vector3 position = StatusLight.localPosition;
            position.x *= -1;
            StatusLight.localPosition = position;
            UpdateSelectable();
        }
        UpdatePairIdScreen(_modulePairId);

        _startingNumber = Rnd.Range(0, 100);
        Debug.LogFormat("[The Twin #{0}] The initial number is {1}.", _moduleId, _startingNumber);
        _stageZeroScreenNumber = _startingNumber;
        UpdateStageScreen("--");
        _startingCoordinate[0] = Rnd.Range(0, 12);
        _startingCoordinate[1] = Rnd.Range(0, 10);
        Debug.LogFormat("[The Twin #{0}] The starting coordinate in remove table is ({1}, {2}).", _moduleId, _startingCoordinate[0], _startingCoordinate[1]);
        _currentCoordinate[0]           = _startingCoordinate[0];
        _currentCoordinate[1]           = _startingCoordinate[1];
        _removeSet                      = _removeGrid[_startingCoordinate[1]][_startingCoordinate[0]];
        _startingColorGridCoordinate[0] = _startingCoordinate[0] % 6;
        _startingColorGridCoordinate[1] = _startingCoordinate[1] % 5;
        Debug.LogFormat("[The Twin #{0}] The starting coordinate in color table is ({1}, {2}).", _moduleId, _startingColorGridCoordinate[0], _startingColorGridCoordinate[1]);
        _currentColorGridCoordinate[0] = _startingColorGridCoordinate[0];
        _currentColorGridCoordinate[1] = _startingColorGridCoordinate[1];

        Module.OnActivate += delegate()
        {
            _totalStages = Math.Min(Info.GetSolvableModuleNames().Where(a => !_ignoredModules.Contains(a)).ToList().Count, 101);
            Debug.LogFormat("[The Twin #{0}] There are {1} non-ignored modules.", _moduleId, _totalStages);
            if (_totalStages < 2)
            {
                Debug.LogFormat("[The Twin #{0}] Too few non-ignored modules. Solving the module.", _moduleId);
                _autoSolved   = true;
                _moduleSolved = true;
            }
            else
            {
                _isActivated    = true;
                _sequenceLength = 2 * (_totalStages - 1);
                Debug.LogFormat("[The Twin #{0}] The initial remove set is {1}.", _moduleId, _removeSet);
                Generate();
            }
        };
    }
示例#6
0
    IEnumerator reset(float time)
    {
        for (float i = time; i < 80f; i++)
        {
            timeRatio = i / 80f;
            barControl.gameObject.transform.localScale = new Vector3(timeRatio, 0.01f, 0.01f);

            for (int e = timeEvents.Count - 1; e >= 0; e--)
            {
                if (e < 0)
                {
                    break;
                }

                if ((float)timeEventsTimes[e] <= timeRatio)
                {
                    if ((string)timeEvents[e] == "FakeSolve")
                    {
                        FakeStatusLight.SetInActive();
                        currentStatusLightState = StatusLightState.Off;
                    }

                    if ((string)timeEvents[e] == "Swap 0")
                    {
                        planetSwap(0, false);
                    }

                    if ((string)timeEvents[e] == "Swap 1")
                    {
                        planetSwap(1, false);
                    }

                    if ((string)timeEvents[e] == "Swap 2")
                    {
                        planetSwap(2, false);
                    }

                    if ((string)timeEvents[e] == "Swap 3")
                    {
                        planetSwap(3, false);
                    }

                    if ((string)timeEvents[e] == "Swap 4")
                    {
                        planetSwap(4, false);
                    }

                    if ((string)timeEvents[e] == "Swap 7")
                    {
                        reRender();
                    }

                    if ((string)timeEvents[e] == "Color Change From 1")
                    {
                        ChangeColor(1);
                    }

                    if ((string)timeEvents[e] == "Color Change From 2")
                    {
                        ChangeColor(2);
                    }

                    if ((string)timeEvents[e] == "Color Change From 3")
                    {
                        ChangeColor(3);
                    }

                    if ((string)timeEvents[e] == "Color Add")
                    {
                        barColor     = 0;
                        bar.material = barMats[0];
                    }

                    timeEvents.RemoveAt(e);
                    timeEventsTimes.RemoveAt(e);
                }
            }
            yield return(new WaitForSeconds(0.1f));
        }
        timeRatio = 1;
        barControl.gameObject.transform.localScale = new Vector3(1f, 0.01f, 0.01f);
        onTimerReset();
        yield return(null);
    }