Example #1
0
        private void IncrementBoost(StatsType stat, int amount)
        {
            var i = StatsManager.GetStatIndex(stat);

            if (_parent.Base[i] + amount < 1)
            {
                amount = (i == 0) ? -_parent.Base[i] + 1 : -_parent.Base[i];
            }
            _boost[i] += amount;
        }
Example #2
0
        private void ApplyEquipBonus(InventoryChangedEventArgs e)
        {
            for (var i = 0; i < 4; i++)
            {
                if (_player.Inventory[i] == null)
                {
                    continue;
                }

                foreach (var b in _player.Inventory[i].StatsBoost)
                {
                    IncrementBoost((StatsType)b.Key, b.Value);
                }

                foreach (var b in _player.Inventory[i].StatsBoostPerc)
                {
                    if (b.Value != 0)
                    {
                        var index = StatsManager.GetStatIndex((StatsType)b.Key);
                        IncrementBoost((StatsType)b.Key, (_parent.Base[index] + _boost[index]) * (b.Value / 100));
                    }
                }
            }
        }
Example #3
0
        private void FixedStat(StatsType stat, int value)
        {
            var i = StatsManager.GetStatIndex(stat);

            _boost[i] = value - _parent.Base[i];
        }