using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Attribute : ScriptableObject
{
public long Base { get; set; }
///
/// Calculates the stat value with accumulated buff and debuff modifiers.
///
/// (base + baseBonus) * (100% + permyriadBonus) + flatBonus, bounded below by 0.
public long Calc(EffectSO effect)
{
var r = Base + effect.Base;
var m = effect.Permyriad + 10000;
r = r * (m / 10000) + (r / 10000) * (m % 10000) + effect.Flat;
if (r <= 0)
{
return 0;
}
return r;
}
}