コード例 #1
0
ファイル: simonStashes.cs プロジェクト: tasthing/Needy-Pack
    IEnumerator Submit(bool correct)
    {
        audio.PlaySoundAtTransform("InputCheck", centerButton.transform);
        autosolveInteract = false;
        for (int i = 0; i < 4; i++)
        {
            for (int j = 0; j < 4; j++)
            {
                buttonLights[j].enabled         = true;
                buttonRenders[j].material.color = litColors[colorsPresent[j]];
                yield return(new WaitForSeconds(.125f));

                buttonLights[j].enabled         = false;
                buttonRenders[j].material.color = colors[colorsPresent[j]];
            }
        }
        for (int i = 0; i < 4; i++)
        {
            buttonLights[i].enabled         = false;
            buttonRenders[i].material.color = colors[colorsPresent[i]];
        }
        if (!correct)
        {
            module.OnStrike();
            module.OnPass();
        }
        else
        {
            module.OnPass();
            yield return(new WaitForSeconds(.1f));

            audio.PlaySoundAtTransform("InputCorrect", centerButton.transform);
        }
        OnNeedyDeactivation();
    }
コード例 #2
0
 void buttonPressed(KMSelectable pressedButton)
 {
     pressedButton.AddInteractionPunch();
     audio.PlaySoundAtTransform(pressedButton.name, transform);
     if (!active)
     {
         return;
     }
     else
     {
         DebugMsg("Pressed note: " + pressedButton.name + ", expecting " + noteRenderers[whichNote].sprite.name);
         if (pressedButton.name != noteRenderers[whichNote].sprite.name) //if pressed button's note isn't the same as the note on the displayed note
         {
             module.OnStrike();
             DebugMsg("Strike!");
             module.OnPass();
         }
         else
         {
             noteRenderers[whichNote].sprite = null;
             whichNote++;
             if (whichNote == 3)
             {
                 module.OnPass();
                 OnNeedyDeactivation();
             }
         }
     }
 }
コード例 #3
0
 void ButtonPress(KMSelectable button)
 {
     if (!active)
     {
         return;
     }
     button.AddInteractionPunch(.5f);
     audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, button.transform);
     if (!pressed[Array.IndexOf(buttons, button)])
     {
         Debug.LogFormat("[Rotating Squares #{0}] Pressed button {1}, which has not been pressed yet. Module temporarily neutralized!", moduleId, Array.IndexOf(buttons, button) + 1);
         pressed[Array.IndexOf(buttons, button)] = true;
         OnNeedyDeactivation();
         module.OnPass();
         StartCoroutine(Rotate());
     }
     else
     {
         Debug.LogFormat("[Rotating Squares #{0}] Pressed button {1}, which has been pressed already. Strike!", moduleId, Array.IndexOf(buttons, button) + 1);
         module.OnStrike();
     }
     if (!pressed.Any(b => !b))
     {
         Debug.LogFormat("[Rotating Squares #{0}] All buttons 16 buttons have been pressed! All buttons returning to unused stage...", moduleId);
         for (int i = 0; i < 16; i++)
         {
             pressed[i] = false;
         }
         audio.PlaySoundAtTransform("jingle", transform);
         foreach (Renderer buttonR in buttonRenders)
         {
             StartCoroutine(Reset(buttonR));
         }
     }
 }
コード例 #4
0
 void Submit()
 {
     if (!active)
     {
         return;
     }
     if (stage == 0)
     {
         if (chosenLetter != letterIndex)
         {
             Debug.LogFormat("[Boozleglyph Identification #{0}] Submitted letter {1}, that is incorrect. Strike!", moduleId, alphabet[chosenLetter]);
             module.OnStrike();
         }
         else
         {
             Debug.LogFormat("[Boozleglyph Identification #{0}] Submitted letter {1}, that is correct.", moduleId, alphabet[chosenLetter]);
             stage++;
             UpdateScreen();
         }
     }
     else if (stage == 1)
     {
         if (chosenSet != setIndex)
         {
             Debug.LogFormat("[Boozleglyph Identification #{0}] Submitted set {1}, that is incorrect. Strike!", moduleId, setNumbers[chosenSet]);
             module.OnStrike();
         }
         else
         {
             Debug.LogFormat("[Boozleglyph Identification #{0}] Submitted set {1}, that is correct. Module temporarily neutralized!", moduleId, setNumbers[chosenSet]);
             module.OnPass();
             OnNeedyDeactivation();
         }
     }
 }
コード例 #5
0
    void AxisButtonPress(KMSelectable axisButton)
    {
        if (!active)
        {
            return;
        }
        var currentRotation = rotationNames[rotationIndex].ToCharArray();

        axisButton.AddInteractionPunch(.5f);
        if (axisButton.GetComponentInChildren <TextMesh>().text != currentRotation[enteringStage].ToString())
        {
            Debug.LogFormat("[Hyperneedy #{0}] Pressed the button {1}, that is incorrect. Strike!", moduleId, axisButton.GetComponentInChildren <TextMesh>().text);
            module.OnStrike();
            enteringStage = 0;
        }
        else
        {
            Debug.LogFormat("[Hyperneedy #{0}] Pressed the button {1}, that is correct.", moduleId, axisButton.GetComponentInChildren <TextMesh>().text);
            enteringStage++;
            audio.PlaySoundAtTransform("Bleep" + rnd.Range(1, 11).ToString(), axisButton.transform);
        }
        if (enteringStage == 2)
        {
            Debug.LogFormat("[Hyperneedy #{0}] Pressed the button {1}, that is correct. Module temporarily neutralized!", moduleId, axisButton.GetComponentInChildren <TextMesh>().text);
            module.OnPass();
            OnNeedyDeactivation();
        }
    }
コード例 #6
0
 void DickPress(KMSelectable Dick)
 {
     Dick.AddInteractionPunch();
     Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, Dick.transform);
     for (int i = 0; i < 4; i++)
     {
         if (Dick == MasherTheBottun[i] && Wheufhahekfhe[i] == true)
         {
             Debug.LogFormat("[NeeDeez Nuts #{0}] Deez nuts!", moduleId);
             Audio.PlaySoundAtTransform("DeezNuts", transform);
             OnNeedyDeactivation();
             module.OnPass();
             Dick.AddInteractionPunch();
             Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, Dick.transform);
             for (int j = 0; j < 4; j++)
             {
                 Wheufhahekfhe[j] = false;
                 IWillBombTheAtlanticOcean[j].text = "Got Eeem!";
             }
         }
         else if (Dick == MasherTheBottun[i] && Wheufhahekfhe[i] == false)
         {
             Debug.LogFormat("[NeeDeez Nuts #{0}] Got Eeem!", moduleId);
             Audio.PlaySoundAtTransform("GOTEEE", transform);
             module.OnStrike();
             Dick.AddInteractionPunch();
             Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, Dick.transform);
         }
     }
 }
コード例 #7
0
 void buttonPressed(KMSelectable pressedButton)
 {
     if (!active)
     {
         return;
     }
     else
     {
         module.OnPass();
         OnNeedyDeactivation();
     }
 }
コード例 #8
0
 void PressButton(KMSelectable button)
 {
     if (!active)
     {
         return;
     }
     button.AddInteractionPunch(.5f);
     audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, button.transform);
     if (Array.IndexOf(buttons, button) != solution)
     {
         Debug.LogFormat("[Marco Polo #{0}] Pressed the {1} button, which was incorrect. Strike!", moduleId, Array.IndexOf(buttons, button) == 0 ? "left" : "right");
         module.OnStrike();
         module.OnPass();
     }
     else
     {
         Debug.LogFormat("[Marco Polo #{0}] Pressed the {1} button, which was correct. Module temporarily neutralized!", moduleId, Array.IndexOf(buttons, button) == 0 ? "left" : "right");
         OnNeedyDeactivation();
         module.OnPass();
     }
 }
コード例 #9
0
 protected void OnTimerExpired()
 {
     if (active)
     {
         if (playerPosition == goalPosition)
         {
             module.OnPass();
             DebugMsg("Was on goal position when timer ran out.");
             OnNeedyDeactivation();
         }
         else
         {
             module.OnStrike();
             DebugMsg("Strike! Was not on right tile when timer ran out. Player position: " + playerPosition + ", Goal position: " + goalPosition);
             OnNeedyDeactivation();
         }
     }
 }
コード例 #10
0
    void bp(KMSelectable key)
    {
        audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, transform);

        if (Array.IndexOf(buttons, key) == sequence[currentInt])
        {
            currentInt++;
        }
        else
        {
            needy.OnStrike();
            currentInt = 0;
        }
        if (currentInt == lenght2)
        {
            needy.OnPass();
            lights[random].enabled = false;
            addseconds            += 3;
        }
    }
コード例 #11
0
    void ButtonPress()
    {
        if (!active)
        {
            return;
        }
        button.AddInteractionPunch(.5f);
        audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, button.transform);
        var timeNow = Mathf.Round(module.GetNeedyTimeRemaining()).ToString();

        if (timeNow != "0")
        {
            Debug.LogFormat("[Red Light Green Light #{0}] Pressed the button with {1} seconds remaining, that is incorrect. Strike!", moduleId, timeNow);
            module.OnStrike();
        }
        else
        {
            Debug.LogFormat("[Red Light Green Light #{0}] Pressed the button with 0 seconds remaining, that is correct. Module temporarily neutralized!", moduleId);
            OnNeedyDeactivation();
            module.OnPass();
        }
    }
コード例 #12
0
 void Solve()
 {
     isEnded = true;
     Reset();
     NeedyModule.OnPass();
 }
コード例 #13
0
 void buttonPressed(KMSelectable pressedButton)
 {
     if (!active)
     {
         return;
     }
     else
     {
         if (buttons[16] == pressedButton)
         {
             setBoard();
         }
         else if (buttons[17] == pressedButton)
         {
             incorrect = false;
             debugStrikeNumbers.Clear();
             for (int i = 0; i < 16; i++)
             {
                 if (inputtedBoard[i] != solvedBoard[i])
                 {
                     incorrect = true;
                     debugStrikeNumbers.Add(i);
                 }
             }
             if (!incorrect)
             {
                 module.OnPass();
                 DebugMsg("Correct input.");
                 OnNeedyDeactivation();
             }
             else
             {
                 module.OnStrike();
                 debugInputtedBoard = "";
                 for (int i = 0; i < 16; i++)
                 {
                     if (inputtedBoard[i] == true)
                     {
                         debugInputtedBoard = debugInputtedBoard + "▇";
                     }
                     else
                     {
                         debugInputtedBoard = debugInputtedBoard + "░";
                     }
                 }
                 DebugMsg("Strike! Inputted:" + debugInputtedBoard.Length);
                 DebugMsg("╔════╗");
                 DebugMsg("║" + debugInputtedBoard[0] + debugInputtedBoard[1] + debugInputtedBoard[2] + debugInputtedBoard[3] + "║");
                 DebugMsg("║" + debugInputtedBoard[4] + debugInputtedBoard[5] + debugInputtedBoard[6] + debugInputtedBoard[7] + "║");
                 DebugMsg("║" + debugInputtedBoard[8] + debugInputtedBoard[9] + debugInputtedBoard[10] + debugInputtedBoard[11] + "║");
                 DebugMsg("║" + debugInputtedBoard[12] + debugInputtedBoard[13] + debugInputtedBoard[14] + debugInputtedBoard[15] + "║");
                 DebugMsg("╚════╝");
                 DebugMsg("Expected:");
                 DebugMsg("╔════╗");
                 DebugMsg("║" + debugSolvedBoard[0] + debugSolvedBoard[1] + debugSolvedBoard[2] + debugSolvedBoard[3] + "║");
                 DebugMsg("║" + debugSolvedBoard[4] + debugSolvedBoard[5] + debugSolvedBoard[6] + debugSolvedBoard[7] + "║");
                 DebugMsg("║" + debugSolvedBoard[8] + debugSolvedBoard[9] + debugSolvedBoard[10] + debugSolvedBoard[11] + "║");
                 DebugMsg("║" + debugSolvedBoard[12] + debugSolvedBoard[13] + debugSolvedBoard[14] + debugSolvedBoard[15] + "║");
                 DebugMsg("╚════╝");
                 module.OnPass();
                 OnNeedyDeactivation();
             }
         }
         else
         {
             for (int i = 0; i < 16; i++)
             {
                 if (pressedButton == buttons[i])
                 {
                     if (inputtedBoard[i])
                     {
                         inputtedBoard[i]   = false;
                         lights[i].material = lightMats[1];
                     }
                     else
                     {
                         inputtedBoard[i]   = true;
                         lights[i].material = lightMats[0];
                     }
                     i = 16;
                 }
             }
         }
     }
 }
コード例 #14
0
 protected bool Solve()
 {
     NeedyModule.OnPass();
     return(false);
 }