public StatModifier(float value, ModiferType type, int order, object source) : this() { _value = value; _type = type; _order = order; _source = source; }
public virtual void UpdateAmount(float amount, bool increase, ModiferType type) { float finalAmount = Amount; float sumPercentAdd = 0; if (increase) { if (type == ModiferType.Flat) { Amount += amount; } else if (type == ModiferType.AddPercent) { sumPercentAdd += amount; finalAmount *= 1 + sumPercentAdd; sumPercentAdd = 0; Amount = finalAmount; } else if (type == ModiferType.MultPercent) { finalAmount *= 1 + amount; Amount = finalAmount; } } else { if ((Amount - amount) >= 0) { Amount -= amount; } else { Amount = 0; } } }
public StatModifier(float value, ModiferType type, object source) : this(value, type, 0, source) { }
public StatModifier(float value, ModiferType type, int order) : this(value, type, order, null) { }
public StatModifier(float value, ModiferType type) : this(value, type, 0, null) { }