Ejemplo n.º 1
0
    public void ApplyPermanentMod(StatType type, float value, StatModificationType modType, GameObject cause, params StatModifierOption[] statOptions)
    {
        List <StatModifierOption> options = ConvertStatOptionsToList(statOptions);

        BaseStat targetStat = GetStat(type);

        if (targetStat == null)
        {
            Debug.LogError("Stat: " + type + " not found");
            return;
        }

        if (options.Contains(StatModifierOption.Cap))
        {
            CappedStat capped = TryConvertToCappedStat(targetStat);

            if (capped != null)
            {
                capped.ModifyCapPermanently(value, modType);
                OnStatChanged(type, cause);
            }
        }

        if ((options.Count < 1 || options.Contains(StatModifierOption.Base)))
        {
            targetStat.ModifyStatPermanently(value, modType);
            OnStatChanged(type, cause);
        }
    }
Ejemplo n.º 2
0
 public void ModifyCapPermanently(float value, StatModifier.StatModificationType modType)
 {
     maxValue.ModifyStatPermanently(value, modType);
 }