public void HandleConfrontation()
    {
        score -= timer.GetCountdown() > 0 ? 5 : 10;
        ++stepsTaken;

        pressedButton = currentPhase.buttons[3];

        if (currentPhase.confrontationPossible)
        {
            answers.Add(new Answer(pressedButton.buttonText, 1));
            answers.Add(new Answer(pressedButton.answerText, 3));
            isConfronting = true;
            videoPlayer.SetVideo(Application.dataPath + "/Videos/" + pressedButton.videoName);
            ani.Play("VideoScaleUp");
            previousText.text += System.Environment.NewLine + System.Environment.NewLine + "Jij: " + pressedButton.buttonText + System.Environment.NewLine + System.Environment.NewLine + scenario.Scenario.patientName + ": " + pressedButton.answerText;
        }
        else
        {
            answers.Add(new Answer(pressedButton.buttonText, 1));
            answers.Add(new Answer("...", 0));
            ani.Play("PopUp");
            StartCoroutine(ScrollToBottom());
            previousText.text += System.Environment.NewLine + System.Environment.NewLine + "Jij: " + pressedButton.buttonText + System.Environment.NewLine + System.Environment.NewLine + scenario.Scenario.patientName + ": ...";
        }
    }
Пример #2
0
    void CreateScenarioButton()
    {
        if (contentTransform.childCount > 0)
        {
            foreach (Transform child in contentTransform)
            {
                if (child.GetSiblingIndex() == 0)
                {
                    continue;
                }

                Destroy(child.gameObject);
            }
        }

        for (int i = 0; i < availableScenario.availableScenario.Length; i++)
        {
            GameObject     spawnedScenarioButton       = Instantiate(scenarioButtonPrefab, contentTransform);
            ScenarioButton spawnedScenarioButtonScript = spawnedScenarioButton.GetComponent <ScenarioButton>();
            spawnedScenarioButtonScript.menu = this;
            spawnedScenarioButtonScript.scenarioIndexNumber = i;
            spawnedScenarioButtonScript.ScenarioIndex.text  = "SCENARIO " + (i + 1);
            UpdateScenarioState(i);
        }
    }
    public void AddStress(int amount)
    {
        ani.Play("VideoScaleUp");

        score -= timer.GetCountdown() > 0 ? 10 : 15;
        ++stepsTaken;

        pressedButton = currentPhase.buttons[1 + amount];

        answers.Add(new Answer(pressedButton.buttonText, amount));
        answers.Add(new Answer(pressedButton.answerText, 3));

        stress += amount;
        gloom.SetStress(stress, scenario.Scenario.maxStress);

        videoPlayer.SetVideo(Application.dataPath + "/Videos/" + pressedButton.videoName);

        if (pressedButton.toEnd)
        {
            ActivateEnd(scenario.Scenario.winText);
            Debug.Log("End screen");
            return;
        }

        if (stress == 0)
        {
            score = 0;
            ActivateEnd(scenario.Scenario.failLowText);
            Debug.Log("Game over: Low stress");
            return;
        }
        if (stress == scenario.Scenario.maxStress)
        {
            score = 0;
            ActivateEnd(scenario.Scenario.failHighText);
            Debug.Log("Game over: Too high stress");
            return;
        }

        ++phase;

        /*
         * stress += amount;
         * if (!(minStress < stress && maxStress > stress))
         * {
         *  Debug.Log("Game Over");
         *  return;
         * }
         * AnswerText.text = "stress: " + stress;
         */
    }
    public void HandelConfrontationEnd()
    {
        isConfronting = false;
        pressedButton = GetEndButton();

        answers.Add(new Answer(pressedButton.buttonText, 1));
        answers.Add(new Answer(pressedButton.answerText, 3));

        videoPlayer.SetVideo(Application.dataPath + "/Videos/" + pressedButton.videoName);

        ani.Play("VideoScaleUp");

        //previousText.text += System.Environment.NewLine + System.Environment.NewLine + "Jij: " + pressedButton.buttonText + System.Environment.NewLine + System.Environment.NewLine + scenario.Scenario.patientName + ": " + pressedButton.answerText;

        ActivateEnd(scenario.Scenario.winText);
    }
Пример #5
0
    public void ScenarioButtonPressed(ScenarioButton _ScenarioButtonScript)
    {
        selectedScenarioScript.selectedScenario = availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber];

        scenarioNamePreview.text  = _ScenarioButtonScript.ScenarioIndex.text;
        scenarioFirstStation.text = "STARTING STATION 	: "+ availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].StationList[0].stationName;
        int scenarioStationListLength = availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].StationList.Length;

        scenarioLastStation.text = "ENDING STATION 	: " + availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].StationList[scenarioStationListLength - 1].stationName;
        buyButtonText.text       = "BUY (" + availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].price + ")";

        if (availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].locked)
        {
            int currentPlayerCredits = PlayerPrefs.GetInt("PlayerCredits");
            if (currentPlayerCredits < availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].price)
            {
                buyButton.interactable = false;
            }
            else if (currentPlayerCredits >= availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].price)
            {
                buyButton.interactable = true;
            }

            buyButton.interactable  = true;
            playButton.interactable = false;
        }
        else if (!availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].locked)
        {
            buyButton.interactable  = false;
            playButton.interactable = true;
        }

        if (PlayerPrefs.GetInt("PlayerCredits") < availableScenario.availableScenario[_ScenarioButtonScript.scenarioIndexNumber].price)
        {
            buyButton.interactable = false;
        }

        scenarioSelection.gameObject.SetActive(false);
        scenarioPreview.gameObject.SetActive(true);
    }
Пример #6
0
        void ReleaseDesignerOutlets()
        {
            if (ActualFilterComboxBox != null)
            {
                ActualFilterComboxBox.Dispose();
                ActualFilterComboxBox = null;
            }

            if (AddressFilterComboBox != null)
            {
                AddressFilterComboBox.Dispose();
                AddressFilterComboBox = null;
            }

            if (CashflowTable != null)
            {
                CashflowTable.Dispose();
                CashflowTable = null;
            }

            if (CashflowTableView != null)
            {
                CashflowTableView.Dispose();
                CashflowTableView = null;
            }

            if (DateFilterDatePicker != null)
            {
                DateFilterDatePicker.Dispose();
                DateFilterDatePicker = null;
            }

            if (EndDatePicker != null)
            {
                EndDatePicker.Dispose();
                EndDatePicker = null;
            }

            if (FullDetailCheckBox != null)
            {
                FullDetailCheckBox.Dispose();
                FullDetailCheckBox = null;
            }

            if (LenderPopUp != null)
            {
                LenderPopUp.Dispose();
                LenderPopUp = null;
            }

            if (BorrowerPopUp != null)
            {
                BorrowerPopUp.Dispose();
                BorrowerPopUp = null;
            }

            if (OutflowsOnlyButton != null)
            {
                OutflowsOnlyButton.Dispose();
                OutflowsOnlyButton = null;
            }

            if (ScenarioButton != null)
            {
                ScenarioButton.Dispose();
                ScenarioButton = null;
            }

            if (ScheduledOnlyButton != null)
            {
                ScheduledOnlyButton.Dispose();
                ScheduledOnlyButton = null;
            }

            if (ShowExpiredCheckBox != null)
            {
                ShowExpiredCheckBox.Dispose();
                ShowExpiredCheckBox = null;
            }

            if (StartDatePicker != null)
            {
                StartDatePicker.Dispose();
                StartDatePicker = null;
            }

            if (TypeFilterComboBox != null)
            {
                TypeFilterComboBox.Dispose();
                TypeFilterComboBox = null;
            }
        }