Example #1
0
    private void InitSliders()
    {
        PlayerConditionModule playerConditionModule = PlayerConditionModule.Get();

        this.m_Proteins.minValue  = 0f;
        this.m_Proteins.maxValue  = playerConditionModule.GetMaxNutritionProtein();
        this.m_Proteins.value     = playerConditionModule.GetNutritionProtein();
        this.m_Fat.minValue       = 0f;
        this.m_Fat.maxValue       = playerConditionModule.GetMaxNutritionFat();
        this.m_Fat.value          = playerConditionModule.GetNutritionFat();
        this.m_Carbo.minValue     = 0f;
        this.m_Carbo.maxValue     = playerConditionModule.GetMaxNutritionCarbo();
        this.m_Carbo.value        = playerConditionModule.GetNutritionCarbo();
        this.m_Hydration.minValue = 0f;
        this.m_Hydration.maxValue = playerConditionModule.GetMaxHydration();
        this.m_Hydration.value    = playerConditionModule.GetHydration();
        this.m_HP.minValue        = 1f;
        this.m_HP.maxValue        = playerConditionModule.GetMaxHP();
        this.m_HP.value           = playerConditionModule.GetHP();
        this.m_Energy.minValue    = 1f;
        this.m_Energy.maxValue    = playerConditionModule.GetMaxEnergy();
        this.m_Energy.value       = playerConditionModule.GetEnergy();
        this.m_Sanity.minValue    = 0f;
        this.m_Sanity.maxValue    = 100f;
        this.m_Sanity.value       = (float)PlayerSanityModule.Get().m_Sanity;
        this.m_Dirtiness.minValue = 0f;
        this.m_Dirtiness.maxValue = PlayerConditionModule.Get().m_MaxDirtiness;
        this.m_Dirtiness.value    = PlayerConditionModule.Get().m_Dirtiness;
    }
Example #2
0
    private void Setup()
    {
        this.m_ToggleLimbs.Clear();
        this.m_ToggleLimbsState.Clear();
        this.m_ToggleLimbs.Add(this.m_ToggleLH);
        this.m_ToggleLimbsState.Add(this.m_ToggleLH.isOn);
        this.m_ToggleLimbs.Add(this.m_ToggleRH);
        this.m_ToggleLimbsState.Add(this.m_ToggleRH.isOn);
        this.m_ToggleLimbs.Add(this.m_ToggleLL);
        this.m_ToggleLimbsState.Add(this.m_ToggleLL.isOn);
        this.m_ToggleLimbs.Add(this.m_ToggleRL);
        this.m_ToggleLimbsState.Add(this.m_ToggleRL.isOn);
        this.m_WoundTypeList.Clear();
        for (int i = 0; i < Enum.GetValues(typeof(InjuryType)).Length; i++)
        {
            this.m_WoundTypeList.AddElement(Enum.GetValues(typeof(InjuryType)).GetValue(i).ToString(), -1);
        }
        this.m_WoundTypeList.SetFocus(true);
        this.m_WoundParameters.Clear();
        for (int j = 0; j < 10; j++)
        {
            Transform transform = base.gameObject.transform.FindDeepChild("Wound" + j.ToString());
            if (transform != null)
            {
                Text component = transform.gameObject.GetComponent <Text>();
                this.m_WoundParameters.Add(component);
            }
        }
        PlayerConditionModule playerConditionModule = PlayerConditionModule.Get();

        this.m_Proteins.minValue  = 0f;
        this.m_Proteins.maxValue  = playerConditionModule.GetMaxNutritionProtein();
        this.m_Proteins.value     = playerConditionModule.GetNutritionProtein();
        this.m_Fat.minValue       = 0f;
        this.m_Fat.maxValue       = playerConditionModule.GetMaxNutritionFat();
        this.m_Fat.value          = playerConditionModule.GetNutritionFat();
        this.m_Carbo.minValue     = 0f;
        this.m_Carbo.maxValue     = playerConditionModule.GetMaxNutritionCarbo();
        this.m_Carbo.value        = playerConditionModule.GetNutritionCarbo();
        this.m_Hydration.minValue = 0f;
        this.m_Hydration.maxValue = playerConditionModule.GetMaxHydration();
        this.m_Hydration.value    = playerConditionModule.GetHydration();
        this.m_HP.minValue        = 0f;
        this.m_HP.maxValue        = playerConditionModule.GetMaxHP();
        this.m_HP.value           = playerConditionModule.GetHP();
        this.m_Energy.minValue    = 0f;
        this.m_Energy.maxValue    = playerConditionModule.GetMaxEnergy();
        this.m_Energy.value       = playerConditionModule.GetEnergy();
        this.m_Sanity.minValue    = 0f;
        this.m_Sanity.maxValue    = 100f;
        this.m_Sanity.value       = (float)PlayerSanityModule.Get().m_Sanity;
    }
Example #3
0
    protected override void Update()
    {
        base.Update();
        PlayerInjuryModule    playerInjuryModule    = PlayerInjuryModule.Get();
        PlayerConditionModule playerConditionModule = PlayerConditionModule.Get();

        for (int i = 0; i < this.m_WoundParameters.Count; i++)
        {
            if (i < playerInjuryModule.m_Injuries.Count)
            {
                Injury injury = playerInjuryModule.m_Injuries[i];
                this.m_WoundParameters[i].enabled = true;
                this.m_WoundParameters[i].text    = "Type: " + injury.m_Type.ToString();
                if (injury.m_Type == InjuryType.SmallWoundAbrassion)
                {
                    Text text = this.m_WoundParameters[i];
                    text.text = text.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_HealingStartTime)).ToString();
                    Text text2 = this.m_WoundParameters[i];
                    text2.text = text2.text + " HealTimeBonus: " + injury.m_HealingTimeDec.ToString();
                }
                else if (injury.m_Type == InjuryType.SmallWoundScratch)
                {
                    Text text3 = this.m_WoundParameters[i];
                    text3.text = text3.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_HealingStartTime)).ToString();
                    Text text4 = this.m_WoundParameters[i];
                    text4.text = text4.text + " HealTimeBonus: " + injury.m_HealingTimeDec.ToString();
                }
                else if (injury.m_Type == InjuryType.Laceration || injury.m_Type == InjuryType.LacerationCat)
                {
                    Text text5 = this.m_WoundParameters[i];
                    text5.text = text5.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_HealingStartTime)).ToString();
                    Text text6 = this.m_WoundParameters[i];
                    text6.text = text6.text + " Will transform to: " + injury.m_HealingResultInjuryState.ToString();
                }
                else if (injury.m_Type == InjuryType.VenomBite)
                {
                    Text text7 = this.m_WoundParameters[i];
                    text7.text = text7.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_HealingStartTime)).ToString();
                    Text text8 = this.m_WoundParameters[i];
                    text8.text = text8.text + " PoisonLevel: " + injury.m_PoisonLevel.ToString();
                }
                else if (injury.m_Type == InjuryType.SnakeBite)
                {
                    Text text9 = this.m_WoundParameters[i];
                    text9.text = text9.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_HealingStartTime)).ToString();
                    Text text10 = this.m_WoundParameters[i];
                    text10.text = text10.text + " PoisonLevel: " + injury.m_PoisonLevel.ToString();
                }
                else if (injury.m_Type == InjuryType.Rash)
                {
                    Text text11 = this.m_WoundParameters[i];
                    text11.text = text11.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_StartTimeInMinutes)).ToString();
                    Text text12 = this.m_WoundParameters[i];
                    text12.text = text12.text + " HealTimeBonus: " + injury.m_HealingTimeDec.ToString();
                }
                else if (injury.m_Type == InjuryType.WormHole)
                {
                    Text text13 = this.m_WoundParameters[i];
                    text13.text = text13.text + " TimeToHeal:" + (injury.GetHealingDuration() - (MainLevel.Instance.GetCurrentTimeMinutes() - injury.m_HealingStartTime)).ToString();
                    Text text14 = this.m_WoundParameters[i];
                    text14.text = text14.text + " HealTimeBonus: " + injury.m_HealingTimeDec.ToString();
                }
            }
            else
            {
                this.m_WoundParameters[i].enabled = false;
            }
        }
        WaterCollider waterPlayerInside = WaterBoxManager.Get().GetWaterPlayerInside();

        this.m_LeechCooldownText.text = "Leech chance: ";
        if (waterPlayerInside == null)
        {
            Text leechCooldownText = this.m_LeechCooldownText;
            leechCooldownText.text += "None";
        }
        else
        {
            Text leechCooldownText2 = this.m_LeechCooldownText;
            leechCooldownText2.text += waterPlayerInside.m_LeechChance.ToString();
        }
        Text leechCooldownText3 = this.m_LeechCooldownText;

        leechCooldownText3.text = leechCooldownText3.text + " Time to next leech: " + (playerInjuryModule.GetLeechNextTime() - MainLevel.Instance.GetCurrentTimeMinutes()).ToString();
        Text leechCooldownText4 = this.m_LeechCooldownText;

        leechCooldownText4.text   = leechCooldownText4.text + " CoolDown: " + Injury.s_LeechCooldownInMinutes.ToString();
        this.m_HPText.text        = "HP = " + playerConditionModule.GetHP().ToString() + "/" + playerConditionModule.GetMaxHP().ToString();
        this.m_ConditionText.text = "Condition = " + playerConditionModule.GetEnergy().ToString() + "/" + playerConditionModule.GetMaxEnergy().ToString();
        playerConditionModule.m_NutritionProteins = this.m_Proteins.value;
        playerConditionModule.m_NutritionFat      = this.m_Fat.value;
        playerConditionModule.m_NutritionCarbo    = this.m_Carbo.value;
        playerConditionModule.m_Hydration         = this.m_Hydration.value;
        playerConditionModule.m_HP     = this.m_HP.value;
        playerConditionModule.m_Energy = this.m_Energy.value;
        PlayerSanityModule.Get().m_Sanity = (int)this.m_Sanity.value;
    }