示例#1
0
 public override void Apply(CombatAbilities combatAbilities)
 {
     if (OwningCard.Controller.HasMana(_cost, ManaUsage.Abilities))
     {
         combatAbilities.CanRegenerate = true;
     }
 }
示例#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
            }
            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;
            }
        }
    }
示例#3
0
        public override void Apply(CombatAbilities combatAbilities)
        {
            var cost = _cost;

              while (OwningCard.Controller.HasMana(cost, ManaUsage.Abilities))
              {
            combatAbilities.PowerIncrease += _power;
            combatAbilities.ToughnessIncrease += _toughness;

            cost = cost.Add(_cost);
              }
        }
示例#4
0
        public override void Apply(CombatAbilities combatAbilities)
        {
            var cost = _cost;

            while (OwningCard.Controller.HasMana(cost, ManaUsage.Abilities))
            {
                combatAbilities.PowerIncrease     += _power;
                combatAbilities.ToughnessIncrease += _toughness;

                cost = cost.Add(_cost);
            }
        }
示例#5
0
        ///──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        /// <summary>
        /// If the Rider had a weapon before mounting.. equip it.
        /// The weapon need an |IMWeapon| Interface, if not it wont be equiped
        /// </summary>
        public virtual void SetWeaponBeforeMounting(GameObject weapon)
        {
            if (weapon == null)
            {
                return;
            }
            if (weapon.GetComponent <IMWeapon>() == null)
            {
                return;                                                                                 //If the weapon doesn't have IMweapon Interface do nothing
            }
            /// Try the set to false the weapon if is not a Prefab ///

            SetActiveWeapon(weapon);

            isInCombatMode = true;

            Active_IMWeapon.Equiped();                                                                   //Let the weapon know that it has been Equiped

            EnableMountAttack(false);

            SetActiveHolder(Active_IMWeapon.Holder);                                                    //Set the Active Holder for the Active Weapon

            _weaponType = GetWeaponType();                                                              //Set the Weapon Type

            SetAction(WeaponActions.Idle);

            SetWeaponIdleAnimState(Active_IMWeapon.RightHand);                                          //Set the Correct Idle Hands Animations

            Active_IMWeapon.HitMask = HitMask;                                                          //Link the Hit Mask

            ActiveAbility = CombatAbilities.Find(ability => ability.WeaponType() == GetWeaponType());   //Find the Ability for the IMWeapon

            if (ActiveAbility)
            {
                ActiveAbility.ActivateAbility();
            }
            else
            {
                Debug.LogWarning("The Weapon is combatible but there's no Combat Ability available for it, please Add the matching ability it on the list of Combat Abilities");
            }

            OnEquipWeapon.Invoke(ActiveWeapon);

            LinkAnimator();
        }
示例#6
0
        ///──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        /// <summary>
        /// Draw (Set the Correct Parameters to play Draw Weapon Animation)
        /// </summary>
        public virtual void Draw_Weapon()
        {
            EnableMountAttack(false);                                                                   //Disable Attack Animations of the Animal
            ResetRiderCombat();

            if (UseInventory)                                                                           //If is using inventory
            {
                if (Active_IMWeapon != null)
                {
                    SetActiveHolder(Active_IMWeapon.Holder);                                             //Set the Current Holder to the weapon asigned holder
                }
            }
            else //if Use Holders
            {
                if (ActiveHolderTransform.childCount == 0)
                {
                    return;
                }
                IMWeapon isCombatible = ActiveHolderTransform.GetChild(0).GetComponent <IMWeapon>();     //Check if the Child on the holder Has a IMWeapon on it

                if (isCombatible == null)
                {
                    return;
                }

                SetActiveWeapon(ActiveHolderTransform.GetChild(0).gameObject);                               //Set Active Weapon to the Active Holder Child
            }
            _weaponType = GetWeaponType();                                                                   //Set the Weapon Type (For the correct Animations)

            SetAction(Active_IMWeapon.RightHand ? WeaponActions.DrawFromRight : WeaponActions.DrawFromLeft); //Set the  Weapon Action to -1 to Draw Weapons From Right or from left -2

            SetWeaponIdleAnimState(Active_IMWeapon.RightHand);

            ActiveAbility = CombatAbilities.Find(ability => ability.TypeOfAbility(Active_IMWeapon)); //Find the Ability for the IMWeapon


            LinkAnimator();

            if (debug)
            {
                Debug.Log("Draw: " + ActiveWeapon.name);         //Debug
            }
        }
示例#7
0
 private void SetActiveAbility()
 {
     ActiveAbility = CombatAbilities.Find(ability => ability.WeaponType == ActiveWeapon.WeaponType); //Find the Ability for the IMWeapon
 }
示例#8
0
 public abstract void Apply(CombatAbilities combatAbilities);
示例#9
0
 public abstract void Apply(CombatAbilities combatAbilities);
示例#10
0
 public virtual void AddAbility(RiderCombatAbility newAbility)
 {
     newAbility.StartAbility(this);
     CombatAbilities.Add(newAbility);
 }
示例#11
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;
                }
            }
        }
示例#12
0
 public CardWithCombatAbilities(Card card)
 {
     Card      = card;
     Abilities = card.GetCombatAbilities();
 }
示例#13
0
 public CardWithCombatAbilities(Card card)
 {
     Card = card;
       Abilities = card.GetCombatAbilities();
 }
 public override void Apply(CombatAbilities combatAbilities)
 {
     if (OwningCard.Controller.HasMana(_cost, ManaUsage.Abilities))
     combatAbilities.CanRegenerate = true;
 }