Пример #1
0
    // add items to player's inventory from the medicine cups after quitting the minigame
    public void AddCupsToInv()
    {
        GameObject morningCupObj = GameObject.FindGameObjectWithTag("morningCup");
        MedCup     morningCup    = morningCupObj.GetComponent <MedCup>();

        GameObject afternoonCupObj = GameObject.FindGameObjectWithTag("afternoonCup");
        MedCup     afternoonCup    = afternoonCupObj.GetComponent <MedCup>();

        GameObject eveningCupObj = GameObject.FindGameObjectWithTag("eveningCup");
        MedCup     eveningCup    = eveningCupObj.GetComponent <MedCup>();

        GameObject nightCupObj = GameObject.FindGameObjectWithTag("nightCup");
        MedCup     nightCup    = nightCupObj.GetComponent <MedCup>();

        if (morningCup.medsInThisCup.Count > 0)
        {
            playerInv.AddItems(morningCup.medsInThisCup, 0);
        }

        if (afternoonCup.medsInThisCup.Count > 0)
        {
            playerInv.AddItems(afternoonCup.medsInThisCup, 1);
        }

        if (eveningCup.medsInThisCup.Count > 0)
        {
            playerInv.AddItems(eveningCup.medsInThisCup, 2);
        }

        if (nightCup.medsInThisCup.Count > 0)
        {
            playerInv.AddItems(nightCup.medsInThisCup, 3);
        }

        // clear all medicine cups in minigame
        morningCup.Reset();
        afternoonCup.Reset();
        eveningCup.Reset();
        nightCup.Reset();
    }
Пример #2
0
    // initialize new state
    void OnStateChange()
    {
        timeSpentInThisState = 0f;
        nextClicked          = false;
        StopAllCoroutines();
        text.text = "";

        switch (currentState)
        {
        case TutorialState.STATE_START:
            nextBtn.SetActive(true);
            message = "Hi, welcome to the tutorial! Click the V-button to continue.";
            break;

        case TutorialState.STATE_WALK_PRACTICE_1:
            nextBtn.SetActive(false);
            message = "Lets start by walking to the reception. Just click on the ground to move.";
            StartCoroutine(ShowPath());
            break;

        case TutorialState.STATE_TARGET_PRACTICE_1:
            if (indicator != null)
            {
                Destroy(indicator);
            }
            walkHere.SetActive(false);
            message = "Great job!";
            StartCoroutine(ChangeState(TutorialState.STATE_TARGET_PRACTICE_2, 1f));
            break;

        case TutorialState.STATE_TARGET_PRACTICE_2:
            nextBtn.SetActive(true);
            message = "Here comes a patient! Patients go first to the doctor's office to get diagnosed.";
            ShowNPC();
            break;

        case TutorialState.STATE_TARGET_PRACTICE_3:
            message = "Patients with red cross above their head are your responsibility.";
            break;

        case TutorialState.STATE_TARGET_PRACTICE_4:
            nextBtn.SetActive(false);
            message = "Double-click the patient to walk to him and see his information.";
            break;

        case TutorialState.STATE_TARGET_PRACTICE_5:
            message = "Good job!";
            StartCoroutine(ChangeState(TutorialState.STATE_MINIGAME_PRACTICE_1, 1f));
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_1:
            nextBtn.SetActive(true);
            message = "You can see on the patient's medicine card that he needs Ibuprofen. Lets go get some!";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_2:
            nextBtn.SetActive(false);
            message = "Double-click the medicine cabinet to use it.";
            ShowMedCab();
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_2_1:
            nextBtn.SetActive(true);
            if (indicator != null)
            {
                Destroy(indicator);
            }
            message = "This is the administration minigame. You can see all of your patients medicine cards on the left.";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_3:
            nextBtn.SetActive(false);
            medCont = GameObject.FindGameObjectWithTag("BigMedCont").GetComponent <BigMedCont>();
            message = "Your patient needs 400 mg of Ibuprofen. Use hand disinfectant first and then choose Ibuprofen.";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_4:
            morningCup   = GameObject.FindGameObjectWithTag("morningCup").GetComponent <MedCup>();
            afternoonCup = GameObject.FindGameObjectWithTag("afternoonCup").GetComponent <MedCup>();
            eveningCup   = GameObject.FindGameObjectWithTag("eveningCup").GetComponent <MedCup>();
            nightCup     = GameObject.FindGameObjectWithTag("nightCup").GetComponent <MedCup>();
            message      = "Here you gotta shoot pills to medicine cups with slingshot like in Angry Birds. Fire away!";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_SPLITTING_1:
            message = "Nice shot!";
            StartCoroutine(ChangeState(TutorialState.STATE_MINIGAME_PRACTICE_SPLITTING_2, 1f));
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_SPLITTING_2:
            message = "You can split some pills in half by clicking them in the air during slow motion. Try it out!";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_SPLITTING_3:
            nextBtn.SetActive(true);
            message = "Cool! Clicking the button on medicine cup removes the last pill from the cup. Clicking it twice removes all pills.";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_5:
            nextBtn.SetActive(false);
            message = "Lets go give your patient his medicine. Click the X-button in the top-left corner twice.";
            break;

        case TutorialState.STATE_MINIGAME_PRACTICE_6:
            message = "Find your patient and double-click him. Then click medicine cup in your inventory (bottom-right corner) to give it to him.";
            break;

        case TutorialState.STATE_ENDING_GOOD_1:
            if (mascot.currentState != Mascot.MascotState.STATE_NORMAL)
            {
                mascot.ChangeState(Mascot.MascotState.STATE_NORMAL);
            }
            nextBtn.SetActive(true);
            message = "Great job! This is the basic idea of the game, give correct medicine at correct times to your patients.";
            break;

        case TutorialState.STATE_COMPUTER_PRACTICE:
            nextBtn.SetActive(false);
            message = "There is a computer in the office. You can see your schedule and patients there. Go use it!";
            ShowComputer();
            break;

        case TutorialState.STATE_COMPUTER_PRACTICE_1:
            nextBtn.SetActive(false);
            message = "Check out your daily schedule by clicking the Skeduler-button.";
            break;

        case TutorialState.STATE_COMPUTER_PRACTICE_2:
            message = "Close the computer by pressing the X-button in the top-left corner.";
            break;

        case TutorialState.STATE_TRASH_PRACTICE:
            nextBtn.SetActive(true);
            message = "Next to the computer, there is a trash can. Double-click it and click a medicine cup in your inventory to delete it.";
            ShowTrashCan();
            break;

        case TutorialState.STATE_COFFEE_PRACTICE:
            nextBtn.SetActive(true);
            message = "There is a coffeemaker in the office too. Use it if you want to skip time.";
            ShowCoffee();
            break;

        case TutorialState.STATE_ENDING_GOOD_2:
            if (indicator != null)
            {
                Destroy(indicator);
            }
            scoreBarHighlight.SetActive(true);
            message = "In the score bar you can see how well you take care of your patients, and if it reaches zero, you will lose.";
            break;

        case TutorialState.STATE_ENDING_GOOD_3:
            message = "You will lose score points if you give wrong medicine or wrong dosage.";
            break;

        case TutorialState.STATE_ENDING_GOOD_4:
            scoreBarHighlight.SetActive(false);
            message = "Each day the number of patients you gotta take care of increases. The patients will start to arrive at 7 am.";
            break;

        case TutorialState.STATE_ENDING_GOOD_FINAL:
            nextBtn.SetActive(false);
            message = "Good luck on your first day in the hospital, bye for now!";
            Invoke("QuitTutorial", 6);
            break;

        case TutorialState.STATE_ENDING_BAD_1:
            message = "That medicine was incorrect or the dosage was wrong. Try again, the patient needs 400 mg of Ibuprofen.";
            mascot.ChangeState(Mascot.MascotState.STATE_ANGRY);
            break;

        case TutorialState.STATE_INACTIVE:
            message = "";
            break;

        case TutorialState.STATE_SHOW_NOTIFICATION:
            message = notificationMsg;
            Invoke("HideNotification", notificationTime);
            break;
        }
        StartCoroutine(TypeText());
        stateChanged = false;
    }