string RpsOptionToString(VisualNovelScene.RpsOption rpsOption)
    {
        string rpsString = "";

        switch (rpsOption)
        {
        case VisualNovelScene.RpsOption.Rock:
            rpsString = "BE AGGRESSIVE";
            break;

        case VisualNovelScene.RpsOption.Paper:
            rpsString = "BE NICE";
            break;

        case VisualNovelScene.RpsOption.Scissors:
            rpsString = "BE PASSIVE AGGRESSIVE";
            break;

        case VisualNovelScene.RpsOption.None:
            break;

        default:
            break;
        }

        return(rpsString);
    }
Beispiel #2
0
    public Sprite GetRpsSymbol(VisualNovelScene.RpsOption rpsOption)
    {
        Sprite symbol = null;

        switch (rpsOption)
        {
        case VisualNovelScene.RpsOption.Rock:
            symbol = rockSymbol;
            break;

        case VisualNovelScene.RpsOption.Paper:
            symbol = paperSymbol;
            break;

        case VisualNovelScene.RpsOption.Scissors:
            symbol = scissorsSymbol;
            break;

        case VisualNovelScene.RpsOption.None:
            symbol = blankSymbol;
            break;

        default:
            break;
        }

        return(symbol);
    }
 public string[] GetRpsDialogue(int scenarioNum, VisualNovelScene.RpsOption winningChoice, VisualNovelScene.RpsOption losingChoice)
 {
     string[] key = new string[3] {
         scenarioNum.ToString(),
         RpsOptionToString(winningChoice),
         RpsOptionToString(losingChoice)
     };
     return(rpsDialogueDict[key]);
 }
Beispiel #4
0
 protected override void Init()
 {
     Services.EventManager.Register <ButtonPressed>(OnInputReceived);
     duration        = Services.DialogueUIManager.rpsWaitTime;
     timeElapsed     = 0;
     choice_P1       = VisualNovelScene.RpsOption.None;
     choice_P2       = VisualNovelScene.RpsOption.None;
     timerBackground = Services.DialogueUIManager.rpsTimerBackground.GetComponent <Image>();
     timer           = Services.DialogueUIManager.rpsTimer.GetComponent <Image>();
     timer.gameObject.SetActive(true);
     timerBackground.gameObject.SetActive(true);
 }
Beispiel #5
0
    private void OnInputReceived(ButtonPressed e)
    {
        VisualNovelScene.RpsOption choice = VisualNovelScene.RpsOption.None;
        switch (e.buttonTitle)
        {
        case "Y":
            choice = VisualNovelScene.RpsOption.Rock;
            break;

        case "X":
            choice = VisualNovelScene.RpsOption.Paper;
            break;

        case "B":
            choice = VisualNovelScene.RpsOption.Scissors;
            break;

        default:
            break;
        }
        if (e.playerNum == 1)
        {
            choice_P1 = choice;
            if (choice != VisualNovelScene.RpsOption.None)
            {
                Services.MusicManager.GenerateSourceAndPlay(Services.MusicManager.rpsReadySoundP1);
                choiceTime_P1 = timeElapsed;
                Services.DialogueUIManager.rpsReady_P1.SetActive(true);
            }
        }
        else if (e.playerNum == 2)
        {
            choice_P2 = choice;
            if (choice != VisualNovelScene.RpsOption.None)
            {
                Services.MusicManager.GenerateSourceAndPlay(Services.MusicManager.rpsReadySoundP2);
                choiceTime_P2 = timeElapsed;
                Services.DialogueUIManager.rpsReady_P2.SetActive(true);
            }
        }
        if ((choice_P1 != VisualNovelScene.RpsOption.None) && (choice_P2 != VisualNovelScene.RpsOption.None))
        {
            SetStatus(TaskStatus.Success);
        }
    }