public IEnumerator ApplyBuff(EBuffType _buffType, float buffAmount, float duration) { Debug.Log("Applying float buff to " + gameObject.name + " of " + _buffType.ToString() + " for " + duration + " seconds with " + buffAmount + " buff amount"); CharacterStats cs = GetComponent <Character>().Stats; switch (_buffType) { case EBuffType.CritRate: cs.CritRate *= buffAmount; break; case EBuffType.CritDamage: cs.CritDamage *= buffAmount; break; case EBuffType.HpRegen: cs.HpRegen *= buffAmount; break; case EBuffType.ManaRegen: cs.ManaRegen *= buffAmount; break; case EBuffType.ASpeed: cs.ASpeed *= buffAmount; break; case EBuffType.Cdr: cs.Cdr *= buffAmount; break; case EBuffType.Tenacity: cs.Tenacity *= buffAmount; break; case EBuffType.LifeSteal: cs.LifeSteal *= buffAmount; break; case EBuffType.SpellVamp: cs.SpellVamp *= buffAmount; break; } yield return(new WaitForSeconds(duration)); switch (_buffType) { case EBuffType.CritRate: cs.CritRate /= buffAmount; break; case EBuffType.CritDamage: cs.CritDamage /= buffAmount; break; case EBuffType.HpRegen: cs.HpRegen /= buffAmount; break; case EBuffType.ManaRegen: cs.ManaRegen /= buffAmount; break; case EBuffType.ASpeed: cs.ASpeed /= buffAmount; break; case EBuffType.Cdr: cs.Cdr /= buffAmount; break; case EBuffType.Tenacity: cs.Tenacity /= buffAmount; break; case EBuffType.LifeSteal: cs.LifeSteal /= buffAmount; break; case EBuffType.SpellVamp: cs.SpellVamp /= buffAmount; break; } }
public IEnumerator ApplyBuff(EBuffType _buffType, int buffAmount, float duration) { Debug.Log("Applying int buff to " + gameObject.name + " of " + _buffType.ToString() + " for " + duration + " seconds with " + buffAmount + " buff amount"); CharacterStats cs = GetComponent <Character>().Stats; switch (_buffType) { case EBuffType.Attack: cs.Attack *= buffAmount; break; case EBuffType.Magic: cs.Magic *= buffAmount; break; case EBuffType.Armor: cs.Armor *= buffAmount; break; case EBuffType.MResistance: cs.MResistance *= buffAmount; break; case EBuffType.MSpeed: cs.MSpeed *= buffAmount; break; case EBuffType.MaxHP: cs.MaxHp *= buffAmount; break; case EBuffType.MaxMP: cs.MaxMp *= buffAmount; break; case EBuffType.Barrier: cs.Barrier *= buffAmount; break; case EBuffType.Range: cs.Range *= buffAmount; break; case EBuffType.ArmorPen: cs.ArmorPen *= buffAmount; break; case EBuffType.MagicPen: cs.MagicPen *= buffAmount; break; } yield return(new WaitForSeconds(duration)); switch (_buffType) { case EBuffType.Attack: cs.Attack /= buffAmount; break; case EBuffType.Magic: cs.Magic /= buffAmount; break; case EBuffType.Armor: cs.Armor /= buffAmount; break; case EBuffType.MResistance: cs.MResistance /= buffAmount; break; case EBuffType.MSpeed: cs.MSpeed /= buffAmount; break; case EBuffType.MaxHP: cs.MaxHp /= buffAmount; break; case EBuffType.MaxMP: cs.MaxMp /= buffAmount; break; case EBuffType.Barrier: cs.Barrier /= buffAmount; break; case EBuffType.Range: cs.Range /= buffAmount; break; case EBuffType.ArmorPen: cs.ArmorPen /= buffAmount; break; case EBuffType.MagicPen: cs.MagicPen /= buffAmount; break; } }