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; } }
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()); }
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; }
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); }
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; } }
private bool CanStartDialog() { return(!ConsciousnessController.Get().IsActive() && !HarvestingAnimalController.Get().IsActive() && !HarvestingSmallAnimalController.Get().IsActive() && !TriggerController.Get().IsGrabInProgress()); }
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; } } }
protected override bool ShouldShow() { return(ConsciousnessController.Get().GetPassingOutProgress() > 0f); }
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; }