Exemplo n.º 1
0
 // Token: 0x06005DD8 RID: 24024 RVA: 0x0020D7D4 File Offset: 0x0020BBD4
 public void StartNock(ArrowHand currentArrowHand)
 {
     this.arrowHand = currentArrowHand;
     this.hand.HoverLock(base.GetComponent <Interactable>());
     this.nocked                = true;
     this.nockLerpStartTime     = Time.time;
     this.nockLerpStartRotation = this.pivotTransform.rotation;
     this.arrowSlideSound.Play();
     this.DoHandednessCheck();
 }
Exemplo n.º 2
0
        //-------------------------------------------------
        public void StartNock(ArrowHand currentArrowHand)
        {
            arrowHand = currentArrowHand;
            hand.HoverLock(GetComponent <Interactable>());
            nocked                = true;
            nockLerpStartTime     = Time.time;
            nockLerpStartRotation = pivotTransform.rotation;

            // Sound of arrow sliding on nock as it's being pulled back
            arrowSlideSound.Play();

            // Decide which hand we're drawing with and lerp to the correct side
            DoHandednessCheck();
        }
Exemplo n.º 3
0
        }                                          // 0x0000000180FC98C0-0x0000000180FC9920

        public void StartNock(ArrowHand currentArrowHand)
        {
        }                                                            // 0x0000000180FC97A0-0x0000000180FC98C0
Exemplo n.º 4
0
        //-------------------------------------------------
        void OnCollisionEnter(Collision collision)
        {
            if (inFlight)
            {
                ArrowHand.SetIsArrowInAir(false);
                Rigidbody rb         = GetComponent <Rigidbody>();
                float     rbSpeed    = rb.velocity.sqrMagnitude;
                bool      canStick   = (targetPhysMaterial != null && collision.collider.sharedMaterial == targetPhysMaterial && rbSpeed > 0.2f);
                bool      hitBalloon = collision.collider.gameObject.GetComponent <Balloon>() != null;

                if (travelledFrames < 2 && !canStick)
                {
                    // Reset transform but halve your velocity
                    transform.position = prevPosition - prevVelocity * Time.deltaTime;
                    transform.rotation = prevRotation;

                    Vector3 reflfectDir = Vector3.Reflect(arrowHeadRB.velocity, collision.contacts[0].normal);
                    arrowHeadRB.velocity = reflfectDir * 0.25f;
                    shaftRB.velocity     = reflfectDir * 0.25f;

                    travelledFrames = 0;
                    return;
                }

                if (glintParticle != null)
                {
                    glintParticle.Stop(true);
                }

                // Only play hit sounds if we're moving quickly
                if (rbSpeed > 0.1f)
                {
                    hitGroundSound.Play();
                    if (OnArrowLanded != null)
                    {
                        if (collision.gameObject.tag == "Tree")
                        {
                            Transform[] teleportLocation = collision.gameObject.GetComponentsInChildren <Transform>();
                            for (int i = 0; i < teleportLocation.Length; i++)
                            {
                                if (teleportLocation[i].name == "TeleportationSpot")
                                {
                                    Debug.Log(teleportLocation[i].name + " is the name of teleportLocation");
                                    OnArrowLanded(this, collision.gameObject.tag, teleportLocation[i]);
                                }
                            }
                        }
                        else
                        {
                            OnArrowLanded(this, collision.gameObject.tag, null);
                        }
                    }
                }

                FireSource arrowFire          = gameObject.GetComponentInChildren <FireSource>();
                FireSource fireSourceOnTarget = collision.collider.GetComponentInParent <FireSource>();

                if (arrowFire != null && arrowFire.isBurning && (fireSourceOnTarget != null))
                {
                    if (!hasSpreadFire)
                    {
                        collision.collider.gameObject.SendMessageUpwards("FireExposure", gameObject, SendMessageOptions.DontRequireReceiver);
                        hasSpreadFire = true;
                    }
                }
                else
                {
                    // Only count collisions with good speed so that arrows on the ground can't deal damage
                    // always pop balloons
                    if (rbSpeed > 0.1f || hitBalloon)
                    {
                        collision.collider.gameObject.SendMessageUpwards("ApplyDamage", SendMessageOptions.DontRequireReceiver);
                        gameObject.SendMessage("HasAppliedDamage", SendMessageOptions.DontRequireReceiver);
                    }
                }

                if (hitBalloon)
                {
                    // Revert my physics properties cause I don't want balloons to influence my travel
                    transform.position   = prevPosition;
                    transform.rotation   = prevRotation;
                    arrowHeadRB.velocity = prevVelocity;
                    Physics.IgnoreCollision(arrowHeadRB.GetComponent <Collider>(), collision.collider);
                    Physics.IgnoreCollision(shaftRB.GetComponent <Collider>(), collision.collider);
                }

                if (canStick)
                {
                    StickInTarget(collision, travelledFrames < 2);
                }

                // Player Collision Check (self hit)
                if (Player.instance && collision.collider == Player.instance.headCollider)
                {
                    Player.instance.PlayerShotSelf();
                }
            }
        }