private void UpdateHydration() { if (this.m_Player.m_DreamActive) { return; } FPPController fppcontroller = this.m_Player.m_FPPController; if (!fppcontroller) { return; } float num = 0f; float num2 = 1f; if (!Cheats.m_GodMode || this.m_LossParametersBlocked) { float deltaTime = Time.deltaTime; if (fppcontroller.IsRunning()) { num2 *= this.m_HydrationConsumptionRunMul; } num = this.m_HydrationConsumptionPerSecond * deltaTime * num2; if (PlayerDiseasesModule.Get().GetDisease(ConsumeEffect.Fever).IsActive()) { num += this.m_HydrationConsumptionDuringFeverPerSecond * deltaTime; } for (int i = 0; i < this.m_InjuryModule.m_Injuries.Count; i++) { Injury injury = this.m_InjuryModule.m_Injuries[i]; if (injury.m_Type == InjuryType.VenomBite || injury.m_Type == InjuryType.SnakeBite) { num += Injury.s_PoisonedWoundHydrationDecPerSec * deltaTime; } } } GameDifficulty gameDifficulty = GreenHellGame.Instance.m_GameDifficulty; if (gameDifficulty == GameDifficulty.Normal) { num *= GreenHellGame.s_NormalModeLossMul; } else if (gameDifficulty == GameDifficulty.Easy) { num *= GreenHellGame.s_EasyModeLossMul; } this.DecreaseHydration(num); }
private void UpdateStamina() { float deltaTime = Time.deltaTime; FPPController fppcontroller = this.m_Player.m_FPPController; if (!fppcontroller) { return; } if (Cheats.m_GodMode) { this.m_Stamina = this.m_MaxStamina; return; } float num = this.m_Stamina; if (fppcontroller.IsActive() && fppcontroller.IsWalking()) { num -= this.m_StaminaConsumptionWalkPerSecond * deltaTime * ((!PlayerCocaineModule.Get().m_Active) ? 1f : PlayerCocaineModule.Get().m_StaminaConsumptionMul); } else if (fppcontroller.IsActive() && fppcontroller.IsRunning()) { num -= this.m_StaminaConsumptionRunPerSecond * deltaTime * ((!PlayerCocaineModule.Get().m_Active) ? 1f : PlayerCocaineModule.Get().m_StaminaConsumptionMul); } else if (fppcontroller.IsActive() && fppcontroller.IsDepleted()) { num -= this.m_StaminaConsumptionDepletedPerSecond * deltaTime * ((!PlayerCocaineModule.Get().m_Active) ? 1f : PlayerCocaineModule.Get().m_StaminaConsumptionMul); } else if (!MakeFireController.Get().IsActive()) { num += this.m_StaminaRegenerationPerSecond * deltaTime; } if (num < this.m_Stamina || Time.time - this.m_LastDecreaseStaminaTime >= this.m_StaminaRenerationDelay) { this.m_Stamina = num; } float num2 = this.m_Stamina - this.m_PrevStamina; if (num2 < 0f) { this.m_LastDecreaseStaminaTime = Time.time; } this.m_Stamina = Mathf.Clamp(this.m_Stamina, 0f, this.m_MaxStamina); this.m_PrevStamina = this.m_Stamina; }
private void UpdateNutrition() { if (this.m_ParasiteSickness == null) { this.m_ParasiteSickness = (ParasiteSickness)PlayerDiseasesModule.Get().GetDisease(ConsumeEffect.ParasiteSickness); } if (this.m_Player.m_DreamActive) { return; } if (Cheats.m_GodMode || this.m_LossParametersBlocked) { return; } FPPController fppcontroller = this.m_Player.m_FPPController; if (!fppcontroller) { return; } WeaponController weaponController = this.m_Player.m_WeaponController; bool flag = false; if (weaponController && weaponController.IsAttack()) { flag = true; } if (!flag && this.m_Player.GetCurrentItem(Hand.Right) && this.m_Player.GetCurrentItem(Hand.Right).m_Info.IsHeavyObject()) { flag = true; } float deltaTime = Time.deltaTime; float num = 1f; float num2 = 1f; float num3 = 1f; if (fppcontroller.IsRunning()) { num *= this.m_NutritionCarbohydratesConsumptionRunMul; num2 *= this.m_NutritionFatConsumptionRunMul; num3 *= this.m_NutritionProteinsConsumptionRunMul; } if (flag) { num *= this.m_NutritionCarbohydratesConsumptionActionMul; num2 *= this.m_NutritionFatConsumptionActionMul; num3 *= this.m_NutritionProteinsConsumptionActionMul; } if (this.IsNutritionCarboCriticalLevel()) { num2 *= this.m_NutritionFatConsumptionMulNoCarbs; num3 *= this.m_NutritionProteinsConsumptionMulNoCarbs; } if (InventoryBackpack.Get().IsCriticalOverload()) { num *= this.m_NutritionCarbohydratesConsumptionWeightCriticalMul; num2 *= this.m_NutritionFatConsumptionWeightCriticalMul; num3 *= this.m_NutritionProteinsConsumptionWeightCriticalMul; } else if (InventoryBackpack.Get().IsOverload()) { num *= this.m_NutritionCarbohydratesConsumptionWeightOverloadMul; num2 *= this.m_NutritionFatConsumptionWeightOverloadMul; num3 *= this.m_NutritionProteinsConsumptionWeightOverloadMul; } else { num *= this.m_NutritionCarbohydratesConsumptionWeightNormalMul; num2 *= this.m_NutritionFatConsumptionWeightNormalMul; num3 *= this.m_NutritionProteinsConsumptionWeightNormalMul; } if (this.m_ParasiteSickness.IsActive()) { num *= this.m_ParasiteSickness.m_MacroNutricientCarboLossMul * (float)this.m_ParasiteSickness.m_Level; num2 *= this.m_ParasiteSickness.m_MacroNutricientFatLossMul * (float)this.m_ParasiteSickness.m_Level; num3 *= this.m_ParasiteSickness.m_MacroNutricientProteinsLossMul * (float)this.m_ParasiteSickness.m_Level; } GameDifficulty gameDifficulty = GreenHellGame.Instance.m_GameDifficulty; if (gameDifficulty == GameDifficulty.Normal) { float s_NormalModeLossMul = GreenHellGame.s_NormalModeLossMul; num *= s_NormalModeLossMul; num2 *= s_NormalModeLossMul; num3 *= s_NormalModeLossMul; } else if (gameDifficulty == GameDifficulty.Easy) { float s_EasyModeLossMul = GreenHellGame.s_EasyModeLossMul; num *= s_EasyModeLossMul; num2 *= s_EasyModeLossMul; num3 *= s_EasyModeLossMul; } this.m_NutritionCarbo -= this.m_NutritionCarbohydratesConsumptionPerSecond * deltaTime * num * ((!PlayerCocaineModule.Get().m_Active) ? 1f : PlayerCocaineModule.Get().m_CarboConsumptionMul); this.m_NutritionCarbo = Mathf.Clamp(this.m_NutritionCarbo, 0f, this.m_MaxNutritionCarbo); this.m_NutritionFat -= this.m_NutritionFatConsumptionPerSecond * deltaTime * num2 * ((!PlayerCocaineModule.Get().m_Active) ? 1f : PlayerCocaineModule.Get().m_FatConsumptionMul); this.m_NutritionFat = Mathf.Clamp(this.m_NutritionFat, 0f, this.m_MaxNutritionFat); this.m_NutritionProteins -= this.m_NutritionProteinsConsumptionPerSecond * deltaTime * num3 * ((!PlayerCocaineModule.Get().m_Active) ? 1f : PlayerCocaineModule.Get().m_ProteinsConsumptionMul); this.m_NutritionProteins = Mathf.Clamp(this.m_NutritionProteins, 0f, this.m_MaxNutritionProteins); }