KMSelectable.OnInteractHandler SetupInteraction(Light light)
    {
        return(() =>
        {
            if (light.speed == 0 || Solved || syncPause)
            {
                return false;
            }

            light.gObject.GetComponent <KMSelectable>().AddInteractionPunch(0.5f);

            if (SelectAudioRef != null)
            {
                SelectAudioRef.StopSound();
                SelectAudioRef = null;
                StopCoroutine(SelectSFXCoroutine);
            }

            if (SelectedLight == null)
            {
                SelectAudioRef = Audio.PlaySoundAtTransformWithRef("Select", transform);
                SelectSFXCoroutine = StartCoroutine(StopSelectSFX());

                ApplyToSpeed(light, l =>
                {
                    l.selection.SetActive(true);
                    l.StopFlashing();
                });

                SelectedLight = light;
            }
            else
            {
                if (SelectedLight.speed == light.speed)
                {
                    ApplyToSpeed(light, l =>
                    {
                        l.selection.SetActive(false);
                        l.StartFlashing();
                    });

                    SelectedLight = null;
                    SelectAudioRef = Audio.PlaySoundAtTransformWithRef("Deselect", transform);
                    SelectSFXCoroutine = StartCoroutine(StopSelectSFX());
                }
                else
                {
                    Audio.PlaySoundAtTransform("Syncing", transform);
                    StartCoroutine(SyncLights(light));
                }
            }

            return false;
        });
    }
Beispiel #2
0
 void StartButtonPress()
 {
     if (Active)
     {
         return;
     }
     if (Sound)
     {
         SoundIThink = Audio.PlaySoundAtTransformWithRef("ALittleBit", transform);
     }
     StartButton.gameObject.SetActive(false);
     Active = true;
     WordChoice();
 }
Beispiel #3
0
    IEnumerator pressureCount()
    {
        timerSound = Audio.PlaySoundAtTransformWithRef("countdown", transform);

        for (int u = 0; u < timer; u++)
        {
            yield return(new WaitForSecondsRealtime(1));
        }
        float p = -2.82f;

        for (int u = 0; u < 14; u++)
        {
            p += 0.1f;
            piston.transform.localPosition = new Vector3(0, p, 0);
            yield return(new WaitForSecondsRealtime(0.001f));
        }
        for (int u = 0; u < 14; u++)
        {
            p -= 0.1f;
            piston.transform.localPosition = new Vector3(0, p, 0);
            yield return(new WaitForSecondsRealtime(0.001f));
        }
        if (!_isSolved && !turn)
        {
            Debug.LogFormat("[Manometers #{0}] Time ran out ! Strike and reset !", _moduleId);
            this.HandleStrike();
        }
    }
Beispiel #4
0
 void MusicStarter()
 {
     if (SoundIThink == null)
     {
         SoundIThink = Audio.PlaySoundAtTransformWithRef("Kahoot!", transform);
     }
 }
Beispiel #5
0
    IEnumerator SubmitAnimation()
    {
        StringBuilder stringBuilder   = new StringBuilder(Submission.text);
        float         y               = 0;
        float         changeCharacter = 0;

        KMAudio.KMAudioRef audioRef = Audio.PlaySoundAtTransformWithRef("Submit", transform);
        foreach (float alpha in TimedAnimation(4))
        {
            float curvedAlpha = Mathf.Pow(alpha, 4) / 5;
            changeCharacter += alpha;

            while (changeCharacter >= 0.5f)
            {
                changeCharacter -= 0.5f;
                stringBuilder[Random.Range(0, stringBuilder.Length)] = (char)Random.Range(32, 126);
                CustomDisplayText = stringBuilder.ToString();
            }

            SubmissionMaterial.mainTextureOffset = new Vector2(0, y += curvedAlpha);
            yield return(null);
        }

        audioRef.StopSound();
    }
Beispiel #6
0
 void Awake()
 {
     _moduleID = _moduleIdCounter++;
     while (Outputs.Distinct().Count() < 4)
     {
         for (int i = 0; i < 10; i++)
         {
             Outputs[i] = Rnd.Range(0, 7);
         }
     }
     Calculate();
     Inner.material.color           = new Color(1f, 1f, 1f);
     BlackHole.transform.localScale = new Vector3(0f, 0f, 0f);
     Block.transform.localPosition += new Vector3(0f, -0.05f, 0f);
     Block.OnInteract += delegate { if (!GivenAnswer.Contains('['))
                                    {
                                        Sound = Audio.PlaySoundAtTransformWithRef("input", BlackHole.transform);
                                    }
                                    ; GivenAnswer += "["; return(false); };
     Block.OnInteractEnded   += delegate { GivenAnswer += "]"; };
     Module.OnActivate       += delegate { StartCoroutine(OnActivate()); };
     RotationSpeed            = Rnd.Range(0.1f, 0.5f);
     RotationSpeedMorePoggers = Rnd.Range(0.5f, 1f);
     ColourblindEnabled       = Colourblind.ColorblindModeActive;
 }
    private IEnumerator RotateDial(int ix)
    {
        cantPress = true;
        var count    = 300 * (ix + 1);
        var target   = 180f + (.1f * count);
        var elapsed  = 0f;
        var duration = 0f;

        if (ix == 0 || ix == 1 || ix == 2)
        {
            duration = .5f;
        }
        else if (ix == 3 || ix == 4 || ix == 5)
        {
            duration = .75f;
        }
        else if (ix == 6 || ix == 7 || ix == 8)
        {
            duration = 1f;
        }
        else
        {
            duration = 1.25f;
        }
        audio.PlaySoundAtTransform("dial", transform);
        while (elapsed < duration)
        {
            dial.localEulerAngles = new Vector3(0f, Mathf.Lerp(180f, target, elapsed / duration), 0f);
            yield return(null);

            elapsed += Time.deltaTime;
        }
        dial.localEulerAngles = new Vector3(0f, target, 0f);
        yield return(new WaitForSeconds(.25f));

        elapsed  = 0f;
        audioRef = audio.PlaySoundAtTransformWithRef("rewind", transform);
        while (elapsed < duration)
        {
            dial.localEulerAngles = new Vector3(0f, Mathf.Lerp(target, 180f, elapsed / duration), 0f);
            yield return(null);

            elapsed += Time.deltaTime;
        }
        audioRef.StopSound();
        audioRef = null;
        dial.localEulerAngles = new Vector3(0f, 180f, 0f);
        cantPress             = false;

        if (input.Length == 3)
        {
            CheckAnswer();
        }
    }
Beispiel #8
0
        private IEnumerator WobbleTime(float duration)
        {
            _postProcess = CameraPostProcess.AddPostProcess(Material);

            _ref = _audio.PlaySoundAtTransformWithRef(WobbleAudio.name, transform);

            float finalTime = Random.Range(0, 2) == 0 ? Random.Range(0.4f, 0.6f) : Random.Range(1.2f, 1.3f);
            float sign      = Mathf.Sign(finalTime - 1.0f);

            float startTime = Time.realtimeSinceStartup;

            while ((Time.realtimeSinceStartup - startTime) < (duration * 0.8f))
            {
                float delta = (Time.realtimeSinceStartup - startTime) / (duration * 0.9f);

                Time.timeScale = Mathf.SmoothStep(1.0f, finalTime, delta);
                Material.SetFloat("_Stretch", Mathf.Lerp(1.0f, 1.0f - sign, delta));
                Material.SetFloat("_Vignette", Mathf.Lerp(0.0f, sign * -2.0f, delta));

                yield return(null);
            }

            yield return(new WaitForSeconds(duration * 0.1f));

            startTime = Time.realtimeSinceStartup;
            while ((Time.realtimeSinceStartup - startTime) < (duration * 0.1f))
            {
                float delta = (Time.realtimeSinceStartup - startTime) / (duration * 0.1f);

                Time.timeScale = Mathf.SmoothStep(finalTime, 1.0f, delta);
                Material.SetFloat("_Stretch", Mathf.Lerp(1.0f - sign, 1.0f, delta));
                Material.SetFloat("_Vignette", Mathf.Lerp(sign * -2.0f, 0.0f, delta));

                yield return(null);
            }

            Time.timeScale = 1.0f;

            _ref.StopSound();
            _ref = null;

            DestroyImmediate(_postProcess);
            _postProcess = null;

            gameObject.SetActive(false);
        }
Beispiel #9
0
    IEnumerator AllTimerFunctions()
    {
        IsActive = true;
        yield return(new WaitForSecondsRealtime(1f));

        Timer--;
        TimerDisplay.text = Timer.ToString();
        if (Timer == 30)
        {
            Last30Seconds          = true;
            ClockSoundForNoLooping = Audio.PlaySoundAtTransformWithRef("clock", transform);
        }
        if (Timer == 0)
        {
            if (ClockSoundForNoLooping != null)
            {
                ClockSoundForNoLooping.StopSound();
                ClockSoundForNoLooping = null;
            }
            for (int i = 0; i < 4; i++)
            {
                DisplayLetters[i].text = GoalWord[i].ToString().ToUpper();
            }
            Debug.LogFormat("[Jailbreak #{0}] You took too long!", moduleId);
            Last30Seconds = false;
            CanType       = true;
            yield return(new WaitForSecondsRealtime(5f));

            CanType = false;
            //GetComponent<KMBombModule>().HandleStrike();
            GuessDisplay.text = "Query";
            Audio.PlaySoundAtTransform("DooDooDooDoo", transform);
            WordGeneration();
            IsActive = false;
            Timer    = 90;
            for (int i = 0; i < 4; i++)
            {
                DisplayLetters[i].text = "_";
            }
        }
        else
        {
            StartCoroutine(AllTimerFunctions());
        }
    }
 void Update()
 {
     if (focused)
     {
         if (tpcycle != null)
         {
             allHit = Physics.RaycastAll(new Ray(cycle.transform.position, -cycle.transform.up));
         }
         else
         {
             allHit = Physics.RaycastAll(Camera.main.ScreenPointToRay(Input.mousePosition));
         }
         List <string> names = new List <string>();
         foreach (RaycastHit hit in allHit)
         {
             names.Add(hit.collider.name);
             if (objNames.Contains(hit.collider.name) && !playing)
             {
                 playing = true;
                 lastHit = hit.collider.name;
                 sound   = Audio.PlaySoundAtTransformWithRef("tone", transform);
             }
         }
         if (!names.Contains(lastHit))
         {
             playing = false;
             lastHit = "";
             if (sound != null)
             {
                 sound.StopSound();
             }
         }
     }
     else
     {
         playing = false;
         lastHit = "";
         if (sound != null)
         {
             sound.StopSound();
         }
     }
 }
    private void StartAppreciatingArt()
    {
        _module.Log("Art is being appreciated.");
        _appreciationStartTime = Time.time;

        _audio.PlaySoundAtTransform(AppreciationStartedClip.RandomPick().name, _transform);
        _ambientRef = _audio.PlaySoundAtTransformWithRef(AppreciationAmbientClip.name, _transform);

        try
        {
            GameMusicControl.GameMusicVolume = 0.0f;
        }
        catch (Exception)
        {
        }

        StopAllCoroutines();
        StartCoroutine(FadeIn());
    }
Beispiel #12
0
    private IEnumerator DisableDummies()
    {
        yield return(null);

        dummyStar.gameObject.SetActive(false);
        foreach (Renderer planet in dummyPlanets)
        {
            planet.gameObject.SetActive(false);
        }
        if (settings.playAmbiance)
        {
            ambianceRef = audio.PlaySoundAtTransformWithRef("ambiance", star.transform);
        }
        yield return(new WaitForSeconds(rnd.Range(.5f, 1.5f)));

        dummyStar.gameObject.SetActive(false);
        foreach (Renderer planet in dummyPlanets)
        {
            planet.gameObject.SetActive(false);
        }
    }
Beispiel #13
0
        private IEnumerator Bumps(float duration)
        {
            _ref = _audio.PlaySoundAtTransformWithRef(RumbleAudio.name, transform);

            while (duration >= 0.0f)
            {
                Vector3 punchPosition          = new Vector3(Random.Range(-10.0f, 10.0f), Random.Range(0.0f, 10.0f), Random.Range(-10.0f, 10.0f));
                float   bumpAmount             = Random.Range(MinimumBump, MaximumBump);
                float   punchDuration          = Random.Range(MinimumPunchDuration, MaximumPunchDuration);
                float   punchOscillationPeriod = Random.Range(MinimumPunchOscillationPeriod, MaximumPunchOscillationPeriod);

                KTInputManager.Instance.AddInteractionPunch(punchPosition, bumpAmount, punchDuration, punchOscillationPeriod);

                yield return(new WaitForSeconds(0.1f));

                duration -= 0.1f;
            }

            _ref.StopSound();
            _ref = null;

            gameObject.SetActive(false);
        }
Beispiel #14
0
    void Awake()
    {
        moduleId = moduleIdCounter++;
        foreach (KMSelectable button in planetButtons)
        {
            button.OnInteract += delegate() { PressPlanet(button); return(false); }
        }
        ;
        starButton.OnInteract += delegate() { PressStar(); return(false); };
        bomb.OnBombExploded   += delegate { HandleDetonation(); };
    }

    void Start()
    {
        StartCoroutine(DisableDummies());
        statusLight.SetActive(false);
        starCcw      = rnd.Range(0, 2) != 0;
        planetSizes  = Enumerable.Range(0, 3).ToList().Shuffle().ToArray();
        planetSpeeds = speeds.ToList().Shuffle().Take(3).ToArray();
        for (int i = 0; i < 3; i++)
        {
            planetSurfaces[i] = rnd.Range(0, 10);
            planetsCcw[i]     = rnd.Range(0, 2) != 0;
            spinningCcw[i]    = rnd.Range(0, 2) != 0;
            Debug.LogFormat("[Exoplanets #{0}] The {1} planet has an angular velocity of {2}.", moduleId, positionNames[i], (int)planetSpeeds[i]);
            Debug.LogFormat("[Exoplanets #{0}] The {1} planet is {2}.", moduleId, positionNames[i], sizeNames[planetSizes[i]]);
        }
        for (int i = 0; i < 3; i++)
        {
            orbits[i] = StartCoroutine(Orbit(pivots[i], i));
        }
        foreach (Renderer planet in planets)
        {
            var ix = Array.IndexOf(planets, planet);
            planet.material.mainTexture = surfaces[planetSurfaces[ix]];
            var sizecord = sizes[planetSizes[ix]];
            planet.transform.localScale           = new Vector3(sizecord, sizecord, sizecord);
            dummyPlanets[ix].transform.localScale = new Vector3(sizecord, sizecord, sizecord);
            planet.transform.localRotation        = rnd.rotation;
            tilts[ix] = StartCoroutine(Spinning(planet, ix));
        }
        starSpinning = StartCoroutine(StarMovement());
        GenerateSolution();
    }

    void GenerateSolution()
    {
        if (!planetsCcw.Contains(true))
        {
            targetPlanet = 0;
            Debug.LogFormat("[Exoplanets #{0}] All planets are oribiting clockwise, so the initial target planet is the one closest to the star.", moduleId);
        }
        else if (!planetsCcw.Contains(false))
        {
            targetPlanet = 2;
            Debug.LogFormat("[Exoplanets #{0}] All planets are orbiting counterclockwise, so the initial target planet is the one farthest from the star.", moduleId);
        }
        else
        {
            if (planetsCcw.Count(x => x) == 2)
            {
                targetPlanet = Array.IndexOf(planetsCcw, planetsCcw.First(x => !x));
            }
            else
            {
                targetPlanet = Array.IndexOf(planetsCcw, planetsCcw.First(x => x));
            }
            Debug.LogFormat("[Exoplanets #{0}] The {1} planet is orbiting {2}, so it is the initial target planet.", moduleId, positionNames[targetPlanet], planetsCcw[targetPlanet] ? "counterclockwise" : "clockwise");
        }
        targetDigit         = planetSurfaces[targetPlanet];
        startingTargetDigit = targetDigit;
        Debug.LogFormat("[Exoplanets #{0}] The initial target digit is {1}.", moduleId, targetDigit);
        tablePosition = (tablePosition + bomb.GetBatteryCount() * (starCcw ? 7 : 1)) % 8;
        Debug.LogFormat("[Exoplanets #{0}] The star is rotating {1} and there are {2} batteries.", moduleId, !starCcw ? "clockwise" : "counterclockwise", bomb.GetBatteryCount());
        tableRing = targetPlanet;
        for (int i = 0; i < 3; i++)
        {
            Modify(i);
        }
        Debug.LogFormat("[Exoplanets #{0}] The final solution is to press the {1} planet on a {2}.", moduleId, positionNames[targetPlanet], targetDigit);
    }

    void Modify(int j)
    {
        var offset = ((int)planetSpeeds[tableRing]);

        if (bomb.GetBatteryHolderCount() != 0)
        {
            offset %= bomb.GetBatteryHolderCount();
        }
        else
        {
            offset %= 5;
        }
        offset       += bomb.GetPortCount();
        tablePosition = (tablePosition + offset * (planetsCcw[tableRing] ? 7 : 1)) % 8;
        var prevPlanet = targetPlanet;
        var prevDigit  = targetDigit;

        Debug.LogFormat("[Exoplanets #{0}] Using rule {1}.", moduleId, table[tableRing][tablePosition]);
        switch (table[tableRing][tablePosition])
        {
        case "A":
            if (planetSizes[targetPlanet] == 2)
            {
                targetPlanet = Array.IndexOf(planetSizes, 0);
            }
            else
            {
                targetPlanet = Array.IndexOf(planetSizes, planetSizes.Where(x => x > planetSizes[targetPlanet]).Min());
            }
            break;

        case "B":
            targetDigit = (targetDigit + startingTargetDigit) % 10;
            break;

        case "C":
            if (planetSizes[targetPlanet] == 0)
            {
                targetPlanet = Array.IndexOf(planetSizes, 2);
            }
            else
            {
                targetPlanet = Array.IndexOf(planetSizes, planetSizes.Where(x => x < planetSizes[targetPlanet]).Max());
            }
            break;

        case "D":
            var differencesMax = new int[3];
            for (int i = 0; i < 3; i++)
            {
                differencesMax[i] = planetSurfaces[targetPlanet] - planetSurfaces[i];
                if (differencesMax[i] < 0)
                {
                    differencesMax[i] *= -1;
                }
            }
            targetPlanet = Array.IndexOf(differencesMax, differencesMax.Max());
            break;

        case "E":
            targetDigit = 9 - targetDigit;
            break;

        case "F":
            if (planetsCcw.Distinct().Count() == 0)
            {
                targetPlanet = 1;
            }
            else
            {
                targetPlanet = Array.IndexOf(planetsCcw, planetsCcw.First(x => x == planetsCcw[targetPlanet]));
            }
            break;

        case "G":
            targetPlanet = Array.IndexOf(planetsCcw, planetsCcw.First(x => x == planetsCcw[targetPlanet]));
            break;

        case "H":
            targetDigit = (targetDigit + bomb.GetSerialNumberNumbers().Sum()) % 10;
            break;

        case "I":
            if (planetSurfaces[targetPlanet] == planetSurfaces.Max())
            {
                targetPlanet = Array.IndexOf(planetSurfaces, planetSurfaces.Min());
            }
            else
            {
                targetPlanet = Array.IndexOf(planetSurfaces, planetSurfaces.Where(x => x > planetSurfaces[targetPlanet]).Min());
            }
            break;

        case "J":
            targetDigit = (targetDigit + bomb.GetModuleNames().Count()) % 10;
            break;

        case "K":
            targetPlanet--;
            if (targetPlanet == -1)
            {
                targetPlanet = 2;
            }
            break;

        case "L":
            targetDigit = (targetDigit + bomb.GetSerialNumberNumbers().First()) % 10;
            break;

        case "M":
            var differencesMin = new int[3];
            for (int i = 0; i < 3; i++)
            {
                differencesMin[i] = planetSurfaces[targetPlanet] - planetSurfaces[i];
                if (differencesMin[i] < 0)
                {
                    differencesMin[i] *= -1;
                }
            }
            var differencesMinList = differencesMin.ToList();
            differencesMinList.Remove(differencesMinList[targetPlanet]);
            targetPlanet = Array.IndexOf(differencesMin, differencesMinList.Min());
            break;

        case "N":
            targetDigit = (targetDigit + bomb.GetSerialNumberNumbers().ToArray()[1]) % 10;
            break;

        case "O":
            if (targetPlanet == Array.IndexOf(planetSpeeds, planetSpeeds.Min()))
            {
                targetPlanet = Array.IndexOf(planetSpeeds, planetSpeeds.Max());
            }
            else
            {
                targetPlanet = Array.IndexOf(planetSpeeds, planetSpeeds.Where(x => x < planetSpeeds[targetPlanet]).Max());
            }
            break;

        case "P":
            targetPlanet = targetPlanet == 0 ? 2 : 0;
            break;

        case "Q":
            targetDigit = (targetDigit + bomb.GetPortCount()) % 10;
            break;

        case "R":
            targetDigit = (targetDigit + 5) % 10;
            break;

        case "S":
            if (targetPlanet == Array.IndexOf(planetSpeeds, planetSpeeds.Max()))
            {
                targetPlanet = Array.IndexOf(planetSpeeds, planetSpeeds.Min());
            }
            else
            {
                targetPlanet = Array.IndexOf(planetSpeeds, planetSpeeds.Where(x => x > planetSpeeds[targetPlanet]).Min());
            }
            break;

        case "T":
            targetDigit = (targetDigit + bomb.GetSerialNumberNumbers().Last()) % 10;
            break;

        case "U":
            targetPlanet = (targetPlanet + 1) % 3;
            break;

        case "V":
            targetDigit = (targetDigit + bomb.GetBatteryCount()) % 10;
            break;

        case "W":
            var indicators = bomb.GetIndicators().SelectMany(x => x.ToUpperInvariant().ToCharArray());
            var count      = 0;
            foreach (Char c in indicators)
            {
                if (!"AEIOU".Contains(c))
                {
                    count++;
                }
            }
            targetDigit = (targetDigit + count) % 10;
            break;

        default:
            if (planetSurfaces[targetPlanet] == planetSurfaces.Min())
            {
                targetPlanet = Array.IndexOf(planetSurfaces, planetSurfaces.Max());
            }
            else
            {
                targetPlanet = Array.IndexOf(planetSurfaces, planetSurfaces.Where(x => x < planetSurfaces[targetPlanet]).Min());
            }
            break;
        }
        if (targetPlanet != prevPlanet)
        {
            Debug.LogFormat("[Exoplanets #{0}] The target planet is now the {1} planet.", moduleId, positionNames[targetPlanet]);
        }
        if (targetDigit != prevDigit)
        {
            Debug.LogFormat("[Exoplanets #{0}] The target digit is now {1}.", moduleId, targetDigit);
        }
        if (j != 2)
        {
            tableRing--;
            if (tableRing == -1)
            {
                tableRing = 2;
            }
            Debug.LogFormat("[Exoplanets #{0}] Moving inward...", moduleId);
        }
    }

    void PressPlanet(KMSelectable button)
    {
        var ix            = Array.IndexOf(planetButtons, button);
        var submittedTime = ((int)bomb.GetTime()) % 10;
        var oridinals     = new string[] { "1st", "2nd", "3rd" };

        Debug.LogFormat("[Exoplanets #{0}] You pressed the {1} planet.", moduleId, oridinals[ix]);
        var planetCorrect = targetPlanet == ix;
        var timeCorrect   = targetDigit == submittedTime;

        if (planetCorrect && timeCorrect)
        {
            module.HandlePass();
            moduleSolved = true;
            if (ambianceRef != null)
            {
                ambianceRef.StopSound();
                ambianceRef = null;
            }
            Debug.LogFormat("[Exoplanets #{0}] That was correct. Module solved!", moduleId);
            audio.PlaySoundAtTransform("explosion", transform);
            StartCoroutine(SolveAnimation());
        }
        else
        {
            if (!planetCorrect && !timeCorrect)
            {
                Debug.LogFormat("[Exoplanets #{0}] Neither the planet nor the time were correct.", moduleId);
            }
            else if (!planetCorrect && timeCorrect)
            {
                Debug.LogFormat("[Exoplanets #{0}] The planet wasn’t correct, but the time was.", moduleId);
            }
            else
            {
                Debug.LogFormat("[Exoplanets #{0}] The planet was correct, but the time wasn’t.", moduleId);
            }
            module.HandleStrike();
            Debug.LogFormat("[Exoplanets #{0}] Strike!", moduleId);
        }
    }

    void PressStar()
    {
        if (isMoving && !moduleSolved)
        {
            return;
        }
        if (moduleSolved)
        {
            return;
        }
        else
        {
            foreach (Renderer planet in planets)
            {
                var ix = Array.IndexOf(planets, planet);
                if (!planetsHidden)
                {
                    savedPositions[ix] = planet.transform.localPosition;
                }
                StartCoroutine(MovePlanets(planet, ix));
            }
        }
    }

    IEnumerator MovePlanets(Renderer planet, int ix)
    {
        isMoving = true;
        var elapsed  = 0f;
        var duration = 1f;

        while (elapsed < duration)
        {
            if (!planetsHidden)
            {
                planet.transform.localPosition = new Vector3(Easing.InOutQuad(elapsed, savedPositions[ix].x, 0, duration), Easing.InOutQuad(elapsed, savedPositions[ix].y, .0314f, duration), Easing.InOutQuad(elapsed, savedPositions[ix].z, 0, duration));
            }
            else
            {
                planet.transform.localPosition = new Vector3(Easing.InOutQuad(elapsed, 0, savedPositions[ix].x, duration), Easing.InOutQuad(elapsed, .0314f, savedPositions[ix].y, duration), Easing.InOutQuad(elapsed, 0, savedPositions[ix].z, duration));
            }
            yield return(null);

            elapsed += Time.deltaTime;
        }
        isMoving      = false;
        planetsHidden = !planetsHidden;
    }

    IEnumerator Orbit(Transform pivot, int ix)
    {
        var startAngle = rnd.Range(0, 360);
        var elapsed    = 0f;
        var speed      = planetSpeeds[ix];

        if (planetsCcw[ix])
        {
            speed = -speed;
        }
        while (true)
        {
            pivot.localEulerAngles = new Vector3(0, elapsed / speed * 360 + startAngle, 0);
            yield return(null);

            elapsed += Time.deltaTime;
        }
    }

    IEnumerator Spinning(Renderer planet, int ix)
    {
        var startAngle = rnd.Range(0, 360);
        var pX = planet.transform.localEulerAngles.x;
        var pZ = planet.transform.localEulerAngles.z;
        var elapsed = 0f;
        var speed = new float[] { 4f, 6f, 7f, 8f }.PickRandom();

        if (!planetsCcw[ix])
        {
            speed = -speed;
        }
        while (true)
        {
            planet.transform.localEulerAngles = new Vector3(pX, elapsed / speed * 360 + startAngle, pZ);
            yield return(null);

            elapsed += Time.deltaTime;
        }
    }

    IEnumerator StarMovement()
    {
        var starScrollSpeed = .02f;

        if (starCcw)
        {
            starScrollSpeed = -starScrollSpeed;
        }
        while (true)
        {
            var offsetStar = Time.time * starScrollSpeed;
            star.material.mainTextureOffset = new Vector2(offsetStar, 0f);
            yield return(null);
        }
    }

    IEnumerator BackgroundMoveMent()
    {
        var horizontalScrollSpeed = .001f;
        var verticalScrollSpeed   = .001f;

        while (true)
        {
            var offsetY = Time.time * horizontalScrollSpeed;
            var offsetZ = Time.time * verticalScrollSpeed;
            background.material.mainTextureOffset = new Vector2(offsetY, offsetZ);
            yield return(null);
        }
    }

    IEnumerator SolveAnimation()
    {
        var elapsed  = 0f;
        var duration = 6f;

        for (int i = 0; i < 3; i++)
        {
            savedPositions[i] = planets[i].transform.localPosition;
            StopCoroutine(orbits[i]);
            StopCoroutine(tilts[i]);
        }
        StopCoroutine(starSpinning);
        while (elapsed < duration)
        {
            var fade = Mathf.Lerp(1f, 0f, elapsed / duration);
            foreach (Renderer planet in planets)
            {
                planet.material.color = new Color(fade, fade, fade);
            }
            yield return(null);

            elapsed += Time.deltaTime;
        }
        for (int i = 0; i < 3; i++)
        {
            planets[i].gameObject.SetActive(false);
            dummyPlanets[i].transform.SetParent(pivots[i], false);
            dummyPlanets[i].gameObject.SetActive(true);
            dummyPlanets[i].transform.localPosition = savedPositions[i];
        }
        elapsed  = 0f;
        duration = 3f;
        while (elapsed < duration)
        {
            var fade = Mathf.Lerp(1f, 0f, elapsed / duration);
            star.material.color = new Color(fade, fade, fade);
            yield return(null);

            elapsed += Time.deltaTime;
        }
        star.gameObject.SetActive(false);
        dummyStar.gameObject.SetActive(true);
        elapsed  = 0f;
        duration = 3.5f;
        while (elapsed < duration)
        {
            var fade = Mathf.Lerp(1f, 0f, elapsed / duration);
            dummyStar.material.color = new Color(0f, 0f, 0f, fade);
            foreach (Renderer planet in dummyPlanets)
            {
                planet.material.color = new Color(0f, 0f, 0f, fade);
            }
            yield return(null);

            elapsed += Time.deltaTime;
        }
        dummyStar.gameObject.SetActive(false);
        foreach (Renderer planet in dummyPlanets)
        {
            planet.gameObject.SetActive(false);
        }
        yield return(new WaitForSeconds(.75f));

        background.material.color = solveColor;
        audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.CorrectChime, transform);
    }

    IEnumerator DisableDummies()
    {
        yield return(null);

        ambianceRef = audio.PlaySoundAtTransformWithRef("ambiance", star.transform);
        dummyStar.gameObject.SetActive(false);
        foreach (Renderer planet in dummyPlanets)
        {
            planet.gameObject.SetActive(false);
        }
    }

    void HandleDetonation()
    {
        StopAllCoroutines();
        if (ambianceRef != null)
        {
            ambianceRef.StopSound();
            ambianceRef = null;
        }
    }
    void Activate()
    {
        this.activated    = false;
        this.moduleNumber = new int[8];
        this.answers      = new int[8];

        for (int i = 0; i < this.moduleNumber.Length; ++i)
        {
            this.moduleNumber[i] = Rnd.Range(0, 10);
        }
        ;

        var burglarAlarmHelper = new BurglarAlarmHelper(this.moduleNumber, this.Info);

        this.numberHandlers = CreateNumberHandlers(burglarAlarmHelper);

        Debug.LogFormat("[Burglar Alarm #{0}] Module number is: {1}.", this._moduleId, string.Join(string.Empty, this.moduleNumber.Select(x => x.ToString()).ToArray()));
        LogSolutionAlternatives(this._moduleId, this.moduleNumber, this.Info);

        this.DisplayText.text = burglarAlarmHelper.ToStringNumber;

        this.Info.OnBombExploded += delegate()
        {
            this.StopSound();
        };

        for (int i = 0; i < this.Buttons.Count(); ++i)
        {
            var myIndex = i;
            this.Buttons[i].OnInteract += delegate()
            {
                Audio.PlaySoundAtTransform("Button sound", this.Buttons[myIndex].transform);
                this.Buttons[myIndex].AddInteractionPunch();

                if (!activated || this.isSolved)
                {
                    return(false);
                }

                if (this.noPressed >= 8)
                {
                    Debug.LogFormat("[Burglar Alarm #{0}] Pressed too many numbers! Strike!", this._moduleId);
                    this.HandleStrike();
                    return(false);
                }

                else
                {
                    this.answers[this.noPressed++] = myIndex;
                }

                return(false);
            };
        }

        this.ActivateButton.OnInteract += delegate()
        {
            Audio.PlaySoundAtTransform("Button sound", this.ActivateButton.transform);
            ActivateButton.AddInteractionPunch();
            if (this.isSolved)
            {
                return(false);
            }

            if (this.activated)
            {
                this.HandleStrike();
            }
            else
            {
                Debug.LogFormat("[Burglar Alarm #{0}] Module activated!", this._moduleId);
                Debug.LogFormat("[Burglar Alarm #{0}] Started at {1} solves.", this._moduleId, this.Info.GetSolvedModuleNames().Count);
                Debug.LogFormat("[Burglar Alarm #{0}] Expected input: {1}.", this._moduleId, LogModuleSolutionNumber(numberHandlers));
                StartCoroutine("Countdown");
                this.activationSound = Audio.PlaySoundAtTransformWithRef("Activation sound", Module.transform);
                this.activated       = true;
            }

            return(false);
        };

        this.SubmitButton.OnInteract += delegate()
        {
            if (this.activated)
            {
                Debug.LogFormat("[Burglar Alarm #{0}] Submitted: {1}.", this._moduleId, string.Join(string.Empty, this.answers.Select(x => x.ToString()).ToArray()));
            }

            Audio.PlaySoundAtTransform("Button sound", this.SubmitButton.transform);
            SubmitButton.AddInteractionPunch();
            if (this.isSolved)
            {
                return(false);
            }

            if (!this.activated)
            {
                Debug.LogFormat("[Burglar Alarm #{0}] Submitted a number before activating the module. Strike!", this._moduleId);
                this.HandleStrike();
                return(false);
            }

            bool success = true;
            for (int i = 0; i < this.answers.Count(); ++i)
            {
                if (this.answers[i] != this.numberHandlers[i].GetNumber())
                {
                    success = false;
                }
            }

            if (success)
            {
                Debug.LogFormat("[Burglar Alarm #{0}] Module passed!", this._moduleId);
                this.HandlePass();
            }
            else
            {
                Debug.LogFormat("[Burglar Alarm #{0}] Wrong answer!", this._moduleId);
                this.HandleStrike();
            }

            return(false);
        };
    }
    void Awake()
    {
        kugelcount         = 0;
        struck             = 0;
        totalsolved        = false;
        controlSequence    = "[";
        sphereMeshRenderer = Sphere.GetComponent <MeshRenderer>();
        sphereTextMesh     = Sphere.GetComponentInChildren <TextMesh>();
        shinyMeshRenderer  = Shiny.GetComponent <Light>();
        foreach (GameObject orb in Orbs)
        {
            OrbsMeshRenderer.Add(orb.GetComponent <MeshRenderer>());
        }

        foreach (GameObject light in Glow)
        {
            GlowLight.Add(light.GetComponent <Light>());
        }

        currentModID = modID++;
        colorblind   = CBM.ColorblindModeActive;

        if (ignoredModules == null)
        {
            ignoredModules = GetComponent <KMBossModule>().GetIgnoredModules("Kugelblitz", new string[] {
                "Forget Me Not",
                "Forget Everything",
                "Turn The Key",
                "Souvenir",
                "The Time Keeper",
                "Simon's Stages",
                "Forget It Not",
                "Forget This",
                "Forget Them All",
                "Divided Squares",
                "Übermodule",
                "Encryption Bingo",
                "Organization",
                "Ultimate Custom Night",
                "RPS Judging",
                "Cookie Jar",
                "Brainf---",
                "Kugelblitz"                 //for the sake of safety
            });
        }

        Sphere.OnInteract += delegate()
        {
            if (solved != Display.Length)
            {
                Module.HandleStrike(); sphereMeshRenderer.material.color = new Color(0.5f, 0f, 0f); basecol = new float[] { 0.5f, 0f, 0f }; hold = false;
                struck = (struck + 1) % (solved + 1);
            }
            else
            {
                if (!solve)
                {
                    sphereMeshRenderer.material.color = new Color(1f, 1f, 1f);
                    shinyMeshRenderer.color           = new Color(1f, 1f, 1f, 0.5f);
                    basecol = new float[] { 1f, 1f, 1f };
                }
                hold          = true;
                userSequence += '[';
                if (userSequence == "[")
                {
                    sound = Audio.PlaySoundAtTransformWithRef("VoidSucc", Module.transform);
                }
            }
            return(false);
        };
        Sphere.OnInteractEnded += delegate()
        {
            if (solved == Display.Length && hold)
            {
                hold          = false;
                userSequence += ']';
            }
        };
        BombInfo.OnBombExploded += delegate()
        {
            if (sound != null)
            {
                sound.StopSound();
                sound = null;
            }
        };

        GetComponent <KMBombModule>().OnActivate += ActivateModule;

        for (int i = 0; i < 7; i++)
        {
            r[i]  = Rnd.Range(0.055f, 0.09f);
            x[i]  = Rnd.Range(-1f, 1f); y[i] = Rnd.Range(-1f, 1f); z[i] = Rnd.Range(-1f, 1f);
            r2[i] = Mathf.Pow(Mathf.Pow(x[i], 2f) + Mathf.Pow(y[i], 2f) + Mathf.Pow(z[i], 2f), 0.5f);
            x[i]  = x[i] * r[i] / r2[i]; y[i] = y[i] * r[i] / r2[i]; z[i] = z[i] * r[i] / r2[i];
            vx[i] = Rnd.Range(-.1f, .1f); vy[i] = Rnd.Range(-.1f, .1f); vz[i] = Rnd.Range(-.1f, .1f);
            Orbs[i].transform.localPosition = new Vector3(x[i], y[i], z[i]);
            vmod[i] = 0.001f / Mathf.Pow(r[i], 2f);
        }
        sphereTextMesh.text = "";
    }
Beispiel #17
0
 private KMSelectable.OnInteractHandler BeanPressed(int pos)
 {
     return(delegate
     {
         if (frozen[pos])
         {
             sound = Audio.PlaySoundAtTransformWithRef("Mmmmmicrowave", Module.transform);
             heating = true;
             StartCoroutine(BeanHeating(pos));
         }
         else
         {
             Audio.PlaySoundAtTransform("Monch", Module.transform);
             if (eatenbeans == 3)
             {
                 Debug.LogFormat("[Cool Beans #{0}] They know...", _moduleID);
                 Module.HandleStrike();
             }
             else
             {
                 int solution = -1;
                 bool check = true;
                 for (int i = 8; i > -1 && check; i--)
                 {
                     if (beansafe[i] && safetypes[beanArray[i]])
                     {
                         solution = i;
                         check = false;
                     }
                 }
                 if (solution != -1)
                 {
                     if (!beansafe[pos])
                     {
                         string[] colour = { "n orange", " yellow", " green" };
                         if (safetypes[beanArray[pos]])
                         {
                             Debug.LogFormat("[Cool Beans #{0}] Eating bean {1} became unhygienic, remember?", _moduleID, pos + 1);
                         }
                         else
                         {
                             Debug.LogFormat("[Cool Beans #{0}] You already ate a{1} bean.", _moduleID, colour[beanArray[pos]]);
                         }
                         Module.HandleStrike();
                         StartCoroutine(Strike());
                     }
                     else if (pos != solution)
                     {
                         Debug.LogFormat("[Cool Beans #{0}] Why did you eat bean {1} when bean {2} was perfectly available?", _moduleID, pos + 1, solution + 1);
                         Module.HandleStrike();
                         StartCoroutine(Strike());
                     }
                 }
                 else
                 {
                     Debug.LogFormat("[Cool Beans #{0}] There was no valid bean, so you will not get a strike.", _moduleID);
                 }
                 beansafe[pos] = false;
                 if (pos / 3 != 0)
                 {
                     beansafe[pos - 3] = false;
                 }
                 if (pos / 3 != 2)
                 {
                     beansafe[pos + 3] = false;
                 }
                 if (pos % 3 != 0)
                 {
                     beansafe[pos - 1] = false;
                 }
                 if (pos % 3 != 2)
                 {
                     beansafe[pos + 1] = false;
                 }
                 safetypes[beanArray[pos]] = false;
                 eatenbeans++;
                 if (eatenbeans == 3)
                 {
                     Module.HandlePass();
                     Solve();
                 }
             }
             //Beans[pos].GetComponent<Renderer>().enabled = false;
             Beans[pos].transform.localScale = new Vector3(0f, 0f, 0f);
         }
         return false;
     });
 }
Beispiel #18
0
    // Update is called once per frame
    void Update()
    {
        if (stage != 0 && moduleSolved == false)
        {
            time += 1;
            if (time == 1)
            {
                soundEffect.StopSound();
                soundEffect = Audio.PlaySoundAtTransformWithRef(string.Format("Chunk {0}", stage), transform);
                back.GetComponent <MeshRenderer>().material   = mats[0];
                Button.GetComponent <MeshRenderer>().material = mats[2];
                texts[1].text  = "";
                texts[2].text  = "";
                texts[1].color = colors[4];
                texts[2].color = colors[0];
                texts[5].text  = "";
                texts[6].text  = "";
                texts[7].text  = "";
            }
            if (cycleInstead == false)
            {
                if (time < startTime)
                {
                    //texts[1].text = ""; I HAVE NO CLUE WHY HAVING THE IF STATEMENT HERE HELPS, IT JUST DOES
                    //texts[2].text = "";
                    canClick = false;
                }
                else if (time < sectionTime + startTime)
                {
                    canClick      = true;
                    texts[1].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)];
                    texts[2].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6) + (5 * smallWordOrder[0])];
                }
                else if (time < (sectionTime * 2) + startTime)
                {
                    texts[1].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)];
                    texts[2].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6) + (5 * smallWordOrder[1])];
                }
                else if (time < (sectionTime * 3) + startTime)
                {
                    texts[1].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)];
                    texts[2].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6) + (5 * smallWordOrder[2])];
                }
                else if (time < (sectionTime * 4) + startTime)
                {
                    texts[1].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)];
                    texts[2].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6) + (5 * smallWordOrder[3])];
                }
                else if (time < (sectionTime * 5) + startTime)
                {
                    texts[1].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)];
                    texts[2].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6) + (5 * smallWordOrder[4])];
                }
                else if (time < (sectionTime * 6) + startTime)
                {
                    texts[1].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)];
                    texts[2].text = PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6) + (5 * smallWordOrder[5])];
                }
                else
                {
                    //MISS
                    time = 0;
                    smallWordOrder.Shuffle();
                    stage        += 1;
                    missedStages += 1;
                    bigWordOrder.Add(bigWordOrder[(stage - 1) % 5]);
                    Debug.LogFormat("[Jack Attack #{0}] Stage {1} missed. Current misses: {2}", moduleId, stage - 1, missedStages);
                    Debug.LogFormat("[Jack Attack #{0}] The big word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)].Replace("\n", " "));
                    Debug.LogFormat("[Jack Attack #{0}] The correct small word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6)].Replace("\n", " "));
                    Check(0);
                }
            }
            else
            {
                if (time < startTime && time > 0)
                {
                    //texts[1].text = ""; I HAVE NO CLUE WHY HAVING THE IF STATEMENT HERE HELPS, IT JUST DOES
                    //texts[2].text = "";
                    canClick = false;
                }
                else if (time > 0)
                {
                    canClick = true;
                    dontDisp = false;
                }
                if (time > sectionTime + startTime)
                {
                    //MISS
                    time = 0;
                    smallWordOrder.Shuffle();
                    stage        += 1;
                    missedStages += 1;
                    bigWordOrder.Add(bigWordOrder[(stage - 1) % 5]);
                    Debug.LogFormat("[Jack Attack #{0}] Stage {1} missed. Current misses: {2}", moduleId, stage - 1, missedStages);
                    Debug.LogFormat("[Jack Attack #{0}] The big word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)].Replace("\n", " "));
                    Debug.LogFormat("[Jack Attack #{0}] The correct small word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 6)].Replace("\n", " "));
                    Check(0);
                }
            }
        }

        if (moduleSolved == true)
        {
            time += 1;
            if (time == 60)
            {
                soundEffect.StopSound();
            }
        }

        if (strikeGet == true)
        {
            time += 1;
            if (time == 95)
            {
                soundEffect.StopSound();
                strikeGet = false;
                canClick  = true;
            }
        }

        if (animating == true)
        {
            otherTime += 1;
            if (otherTime == 50)
            {
                texts[7].text = "$" + correctStages + ",000";
            }
            else if (otherTime == 90)
            {
                otherTime = 0;
                animating = false;
                canClick  = true;
            }
        }
    }
Beispiel #19
0
 void PressButton()
 {
     Button.AddInteractionPunch();
     playedTheDamnSound = false;
     if (moduleSolved == false && canClick == true)
     {
         if (stage == 0)
         {
             stage        += 1;
             texts[3].text = "";
             texts[4].text = "";
             texts[0].text = "";
             bigWordOrder.Shuffle();
             smallWordOrder.Shuffle();
             soundEffect = Audio.PlaySoundAtTransformWithRef("blank", transform);
             soundEffect.StopSound();
             soundEffect = Audio.PlaySoundAtTransformWithRef("Chunk 1", transform);
             Debug.LogFormat("[Jack Attack #{0}] The big word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)].Replace("\n", " "));
             Debug.LogFormat("[Jack Attack #{0}] The correct small word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 9)].Replace("\n", " "));
         }
         else
         {
             if (texts[2].text == PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 9)])
             {
                 smallWordOrder.Shuffle();
                 correctStages += 1;
                 time           = -2;
                 stage         += 1;
                 soundEffect.StopSound();
                 soundEffect = Audio.PlaySoundAtTransformWithRef("correct", transform);
                 back.GetComponent <MeshRenderer>().material   = mats[1];
                 Button.GetComponent <MeshRenderer>().material = mats[1];
                 Debug.LogFormat("[Jack Attack #{0}] Stage {1} is correct. Current correct stages: {2}", moduleId, stage - 1, correctStages);
                 Check(1);
                 if (moduleSolved == false)
                 {
                     Debug.LogFormat("[Jack Attack #{0}] The big word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 1)].Replace("\n", " "));
                     Debug.LogFormat("[Jack Attack #{0}] The correct small word is: \"{1}\"", moduleId, PhraseList.phrases[anchor + (bigWordOrder[stage - 1] + 9)].Replace("\n", " "));
                 }
             }
             else
             {
                 Debug.LogFormat("[Jack Attack #{0}] Stage {1} striked. Module reset.", moduleId, stage);
                 time         = 0;
                 stage        = 0;
                 missedStages = 0;
                 bigWordOrder.Shuffle();
                 smallWordOrder.Shuffle();
                 if (cycleInstead == true)
                 {
                     dontDisp = true;
                 }
                 texts[0].text = PhraseList.phrases[anchor];
                 texts[1].text = "";
                 texts[2].text = "";
                 texts[3].text = "JACK";
                 texts[4].text = "ATTACK";
                 strikeGet     = true;
                 canClick      = false;
                 soundEffect.StopSound();
                 soundEffect = Audio.PlaySoundAtTransformWithRef("scream", transform);
                 GetComponent <KMBombModule>().HandleStrike();
             }
         }
     }
     else
     {
         Debug.Log("YOU CANNOT CLICK RIGHT NOW");
     }
 }
Beispiel #20
0
    IEnumerator playSound()
    {
        switch (inputNumber)
        {
        case 1:
            soundRef = audio.PlaySoundAtTransformWithRef("1", transform);
            yield return(new WaitForSeconds(0.757f));

            soundRef.StopSound();
            break;

        case 2:
            soundRef = audio.PlaySoundAtTransformWithRef("2", transform);
            yield return(new WaitForSeconds(0.574f));

            soundRef.StopSound();
            break;

        case 3:
            soundRef = audio.PlaySoundAtTransformWithRef("3", transform);
            yield return(new WaitForSeconds(0.731f));

            soundRef.StopSound();
            break;

        case 4:
            soundRef = audio.PlaySoundAtTransformWithRef("4", transform);
            yield return(new WaitForSeconds(0.783f));

            soundRef.StopSound();
            break;

        case 5:
            soundRef = audio.PlaySoundAtTransformWithRef("5", transform);
            yield return(new WaitForSeconds(0.574f));

            soundRef.StopSound();
            break;

        case 6:
            soundRef = audio.PlaySoundAtTransformWithRef("6", transform);
            yield return(new WaitForSeconds(0.757f));

            soundRef.StopSound();
            break;

        case 7:
            soundRef = audio.PlaySoundAtTransformWithRef("7", transform);
            yield return(new WaitForSeconds(0.653f));

            soundRef.StopSound();
            break;

        case 8:
            soundRef = audio.PlaySoundAtTransformWithRef("8", transform);
            yield return(new WaitForSeconds(0.574f));

            soundRef.StopSound();
            break;

        case 9:
            soundRef = audio.PlaySoundAtTransformWithRef("9", transform);
            yield return(new WaitForSeconds(0.757f));

            soundRef.StopSound();
            break;

        case 10:
            soundRef = audio.PlaySoundAtTransformWithRef("10", transform);
            yield return(new WaitForSeconds(0.862f));

            soundRef.StopSound();
            break;

        case 11:
            soundRef = audio.PlaySoundAtTransformWithRef("11", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 12:
            soundRef = audio.PlaySoundAtTransformWithRef("12", transform);
            yield return(new WaitForSeconds(0.992f));

            soundRef.StopSound();
            break;

        case 13:
            soundRef = audio.PlaySoundAtTransformWithRef("13", transform);
            yield return(new WaitForSeconds(1.149f));

            soundRef.StopSound();
            break;

        case 14:
            soundRef = audio.PlaySoundAtTransformWithRef("14", transform);
            yield return(new WaitForSeconds(1.097f));

            soundRef.StopSound();
            break;

        case 15:
            soundRef = audio.PlaySoundAtTransformWithRef("15", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 16:
            soundRef = audio.PlaySoundAtTransformWithRef("16", transform);
            yield return(new WaitForSeconds(1.018f));

            soundRef.StopSound();
            break;

        case 17:
            soundRef = audio.PlaySoundAtTransformWithRef("17", transform);
            yield return(new WaitForSeconds(1.149f));

            soundRef.StopSound();
            break;

        case 18:
            soundRef = audio.PlaySoundAtTransformWithRef("18", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 19:
            soundRef = audio.PlaySoundAtTransformWithRef("19", transform);
            yield return(new WaitForSeconds(0.914f));

            soundRef.StopSound();
            break;

        case 20:
            soundRef = audio.PlaySoundAtTransformWithRef("20", transform);
            yield return(new WaitForSeconds(1.044f));

            soundRef.StopSound();
            break;

        case 21:
            soundRef = audio.PlaySoundAtTransformWithRef("21", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 22:
            soundRef = audio.PlaySoundAtTransformWithRef("22", transform);
            yield return(new WaitForSeconds(1.123f));

            soundRef.StopSound();
            break;

        case 23:
            soundRef = audio.PlaySoundAtTransformWithRef("23", transform);
            yield return(new WaitForSeconds(1.175f));

            soundRef.StopSound();
            break;

        case 24:
            soundRef = audio.PlaySoundAtTransformWithRef("24", transform);
            yield return(new WaitForSeconds(1.097f));

            soundRef.StopSound();
            break;

        case 25:
            soundRef = audio.PlaySoundAtTransformWithRef("25", transform);
            yield return(new WaitForSeconds(1.175f));

            soundRef.StopSound();
            break;

        case 26:
            soundRef = audio.PlaySoundAtTransformWithRef("26", transform);
            yield return(new WaitForSeconds(0.992f));

            soundRef.StopSound();
            break;

        case 27:
            soundRef = audio.PlaySoundAtTransformWithRef("27", transform);
            yield return(new WaitForSeconds(1.149f));

            soundRef.StopSound();
            break;

        case 28:
            soundRef = audio.PlaySoundAtTransformWithRef("28", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 29:
            soundRef = audio.PlaySoundAtTransformWithRef("29", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 30:
            soundRef = audio.PlaySoundAtTransformWithRef("30", transform);
            yield return(new WaitForSeconds(1.071f));

            soundRef.StopSound();
            break;

        case 31:
            soundRef = audio.PlaySoundAtTransformWithRef("31", transform);
            yield return(new WaitForSeconds(1.384f));

            soundRef.StopSound();
            break;

        case 32:
            soundRef = audio.PlaySoundAtTransformWithRef("32", transform);
            yield return(new WaitForSeconds(1.253f));

            soundRef.StopSound();
            break;

        case 33:
            soundRef = audio.PlaySoundAtTransformWithRef("33", transform);
            yield return(new WaitForSeconds(1.306f));

            soundRef.StopSound();
            break;

        case 34:
            soundRef = audio.PlaySoundAtTransformWithRef("34", transform);
            yield return(new WaitForSeconds(1.227f));

            soundRef.StopSound();
            break;

        case 35:
            soundRef = audio.PlaySoundAtTransformWithRef("35", transform);
            yield return(new WaitForSeconds(1.227f));

            soundRef.StopSound();
            break;

        default:
            soundRef = audio.PlaySoundAtTransformWithRef("36", transform);
            yield return(new WaitForSeconds(1.149f));

            soundRef.StopSound();
            break;
        }
    }