public override void OnExecute(TriggerAction.TYPE action) { base.OnExecute(action); if (action == TriggerAction.TYPE.Take) { Item item = ItemsManager.Get().CreateItem(this.m_AIID.ToString() + "_Body", false); item.transform.rotation = base.transform.rotation; item.transform.position = base.transform.position; if (this.m_AIID == AI.AIID.PoisonDartFrog) { List <Renderer> componentsDeepChild = General.GetComponentsDeepChild <Renderer>(base.gameObject); Material material = null; for (int i = 0; i < componentsDeepChild.Count; i++) { material = componentsDeepChild[i].material; } item.ApplyMaterial(material); } item.Take(); UnityEngine.Object.Destroy(base.gameObject); } else if (action == TriggerAction.TYPE.Harvest) { Player.Get().HideWeapon(); HarvestingAnimalController.Get().SetBody(this); Player.Get().StartController(PlayerControllerType.HarvestingAnimal); } else if (action == TriggerAction.TYPE.RemoveFromSnareTrap && this.m_AI) { this.m_AI.StartRagdoll(); UnityEngine.Object.Destroy(this.m_AI.GetComponent <AI>()); UnityEngine.Object.Destroy(this.m_AI.GetComponent <Animator>()); this.m_Trap = null; } }
private Trigger GetExecutedTrigger() { Trigger trigger = HarvestingAnimalController.Get().GetBody(); if (!trigger) { trigger = TriggerController.Get().m_TriggerToExecute; } return(trigger); }
protected override void Update() { base.Update(); if (!this.m_IsInside) { return; } if (InsectsController.Get().IsActive()) { return; } if (MakeFireController.Get().IsActive()) { return; } if (CraftingController.Get().IsActive()) { return; } if (HitReactionController.Get().IsActive()) { return; } if (HarvestingAnimalController.Get().IsActive()) { return; } if (HarvestingSmallAnimalController.Get().IsActive()) { return; } Item currentItem = Player.Get().GetCurrentItem(Hand.Right); if (currentItem && currentItem.m_Info.IsTorch()) { Torch torch = (Torch)currentItem; if (torch.m_Burning) { return; } } if (Player.Get().IsDead()) { return; } if (this.m_LastTime == 0f || Time.time - this.m_LastTime > this.m_Cooldown) { InsectsController.Get().m_Sensor = this; Player.Get().StartController(PlayerControllerType.Insects); this.m_LastTime = Time.time; } }
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; } }
public bool CanShow() { if (GreenHellGame.Instance.m_GameMode != GameMode.Story) { return(false); } if (ScenarioManager.Get().IsBoolVariableTrue("PlayerMechGameEnding")) { return(false); } if (ConsciousnessController.Get().IsActive()) { return(false); } if (SleepController.Get().IsActive()) { return(false); } if (InsectsController.Get().IsActive()) { return(false); } if (InsectsController.Get().IsActive()) { return(false); } if (SwimController.Get().IsActive()) { return(false); } if (Player.Get().m_IsInAir) { return(false); } if (ChallengesManager.Get() && ChallengesManager.Get().IsChallengeActive()) { 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 (DeathController.Get().IsActive()) { return(false); } if (ScenarioManager.Get().IsDreamOrPreDream()) { return(false); } if (Inventory3DManager.Get().IsActive()) { return(false); } if (CutscenesManager.Get().IsCutscenePlaying()) { return(false); } if (SwimController.Get().IsActive()) { return(false); } if (BodyInspectionController.Get().IsActive()) { return(false); } if (HarvestingAnimalController.Get().IsActive()) { return(false); } if (HarvestingSmallAnimalController.Get().IsActive()) { return(false); } if (VomitingController.Get().IsActive()) { return(false); } if (MapController.Get().IsActive()) { return(false); } if (NotepadController.Get().IsActive()) { return(false); } if (MudMixerController.Get().IsActive()) { return(false); } if (MakeFireController.Get().IsActive()) { return(false); } if (HUDWheel.Get().enabled) { return(false); } if (FPPController.Get().m_Dodge) { return(false); } if (GreenHellGame.IsPadControllerActive() && HUDItem.Get().m_Active) { 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); }
private bool CanStartDialog() { return(!ConsciousnessController.Get().IsActive() && !HarvestingAnimalController.Get().IsActive() && !HarvestingSmallAnimalController.Get().IsActive() && !TriggerController.Get().IsGrabInProgress()); }
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; }