Example #1
0
    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;
        }
    }
Example #2
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;
        }
    }
 private bool CanAttack()
 {
     return(!FightController.s_BlockFight && !MainLevel.Instance.IsPause() && Time.time - MainLevel.Instance.m_LastUnpauseTime >= 0.25f && !this.m_Player.IsDead() && !SwimController.Get().IsActive() && !HUDWheel.Get().enabled&& !BodyInspectionController.Get().IsActive() && !WatchController.Get().IsActive() && !NotepadController.Get().IsActive() && !MapController.Get().IsActive() && this.m_ActionAllowed && !this.m_Player.GetRotationBlocked() && !Inventory3DManager.Get().gameObject.activeSelf&& !HitReactionController.Get().IsActive() && !base.IsBlock() && this.m_CurrentParam != 6 && this.m_CurrentParam != 8 && !ScenarioManager.Get().IsBoolVariableTrue("PlayerMechGameEnding") && !HUDSelectDialog.Get().enabled);
 }
 private bool CanAttack()
 {
     return(!MainLevel.Instance.IsPause() && !this.m_Player.IsDead() && !SwimController.Get().IsActive() && !HUDWheel.Get().enabled&& !BodyInspectionController.Get().IsActive() && !WatchController.Get().IsActive() && !NotepadController.Get().IsActive() && !MapController.Get().IsActive() && this.m_ActionAllowed && !this.m_Player.GetRotationBlocked() && !Inventory3DManager.Get().gameObject.activeSelf&& !HitReactionController.Get().IsActive() && !base.IsBlock() && this.m_CurrentParam != 6 && this.m_CurrentParam != 8);
 }
Example #5
0
 protected virtual bool CanAttack()
 {
     return(!MainLevel.Instance.IsPause() && !this.m_Player.GetRotationBlocked() && !Inventory3DManager.Get().gameObject.activeSelf&& !HitReactionController.Get().IsActive() && !base.IsBlock() && !this.IsAttack() && !this.m_Player.m_Aim && !PlayerConditionModule.Get().IsStaminaLevel(this.m_BlockAttackStaminaLevel));
 }
Example #6
0
 protected virtual bool CanAttack()
 {
     return(!MainLevel.Instance.IsPause() && Time.time - MainLevel.Instance.m_LastUnpauseTime >= 0.25f && !this.m_Player.GetRotationBlocked() && !Inventory3DManager.Get().gameObject.activeSelf&& !HitReactionController.Get().IsActive() && !base.IsBlock() && !this.IsAttack() && !this.m_Player.m_Aim && !ScenarioManager.Get().IsBoolVariableTrue("PlayerMechGameEnding") && !HUDSelectDialog.Get().enabled);
 }
 protected override bool CanAttack()
 {
     return(!MainLevel.Instance.IsPause() && Time.time - MainLevel.Instance.m_LastUnpauseTime >= 0.35f && !this.m_Player.GetRotationBlocked() && !Inventory3DManager.Get().gameObject.activeSelf&& !HitReactionController.Get().IsActive() && !base.IsBlock() && !this.IsAttack() && !HUDSelectDialog.Get().enabled&& !HUDSelectDialogNode.Get().enabled&& Time.time - HUDSelectDialog.Get().m_LastSelectDialogTime >= 0.35f && Time.time - HUDSelectDialogNode.Get().m_LastSelectNodeTime >= 0.35f);
 }
Example #8
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;
 }