//Additive and perrcentage bonus statements public IEnumerable <float> GetAdditiveModifiers(Stat stat) { if (stat == Stat.Damage) { yield return(currentWeaponConfig.GetWeaponDamage()); } }
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 } }
/// <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); }
private void GetWeaponStats(WeaponConfig weapon) { baseDamage = weapon.GetWeaponDamage(); baseRange = weapon.GetWeaponRange(); }