Beispiel #1
0
 // Method to call the state answer selection.
 public void PlayerAnswer()
 {
     state = CustomBattleState.PlayerAnswer;
     dialogBox.EnableActionSelector(false);
     dialogBox.EnableDialogText(false);
     dialogBox.EnableQuestionText(true);
     dialogBox.EnableAnswerSelector(true);
     dialogBox.EnableMoveSelector(false);
 }
Beispiel #2
0
 // Method to call the state action selection.
 public void ActionSelection()
 {
     state = CustomBattleState.ActionSelection;
     StartCoroutine(dialogBox.TypeDialog("Choose an action"));
     dialogBox.EnableActionSelector(true);
     dialogBox.EnableMoveSelector(false);
     dialogBox.EnableDialogText(true);
     dialogBox.EnableAnswerSelector(false);
 }
Beispiel #3
0
    // Method to call the move made by the player.
    public IEnumerator PlayerMove()
    {
        state = CustomBattleState.PerformMove;
        Move move;

        move = player.PlayerUnit.Monster.Moves[0];
        yield return(dialogBox.TypeDialog($"You answered correctly!"));

        yield return(new WaitForSeconds(1f));

        yield return(RunMove(player.PlayerUnit, trainerUnit, move));

        if (state == CustomBattleState.PerformMove)
        {
            ActionSelection();
        }
    }
Beispiel #4
0
    // Method to call the state action selection if the player has answered wrongly (for custom) and if the player has answered all questions, the method BattleOver will be called.
    public IEnumerator ActionSelectionifWrong()
    {
        state = CustomBattleState.ActionSelection;
        yield return(dialogBox.TypeDialog("You answered wrongly!"));

        if (questionNum == (totalQuestionNum + 1))
        {
            Debug.Log("questionnum = total question");
            yield return(dialogBox.TypeDialog("You have answered all questions!"));

            yield return(dialogBox.TypeDialog($"You have scored a total of {totalcorrectAnswer}/{totalQuestionNum} correct!"));

            yield return(new WaitForSeconds(1f));

            BattleOver(false);
        }
        dialogBox.EnableActionSelector(true);
        dialogBox.EnableMoveSelector(false);
        dialogBox.EnableDialogText(true);
        dialogBox.EnableAnswerSelector(false);
    }
Beispiel #5
0
 // Method that calls the state BattleOver and updates the player score into the firebase.
 public void BattleOver(bool won)   //if true means player has won
 {
     state = CustomBattleState.BattleOver;
     StartCoroutine(updateUserCustomBattlePoints(won));
     Debug.Log("How to solve this");
 }