예제 #1
0
 public void solveCurrentProblem()
 {
     countProblemsRemaining -= 1;
     if (countProblemsRemaining == 0)
     {
         PlayAudioTask t = new PlayAudioTask("Audio/win");
         t.Then(new ActionTask(() => CwalEventManager.instance.Raise(new EndCallEvent())));
         TaskManager.instance.AddTask(t);
         // GameManager.instance.aSource.clip = Resources.Load<AudioClip>("Audio/win");
         // GameManager.instance.aSource.Play();
         // GameManager.instance.setGameState(GAME_STATE.VICTORY);
         // CwalEventManager.instance.Raise(new EndCallEvent());
     }
     else
     {
         setCurrentProblem();
         PlayAudioTask t = new PlayAudioTask("Audio/problem_resolved");
         t.Then(new PlayAudioTask("Audio/system_ops_at"))
         .Then(new PlayAudioTask(getPercentFile()))
         .Then(new PlayAudioTask(getNumBatteriesFile()))
         .Then(new PlayAudioTask("Audio/batteries_remaining"))
         .Then(new PlayAudioTask("Audio/next_problem"))
         .Then(new ActionTask(() => playAudioDescriptionOfProblem()));
         TaskManager.instance.AddTask(t);
     }
 }
예제 #2
0
 public void playAudioDescriptionOfProblem()
 {
     GameManager.instance.setGameState(GAME_STATE.SPEAKING);
     Debug.Log("hi!");
     if (currentProblemType == ProblemTypes.PartNotWorking)
     {
         Debug.Log("gorp");
         string partPath     = "Audio/" + currentProblemPart;
         string reportedPath = "Audio/" + currentProblemReported;
         Debug.Log(reportedPath);
         Debug.Log(Resources.Load(reportedPath));
         PlayAudioTask t = new PlayAudioTask("Audio/my");
         t.Then(new PlayAudioTask(partPath))
         .Then(new PlayAudioTask("Audio/is"))
         .Then(new PlayAudioTask(reportedPath))
         .Then(new ActionTask(() => GameManager.instance.setGameState(GAME_STATE.WAIT_FOR_INPUT)));
         TaskManager.instance.AddTask(t);
     }
     else if (currentProblemType == ProblemTypes.WarningLight)
     {
         PlayAudioTask t = new PlayAudioTask("Audio/my");
         t.Then(new PlayAudioTask("Audio/warning_light_is_on"))
         .Then(new ActionTask(() => GameManager.instance.setGameState(GAME_STATE.WAIT_FOR_INPUT)));
         TaskManager.instance.AddTask(t);
     }
 }
예제 #3
0
    public void DidntUnderstand()
    {
        Debug.Log("didnt understand");
        PlayAudioTask t = new PlayAudioTask("Audio/" + didntUnderstand);

        t.Then(new ActionTask(() => GameManager.instance.setGameState(GAME_STATE.WAIT_FOR_INPUT)));
        TaskManager.instance.AddTask(t);
    }
예제 #4
0
    public void loseGame()
    {
        PlayAudioTask t = new PlayAudioTask("Audio/zero");

        t.Then(new PlayAudioTask("Audio/batteries_remaining"))
        .Then(new PlayAudioTask("Audio/goodbye"))
        .Then(new ActionTask(() => CwalEventManager.instance.Raise(new EndCallEvent())));
        TaskManager.instance.AddTask(t);
    }
예제 #5
0
    public void startCall()
    {
        Debug.Log("Start call");
        GameManager.instance.setGameState(GAME_STATE.SPEAKING);
        PlayAudioTask t = new PlayAudioTask("Audio/identify");

        t.Then(new PlayAudioTask("Audio/system_ops_at"))
        .Then(new PlayAudioTask("Audio/forty_percent"))
        .Then(new PlayAudioTask("Audio/three"))
        .Then(new PlayAudioTask("Audio/batteries_remaining"))
        .Then(new ActionTask(() => playAudioDescriptionOfProblem()));
        TaskManager.instance.AddTask(t);
    }
예제 #6
0
 public void nextProblem()
 {
     setCurrentProblem();
     if (countProblemsRemaining == 5)
     {
         loseGame();
     }
     else
     {
         PlayAudioTask t = new PlayAudioTask("Audio/system_ops_at");
         t.Then(new PlayAudioTask(getPercentFile()))
         .Then(new PlayAudioTask("Audio/next_problem"))
         .Then(new ActionTask(() => playAudioDescriptionOfProblem()));
         TaskManager.instance.AddTask(t);
     }
 }
예제 #7
0
 public void answerIncorrectly()
 {
     //		PlayAudioTask t = new PlayAudioTask("Audio/didnt_understand");
     //		t.Then(new ActionTask(()=>GameManager.instance.setGameState(GAME_STATE.WAIT_FOR_INPUT)));
     //		TaskManager.instance.AddTask(t);
     batteriesRemaining -= 1;
     //countProblemsRemaining +=1;
     if (batteriesRemaining == 0)
     {
         loseGame();
     }
     else
     {
         setCurrentProblem();
         PlayAudioTask t = new PlayAudioTask("Audio/unable_to_resolve");
         t.Then(new PlayAudioTask("Audio/system_ops_at"))
         .Then(new PlayAudioTask(getPercentFile()))
         .Then(new PlayAudioTask(getNumBatteriesFile()))
         .Then(new PlayAudioTask("Audio/batteries_remaining"))
         .Then(new PlayAudioTask("Audio/next_problem"))
         .Then(new ActionTask(() => playAudioDescriptionOfProblem()));
         TaskManager.instance.AddTask(t);
     }
 }
예제 #8
0
    public void reportState(int state)
    {
        GameManager.instance.setGameState(GAME_STATE.SPEAKING);
        string audioPath = "Audio/";

        switch (state)
        {
        case ReportTypes.brakeShift:
            audioPath += brakeShift2005 ? "brake_shift_report_05" : "brake_shift_report_14";
            break;

        case ReportTypes.valve:
            audioPath += carburetorValveOpen ? "carb_valve_open" : "carb_valve_closed";
            break;

        case ReportTypes.transmission:
            audioPath += transmissionInFirstGear ? "transmission_first" : "transmission_third";
            break;

        case ReportTypes.numberInCenter: {
            if (numberInStar == 21)
            {
                audioPath += "twenty_one_in_center";
            }
            if (numberInStar == 19)
            {
                audioPath += "nineteen_in_center";
            }
            if (numberInStar == 82)
            {
                audioPath += "eighty_two_in_center";
            }
            break;
        }

        case ReportTypes.warningFrame: {
            if (currentWarningFrame == WarningLightFrames.HorizontalScroll)
            {
                audioPath += "horizontal_scroll";
            }
            if (currentWarningFrame == WarningLightFrames.VerticalScroll)
            {
                audioPath += "vertical_scroll";
            }
            if (currentWarningFrame == WarningLightFrames.Paper)
            {
                audioPath += "paper";
            }
            break;
        }

        case ReportTypes.pointsInStar: {
            if (currentStarPoints == 10)
            {
                audioPath += "ten_point_star";
            }
            if (currentStarPoints == 7)
            {
                audioPath += "seven_point_star";
            }
            if (currentStarPoints == 8)
            {
                audioPath += "eight_point_star";
            }
            break;
        }

        default:
            audioPath += didntUnderstand;
            break;
        }

        PlayAudioTask t = new PlayAudioTask(audioPath);

        t.Then(new ActionTask(() => GameManager.instance.setGameState(GAME_STATE.WAIT_FOR_INPUT)));
        TaskManager.instance.AddTask(t);
    }