Exemplo n.º 1
0
        public virtual void DoUpdate()
        {
            #region Modifiers
            _mBase        = 0;
            _mActual      = 0;
            _mMin         = 0;
            _mMax         = 0;
            _mAffinity    = 0;
            _mMaxAffinity = 0;

            if (Modifiers.Count > 0)
            {
                for (int i = 0; i < Modifiers.Count; i++)
                {
                    StatModifier m = Modifiers[i];
                    if (m.ModType == StatModType.Active && m.ModifierTime > 0)
                    {
                        m.Update();
                        AddToMod(m.TargetProperty, m.GetEffectDelta(this));
                    }
                    else
                    {
                        AddToMod(m.TargetProperty, m.GetEffectDelta(this));
                        Modifiers.Remove(m);
                    }
                }
            }
            //Debug.Log(string.Format("Base: {0}, Value: {1}, Min: {2}, Max: {3}, Aff: {4}, mAf: {5}", _mBase, _mActual, _mMin, _mMax, _mAffinity, _mMaxAffinity));
            #endregion

            #region True Values

            _tMin         = _rMin + _mMin;
            _tMax         = _rMax + Owner.Stats[(int)StatType.Level].Get(StatProperty.Value) * Get(StatProperty.MaxAffinity);
            _tBase        = _rBase + _mBase;
            _tAffinity    = _rAffinity + _mAffinity;
            _tMaxAffinity = _rMaxAffinity + _mMaxAffinity;
            _tActual      = UnregulatedValue
                ? Mathf.Clamp(_rActual + _mActual, _tMin, _tMax)
                : StatUtility.GetRegulatedStatValue(this) + _mActual;
            if (!UnregulatedValue)
            {
                _rActual = StatUtility.GetRegulatedStatValue(this);
            }
            #endregion
        }
Exemplo n.º 2
0
 public void Reset()
 {
     Stats = StatUtility.BaseCharacterStats();
 }