Beispiel #1
0
    public void BeginCombatTutorial()
    {
        tutorial.StopTimer();
        tutorialState = TutorialSequence.Beginning;

        combatGrid.transform.parent.gameObject.SetActive(true);
        items.SetActive(true);

        foreach (Button b in buttons)
        {
            b.interactable = false;
        }
        itemButtons = GameObject.FindObjectsOfType <ItemGUIButton>();
        foreach (ItemGUIButton b in itemButtons)
        {
            b.GetComponent <Button>().interactable = false;
        }

        potionButton = System.Array.Find(itemButtons, item => item.itemToUse.GetType() == typeof(Potion));

        potionButton.gameObject.GetComponent <Button>().onClick.AddListener(PotionButtonTutorial);

        tutorial.SetTutorialText("This is how you help others out, by Battling Sadness! The buttons at the bottom detail what you can do!", beginningTime);

        items.SetActive(false);
    }
Beispiel #2
0
 void Awake()
 {
     //Singleton stuff
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
Beispiel #3
0
    void Update()
    {
        if (tutorialState == TutorialSequence.Beginning && tutorial.TimeIsUp)
        {
            tutorialState = TutorialSequence.Smile;
        }
        else if (tutorialState == TutorialSequence.Smile)
        {
            buttons[0].interactable = true;
            tutorial.SetTutorialText("Your first option is Smile! It takes away a small amount of sadness!" +
                                     " Click it now to see how it works", buttonExplanationTime);
            tutorial.ToggleOkButton(false);
        }
        else if (tutorialState == TutorialSequence.NPCTurn)
        {
            if (!inThing)
            {
                inThing = true;
                tutorial.SetTutorialText("The Sadness is fighting back! It is difficult to help people overcome their inner pain." +
                                         " So you'll help, and then it'll fight back! You take turns!", npcTurnExplanationTime);
            }

            if (tutorial.TimeIsUp)
            {
                inThing       = false;
                tutorialState = TutorialSequence.Compliment;
            }
        }

        else if (tutorialState == TutorialSequence.Compliment)
        {
            buttons[1].interactable = true;
            tutorial.SetTutorialText("The second way you can combat sadness is Complimenting! Though Compliments are dangerous." +
                                     " They hurt your happiness a little too! Try it now!", buttonExplanationTime);
            tutorial.ToggleOkButton(false);
        }

        else if (tutorialState == TutorialSequence.NPCTurn2)
        {
            if (!inThing)
            {
                inThing = true;
                tutorial.SetTutorialText("Ah, the Sadness is recovering health! Different people have different types of Sadness." +
                                         " You've got to watch out for their moves and figure out how to win!", npcTurn2ExplanationTime);
            }
            if (tutorial.TimeIsUp)
            {
                inThing       = false;
                tutorialState = TutorialSequence.Items;
            }
        }

        else if (tutorialState == TutorialSequence.Items)
        {
            buttons[2].interactable = true;
            tutorial.SetTutorialText("Your health is getting kind of low, we should use a Potion to bring up our happiness!" +
                                     " Click on the items to open up that menu!", buttonExplanationTime);
            tutorial.ToggleOkButton(false);
        }

        else if (tutorialState == TutorialSequence.UsePotion)
        {
            potionButton.gameObject.GetComponent <Button>().interactable = true;
            tutorial.SetTutorialText("Click on the Potion button to use it!", buttonExplanationTime);
        }

        else if (tutorialState == TutorialSequence.EndTutorial)
        {
            if (!inThing)
            {
                inThing = true;
                foreach (Button b in buttons)
                {
                    b.interactable = true;
                }
                cancelItemsButton.interactable = true;
                itemButtons = GameObject.FindObjectsOfType <ItemGUIButton>();
                foreach (ItemGUIButton b in itemButtons)
                {
                    b.gameObject.GetComponent <Button>().interactable = true;
                }
                tutorial.SetTutorialText("Well that's the end of the tutorial! Good luck finishing the battle!", 3f);

                buttons[0].onClick.RemoveListener(SmileButtonTutorial);
                buttons[1].onClick.RemoveListener(ComplimentButtonTutorial);
                buttons[2].onClick.RemoveListener(ItemsButtonTutorial);
            }


            if (tutorial.TimeIsUp)
            {
                options.padding.top    = 15;
                options.padding.bottom = 15;
                options.padding.left   = 15;
                options.padding.right  = 15;
                combatGrid.offsetMax   = new Vector2(combatGrid.offsetMax.x, 0);
                tutorialState          = TutorialSequence.None;
            }
        }
    }
Beispiel #4
0
 public void PotionButtonTutorial()
 {
     tutorialState = TutorialSequence.EndTutorial;
     tutorial.StopTimer();
 }
Beispiel #5
0
 public void ItemsButtonTutorial()
 {
     buttons[2].interactable = false;
     tutorialState           = TutorialSequence.UsePotion;
     tutorial.StopTimer();
 }
Beispiel #6
0
 public void ComplimentButtonTutorial()
 {
     buttons[1].interactable = false;
     tutorialState           = TutorialSequence.NPCTurn2;
     tutorial.StopTimer();
 }
Beispiel #7
0
 public void SmileButtonTutorial()
 {
     buttons[0].interactable = false;
     tutorialState           = TutorialSequence.NPCTurn;
     tutorial.StopTimer();
 }