示例#1
0
    void Start()
    {
        _moduleId = _moduleIdCounter++;
        _curPos   = Enumerable.Range(0, 9 * 9).Where(i => _grid[i] >= 10).Except(new[] { 13, 37, 40, 43, 67, 39, 41, 31, 49 }).PickRandom();
        Debug.LogFormat("[Cursed Double-Oh #{1}] Start number is {0:00}.", _grid[_curPos], _moduleId);
        visitedNumbers.Add(_grid[_curPos]);
        _functions        = new ButtonFunction[5];
        _tempfunctions[0] = Rnd.Range(0, 2) == 0 ? ButtonFunction.SmallLeft : ButtonFunction.SmallRight;
        _tempfunctions[1] = Rnd.Range(0, 2) == 0 ? ButtonFunction.SmallUp : ButtonFunction.SmallDown;
        _tempfunctions[2] = Rnd.Range(0, 2) == 0 ? ButtonFunction.LargeLeft : ButtonFunction.LargeRight;
        _tempfunctions[3] = Rnd.Range(0, 2) == 0 ? ButtonFunction.LargeUp : ButtonFunction.LargeDown;
        _tempfunctions.Shuffle();
        _functions[0] = _tempfunctions[0];
        _functions[1] = _tempfunctions[1];
        _functions[2] = _tempfunctions[2];
        _functions[3] = _tempfunctions[3];
        _functions[4] = ButtonFunction.Submit;

        var sounds = Enumerable.Range(1, 4).Select(i => "DoubleOPress" + i).ToList().Shuffle();

        sounds.Insert(Array.IndexOf(_functions, ButtonFunction.Submit), null);
        _sounds = sounds.ToArray();

        _isSolved = false;

        for (int i = 0; i < Buttons.Length; i++)
        {
            Buttons[i].OnInteract += GetButtonHandler(i);
        }
        StartCoroutine(Coroutine());

        FakeStatusLight = Instantiate(FakeStatusLight);
        FakeStatusLight.GetStatusLights(transform);
        FakeStatusLight.Module = Module;
    }
    // Use this for initialization
    void Start()
    {
        moduleID++; thisModuleID = moduleID;
        CurrentNote  = GenerateNote(); Answer = 0;
        CurrentStage = 0;
        RefAvailable = true;
        NumStrikes   = 0;
        RedNotes     = new bool[NoteNames.Length];
        for (int i = 0; i < RedNotes.Length; i++)
        {
            RedNotes[i] = false;
        }
        IsSolved = false;

        PlayButton.OnInteract     += delegate { HandlePress(0); return(false); };
        ReferencePitch.OnInteract += delegate { HandlePress(1); return(false); };
        CycleFlat.OnInteract      += delegate { HandlePress(2); return(false); };
        CycleSharp.OnInteract     += delegate { HandlePress(3); return(false); };
        SubmitButton.OnInteract   += delegate { HandlePress(4); return(false); };

        PPModule.OnPass += delegate {
            SolveAudio.Play();
            IsSolved = true;
            return(true);
        };

        Light = Instantiate(Light);
        Light.GetStatusLights(PPModule.GetComponent <Transform>());
        Light.Module = PPModule;
    }
示例#3
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());
    }
示例#4
0
    //Loading screen
    void Start()
    {
        _moduleId          = _moduleIdCounter++;
        Module.OnActivate += Activate;
        Init();

        FakeStatusLight = Instantiate(FakeStatusLight);
        FakeStatusLight.GetStatusLights(transform);
        FakeStatusLight.Module = Module;
    }
示例#5
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());
    }
示例#7
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();
    }
示例#8
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();
            }
        };
    }