コード例 #1
0
ファイル: Manager.cs プロジェクト: gamesatqu/ABG-Rush
    /// <summary>
    /// Leave the facility happily, and award points
    /// </summary>
    /// <param name="p"></param>
    public void ManagerPatientLeave(Patient p)
    {
        //update the amount of patients.
        currentPatients--;
        //update the amount of patients that have been seen.
        scorePatientsSeen++;

        //spawn another patient if we are down to 0.
        if (currentPatients <= 0)
        {
            ManagerPatientSpawn();
        }

        //listPatients.Remove(p);
        //perform some kind of animation

        //Determine if the initial assessment of the patient was correct.
        bool rm = (p.InitialAssessmentGetRM() == p.MyDiagnosis().AnswerRespiratoryMetabolic);
        bool aa = (p.InitialAssessmentGetAA() == p.MyDiagnosis().AnswerAcidosisAlkalosis);

        //update score
        scoreCorrectDiagnoses++;
        if (rm && aa)
        {
            scoreCorrectInitialAssessment++;
        }

        gameplayUI.PatientFeedback().PatientFeedback(p, rm, aa);
        gameplayUI.PatientFeedback().gameObject.SetActive(true);
        Time.timeScale = 0;
        //gain/increase points based on level of satisfaction
        UpdateSatisfactionScore(6);
        UpdatePatientsTreated();

        //inform abg that the diagnosis is no longer being used.
        //abg.PatientDiagnosisComplete(p.MyDiagnosis());

        p.PersonMove(locationExit.position, "Exit");
    }
コード例 #2
0
    public void PatientFeedback(Patient p, bool initRMCorrect, bool initAACorrect)
    {
        string colorRM, colorAA;

        //inform the title to add the name of the patient to it's text.
        languagetextTitle.AddThisText(p.name);

        //textfieldName.text = p.name;

        imagePatientID.sprite = p.PatientPhotoID();

        if (initRMCorrect)
        {
            colorRM = hexColorCorrect;
            //textfieldInitialRM.color = colorCorrect;
        }
        else
        {
            colorRM = hexColorWrong;
            //textfieldInitialRM.color = colorWrong;
        }

        if (initAACorrect)
        {
            colorAA = hexColorCorrect;
            //textfieldInitialAA.color = colorCorrect;
        }
        else
        {
            colorAA = hexColorWrong;
            //textfieldInitialAA.color = colorWrong;
        }

        if (initRMCorrect && initAACorrect)
        {
            languagetextSuccessLevel.SwitchCurrentText(2);

            //display the correct sprite
            imageInitial.sprite = spriteCorrect;
            //display the correct object
            correctInitialAssessmentObject.SetActive(true);
            //set the bool for time bonus to true.
            timebonus = true;
        }
        else
        {
            languagetextSuccessLevel.SwitchCurrentText(1);
            //display the incorrect initial sprite
            imageInitial.sprite = spriteIncorrect;
            //deactivate the correct object
            correctInitialAssessmentObject.SetActive(false);
            //set the bool for time bonus to false
            timebonus = false;
        }

        //display the initial diagnosis text.
        textfieldInitialAssessment.text = "<color=" + colorRM +">" + p.InitialAssessmentGetRM() + "</color> " + "<color=" + colorAA + ">" + p.InitialAssessmentGetAA() + "</color>";

        //textfieldInitialRM.text = p.InitialAssessmentGetRM();
        //textfieldInitialAA.text = p.InitialAssessmentGetAA();

        //display the correct answer for the final diagnosis
        textfieldDiagnosisFinal.text ="<color=" + hexColorCorrect +">" + p.MyDiagnosis().AnswerRespiratoryMetabolic + " " + p.MyDiagnosis().AnswerAcidosisAlkalosis + " " + p.MyDiagnosis().AnswerCompensation + "</color>";

        //make sure that the final diagnosis sprite always displays correct.
        imageDiagnosis.sprite = spriteCorrect;
    }