Ejemplo n.º 1
0
 //Additive and perrcentage bonus statements
 public IEnumerable <float> GetAdditiveModifiers(Stat stat)
 {
     if (stat == Stat.Damage)
     {
         yield return(currentWeaponConfig.GetWeaponDamage());
     }
 }
Ejemplo n.º 2
0
 public IEnumerable <float> GetAdditiveModifiers(Stat stat)
 {
     // if stat in question passed in above == Stat.cs.damage
     if (stat == Stat.Damage)
     {
         // additive modifier on top of character dameage
         yield return(currentWeaponConfig.GetWeaponDamage());
         // yield return secondWeapon damage, can do multiple yield returns
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles the hit event from an animation
        /// </summary>
        void Hit()
        {
            //If we have lost the target then just return.  Can happen when canceling an attack prior to hit event.
            if (m_Target == null)
            {
                return;
            }
            float totalDamage = 0;

            ////Check to see if this character has equipment slots
            //var statEquipComp = GetComponent<StatsEquipment>();

            //if (statEquipComp == null)
            //{
            //Damage the character does regardless of weapon
            float charDamage = GetComponent <BaseStats>().GetStat(StatType.PhysicalDamage);

            //Enemies don't have equipments slots so just grab the damage from their weapon since
            //Get Stat will not account for it.
            float wepDamage = m_currentWeaponConfig.GetWeaponDamage();

            totalDamage = charDamage + wepDamage;
            //}
            //else
            //{
            //    //Damage character does to include modifiers based on equipped weapons.
            //    totalDamage = GetComponent<BaseStats>().GetStat(StatType.PhysicalDamage);
            //}

            //Invoke weapon hit mechanics
            if (m_currentWeapon.value != null)
            {
                m_currentWeapon.value.OnHit();
            }

            m_Target.TakeDamage(gameObject, totalDamage);
        }
Ejemplo n.º 4
0
 private void GetWeaponStats(WeaponConfig weapon)
 {
     baseDamage = weapon.GetWeaponDamage();
     baseRange  = weapon.GetWeaponRange();
 }