protected virtual void CombatLogicUpdate()
        {
            if (!rider.IsRiding)
            {
                return;                                                                                 //Just work while is in the horse
            }
            if (!IsAiming)
            {
                MountStartRotation = MountPoint.localRotation;                                          //Take the Start Local Rotation of the Link to Easily Return to it when finish AIMING
            }
            CalculateCameraTargetSide();

            if (UseHolders)
            {
                Toogle_Weapon();                                                                        //Call Tooge Weapon (to change between weapons)
            }
            if (isInCombatMode)                                                                         //If there's a Weapon Active
            {
                Anim.speed = 1;                                                                         //Set  Animator Speed back
                Anim.SetInteger(Hash.IDInt, -1);                                                        //Remove the IntID so the attack while  ??/?????

                if (ActiveAbility)
                {
                    if (Active_IMWeapon != null && Active_IMWeapon.Active)
                    {
                        if (ActiveAbility.WeaponType() != GetWeaponType())
                        {
                            ActiveAbility = CombatAbilities.Find(ability => ability.WeaponType() == GetWeaponType()); //Find the Ability for the IMWeapon
                        }
                    }
                    if (ActiveAbility.CanAim())
                    {
                        AimMode();
                    }

                    if (InputAttack1.GetInput) /*Gets the Input from the Primary Attack INPUT*/ } {
                    if (InputAttack2.GetInput)  /*Gets the Input from the Secondary Attack INPUT*/
                    {
                    }
                    if (Reload.GetInput) /*Gets the Input from the Reload INPUT*/ } {
                    ActiveAbility.UpdateAbility();                                                    //Update The Active Ability
            }
        }


        //Used for Invoke On Target
        if (Target != lastTarget)
        {
            OnTarget.Invoke(Target);
            lastTarget = Target;

            if (rider.AnimalControl && StrafeOnTarget)
            {
                rider.AnimalControl.CameraBaseInput = Target ? true : DefaultMonturaInputCamBaseInput;
            }
        }
    }
Beispiel #2
0
        protected virtual void CombatLogicUpdate()
        {
            if (!rider.IsRiding)
            {
                return;                                                                                 //Just work while is in the horse
            }
            if (!isAiming)
            {
                MountStartRotation = MountPoint.localRotation;                                          //Take the Start Local Rotation of the Link to Easily Return to it when finish AIMING
            }
            float TargetSide = 0;
            float CameraSide = 0;

            if (Target)
            {
                TargetSide = Vector3.Dot((_transform.position - Target.position).normalized, _transform.right); //Calculate the side from the Target
            }
            if (_cam)
            {
                CameraSide = Vector3.Dot(_cam.transform.right, _transform.forward);                     //Get the camera Side Float
            }
            this.TargetSide = TargetSide > 0;                                                           //Get the camera Side Left/Right
            this.CameraSide = CameraSide > 0;

            if (UseHolders)
            {
                Toogle_Weapon();                                                                        //Call Tooge Weapon (to change between weapons)
            }
            if (isInCombatMode)                                                                         //If there's a Weapon Active
            {
                Anim.speed = 1;                                                                         //Set  Animator Speed back to 1
                Anim.SetInteger(Hash.IDInt, -1);                                                        //Remove the IntID so the attack while

                if (ActiveAbility)
                {
                    if (Active_IMWeapon != null)
                    {
                        if (ActiveAbility.WeaponType() != GetWeaponType())
                        {
                            ActiveAbility = CombatAbilities.Find(ability => ability.WeaponType() == GetWeaponType()); //Find the Ability for the IMWeapon
                        }
                    }
                    if (ActiveAbility.CanAim())
                    {
                        AimMode();
                    }

                    ActiveAbility.UpdateAbility();                                                    //Update The Active Ability
                }
            }


            //Used for Invoke On Target
            if (Target != lastTarget)
            {
                OnTarget.Invoke(Target);
                lastTarget = Target;

                if (rider.AnimalControl && StrafeOnTarget)
                {
                    rider.AnimalControl.cameraBaseInput = Target ? true : DefaultMonturaInputCamBaseInput;
                }
            }
        }