Esempio n. 1
0
    private void GiveFeedback()
    {
        alreadyGaveFeedback = true;
        if (NPC != null)
        {
            NPCController.SolutionTypes solution = NPCScript.GetSolution();

            canvasScript.SetSolutionType(solution);

            if (solution == NPCController.SolutionTypes.Ignore)
            {
                if (!montyTalking)
                {
                    SoundManager.Instance.ObjectSounds[0].PlayAudioClip(8);
                }
                canvasScript.SetDialogBox(ignoreMontyFeedBack);
                NPC.SetActive(false);
            }

            if (solution == NPCController.SolutionTypes.Flight)
            {
                if (!montyTalking)
                {
                    SoundManager.Instance.ObjectSounds[0].PlayAudioClip(8);
                }
                canvasScript.SetDialogBox(flightMontyFeedBack);
            }

            if (solution == NPCController.SolutionTypes.Fight)
            {
                if (!montyTalking)
                {
                    SoundManager.Instance.ObjectSounds[0].PlayAudioClip(7);
                }
                canvasScript.SetDialogBox(fightMontyFeedBack);
            }

            if (solution == NPCController.SolutionTypes.Confrontation)
            {
                if (!montyTalking)
                {
                    SoundManager.Instance.ObjectSounds[0].PlayAudioClip(6);
                }
                canvasScript.SetDialogBox(confrontMontyFeedBack);
            }
        }
        else
        {
            canvasScript.SetDialogBox(defaultTalk);
        }
        canvasScript.DisableAllButtons();
    }
Esempio n. 2
0
 public void SetSolutionType(NPCController.SolutionTypes solution)
 {
     if (solution == NPCController.SolutionTypes.Fight)
     {
         EmotionField.sprite = Fight;
     }
     if (solution == NPCController.SolutionTypes.Flight || solution == NPCController.SolutionTypes.Ignore)
     {
         EmotionField.sprite = Flight;
     }
     if (solution == NPCController.SolutionTypes.Confrontation)
     {
         EmotionField.sprite = Confront;
     }
 }
Esempio n. 3
0
    public void NextLevel()
    {
        if (!endLevelSoundPlayed)
        {
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.ObjectSounds[0].PlayAudioClip(5);
            }
            endLevelSoundPlayed = true;
        }

        if (LevelLoader.HasMoreLevels)
        {
            NPCController.SolutionTypes solution = MontyController.GetSolution();
            switch (solution)
            {
            case NPCController.SolutionTypes.Confrontation:
                LevelLoader.CurrentPlayThrough.IncreaseGoodQuestionsAfterLevelEnded(1);
                gameStats.IncreaseConfrontation(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Ignore:
            case NPCController.SolutionTypes.Flight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseIgnoreFlight(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Fight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseFight(gameStats.levelDifficulty.ToString());
                break;
            }

            gameStats.Save();
            LevelLoader.LoadNextLevel();
        }
        else if (SceneManager.GetActiveScene().name == "Tutorial")
        {
            SceneManager.LoadScene("MainMenuScene");
            endLevelSoundPlayed = false;
        }
        else if (!playthroughEnded)
        {
            NPCController.SolutionTypes solution = MontyController.GetSolution();
            switch (solution)
            {
            case NPCController.SolutionTypes.Confrontation:
                LevelLoader.CurrentPlayThrough.IncreaseGoodQuestionsAfterLevelEnded(1);
                gameStats.IncreaseConfrontation(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Ignore:
            case NPCController.SolutionTypes.Flight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseIgnoreFlight(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Fight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseFight(gameStats.levelDifficulty.ToString());
                break;
            }

            RewardsText rewardsText = endGamePrefab.GetComponentInChildren <RewardsText>();
            if (rewardsText != null)
            {
                rewardsText.SetText();
            }

            if (LevelLoader.CurrentPlayThrough.GoodQuestionsPlaythrough == LevelLoader.DEFAULT_LEVEL_AMOUNT)
            {
                GameStats.Instance.IncreaseDifficulty();
            }
            if (LevelLoader.CurrentPlayThrough.BadQuestionsPlaythrough >= minQuestionsToDecreaseDifficulty)
            {
                GameStats.Instance.DecreaseDifficulty();
            }

            LevelLoader.EndPlaythrough();
            playthroughEnded = true;
            endGamePrefab.SetActive(true);
            endLevelSoundPlayed = false;
            gameStats.EndPlaythrough(DateTime.Now);
            gameStats.Save();
        }
    }