Esempio n. 1
0
    IEnumerator RunTutorial()
    {
        musicSource.clip = tutorialMusic;
        musicSource.Play();

        yield return(null);

        yield return(DisplayTimedMessage("Your Majesty. Please allow me to welcome you to our humble gouf course.", 8f));

        yield return(DisplayTimedMessage("(Press S to skip the tutorial)", 3f));

        messageDisplay.DisplayIndefiniteMessage("If it so please you, please use your Mouse Wheel to get a better lay of the land.");
        while (!(Input.GetAxis("Mouse ScrollWheel") < 0f))
        {
            yield return(null);
        }

        yield return(DisplayTimedMessage("And what a splendid day it is. The royal treasury glistens brighter every moment.", 6f));

        messageDisplay.DisplayIndefiniteMessage("You of course may survey the course by holding the Left Mouse Button down and moving your Mouse left and right.");
        while (!(Input.GetMouseButton(0) && Mathf.Abs(Input.GetAxis("Mouse X")) > 0f))
        {
            yield return(null);
        }

        messageDisplay.DisplayIndefiniteMessage("Most excellent. At your leisure, you may strike the gouf ball by holding Space bar. After a regal pause, release the Space bar and let it sail!");
        while (!(Input.GetKeyUp(KeyCode.Space)))
        {
            yield return(null);
        }

        yield return(DisplayTimedMessage("Your eminence knows no bounds.", 4f));

        yield return(DisplayTimedMessage("... Your Majesty! Troubling news! Scouts have reported roving goblins in the area. I will, of course, bow to your infinite wisdom, but may I propose we fortify?", 9f));

        messageDisplay.DisplayIndefiniteMessage("When you have comfortably chosen a spot, merely press 1 and I shall draft the blueprint.");
        while (!(Input.GetKeyUp(KeyCode.Alpha1)))
        {
            yield return(null);
        }

        messageDisplay.DisplayIndefiniteMessage("A masterful choice. Press Space to begin the construction, or Escape if perhaps there is an even better location.");
        while (!(Input.GetKeyUp(KeyCode.Space) && buildSystem.isActiveAndEnabled))
        {
            yield return(null);
        }

        yield return(DisplayTimedMessage("May our meager construction raise you to the heavens. Do not trouble yourself about the materials! I will deduct a mere 10 gold from the coffers.", 9f));

        StartCoroutine(InitialSpawnCutscene());
    }
Esempio n. 2
0
    IEnumerator SpawnWaves()
    {
        int largeSpawn = 0;
        int giantSpawn = 0;

        while (elapsedTime < 60f)
        {
            elapsedTime += 1.75f;
            yield return(new WaitForSeconds(1.75f));

            SpawnEnemy(1, pathingNetwork);
        }

        messageDisplay.DisplayTimedMessage("Egads! There are larger ones now!", 10f);

        while (elapsedTime < 120f)
        {
            elapsedTime += 1.5f;
            yield return(new WaitForSeconds(1.5f));

            if (largeSpawn == 0)
            {
                SpawnEnemy(2, pathingNetwork);
            }
            else
            {
                SpawnEnemy(1, pathingNetwork);
            }

            largeSpawn = (largeSpawn + 1) % 4;
        }

        messageDisplay.DisplayTimedMessage("Giant goblins?! Has the world gone mad?!", 10f);

        while (elapsedTime < 180f)
        {
            elapsedTime += 1.25f;
            yield return(new WaitForSeconds(1.25f));

            if (giantSpawn == 0)
            {
                SpawnEnemy(3, pathingNetwork);
            }
            else if (largeSpawn == 0)
            {
                SpawnEnemy(2, pathingNetwork);
            }
            else
            {
                SpawnEnemy(1, pathingNetwork);
            }

            largeSpawn = (largeSpawn + 1) % 3;
            giantSpawn = (giantSpawn + 1) % 12;
        }

        messageDisplay.DisplayTimedMessage("Watch out Your Majesty! They now approach on the other side as well!!", 10f);

        while (elapsedTime < 240f)
        {
            elapsedTime += 1f;
            yield return(new WaitForSeconds(1f));

            if (giantSpawn == 0)
            {
                SpawnEnemy(3, pathingNetwork);
            }
            else if (largeSpawn == 0)
            {
                SpawnEnemy(2, pathingNetwork);
            }
            else
            {
                SpawnEnemy(1, pathingNetwork);
            }

            SpawnEnemy(1, pathingNetwork2);

            largeSpawn = (largeSpawn + 1) % 2;
            giantSpawn = (giantSpawn + 1) % 10;
        }

        messageDisplay.DisplayTimedMessage("They're giving it all they've got!", 10f);

        while (elapsedTime < 360f)
        {
            elapsedTime += 0.8f;
            yield return(new WaitForSeconds(0.8f));

            if (giantSpawn == 0)
            {
                SpawnEnemy(3, pathingNetwork);
                SpawnEnemy(3, pathingNetwork2);
            }
            else if (largeSpawn == 0)
            {
                SpawnEnemy(2, pathingNetwork);
                SpawnEnemy(2, pathingNetwork2);
            }
            else
            {
                SpawnEnemy(1, pathingNetwork);
                SpawnEnemy(1, pathingNetwork2);
            }

            largeSpawn = (largeSpawn + 1) % 2;
            giantSpawn = (giantSpawn + 1) % 8;
        }

        musicSource.clip = tutorialMusic;
        musicSource.Play();

        messageDisplay.DisplayTimedMessage("I believe we have them defeated! Hooray! Congratulations!", 10f);

        yield return(new WaitForSeconds(10f));

        messageDisplay.DisplayIndefiniteMessage("(You win! Thanks for playing. Feel free to continue by pressing P.)");

        while (!(Input.GetKeyUp(KeyCode.P)))
        {
            yield return(null);
        }

        messageDisplay.DisplayIndefiniteMessage("");

        while (true)
        {
            elapsedTime += 0.7f;
            yield return(new WaitForSeconds(0.7f));

            if (giantSpawn == 0)
            {
                SpawnEnemy(3, pathingNetwork);
                SpawnEnemy(3, pathingNetwork2);
            }
            else if (largeSpawn == 0)
            {
                SpawnEnemy(2, pathingNetwork);
                SpawnEnemy(2, pathingNetwork2);
            }
            else
            {
                SpawnEnemy(1, pathingNetwork);
                SpawnEnemy(1, pathingNetwork2);
            }

            largeSpawn = (largeSpawn + 1) % 2;
            giantSpawn = (giantSpawn + 1) % 6;
        }
    }