Пример #1
0
 /// <summary>
 /// Plays an in-game sound and/or custom sound.
 /// </summary>
 /// <param name="audio">The instance of audio, so that the sound can be played.</param>
 /// <param name="transform">The location of the sound.</param>
 /// <param name="customSound">The custom sound effect, which is ignored if null.</param>
 /// <param name="gameSound">The in-game sound effect, which is ignored if null.</param>
 internal static void PlaySound(this KMAudio audio, Transform transform, string customSound = null, KMSoundOverride.SoundEffect?gameSound = null)
 {
     if (customSound != null)
     {
         audio.PlaySoundAtTransform(customSound, transform);
     }
     if (gameSound != null)
     {
         audio.PlayGameSoundAtTransform((KMSoundOverride.SoundEffect)gameSound, transform);
     }
 }
Пример #2
0
 private IEnumerator ButtonPress(int pos)
 {
     Buttons[pos].AddInteractionPunch(0.5f);
     Audio.PlaySoundAtTransform("press", Buttons[pos].transform);
     for (int i = 0; i < 3; i++)
     {
         Buttons[pos].transform.localPosition -= new Vector3(0, 0.0025f, 0);
         yield return(new WaitForSeconds(0.01f));
     }
     if (!Solved)
     {
         Buttons[pos].GetComponent <MeshRenderer>().material = Mats[(NumsZeroToTwo.IndexOf(ButtonTexts[pos].text) + 1) % 3];
         ButtonTexts[pos].text = ((NumsZeroToTwo.IndexOf(ButtonTexts[pos].text) + 1) % 3).ToString();
     }
     for (int i = 0; i < 3; i++)
     {
         Buttons[pos].transform.localPosition += new Vector3(0, 0.0025f, 0);
         yield return(new WaitForSeconds(0.01f));
     }
 }
 void JoonPress()
 {
     Joon.AddInteractionPunch();
     Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, Joon.transform);
     if (ThatWasGreat[Sure] == (Ann * 3) + Need)
     {
         Audio.PlaySoundAtTransform("YouAreGreat", transform);
         if (SingleNote != 2)
         {
             SingleNote = 2;
             Debug.LogFormat("[English Entries #{0}] You submitted the correct frame, module disarmed. You are great!", moduleId);
         }
     }
     else
     {
         GetComponent <KMBombModule>().HandleStrike();
         Debug.LogFormat("[English Entries #{0}] You submitted the incorrect frame, strike. Kevin walks in on Ann playing the stringy paddle. She is no virtuoso. Kevin makes light of the fact by asking when her concert is. She replies with great sarcasm that it's 4 days away. Kevin is confused. Ever since that last binge, his short term memory has been shaken. He cannot remember what day it is, who he is talking to, or why. He suddenly regains consciousness, and tells Ann that it's Friday. She agrees out of a fear of being wrong. She is possibly more confused than him. She asks if he can come to her concert. She has a string she'd like to wrap around his neck, but she doesn't tell him this. He replies, sarcastically, that he'd love to. Even with the memory loss, he knows he would be stepping into a death trap. The tension is so thick, you could cut it, but only if you had a diamond blade saw, or the jaws of life. For reference, that is picture {1}. This is from episode {2}.", moduleId, ThatWasGreat[Sure], LogTitle[Sure / 3]);
         Audio.PlaySoundAtTransform("AwesomeViolin", transform);
     }
 }
 void KeyPress(int pos)
 {
     if (!Halt)
     {
         if (pos == 10)
         {
             StartCoroutine(Go());
         }
         else
         {
             Audio.PlaySoundAtTransform("press", transform);
             Input     = (Input * 10 + pos) % 100000000;
             Text.text = (Input.ToString("00000000") + "\n" + Num2.ToString("00000000") + "\n" + Num3.ToString("00000000") + "\n" + Num4.ToString("00000000"));
         }
     }
     else
     {
         Audio.PlaySoundAtTransform("press", transform);
     }
 }
Пример #5
0
        private IEnumerator Distort()
        {
            _audio.PlaySoundAtTransform(GlitchSound.name, transform);
            _postProcess = CameraPostProcess.AddPostProcess(Material);

            yield return(new WaitForSeconds(GlitchSound.length));

            DestroyImmediate(_postProcess);
            _postProcess = null;

            gameObject.SetActive(false);
        }
Пример #6
0
    private IEnumerator glitchEffect()
    {
        yield return(true);

        if (!bombStarted)
        {
            audio.PlaySoundAtTransform("glitch" + Rnd.Range(1, 6), transform);
        }
        for (int i = 0; i < 10; i++)
        {
            for (int j = 0; j < glitchSquares.Count(); j++)
            {
                glitchSquares[j].color = glitchColors[Rnd.Range(0, 8)];
            }
            yield return(new WaitForSeconds(.02f));
        }
        for (int j = 0; j < glitchSquares.Count(); j++)
        {
            glitchSquares[j].color = glitchColors[8];
        }
    }
Пример #7
0
 public void Onswitch()
 {
     Audio.PlaySoundAtTransform("click", transform);
     toggleSwitch.AddInteractionPunch(.5f);
     if (page1)
     {
         toggleSwitchRend.transform.localRotation = Quaternion.Euler(-20.0f, 0.0f, 0.0f) * toggleSwitchRend.transform.localRotation;;
         page1 = false;
         page1Items.SetActive(false);
         page2 = true;
         page2Items.SetActive(true);
     }
     else if (page2)
     {
         toggleSwitchRend.transform.localRotation = Quaternion.Euler(20.0f, 0.0f, 0.0f) * toggleSwitchRend.transform.localRotation;;
         page1 = true;
         page1Items.SetActive(true);
         page2 = false;
         page2Items.SetActive(false);
     }
 }
    private void Push(int i)
    {
        Buttons[i].AddInteractionPunch(.1f);
        Audio.PlaySoundAtTransform(_pushed[i] ? "ClickOut" : "ClickIn", Buttons[i].transform);

        _pushed[i] = !_pushed[i];
        if (_coroutines[i] == null)
        {
            _coroutines[i] = ButtonCoroutine(i, !_pushed[i]);
            StartCoroutine(_coroutines[i]);
        }
    }
    void ScreenPress()
    {
        button.AddInteractionPunch(1);
        if (moduleSolved)
        {
            PressOnSolve();
            return;
        }

        if (stage != -1)
        {
            Audio.PlaySoundAtTransform(sounds[stage].name, button.transform);
        }
        submission.Add(stage);
        Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, transform);
        Audio.PlaySoundAtTransform(sounds[stage + 1].name, button.transform);
        if (stage == -1)
        {
            CheckSubmission();
        }
    }
Пример #10
0
    public IEnumerator PlayCycleSound(KMAudio moduleAudio, Transform transform, int comboNum)
    {
        var randomStartingNote = Random.Range(8, soundListArray.Count() - 8);
        var offset             = 0;

        for (int i = 0; i < 3; i++)
        {
            moduleAudio.PlaySoundAtTransform(soundListArray[randomStartingNote + offset], transform);
            offset += (comboNum == 0 ? 1 : -1) * (Random.Range(0, 4) + 1);
            yield return(new WaitForSeconds(.1f));
        }
    }
Пример #11
0
    void Roll()
    {
        if (moduleSolved)
        {
            return;
        }

        Audio.PlaySoundAtTransform("roll", transform);

        SetDiceValues();

        SetDiceRotation(0, diceVal[0]);
        SetDiceRotation(1, diceVal[1]);
        SetDiceRotation(2, diceVal[2]);

        if (diceRoll != null)
        {
            StopCoroutine(diceRoll);
        }
        diceRoll = StartCoroutine("RollAnim");
    }
Пример #12
0
 void ButtonPress(KMSelectable Button)
 {
     Button.AddInteractionPunch();
     Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, Button.transform);
     if (moduleSolved)
     {
         return;
     }
     if (Button == Buttons[0])
     {
         if (HitCheck)
         {
             CheckPresses[Stage] = true;
             Stage++;
         }
         else
         {
             GetComponent <KMBombModule>().HandleStrike();
             Debug.LogFormat("[Astrological #{0}] You have pressed the invalid button, resetting the mod.", moduleId);
             Debug.LogFormat("[Astrological #{0}] -------------------------------------------------------", moduleId);
             StartCoroutine(Strike());
         }
     }
     else
     {
         if (!HitCheck)
         {
             CheckPresses[Stage] = false;
             Stage++;
         }
         else
         {
             GetComponent <KMBombModule>().HandleStrike();
             StartCoroutine(Strike());
         }
     }
     if (Stage == 3)
     {
         GetComponent <KMBombModule>().HandlePass();
         moduleSolved = true;
         Audio.PlaySoundAtTransform("Shutdown", this.transform);
         StartCoroutine(BackgroundColorChanger());
         StartCoroutine(SpriteHider());
         //OperatorSymbolsTM[0].text = String.Empty;
         //OperatorSymbolsTM[1].text = String.Empty;
         //for (int i = 0; i < 3; i++)
         //AstrologySymbols[i].gameObject.SetActive(false);
     }
     else
     {
         Randomize();
     }
 }
Пример #13
0
    /*private Action WaitForSelect()
     * {
     *  if (c == 1) return null;
     *  if (curknob == 2) return null;
     *  return delegate
     *  {
     *      if (dT >= 3 && dT <= 5)
     *      {
     *          h = false;
     *          canPress = true;
     *          wait = false;
     *          StopCoroutine(Timer());
     *          StopCoroutine(coroutine);
     *          Hot.OnInteract = ButtonHandler(Hot, 0);
     *          Cold.OnInteract = ButtonHandler(Cold, 0);
     *          c = 0;
     *      }
     *      else if (c == 2 && canPress == false)
     *      {
     *          StopCoroutine(Timer());
     *          DebugLog("Reset failed.");
     *          if (spin > 1500 && dT > 5) BombModule.HandleStrike();
     *      }
     *      else StopCoroutine(Timer());
     *  };
     * }
     *
     * private IEnumerator Timer()
     * {
     *  dT = 0;
     *  while (h == true && canPress == false)
     *  {
     *      dT++;
     *      DebugLog(dT.ToString());
     *      yield return new WaitForSeconds(1);
     *      if (dT > 10) yield break;
     *  }
     * }*/

    protected IEnumerable ButtonPress(KMSelectable knob)
    {
        knob.AddInteractionPunch(0.5f);
        KMAudio.PlaySoundAtTransform("valve_spin", knob.transform);

        if (!SOLVED)
        {
            canPress = false;
            StartCoroutine(KnobTurn(knob));
        }
        yield return(null);
    }
Пример #14
0
    void Awake()
    {
        moduleId = moduleIdCounter++;
        tempunit = 0;

        Buttons[0].OnInteract += delegate { btn1Press(); Buttons[0].AddInteractionPunch(0.25f); Audio.PlaySoundAtTransform("click", transform); return(false); };
        Buttons[1].OnInteract += delegate { btn2Press(); Buttons[1].AddInteractionPunch(0.25f); Audio.PlaySoundAtTransform("click", transform); return(false); };
        Buttons[2].OnInteract += delegate { btn3Press(); Buttons[2].AddInteractionPunch(0.25f); Audio.PlaySoundAtTransform("click", transform); return(false); };
        Buttons[3].OnInteract += delegate { btn4Press(); Buttons[3].AddInteractionPunch(0.25f); Audio.PlaySoundAtTransform("click", transform); return(false); };
        Buttons[4].OnInteract += delegate { btn5Press(); Buttons[4].AddInteractionPunch(0.25f); Audio.PlaySoundAtTransform("click", transform); return(false); };
        Displays[17].text      = alarmclock.ToString();
    }
Пример #15
0
 void Unpressed()
 {
     Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.BigButtonRelease, transform);
     if (Once == 1)
     {
         Debug.LogFormat("[The Simpleton #{0}] You pushed the button. Good job!", moduleId);
         Audio.PlaySoundAtTransform(UnityEngine.Random.Range(0, 20) == 0 ? SFX2.name : SFX.name, transform);
         Victory.text = "VICTORY";
         Module.HandlePass();
         Once = 2;
     }
 }
Пример #16
0
 IEnumerator ButtonFlash(int pos, bool sound, bool stay)
 {
     if (sound && !submission[pos])
     {
         int drunkLevel = BAC - 7 < 0 ? 0 : (BAC - 7) / 8 + 1;
         Audio.PlaySoundAtTransform(allBeeps[8 * drunkLevel + (int)chosenColors[pos]].name, buttons[pos].transform);
     }
     submission[pos] = !submission[pos];
     Material[] usingCols = submission[pos] ? onColors : offColors;
     buttons[pos].GetComponent <MeshRenderer>().material = usingCols[(int)chosenColors[pos]];
     yield return(null);
 }
Пример #17
0
    private KMSelectable.OnInteractHandler BeanPressed(int pos)
    {
        return(delegate
        {
            Audio.PlaySoundAtTransform("Monch", Module.transform);
            if (eatenbeans == 3)
            {
                Debug.LogFormat("[Coffee Beans #{0}] They know...", _moduleID);
                Module.HandleStrike();
            }
            else
            {
                int solution = 0;
                switch (eatenbeans)
                {
                case 0:
                    solution = ((((moves.Select(x => x + 1).Sum() % 2) + 2 * (moves.Select(x => (x + 1) / 2).Sum() % 2)) % 4) % 3);
                    break;

                case 1:
                    solution = (Enumerable.Range(0, moves.Count() - 1).Select(x => ((((moves[x] + 1) ^ (moves[x + 1] + 1)) % 4) % 3) == 0).Count(x => x) % 2);
                    if (beansafe.Take(solution + 1).Any(x => !x))
                    {
                        solution++;
                    }
                    break;

                case 2:
                    solution = Array.IndexOf(beansafe, true);
                    break;
                }
                beansafe[pos] = false;
                if (pos != solution)
                {
                    Debug.LogFormat("[Beans #{0}] Why did you eat bean {1}, when you were supposed to eat bean {2}?", _moduleID, pos + 1, solution + 1);
                    Module.HandleStrike();
                    StartCoroutine(Strike());
                }
                else
                {
                    Debug.LogFormat("[Coffee Beans #{0}] Bean {1} was the correct bean to eat.", _moduleID, pos + 1);
                }
                eatenbeans++;
                if (eatenbeans == 3)
                {
                    Module.HandlePass();
                    Solve();
                }
            }
            Beans[pos].transform.localScale = new Vector3(0f, 0f, 0f);
            return false;
        });
    }
Пример #18
0
    // Submitting

    private void Submit()
    {
        audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, transform);
        GetComponent <KMSelectable>().AddInteractionPunch();
        if (_arenaStages >= 4)
        {
        }
        else
        {
            if (arenaSubmits.text == _arenaNames[_arenaIndex])
            {
                Debug.LogFormat("[Totally Accurate Minecraft Simulator #{0}] Selected {1} on Stage {2}.", moduleId, arenaSubmits.text, _arenaStages + 1);
                if (_arenaStages == 3)
                {
                    _arenaStages = (_arenaStages + 54);
                    _arenaStage4 = _arenaIndex;
                    bombModule.HandlePass();
                    _isSolved = true;
                    TAMSAnimation();
                    SubmitFinished();
                }
                else
                {
                    _displayedSubmit = 0;
                    _arenaStages     = (_arenaStages + 1);
                    TAMSAnimate();
                }
            }
            else
            {
                Debug.LogFormat("[Totally Accurate Minecraft Simulator #{0}] STRIKE! Selected {1}! Resetting to Stage One.", moduleId, arenaSubmits.text);
                bombModule.HandleStrike();
                audio.PlaySoundAtTransform("laugh", transform);
                _displayedSubmit = 0;
                _arenaStages     = (_arenaStages - 1) % 1;
                PickArena();
                PickName();
            }
        }
    }
Пример #19
0
    private KMSelectable.OnInteractHandler ButtonPressed(int number)
    {
        return(delegate
        {
            if (bombSolved)
            {
                return false;
            }

            Audio.PlaySoundAtTransform(soundList[stage - 1], Pie.transform);
            DebugLog("Pressed {0}, expected {1}", number + 1, buttonOrder[stage - 1]);
            if (answer[number] == stage)
            {
                stage++;
                buttonTexts[number].color = Color.gray;
                // pressedButtons[stage - 1] = number;
            }
            else
            {
                // StartCoroutine(ResetColors(true));
                DebugLog("Strike!");
                Pie.HandleStrike();
            }

            if (stage == 6)
            {
                StartCoroutine(ResetColors(false));
                StartCoroutine(PlaySolveSound()); // Will also handle pass.
                bombSolved = true;
            }
            return false;
        });
    }
    void OnAddButtonPressed()
    {
        AddButton.AddInteractionPunch(0.5f);

        if (IsSolved)
        {
            return;
        }

        if (CurrentIngredientsList.Count == 0)
        {
            Audio.PlaySoundAtTransform("invalid", transform);
            return;
        }

        Audio.PlaySoundAtTransform("select", transform);

        var ingredient = CurrentIngredientsList[CurrentIndex];

        ModuleLog("Adding ingredient: {0}", ingredient.ToFriendlyString());
        AddedIngredients.Add(ingredient);
        CurrentIngredientsList.RemoveAt(CurrentIndex);

        // If we add the last ingredient in the list, wrap back to the start
        if (CurrentIndex == CurrentIngredientsList.Count)
        {
            CurrentIndex = 0;
        }

        UpdateDisplay();
    }
Пример #21
0
    private KMSelectable.OnInteractHandler StageButtonPressed(int pos)
    {
        return(delegate
        {
            Audio.PlaySoundAtTransform("Tap", Module.transform);
            StageButtons[pos].AddInteractionPunch();
            if (!solved && !checking)
            {
                switch (pos)
                {
                case 0:
                    if (selected > 0)
                    {
                        selected--;
                    }
                    break;

                case 1:
                    if (selected < 2)
                    {
                        selected++;
                    }
                    break;

                default:
                    break;
                }
                DispUpdate();
            }
            return false;
        });
    }
Пример #22
0
    IEnumerator HoldChecker()
    {
        yield return(new WaitForSeconds(.4f));

        StopCoroutine(startEcho);
        Debug.Log("hold");
        holding = true;
        if (playerPos == keyPos)
        {
            keyGet = true;
            keyPos = -1;
            Debug.LogFormat("[Echolocation #{0}] C HOLD) You are at the key and you've picked it up.", moduleId);
            center.AddInteractionPunch();
        }
        else if (playerPos == exitPos)
        {
            if (keyGet == true)
            {
                Debug.LogFormat("[Echolocation #{0}] C HOLD) You are at the exit and you have the key. MODULE SOLVED!", moduleId);
                actualModule.GetComponent <MeshRenderer>().material = white;
                moves[0].GetComponent <MeshRenderer>().material     = white;
                moves[1].GetComponent <MeshRenderer>().material     = white;
                moves[2].GetComponent <MeshRenderer>().material     = white;
                moves[3].GetComponent <MeshRenderer>().material     = white;
                center.GetComponent <MeshRenderer>().material       = white;
                GetComponent <KMBombModule>().HandlePass();
                Audio.PlaySoundAtTransform("win", transform);
            }
            else
            {
                Debug.LogFormat("[Echolocation #{0}] C HOLD) You are at the exit but you don't have the key. STRIKE!", moduleId);
                GetComponent <KMBombModule>().HandleStrike();
            }
        }
        else
        {
            Debug.LogFormat("[Echolocation #{0}] C HOLD) You are not at the key nor the exit. STRIKE!", moduleId);
            GetComponent <KMBombModule>().HandleStrike();
        }
    }
Пример #23
0
 private void Crank(int b)
 {
     if (!turnanim)
     {
         turnanim = true;
         int s = ((2 * b) - 1) * (select + 1);
         if (rot[1].Last() + s == 0)
         {
             StartCoroutine(Spin(s));
             rot[1].RemoveAt(rot[1].Count() - 1);
             if (rot[1].Count() > 1 && rot[1].Last() == rot[1][rot[1].Count() - 2] && rot[1].Last() == rot[1][rot[1].Count() - 3])
             {
                 Audio.PlaySoundAtTransform("Crank2", transform);
             }
             else
             {
                 Audio.PlaySoundAtTransform("Crank1", transform);
             }
         }
         else
         {
             rot[1].Add(s);
             if (rot[1].Last() != rot[1][rot[1].Count() - 2])
             {
                 Audio.PlaySoundAtTransform("Crank1", transform);
                 StartCoroutine(Spin(s));
             }
             else if (rot[1].Last() != rot[1][rot[1].Count() - 3])
             {
                 Audio.PlaySoundAtTransform("Crank2", transform);
                 StartCoroutine(Spin(s));
             }
             else if (rot[1].Last() != rot[1][rot[1].Count() - 4])
             {
                 Audio.PlaySoundAtTransform("Crank3", transform);
                 StartCoroutine(Spin(s));
             }
             else
             {
                 if (!moduleSolved && !info.GetFormattedTime().Contains((Array.IndexOf(cols, 0) + 1).ToString()))
                 {
                     module.HandleStrike();
                 }
                 Debug.LogFormat("[Turn Four #{0}] Module reset at {1}", moduleID, info.GetFormattedTime());
                 StartCoroutine(Sprung());
                 StartCoroutine(GearReset(false));
             }
         }
     }
 }
Пример #24
0
    void ButtonPress(KMSelectable button)
    {
        if (moduleSolved)
        {
            return;
        }

        //Makes the bomb move when you press it
        button.AddInteractionPunch();

        //As the value of each number on the keypad is equivalent to their position in the array, I can get the button's position and use that to work out it's value.
        int position = Array.IndexOf(buttons, button);

        //If the correct button has been pressed
        if (position + 1 == orders[answer, pressNum])
        {
            //Makes the letter vanish
            button.gameObject.SetActive(false);

            //Makes a sound when you press the button.
            audio.PlaySoundAtTransform(soundEffects[pressNum], transform);

            pressNum++;

            Debug.LogFormat("[XmORse Code #{0}] You pressed button {1}. Correct.", moduleId, position + 1);
        }
        //If the incorrect button has been pressed
        else
        {
            //Makes all letters visable again
            foreach (KMSelectable letter in buttons)
            {
                letter.gameObject.SetActive(true);
            }

            //Strikes the bomb
            GetComponent <KMBombModule>().HandleStrike();
            audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.Strike, transform);
            pressNum = 0;

            Debug.LogFormat("[XmORse Code #{0}] You pressed button {1}. Incorrect. Resetting input.", moduleId, position + 1);
        }

        //After all buttons have been pressed
        if (pressNum == 5)
        {
            //Solves the module
            Debug.LogFormat("[XmORse Code #{0}] Module solved!", moduleId);
            moduleSolved = true;
            GetComponent <KMBombModule>().HandlePass();
        }
    }
Пример #25
0
    IEnumerator Swan()
    {
        yield return(new WaitForSeconds(1.2f));

        while (Started == true)
        {
            yield return(new WaitForSeconds(1.8f));

            Audio.PlaySoundAtTransform("Swan", transform);
        }
    }
Пример #26
0
    private KMSelectable.OnInteractHandler RunePressed(int rune)
    {
        return(delegate
        {
            StartCoroutine(PebbleWiggle(rune, RuneTransforms[rune].localEulerAngles));
            Audio.PlaySoundAtTransform("RockClick", transform);
            Runes[rune].AddInteractionPunch();
            if (moduleSolved)
            {
                return false;
            }
            if (ElderFutharkTranslated[rune].Contains(pickedRuneNamesCipher[currentRune][timesPressed]))
            {
                Debug.LogFormat(@"[Elder Futhark #{0}] You pressed {1}, expecting {2}. Well Done", moduleId, ElderFutharkTranslated[rune], pickedRuneNamesCipher[currentRune][timesPressed]);
                timesPressed++;
                if (timesPressed == pickedRuneNamesCipher[currentRune].Length)
                {
                    timesPressed = 0;
                    RuneLetters[currentRune][pickedRuneLetters[currentRune]].GetComponent <MeshRenderer>().material = Materials[2];
                    currentRune++;
                    if (currentRune == 6)
                    {
                        GetComponent <KMBombModule>().HandlePass();
                        moduleSolved = true;
                        return false;
                    }
                    RuneLetters[currentRune][pickedRuneLetters[currentRune]].GetComponent <MeshRenderer>().material = Materials[1];
                }
            }
            else
            {
                GetComponent <KMBombModule>().HandleStrike();
                Debug.LogFormat(@"[Elder Futhark #{0}] You pressed {1}, expecting {2}. Strike. Rune resetted", moduleId, ElderFutharkTranslated[rune], pickedRuneNamesCipher[currentRune][timesPressed]);
                timesPressed = 0;
            }

            return false;
        });
    }
Пример #27
0
 void SwitchFlip()
 {
     Adding = !Adding;
     if (Adding)
     {
         StartCoroutine(toggleSwitch(0, 30));
         Audio.PlaySoundAtTransform("Switch1", Switch.transform);
         if (moduleSolved)
         {
             StartCoroutine(RiseAnimation());
         }
     }
     else
     {
         StartCoroutine(toggleSwitch(30, 0));
         Audio.PlaySoundAtTransform("Switch2", Switch.transform);
         if (moduleSolved)
         {
             StartCoroutine(FallAnimation());
         }
     }
 }
Пример #28
0
    private KMSelectable.OnInteractHandler HandlePress(int ix)
    {
        return(delegate
        {
            if (_isSolved)
            {
                return false;
            }

            Buttons[ix].AddInteractionPunch();

            _makeSounds = true;
            Audio.PlaySoundAtTransform("Sound" + (ix + 7), Buttons[ix].transform);
            CancelInvoke("startBlinker");

            if (ix != _expectedInput[_stage][_subprogress])
            {
                Debug.LogFormat("[Simon Screams #{3}] Expected {0}, but you pressed {1}. Input reset. Now at stage {2} key 1.", _colors[_expectedInput[_stage][_subprogress]], _colors[ix], _stage + 1, _moduleId);
                Module.HandleStrike();
                _subprogress = 0;
                startBlinker(1.5f);
            }
            else
            {
                _subprogress++;
                var logStage = false;
                if (_subprogress == _expectedInput[_stage].Length)
                {
                    Leds[_stage].material = LitLed;
                    _stage++;
                    _subprogress = 0;
                    if (_stage == _expectedInput.Length)
                    {
                        Debug.LogFormat("[Simon Screams #{1}] Pressing {0} was correct. Module solved.", _colors[ix], _moduleId);
                        _isSolved = true;
                        StartCoroutine(victory(ix));
                        return false;
                    }

                    logStage = true;
                    startBlinker(1f);
                }
                else
                {
                    startBlinker(5f);
                }

                Debug.LogFormat("[Simon Screams #{3}] Pressing {0} was correct; now at stage {1} key {2}.", _colors[ix], _stage + 1, _subprogress + 1, _moduleId);
                if (logStage)
                {
                    logCurrentStage();
                }
            }

            StartCoroutine(flashUpOne(ix));
            return false;
        });
    }
Пример #29
0
 ///Interactables
 public void Onswitch1()
 {
     if (turnLock1)
     {
     }
     else
     {
         Audio.PlaySoundAtTransform("dial", transform);
         turnLock1 = true;
         StartCoroutine(switch1Turn());
     }
 }
    IEnumerator passFlash()
    {
        int flash = 0;

        Audio.PlaySoundAtTransform("lightFlicker", transform);
        int stageCopy = stage;

        while (flash < 10)
        {
            levelIndicators[stageCopy].material = levelMaterials[1];
            yield return(new WaitForSeconds(0.1f));

            levelIndicators[stageCopy].material = levelMaterials[2];
            yield return(new WaitForSeconds(0.1f));

            flash++;
        }
        levelIndicators[stageCopy].material = levelMaterials[1];
        if (stageCopy < 3)
        {
            levelIndicators[stageCopy + 1].material = levelMaterials[2];
        }
    }