Beispiel #1
0
 public void RemoveRawBonus(CRawBonus bonus)
 {
     if (_rawBonuses.ContainsKey(bonus.Name))
     {
         _rawBonuses.Remove(bonus.Name);
     }
 }
Beispiel #2
0
 public void AddRawBonus(CRawBonus bonus)
 {
     if (!_rawBonuses.ContainsKey(bonus.Name))
     {
         _rawBonuses.Add(bonus.Name, bonus);
     }
 }
Beispiel #3
0
 public void SetOrAddRawBonus(CRawBonus bonus)
 {
     if (!_rawBonuses.ContainsKey(bonus.Name))
     {
         _rawBonuses.Add(bonus.Name, bonus);
     }
     else
     {
         _rawBonuses[bonus.Name] = new CRawBonus(bonus.Name, bonus.BaseValue, bonus.BaseMultiplier);
     }
 }
Beispiel #4
0
        protected void ApplyRawBonuses()
        {
            // Adding value from raw
            float rawBonusValue      = 0;
            float rawBonusMultiplier = 0;

            foreach (KeyValuePair <string, CRawBonus> kvp in _rawBonuses)
            {
                CRawBonus bonus = kvp.Value;
                rawBonusValue      += bonus.BaseValue;
                rawBonusMultiplier += bonus.BaseMultiplier;
            }

            _finalValue += rawBonusValue;
            _finalValue *= (1 + rawBonusMultiplier);
        }