Exemplo n.º 1
0
 protected override void Update()
 {
     base.Update();
     if (this.m_BG.color.a < 1f)
     {
         Color color = this.m_BG.color;
         color.a += Time.deltaTime;
         float num = 0.7f;
         if (ConsciousnessController.Get().IsState(ConsciousnessController.ConsciousnessState.PassingOut) && color.a > num)
         {
             color.a = Mathf.Clamp(color.a, 0f, num);
         }
         else
         {
             color.a = Mathf.Clamp01(color.a);
         }
         this.m_BG.color = color;
     }
     else if (this.m_Text.color.a < 1f)
     {
         Color color2 = this.m_Text.color;
         color2.a         += Time.deltaTime;
         color2.a          = Mathf.Clamp01(color2.a);
         this.m_Text.color = color2;
     }
 }
Exemplo n.º 2
0
    protected override bool ShouldShow()
    {
        if (GreenHellGame.Instance.m_GameMode != GameMode.Story)
        {
            return(false);
        }
        if (ScenarioManager.Get().IsBoolVariableTrue("PlayerMechGameEnding"))
        {
            return(false);
        }
        if (ChallengesManager.Get() && ChallengesManager.Get().IsChallengeActive())
        {
            return(false);
        }
        if (ConsciousnessController.Get().IsActive())
        {
            return(false);
        }
        if (SleepController.Get().IsActive())
        {
            return(false);
        }
        if (HUDReadableItem.Get().enabled)
        {
            return(false);
        }
        if (Player.Get().m_Animator.GetBool(Player.Get().m_CleanUpHash))
        {
            return(false);
        }
        if (Time.time - SwimController.Get().m_LastDisableTime < 0.5f)
        {
            return(false);
        }
        if (Player.Get().m_IsInAir)
        {
            return(false);
        }
        if (HUDWheel.Get().enabled)
        {
            return(false);
        }
        if (FPPController.Get().m_Dodge)
        {
            return(false);
        }
        int shortNameHash = Player.Get().m_Animator.GetCurrentAnimatorStateInfo(1).shortNameHash;

        return(shortNameHash != this.m_MapWatchHideHash && shortNameHash != this.m_MapWatchIdleHash && shortNameHash != this.m_MapWatchShowHash && shortNameHash != this.m_MapZoomHash && shortNameHash != this.m_MapHideHash && shortNameHash != this.m_MapIdleHash && shortNameHash != this.m_ShowMapHash && (!DeathController.Get().IsActive() && !InsectsController.Get().IsActive() && !ScenarioManager.Get().IsDreamOrPreDream() && !Inventory3DManager.Get().IsActive() && !CutscenesManager.Get().IsCutscenePlaying() && !SwimController.Get().IsActive() && !BodyInspectionController.Get().IsActive() && !HarvestingAnimalController.Get().IsActive() && !HarvestingSmallAnimalController.Get().IsActive() && !VomitingController.Get().IsActive() && !MapController.Get().IsActive() && !NotepadController.Get().IsActive() && !MudMixerController.Get().IsActive()) && !MakeFireController.Get().IsActive());
    }
Exemplo n.º 3
0
    private void UpdateEnergy()
    {
        if (this.m_Player.m_DreamActive)
        {
            return;
        }
        float         deltaTime     = Time.deltaTime;
        FPPController fppcontroller = this.m_Player.m_FPPController;

        if (!fppcontroller)
        {
            return;
        }
        DeathController deathController = this.m_Player.m_DeathController;

        if (deathController.IsActive())
        {
            return;
        }
        ConsciousnessController component = this.m_Player.GetComponent <ConsciousnessController>();

        if (component.IsActive())
        {
            return;
        }
        if (!Cheats.m_GodMode && !this.m_LossParametersBlocked)
        {
            this.m_Energy -= this.m_EnergyConsumptionPerSecond * deltaTime;
            if (this.IsNutritionCarboCriticalLevel() || this.IsNutritionFatCriticalLevel() || this.IsNutritionProteinsCriticalLevel())
            {
                this.m_Energy -= this.m_EnergyConsumptionPerSecondNoNutrition * deltaTime;
            }
            if (this.m_DiseasesModule.GetDisease(ConsumeEffect.Fever).IsActive())
            {
                this.m_Energy -= this.m_EnergyConsumptionPerSecondFever * deltaTime;
            }
            if (this.m_DiseasesModule.GetDisease(ConsumeEffect.FoodPoisoning).IsActive())
            {
                this.m_Energy -= this.m_EnergyConsumptionPerSecondFoodPoison * deltaTime;
            }
        }
        this.m_Energy = Mathf.Clamp(this.m_Energy, 0f, this.m_MaxEnergy);
        if (this.m_Energy <= PlayerSanityModule.Get().m_LowEnegryWhispersLevel)
        {
            PlayerSanityModule.Get().OnWhispersEvent(PlayerSanityModule.WhisperType.LowEnergy);
        }
    }
Exemplo n.º 4
0
    public void UpdateBuriningDuration()
    {
        if (!this.m_Burning)
        {
            return;
        }
        float num = MainLevel.Instance.m_TODSky.Cycle.GameTimeDelta;

        if (HUDSleeping.Get().GetState() == HUDSleepingState.Progress)
        {
            num = SleepController.Get().m_HoursDelta;
        }
        else if (ConsciousnessController.Get().IsUnconscious())
        {
            num = ConsciousnessController.Get().m_HoursDelta;
        }
        this.m_BurningDuration += num;
    }
Exemplo n.º 5
0
 public void OnYesFromDialog()
 {
     SaveGame.s_MainSaveName = this.m_Slots[this.m_SlotIdx].m_SaveInfo.file_name;
     Debug.Log("LoadGameMenu:OnYesFromDialog - " + SaveGame.s_MainSaveName);
     if (this.m_IsIngame)
     {
         GreenHellGame.GetFadeSystem().FadeOut(FadeType.All, new VDelegate(this.OnLoadGame), 0.5f, null);
         this.m_MenuInGameManager.HideMenu();
         if (ConsciousnessController.Get().IsActive())
         {
             ConsciousnessController.Get().Stop();
         }
         CursorManager.Get().ShowCursor(false, false);
         return;
     }
     GreenHellGame.Instance.m_GameMode = this.m_Slots[this.m_SlotIdx].m_GameMode;
     MainMenuManager.Get().CallLoadGameFadeSequence();
     base.EnableSlots(false);
 }
Exemplo n.º 6
0
    protected override void Update()
    {
        base.Update();
        if (!this.m_IsInside)
        {
            return;
        }
        if (!DifficultySettings.ActivePreset.m_Insects)
        {
            return;
        }
        if (InsectsController.Get().IsActive())
        {
            return;
        }
        if (MakeFireController.Get().IsActive())
        {
            return;
        }
        if (HitReactionController.Get().IsActive())
        {
            return;
        }
        if (HarvestingAnimalController.Get().IsActive())
        {
            return;
        }
        if (MudMixerController.Get().IsActive())
        {
            return;
        }
        if (HarvestingSmallAnimalController.Get().IsActive())
        {
            return;
        }
        if (ConsciousnessController.Get().IsActive())
        {
            return;
        }
        if (DeathController.Get().IsActive())
        {
            return;
        }
        if (SleepController.Get().IsActive())
        {
            return;
        }
        if (Player.Get().m_Animator.GetBool(Player.Get().m_CleanUpHash))
        {
            return;
        }
        Item currentItem = Player.Get().GetCurrentItem(Hand.Right);

        if (currentItem && currentItem.m_Info.IsTorch() && ((Torch)currentItem).m_Burning)
        {
            return;
        }
        if (Player.Get().IsDead())
        {
            return;
        }
        if (InsectsSensor.m_LastTime == 0f || Time.time - InsectsSensor.m_LastTime > this.m_Cooldown)
        {
            if (CraftingManager.Get().IsActive())
            {
                CraftingManager.Get().Deactivate();
            }
            InsectsController.Get().m_Sensor = this;
            Player.Get().StartController(PlayerControllerType.Insects);
            InsectsSensor.m_LastTime = Time.time;
        }
    }
Exemplo n.º 7
0
    private void UpdateHP()
    {
        if (this.m_Player.m_DreamActive)
        {
            return;
        }
        float         deltaTime     = Time.deltaTime;
        FPPController fppcontroller = this.m_Player.m_FPPController;

        if (!fppcontroller)
        {
            return;
        }
        DeathController deathController = this.m_Player.m_DeathController;

        if (deathController.IsActive())
        {
            return;
        }
        ConsciousnessController component = this.m_Player.GetComponent <ConsciousnessController>();

        if (component.IsActive())
        {
            return;
        }
        if (!Cheats.m_GodMode)
        {
            if (this.IsNutritionCarboCriticalLevel() || this.IsNutritionFatCriticalLevel() || this.IsNutritionProteinsCriticalLevel())
            {
                this.IncreaseHP(-this.m_HealthLossPerSecondNoNutrition * deltaTime);
            }
            if (this.IsHydrationCriticalLevel())
            {
                this.IncreaseHP(-this.m_HealthLossPerSecondNoHydration * deltaTime);
            }
            bool          flag         = true;
            List <Injury> injuriesList = this.m_InjuryModule.GetInjuriesList();
            for (int i = 0; i < injuriesList.Count; i++)
            {
                if (injuriesList[i].m_ParentInjury == null)
                {
                    if (injuriesList[i].m_Type != InjuryType.Worm && injuriesList[i].m_Type != InjuryType.Rash && injuriesList[i].m_Type != InjuryType.Leech)
                    {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag)
            {
                float num  = MainLevel.Instance.m_TODTime.m_DayLengthInMinutes + MainLevel.Instance.m_TODTime.m_NightLengthInMinutes;
                float num2 = num * 60f;
                this.IncreaseHP(this.m_MaxHP * this.m_HealthRecoveryPerDay / num2 * deltaTime);
            }
            if (this.m_Oxygen <= 0f)
            {
                this.IncreaseHP(-this.m_HealthLossPerSecondNoOxygen * deltaTime);
            }
        }
        this.m_HP = Mathf.Clamp(this.m_HP, 0f, this.m_MaxHP);
        if (this.m_HP < 10f)
        {
            if (!this.m_AudioModule.IsHeartBeatSoundPlaying())
            {
                this.m_AudioModule.PlayHeartBeatSound(1f, true);
            }
        }
        else if (this.m_AudioModule.IsHeartBeatSoundPlaying())
        {
            this.m_AudioModule.StopHeartBeatSound();
        }
    }
Exemplo n.º 8
0
 private bool CanStartDialog()
 {
     return(!ConsciousnessController.Get().IsActive() && !HarvestingAnimalController.Get().IsActive() && !HarvestingSmallAnimalController.Get().IsActive() && !TriggerController.Get().IsGrabInProgress());
 }
Exemplo n.º 9
0
    public void UpdateProcessing()
    {
        if (!ItemsManager.Get())
        {
            return;
        }
        float num = MainLevel.Instance.m_TODSky.Cycle.GameTimeDelta;

        if (HUDSleeping.Get().GetState() == HUDSleepingState.Progress)
        {
            num = SleepController.Get().m_HoursDelta;
        }
        else if (ConsciousnessController.Get().IsUnconscious())
        {
            num = ConsciousnessController.Get().m_HoursDelta;
        }
        foreach (ItemSlot itemSlot in this.m_ActiveSlots)
        {
            Food food = (Food)itemSlot.m_Item;
            if (this.m_Firecamp)
            {
                if (!this.m_Firecamp.m_Burning)
                {
                    if (food.m_ProcessDuration > 0f)
                    {
                        food.m_ProcessDuration -= num;
                    }
                    else
                    {
                        food.m_ProcessDuration = 0f;
                    }
                    if (!itemSlot.gameObject.activeSelf)
                    {
                        itemSlot.gameObject.SetActive(true);
                    }
                    if (!itemSlot.m_Item.enabled)
                    {
                        itemSlot.m_Item.enabled = true;
                        continue;
                    }
                    continue;
                }
            }
            else if (this.m_Type != FoodProcessor.Type.Dryer && (!this.m_ConnectedFirecamp || !this.m_ConnectedFirecamp.m_Burning))
            {
                if (food.m_ProcessDuration > 0f)
                {
                    food.m_ProcessDuration -= num;
                }
                else
                {
                    food.m_ProcessDuration = 0f;
                }
                if (!itemSlot.gameObject.activeSelf)
                {
                    itemSlot.gameObject.SetActive(true);
                }
                if (!itemSlot.m_Item.enabled)
                {
                    itemSlot.m_Item.enabled = true;
                    continue;
                }
                continue;
            }
            if (this.m_Type == FoodProcessor.Type.Dryer)
            {
                if (!RainManager.Get().IsRain() || RainManager.Get().IsInRainCutter(base.transform.position))
                {
                    food.m_ProcessDuration += num;
                }
                else if (food.m_ProcessDuration > 0f)
                {
                    food.m_ProcessDuration -= num;
                }
                else
                {
                    food.m_ProcessDuration = 0f;
                }
            }
            else
            {
                food.m_ProcessDuration += num;
            }
            FoodInfo foodInfo = (FoodInfo)itemSlot.m_Item.m_Info;
            if (food.m_ProcessDuration >= this.GetProcessingTime(foodInfo) || this.m_DebugImmediate)
            {
                HUDProcess.Get().UnregisterProcess(itemSlot.m_Item);
                Item item = ItemsManager.Get().CreateItem(this.GetResultItemID(foodInfo), true, itemSlot.m_Item.transform.position, itemSlot.m_Item.transform.rotation);
                itemSlot.ReplaceItem(item);
                if (!this.m_ProcessedSlots.Contains(itemSlot))
                {
                    this.m_ProcessedSlots.Add(itemSlot);
                }
                this.m_DebugImmediate = false;
                if (this.m_Type == FoodProcessor.Type.Fire && !foodInfo.m_CanCook)
                {
                    food.m_Burned = true;
                    break;
                }
                break;
            }
        }
    }
Exemplo n.º 10
0
 protected override bool ShouldShow()
 {
     return(ConsciousnessController.Get().GetPassingOutProgress() > 0f);
 }
Exemplo n.º 11
0
 public void Activate()
 {
     if (CutscenesManager.Get().IsCutscenePlaying())
     {
         return;
     }
     if (base.gameObject.activeSelf)
     {
         return;
     }
     if (BodyInspectionMiniGameController.Get().IsActive())
     {
         return;
     }
     if (VomitingController.Get().IsActive())
     {
         return;
     }
     if (SwimController.Get().IsActive())
     {
         return;
     }
     if (ConsciousnessController.Get().IsActive())
     {
         return;
     }
     if (WatchController.Get().IsActive())
     {
         return;
     }
     if (SleepController.Get().IsActive())
     {
         return;
     }
     if (InsectsController.Get().IsActive())
     {
         return;
     }
     if (HarvestingAnimalController.Get().IsActive())
     {
         return;
     }
     if (HarvestingSmallAnimalController.Get().IsActive())
     {
         return;
     }
     if (Player.Get().IsDead())
     {
         return;
     }
     if (HitReactionController.Get().IsActive())
     {
         return;
     }
     if (TriggerController.Get().IsGrabInProgress())
     {
         return;
     }
     if (HUDMovie.Get().enabled&& HUDMovie.Get().gameObject.activeSelf)
     {
         return;
     }
     if (Player.Get().m_Aim || Time.time - Player.Get().m_StopAimTime < 0.5f)
     {
         return;
     }
     base.gameObject.SetActive(true);
     this.BlockPlayerRotation(true);
     if (!Player.Get().m_BodyInspectionController.IsActive() && !CraftingManager.Get().gameObject.activeSelf)
     {
         Player.Get().StartController(PlayerControllerType.Inventory);
         if (Player.Get().m_ControllerToStart != PlayerControllerType.Unknown)
         {
             Player.Get().StartControllerInternal();
         }
     }
     this.m_Camera.enabled = true;
     this.m_Canvas.gameObject.SetActive(true);
     CursorManager.Get().ShowCursor(true);
     HUDManager.Get().SetActiveGroup(HUDManager.HUDGroup.Inventory3D);
     this.m_CarriedItem = null;
     this.SetupPocket(this.m_ActivePocket);
     Player.Get().m_BackpackWasOpen = true;
     if (BodyInspectionController.Get().IsActive())
     {
         HintsManager.Get().ShowHint("Inspection_Backpack", 10f);
     }
     this.m_ActivityChanged = true;
 }