private void HandleStartInteract(HeroTriggerType triggerType)
 {
     if (triggerType != HeroTriggerType.Gear)
     {
         Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
         return;
     }
     if (IsReady)
     {
         Debug.Log("Already set");
         return;
     }
     if (_state == State.Turn)
     {
         Debug.Log("Turning");
         return;
     }
     if (_state == State.Reset)
     {
         Debug.Log("Resetting");
         return;
     }
     if (_fuseStation.IsFuseReady == false)
     {
         Debug.Log("Fuse is not ready");
         return;
     }
     Crank();
 }
Example #2
0
 private void HandleAutoTriggerTorch(HeroTriggerType type)
 {
     _torchTrigger.OnAutoTrigger -= HandleAutoTriggerTorch;
     Dialog.Instance.ShowDynamic("Glad I brought a flashlight.", "But at this point, I would have preferred a gun.");
     _torch.gameObject.SetActive(true);
     _torch.transform.parent        = Hero.Instance.transform;
     _torch.transform.localPosition = (Vector3.up * 1.5f) + (_torch.transform.forward * 0.3f);
 }
Example #3
0
        private void HandleStartInteract(HeroTriggerType triggerType)
        {
            if (triggerType != HeroTriggerType.Fuse)
            {
                Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
                return;
            }

            // Do nothing if the door is moving
            if (_door.IsMoving)
            {
                return;
            }

            // If the door is open, either interact with the fuse or close the box
            if (IsOpen)
            {
                switch (State)
                {
                case FuseState.Bad:
                    SetFuseState(FuseState.Empty);
                    if (PowerStation.Instance.HasPower)
                    {
                        //Hero.Instance.Die();
                    }
                    break;

                case FuseState.Empty:
                    if (Hero.Instance.FuseCount > 0)
                    {
                        Hero.Instance.RemoveFuse();
                        SetFuseState(FuseState.Good);
                        if (PowerStation.Instance.HasPower)
                        {
                            //Hero.Instance.Die();
                        }
                    }
                    break;

                case FuseState.Good:
                    _door.Close();
                    break;
                }
            }
            // If the door is closed, and the fuse is not good, open it
            else
            {
                if (State != FuseState.Good)
                {
                    _door.Open();
                }
                else
                {
                    Instructions.Instance.Hide();
                }
            }
        }
Example #4
0
 private void HandleHeroEnterTrigger(HeroTriggerType triggerType)
 {
     if (triggerType != HeroTriggerType.Elevator)
     {
         Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
         return;
     }
     _showInstructions = true;
 }
 private void HandleHeroInteract(HeroTriggerType triggerType)
 {
     if (triggerType != HeroTriggerType.Power)
     {
         Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
         return;
     }
     TogglePower();
 }
Example #6
0
 private void HandleHeroExitTrigger(HeroTriggerType triggerType)
 {
     if (triggerType != HeroTriggerType.Elevator)
     {
         Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
         return;
     }
     Instructions.Instance.Hide();
     _showInstructions = false;
 }
Example #7
0
 private void HandleStartInteract(HeroTriggerType triggerType)
 {
     Debug.Log("handle start interact");
     if (Close())
     {
         Instructions.Instance.Hide();
         if (OnActivateElevator != null)
         {
             OnActivateElevator();
         }
     }
 }
Example #8
0
        private void HandleAutoTrigger(HeroTriggerType triggerType)
        {
            if (triggerType != HeroTriggerType.WalkThroughDoor)
            {
                Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
                return;
            }

            if (_collider.activeSelf == true)
            {
                Debug.Log("Already triggered door blocker");
                return;
            }

            Debug.Log("Close and block door");
            _collider.SetActive(true);
            _door.Close(autoCloseIfOpening: true);
        }
Example #9
0
        private void HandleStartInteract(HeroTriggerType triggerType)
        {
            if (triggerType != HeroTriggerType.Door)
            {
                Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
                return;
            }

            if (HasFuse == false)
            {
                Debug.Log("Target fuse station " + _fuseStation.name + " is not working");
                return;
            }

            if (HasMotor == false)
            {
                Debug.Log("Target fuse station motor " + _fuseStation.name + " is not working");
                return;
            }

            if (HasPower == false)
            {
                Debug.Log("Power Station does not have power");
                return;
            }

            if (CanBeOpened)
            {
                Open();
            }
            else if (CanBeClosed && _allowHeroToCloseDoor)
            {
                Close();
            }
            else
            {
                Debug.Log("Door is in State." + _door0.CurrentState);
            }
        }
        private void HandleAutoTrigger(HeroTriggerType triggerType)
        {
            _heroTrigger.OnAutoTrigger -= HandleAutoTrigger;

            if (_level1)
            {
                Debug.Log("Trigger level 1 dialog " + _level1Dialog);
                _level1.StartDialog(_level1Dialog);
            }
            else
            {
                Dialog.Instance.ShowBaked(_lines);
            }

            if (_lookTarget)
            {
                Hero.Instance.SetDialogLookTarget(_lookTarget.transform.position);
            }

            if (_zoomFov > 0)
            {
                HeroCamera.Instance.Zoom(_zoomFov, _zoomDuration);
            }
        }
Example #11
0
        private void HandleStartInteract(HeroTriggerType triggerType)
        {
            if (triggerType != HeroTriggerType.PullFuseFromRobot)
            {
                Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString());
                return;
            }

            if (_fuseObject == null)
            {
                Debug.Log("fuse object is null");
                return;
            }

            Hero.Instance.AddFuse();
            if (_fuseObject)
            {
                Destroy(_fuseObject);
                _fuseObject = null;
            }
            FallOver();
            Instructions.Instance.Hide();
            _showInstructions = false;
        }
Example #12
0
 private void HandleHeroEnterTrigger(HeroTriggerType triggerType)
 {
     _showInstructions = true;
 }
Example #13
0
 private void HandleAutoTrigger(HeroTriggerType triggerType)
 {
     _outerDoorAutoTrigger.OnAutoTrigger -= HandleAutoTrigger;
     StartCoroutine(OpenInnerDoorAfterDelay());
 }
Example #14
0
 private void HandleAutoTrigger(HeroTriggerType triggerType)
 {
     Debug.Log("handle auto trigger");
     Open();
     _autoOpenTrigger.OnAutoTrigger -= HandleAutoTrigger;
 }
Example #15
0
 private void HandleAutoTrigger(HeroTriggerType triggerType)
 {
     _outerTrigger.OnAutoTrigger -= HandleAutoTrigger;
     enabled = true;
 }
Example #16
0
 private void HandleAutoTriggerPowerOutage(HeroTriggerType triggerType)
 {
     _triggerPowerOutage.OnAutoTrigger -= HandleAutoTriggerPowerOutage;
     StartCoroutine(TriggerPowerOutage());
 }
Example #17
0
 private void HandleHeroExitTrigger(HeroTriggerType triggerType)
 {
     Instructions.Instance.Hide();
     _showInstructions = false;
 }