private void ImpaleObject(CJObject obj) { if (this.m_ImpaledObject) { return; } Item currentItem = this.m_Player.GetCurrentItem(Hand.Right); DebugUtils.Assert(currentItem, true); this.m_ImpaledObject = obj.gameObject; this.m_ImpaledObject.transform.position = currentItem.m_DamagerStart.position; this.m_ImpaledObject.transform.parent = currentItem.m_DamagerStart; Rigidbody component = this.m_ImpaledObject.GetComponent <Rigidbody>(); if (component) { UnityEngine.Object.Destroy(component); } obj.OnImpaleOnSpear(); HintsManager.Get().ShowHint("Take_Item_From_Spear", 10f); Item component2 = this.m_ImpaledObject.GetComponent <Item>(); if (component2) { component2.ItemsManagerUnregister(); component2.enabled = false; } }
public static void SetupObjects() { SaveGame.m_Objects.Clear(); SaveGame.m_Objects.Add(DifficultySettings.Get()); SaveGame.m_Objects.Add(DialogsManager.Get()); SaveGame.m_Objects.Add(AIManager.Get()); SaveGame.m_Objects.Add(EnemyAISpawnManager.Get()); SaveGame.m_Objects.Add(TriggersManager.Get()); SaveGame.m_Objects.Add(ItemsManager.Get()); SaveGame.m_Objects.Add(SensorManager.Get()); SaveGame.m_Objects.Add(ConstructionGhostManager.Get()); SaveGame.m_Objects.Add(StaticObjectsManager.Get()); SaveGame.m_Objects.Add(Player.Get()); SaveGame.m_Objects.Add(PlayerConditionModule.Get()); SaveGame.m_Objects.Add(PlayerInjuryModule.Get()); SaveGame.m_Objects.Add(PlayerDiseasesModule.Get()); SaveGame.m_Objects.Add(StatsManager.Get()); SaveGame.m_Objects.Add(HintsManager.Get()); SaveGame.m_Objects.Add(ObjectivesManager.Get()); SaveGame.m_Objects.Add(StoryObjectivesManager.Get()); SaveGame.m_Objects.Add(HUDObjectives.Get()); SaveGame.m_Objects.Add(MenuNotepad.Get()); SaveGame.m_Objects.Add(MapTab.Get()); SaveGame.m_Objects.Add(Music.Get()); SaveGame.m_Objects.Add(RainManager.Get()); SaveGame.m_Objects.Add(SleepController.Get()); SaveGame.m_Objects.Add(MainLevel.Instance); SaveGame.m_Objects.Add(ScenarioManager.Get()); SaveGame.m_Objects.Add(InventoryBackpack.Get()); SaveGame.m_Objects.Add(ReplicatedSessionState.Get()); }
public static void SetupObjects() { SaveGame.m_Objects.Clear(); SaveGame.m_Objects.Add(MainLevel.Instance); SaveGame.m_Objects.Add(Scenario.Get()); SaveGame.m_Objects.Add(AIManager.Get()); SaveGame.m_Objects.Add(TriggersManager.Get()); SaveGame.m_Objects.Add(ItemsManager.Get()); SaveGame.m_Objects.Add(SensorManager.Get()); SaveGame.m_Objects.Add(ConstructionGhostManager.Get()); SaveGame.m_Objects.Add(StaticObjectsManager.Get()); SaveGame.m_Objects.Add(Player.Get()); SaveGame.m_Objects.Add(PlayerConditionModule.Get()); SaveGame.m_Objects.Add(PlayerInjuryModule.Get()); SaveGame.m_Objects.Add(PlayerDiseasesModule.Get()); SaveGame.m_Objects.Add(StatsManager.Get()); SaveGame.m_Objects.Add(HintsManager.Get()); SaveGame.m_Objects.Add(ObjectivesManager.Get()); SaveGame.m_Objects.Add(HUDObjectives.Get()); SaveGame.m_Objects.Add(MenuNotepad.Get()); SaveGame.m_Objects.Add(MapTab.Get()); SaveGame.m_Objects.Add(Music.Get()); SaveGame.m_Objects.Add(RainManager.Get()); SaveGame.m_Objects.Add(BalanceSystem.Get()); }
private void UpdateHints() { CraftingManager.CraftingHints craftingHints = CraftingManager.CraftingHints.None; if (base.gameObject.activeSelf && !CraftingController.Get().m_InProgress) { if (this.m_Items.Count == 0) { craftingHints = CraftingManager.CraftingHints.Empty; } else if (this.m_PossibleResults.Count > 0) { craftingHints = CraftingManager.CraftingHints.Combine; } else { craftingHints = CraftingManager.CraftingHints.Full; } } if (craftingHints != this.m_CurrentHint) { if (this.m_CurrentHint != CraftingManager.CraftingHints.None) { HintsManager.Get().HideHint("Crafting_" + this.m_CurrentHint.ToString()); } this.m_CurrentHint = craftingHints; if (this.m_CurrentHint != CraftingManager.CraftingHints.None) { HintsManager.Get().ShowHint("Crafting_" + this.m_CurrentHint.ToString(), 0f); } } }
public override bool TakeDamage(DamageInfo damage_info) { if (this.m_ConstructionInfo.m_HitsCountToDestroy == 0) { return(false); } if (damage_info.m_DamageItem && damage_info.m_DamageItem.m_Info.IsArrow()) { return(false); } if (!ItemsManager.Get().m_WasConstructionDestroyed&& this.m_CurrentHitsCount == 0) { Hint hint = HintsManager.Get().FindHint(this.m_DestroyHintName); if (!HUDHint.Get().IsHintActive(hint) && Time.time - hint.m_LastShowTime > 5f) { hint.m_ShowedNTimes = 0; HintsManager.Get().ShowHint(this.m_DestroyHintName, 5f); } } this.ReplRequestOwnership(false); this.ReplSetDirty(); this.m_CurrentHitsCount++; if (this.m_CurrentHitsCount >= this.m_ConstructionInfo.m_HitsCountToDestroy) { this.DestroyMe(true); } else { this.m_LastDamageTime = Time.time; base.HitShake(); } return(true); }
protected override void OnEnable() { base.OnEnable(); Item currentItem = this.m_Player.GetCurrentItem(Hand.Right); this.m_FishingRod = ((!currentItem) ? null : currentItem.gameObject.GetComponent <FishingRod>()); this.m_FishingRod.enabled = true; this.SetState(FishingController.State.None); HintsManager.Get().ShowHint("Start_Fishing", 10f); }
public void OnInsertItem(ItemSlot slot) { if (this.m_HookSlot == slot) { this.m_Hook = slot.m_Item.GetComponent <FishingHook>(); this.m_Hook.SetFishingRod(this); slot.m_Item.m_CantSave = true; HintsManager.Get().ShowHint("FishRod_Bait", 10f); } }
private void OnEnterState() { this.m_EnterStateTime = Time.time; switch (this.m_Animator.GetInteger(this.m_StateHash)) { case 0: this.DestroyFish(); this.m_FishingRod.Break(); return; case 1: this.BlockMoves(false); this.BlockRotation(false); return; case 2: case 3: case 4: case 10: case 11: break; case 5: this.BlockMoves(true); this.m_Player.StartAim(Player.AimType.Fishing, 18f); return; case 6: this.m_FishingRod.StartCast(); PlayerConditionModule.Get().DecreaseStamina(PlayerConditionModule.Get().GetStaminaDecrease(StaminaDecreaseReason.RodCast)); return; case 7: HintsManager.Get().ShowHint("Catch_Fish", 10f); this.m_FishingRod.StartFishing(this.m_Target); ParticlesManager.Get().Spawn("SmallSplash_Size_C", this.m_Target, Quaternion.identity, Vector3.zero, null, -1f, false); return; case 8: PlayerConditionModule.Get().DecreaseStamina(PlayerConditionModule.Get().GetStaminaDecrease(StaminaDecreaseReason.RodReel)); return; case 9: PlayerConditionModule.Get().DecreaseStamina(PlayerConditionModule.Get().GetStaminaDecrease(StaminaDecreaseReason.RodStrike)); break; case 12: this.ShowFish(); this.BlockRotation(true); return; default: return; } }
protected override void OnEnable() { base.OnEnable(); Item currentItem = this.m_Player.GetCurrentItem(Hand.Right); this.m_FishingRod = currentItem.gameObject.GetComponent <FishingRod>(); this.m_FishingRod.enabled = true; currentItem.gameObject.SetActive(true); this.SetState(FishingController.State.Idle); HintsManager.Get().ShowHint("FishRod_Hook", 10f); }
protected override void Start() { base.Start(); this.m_ArrowSlot.m_ActivityUpdate = false; if (this.m_Armed) { this.m_ArrowSlot.Activate(true); } this.m_ArrowHolder.gameObject.SetActive(false); base.gameObject.GetComponent <AnimationEventsReceiver>().Initialize(null); HintsManager.Get().ShowHint("BowTrap_InsertArrow", 10f); }
private void ApplyDefaultOptions() { InputsManager.Get().ApplyDefaultOptions(); if (this.InitializeButtons()) { GreenHellGame.Instance.m_Settings.SaveSettings(); } if (HintsManager.Get() != null) { HintsManager.Get().ReloadScript(); } }
protected override void OnEnable() { base.OnEnable(); this.m_PlayerIdleAnimHash = Animator.StringToHash(Player.Get().GetCurrentItem(Hand.Right).m_InfoName + "_Idle"); this.m_PlayerAnimHash = Animator.StringToHash(Player.Get().GetCurrentItem(Hand.Right).m_InfoName); this.SetState(MakeFireController.State.WaitingForKindling); HintsManager.Get().ShowHint("AddKindling", 10f); Vector2 lookDev = this.m_Player.m_FPPController.GetLookDev(); lookDev.y = 0f; this.m_Player.m_FPPController.SetLookDev(lookDev); this.InitializeAudio(); }
public override void OnShow() { base.OnShow(); Player.Get().BlockMoves(); this.m_MovesBlocked = true; Player.Get().BlockRotation(); this.m_RotationBlocked = true; if (!this.m_MapDatas.Values.ElementAt(this.m_CurrentPage).m_Unlocked) { this.SetNextPage(); } this.SetupPage(); HintsManager.Get().ShowHint("MapZoom", 10f); }
public void ResetGameBeforeLoad() { if (CameraManager.Get()) { CameraManager.Get().SetZoom(0f); } if (HintsManager.Get()) { HintsManager.Get().HideAllHints(); } if (ObjectivesManager.Get()) { ObjectivesManager.Get().DeactivateAllActiveObjectives(); } }
public void OnInsertItem(ItemSlot slot) { if (slot == this.m_BaitSlot) { this.m_Bait = slot.m_Item; this.m_Bait.transform.position = this.m_BaitTransform.transform.position; this.m_Bait.transform.rotation = this.m_BaitTransform.transform.rotation; this.m_Bait.transform.parent = this.m_BaitTransform.transform; this.m_Bait.ItemsManagerUnregister(); this.m_Bait.transform.localScale = this.m_BaitTransform.FindChild(this.m_Bait.GetInfoID().ToString()).transform.localScale; base.enabled = false; this.m_Item.m_BlockTrigger = true; slot.m_Item.m_CantSave = true; HintsManager.Get().ShowHint("Cast_FishingRod", 10f); } }
public static void SetupObjectsCoop() { SaveGame.m_Objects.Clear(); SaveGame.m_Objects.Add(ItemsManager.Get()); SaveGame.m_Objects.Add(Player.Get()); SaveGame.m_Objects.Add(PlayerConditionModule.Get()); SaveGame.m_Objects.Add(PlayerInjuryModule.Get()); SaveGame.m_Objects.Add(PlayerDiseasesModule.Get()); SaveGame.m_Objects.Add(StatsManager.Get()); SaveGame.m_Objects.Add(HintsManager.Get()); SaveGame.m_Objects.Add(MenuNotepad.Get()); SaveGame.m_Objects.Add(MapTab.Get()); SaveGame.m_Objects.Add(SleepController.Get()); SaveGame.m_Objects.Add(DifficultySettings.Get()); SaveGame.m_Objects.Add(InventoryBackpack.Get()); }
private void ShowFish() { if (!this.m_FishingRod.m_Fish) { return; } this.m_Fish = UnityEngine.Object.Instantiate <GameObject>(this.m_FishingRod.m_Fish.GetPrefab()); this.m_Fish.transform.localScale = this.m_FishingRod.m_Fish.transform.localScale; Collider component = this.m_Fish.GetComponent <Collider>(); if (component) { component.enabled = false; } HintsManager.Get().ShowHint("Take_Fish", 10f); this.m_FishingRod.DestroyFish(); }
public void OnCreateItem(ItemID id) { if (this.m_CreationsData.ContainsKey((int)id)) { Dictionary <int, int> creationsData; int key; (creationsData = this.m_CreationsData)[key = (int)id] = creationsData[key] + 1; if (id == ItemID.Stone_Blade && this.m_CreationsData[(int)id] == 2) { HintsManager.Get().ShowHint("Crafting_Proggresion", 10f); } } else { DebugUtils.Assert("[ItemsManager:OnCraft] Missing item in crafting data - " + id.ToString(), true, DebugUtils.AssertType.Info); } }
private void ShowNodes(bool show) { if (this.m_NodesVisible == show) { return; } foreach (UISelectDialogNodeData uiselectDialogNodeData in this.m_UINodeDatas) { uiselectDialogNodeData.m_Object.SetActive(show); } this.m_NodesVisible = show; this.m_SelectedNode = 0; if (this.m_NodesVisible) { Player.Get().BlockMoves(); Player.Get().BlockRotation(); this.m_PlayerBlocked = true; this.m_Reply.SetActive(false); CursorManager.Get().ShowCursor(true); CursorManager.Get().UpdateCursorVisibility(); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); Vector3 zero = Vector3.zero; zero.x = (float)Screen.width * this.m_CursorOffset.x; zero.y = (float)Screen.height * this.m_CursorOffset.y; CursorManager.Get().SetCursorPos(this.m_Dummy.transform.position + zero); HintsManager.Get().ShowHint("Scroll_Dialog", 10f); } else { if (this.m_PlayerBlocked) { Player.Get().UnblockMoves(); Player.Get().UnblockRotation(); CursorManager.Get().ShowCursor(false); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); this.m_PlayerBlocked = false; } this.m_Reply.SetActive(true); this.m_ReplyCanvasGroup.alpha = 0f; HintsManager.Get().HideHint("Scroll_Dialog"); } }
private void OnEnterState() { switch (this.m_State) { case FishingController.State.None: this.DestroyFish(); this.m_Animator.SetBool(this.m_BFishing, false); this.m_Animator.SetBool(this.m_BIdle, true); break; case FishingController.State.Aim: this.m_Animator.SetBool(this.m_BFishing, true); this.m_Animator.SetBool(this.m_BIdle, false); this.m_Player.BlockMoves(); HintsManager.Get().ShowHint("Cast_FishingRod", 10f); this.m_Player.StartAim(Player.AimType.Fishing); break; case FishingController.State.Cast: this.m_Animator.SetTrigger(this.m_TFishingCast); break; case FishingController.State.Waiting: this.m_FishingRod.StartFishing(this.m_Target); HintsManager.Get().ShowHint("Catch_Fish", 10f); break; case FishingController.State.Strike: this.m_Animator.SetTrigger(this.m_TFishingStrike); break; case FishingController.State.Reel: this.m_Animator.SetTrigger(this.m_TFishingReel); break; case FishingController.State.Fish: this.ShowFish(); break; } }
private void ApplyOptions() { Dictionary <int, int> dictionary = new Dictionary <int, int>(); Dictionary <int, int> dictionary2 = new Dictionary <int, int>(); foreach (UIKeyBindButton uikeyBindButton in this.m_KeyBindButtons) { if (uikeyBindButton.m_Actions.Count > 0) { this.AddActionsByInputAction(uikeyBindButton, dictionary); } if (uikeyBindButton.m_TriggerActions.Count > 0) { this.AddActionsByTriggerAction(uikeyBindButton, dictionary2); } } InputsManager.Get().ApplyOptions(dictionary, dictionary2, ControllerType.PC); if (HintsManager.Get() != null) { HintsManager.Get().ReloadScript(); } }
private void TakeFish() { if (!this.m_Fish) { return; } AI component = this.m_Fish.GetComponent <AI>(); AI.AIID id = component.m_ID; Item item = ItemsManager.Get().CreateItem(id.ToString() + "_Body", false); InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true); UnityEngine.Object.Destroy(component.gameObject); this.m_Fish = null; this.SetState(FishingController.State.Idle); Animator componentDeepChild = General.GetComponentDeepChild <Animator>(item.gameObject); if (componentDeepChild != null) { componentDeepChild.SetBool("Backpack", true); } HintsManager.Get().HideHint("Cast_FishingRod"); }
private void OnSetState() { this.m_StartStateTime = Time.time; switch (this.m_State) { case MakeFireController.State.None: if (this.m_Kindling) { UnityEngine.Object.Destroy(this.m_Kindling.gameObject); } if (this.m_FireTool) { if (this.m_FireTool.m_Animator.isInitialized) { this.m_FireTool.m_Animator.SetBool(this.m_ToolAnimHash, false); } this.m_FireTool.m_Light.enabled = false; this.m_FireTool.m_Emission.enabled = false; this.m_FireTool.m_KindlingSlot.Deactivate(); this.m_FireTool.m_KindlingSlot.gameObject.SetActive(false); if (this.m_FireTool.m_AnimationVis) { this.m_FireTool.m_AnimationVis.SetActive(false); } if (this.m_FireTool.m_NormalVis) { this.m_FireTool.m_NormalVis.SetActive(true); } this.m_FireTool = null; } if (this.m_Tool) { this.m_Tool.StaticPhxRequestRemove(); this.m_Tool.OnRemovedFromHand(); this.m_Tool = null; } if (this.m_Animator.isInitialized) { this.m_Animator.SetBool(this.m_PlayerIdleAnimHash, false); this.m_Animator.SetBool(this.m_PlayerAnimHash, false); this.m_Animator.SetBool(this.m_SuccessHash, false); this.m_Animator.SetBool(this.m_FailHash, false); } if (this.m_ParticleObj) { ParticlesManager.Get().Remove(this.m_ParticleObj); this.m_ParticleObj = null; } this.m_FXSpawned = false; this.m_Player.UnblockMoves(); this.m_Player.UnblockRotation(); break; case MakeFireController.State.WaitingForKindling: this.m_FireLevel = 0f; this.m_Tool = (ItemTool)this.m_Player.GetCurrentItem(Hand.Right); DebugUtils.Assert(this.m_Tool != null, "[MakeFireController:OnEnable] ERROR - Currentitem is not a Fire Tool!", true, DebugUtils.AssertType.Info); this.m_Tool.ItemsManagerUnregister(); this.m_FireTool = this.m_Tool.GetComponent <FireTool>(); DebugUtils.Assert(this.m_FireTool != null, "[MakeFireController:OnEnable] ERROR - Missing FireTool component!", true, DebugUtils.AssertType.Info); this.m_FireTool.m_KindlingSlot.gameObject.SetActive(true); this.m_FireTool.m_KindlingSlot.Activate(); this.m_Tool.StaticPhxRequestAdd(); if (this.m_FireTool.m_AnimationVis) { this.m_FireTool.m_AnimationVis.SetActive(true); } if (this.m_FireTool.m_NormalVis) { this.m_FireTool.m_NormalVis.SetActive(false); } this.m_Player.BlockMoves(); this.m_Player.BlockRotation(); this.m_Animator.CrossFadeInFixedTime(this.m_PlayerIdleAnimHash, 0.25f, this.m_SpineLayerIndex); this.m_Animator.CrossFadeInFixedTime(this.m_PlayerIdleAnimHash, 0.25f, this.m_BaseLayerIndex); this.m_Animator.SetBool(this.m_PlayerIdleAnimHash, true); this.m_Animator.SetBool(this.m_PlayerAnimHash, false); this.m_Animator.SetBool(this.m_SuccessHash, false); this.m_Animator.SetBool(this.m_FailHash, false); this.m_Tool.OnWaitingForKindling(); break; case MakeFireController.State.Game: PlayerSanityModule.Get().OnWhispersEvent(PlayerSanityModule.WhisperType.StartFire); this.m_Tool.OnStartMakeFireGame(); this.m_Animator.CrossFadeInFixedTime(this.m_PlayerAnimHash, 0.25f, this.m_SpineLayerIndex); this.m_Animator.CrossFadeInFixedTime(this.m_PlayerAnimHash, 0.25f, this.m_BaseLayerIndex); this.m_Animator.SetBool(this.m_PlayerAnimHash, true); this.m_Animator.SetBool(this.m_PlayerIdleAnimHash, false); this.m_FireTool.m_Animator.SetBool(this.m_ToolAnimHash, true); this.m_FireTool.m_KindlingSlot.gameObject.SetActive(false); this.m_FireTool.m_KindlingSlot.Deactivate(); this.m_Kindling.enabled = false; Inventory3DManager.Get().Deactivate(); this.CalcStaminaConsumption(); this.PlaySound(); break; case MakeFireController.State.Fail: this.m_Tool.OnFailMakeFireGame(); this.m_Animator.SetBool(this.m_FailHash, true); ParticlesManager.Get().Remove(this.m_ParticleObj); this.m_ParticleObj = null; this.m_FireTool.m_Animator.SetBool(this.m_ToolAnimHash, false); this.StopSound(); HintsManager.Get().ShowHint("MakeFire_Fail", 10f); break; case MakeFireController.State.Success: Skill.Get <MakeFireSkill>().OnSkillAction(); ParticlesManager.Get().Remove(this.m_ParticleObj); this.m_ParticleObj = null; this.m_Tool.OnSuccessMakeFireGame(); this.m_Animator.SetBool(this.m_SuccessHash, true); this.m_FireTool.m_Animator.SetBool(this.m_ToolAnimHash, false); this.StopSound(); break; } }
protected override void OnDisable() { base.OnDisable(); HintsManager.Get().HideHint("AddKindling"); this.SetState(MakeFireController.State.None); }
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; }