Esempio n. 1
0
 public void ResolveChoice(EpisodeChoice choice)
 {
     foreach (var score in choice.Scores)
     {
         AddScore(score);
     }
 }
Esempio n. 2
0
 public void SetCurrentTimeOut(EpisodeChoice choice, float timeLeft)
 {
     if (choice != null)
     {
         VigController.SetIntensity(IntensityCurve.Evaluate(timeLeft));
     }
 }
Esempio n. 3
0
    public void SelectChoice(EpisodeChoice choice)
    {
        if (!Playing)
        {
            return;
        }

        toController.CancelTimeOut();
        Playing = false;
        StartCoroutine(ResolveEpisode(CurrentEpisode, choice));
    }
Esempio n. 4
0
    public void SetChoice(EpisodeChoice choice)
    {
        Choice = choice;

        foreach (var text in Texts)
        {
            text.text = Choice.Text;
        }

        ShowColors(choice);
    }
Esempio n. 5
0
    public void SpawnChoice(EpisodeChoice choice, bool isDark)
    {
        GameObject bubble = GameObject.Instantiate(GameConfig.Instance.EpisodeBubblePrefab, transform.position, GameConfig.Instance.EpisodeBubblePrefab.transform.rotation);

        bubble.GetComponent <EpisodeChoiceBubble>().SetChoice(choice);
        bubble.GetComponent <EpisodeChoiceBubble>().SetTargetVelocity(m_VelocityToSet);

        if (isDark)
        {
            bubble.GetComponent <EpisodeChoiceBubble>().SetDark(choice);
        }
    }
Esempio n. 6
0
    public void SetDark(EpisodeChoice choice)
    {
        if (IsDark)
        {
            return;
        }

        SetChoice(choice);
        IsDark = true;
        NormalObject.SetActive(false);
        DarkObject.SetActive(true);
    }
Esempio n. 7
0
    private IEnumerator ShowFailedToMakeChoice(Episode episode, EpisodeChoice timeOutChoice)
    {
        Playing = false;
        EpisodeManager.Instance.DisplayFailedToChoose(timeOutChoice);

        while (EpisodeManager.Instance.ShowingMessage)
        {
            yield return(null);
        }

        yield return(new WaitForSeconds(1f));

        toController.CancelTimeOut();
        StartCoroutine(ResolveEpisode(CurrentEpisode, timeOutChoice));
    }
Esempio n. 8
0
    private IEnumerator ResolveEpisode(Episode episode, EpisodeChoice choice)
    {
        Resolving = true;
        yield return(new WaitForSeconds(1f));

        EpisodeManager.Instance.DisplayResolveEpisode(episode, choice);

        while (EpisodeManager.Instance.ShowingMessage)
        {
            yield return(null);
        }

        if (choice.PlotToApply != null)
        {
            PlotManager.Instance.TriggerPlot(choice.PlotToApply);
        }


        while (EpisodeManager.Instance.ShowingMessage)
        {
            yield return(null);
        }

        HealthManager.Instance.ChangeHealth(choice.HealthChange);

        yield return(new WaitForSeconds(1f));

        if (HealthManager.Instance.Health <= 0)
        {
            StartCoroutine(LoseGame());
        }
        else if (choice.EndsGame)
        {
            StartCoroutine(FinishGame());
        }
        else
        {
            StartCoroutine(EnterEpisode(choice.NextScene));
        }
    }
Esempio n. 9
0
    private void AttemptSpawnGremlin()
    {
        if (EpisodeChoiceBubble.CurrentBubbles.Count == 0)
        {
            return;
        }

        foreach (var bubble in EpisodeChoiceBubble.CurrentBubbles)
        {
            if (!bubble.IsDark)
            {
                sValidChoices.Add(bubble);
            }
        }

        if (sValidChoices.Count == 0)
        {
            sValidChoices.Clear();
            return;
        }

        sValidChoices.Clear();

        if (GameStateManager.Instance.CurrentEpisode == null)
        {
            return;
        }

        EpisodeChoice darkChoice = GameStateManager.Instance.CurrentEpisode.GetRandomDarkChoice();

        if (darkChoice == null)
        {
            return;
        }

        GameObject spawned = Instantiate(PrefabToSpawn, transform.position, PrefabToSpawn.transform.rotation);

        spawned.GetComponent <Gremlin>().SetDarkChoice(darkChoice);
    }
Esempio n. 10
0
 private void ShowColors(EpisodeChoice choice)
 {
     if (choice.Scores.Count == 1)
     {
         leftGlow.enabled = rightGlow.enabled = true;
         leftGlow.color   = rightGlow.color = choice.Scores[0].Type.Color;
     }
     else if (choice.Scores.Count == 2)
     {
         leftGlow.enabled = rightGlow.enabled = true;
         leftGlow.color   = choice.Scores[0].Type.Color;
         rightGlow.color  = choice.Scores[1].Type.Color;
     }
     else if (choice.Scores.Count == 4)
     {
         allColorGlow.gameObject.SetActive(true);
     }
     else
     {
         leftGlow.enabled = rightGlow.enabled = false;
     }
 }
Esempio n. 11
0
    private IEnumerator PlayEpisode(Episode episode)
    {
        Playing = true;
        EpisodeChoice timeOutChoice = episode.GetRandomDarkChoice();
        float         timeLeft      = TimeUntilTimeOut;

        EpisodeManager.Instance.DisplayPlayingEpisode(episode);

        while (Playing)
        {
            /*
             * if (timeOutChoice != null)
             * {
             *  timeLeft -= Time.deltaTime;
             *  toController.SetCurrentTimeOut(timeOutChoice, timeLeft);
             *
             *  if (timeLeft <= 0f)
             *      yield return StartCoroutine(ShowFailedToMakeChoice(episode, timeOutChoice));
             * }
             */

            yield return(null);
        }
    }
Esempio n. 12
0
 public void DisplayFailedToChoose(EpisodeChoice timeOutChoice)
 {
     DescriptionUI.PlayMessage(timeOutChoice.Text);
 }
Esempio n. 13
0
 public void DisplayResolveEpisode(Episode episode, EpisodeChoice choice)
 {
     DescriptionUI.PlayMessage(choice.Outcome);
 }
Esempio n. 14
0
 public EpisodeChoice GetRandomDarkChoice()
 {
     return(EpisodeChoice.GetRandomChoice(DarkChoices));
 }
Esempio n. 15
0
 public void SetDarkChoice(EpisodeChoice darkChoice)
 {
     DarkChoice = darkChoice;
 }