Esempio n. 1
0
        public string GetCriticalRange(GetBonusDto bonusDto)
        {
            var critRange = 0;

            if (Item.CritRange.HasValue)
            {
                critRange += Item.CritRange.GetValueOrDefault();
            }

            var calcStr = new CalculatedString();

            calcStr.AddPartsByRef(GetItemBonuses(bonusDto).Where(x => x.ShouldApplyToSubType(Configuration.CritRange)).ToList(), bonusDto);
            if (calcStr.GetValueAsInt() != 0)
            {
                critRange *= calcStr.GetValueAsInt();
            }
            string critStr = null;

            if (critRange == 0)
            {
                critStr = "20";
            }
            else
            {
                critStr = (20 - critRange).ToString() + " - 20";
            }
            if (Item.CriticalMultiplier.HasValue)
            {
                critStr += " x" + Item.CriticalMultiplier;
            }

            return(critStr);
        }
Esempio n. 2
0
        public double GetWeight(GetBonusDto bonusDto)
        {
            var weightBonus = GetItemBonuses(bonusDto).Where(x => x.ShouldApplyToSubType(Configuration.WeightReductionInProcentage)).MaxBonusRefList(bonusDto);
            var calcStr     = new CalculatedString();

            calcStr.AddPartsByRef(weightBonus, bonusDto);
            var procentReduction = calcStr.GetValueAsInt();

            return(Item.Weight.Lb / 100.0 * (100 - procentReduction));
        }
Esempio n. 3
0
        public int GetBaseModifier(GetBonusDto bonusDto)
        {
            var passiveBonuses = Tools.GetBonusesApplyingTo(Ability.ID, BonusApplyToType.Ability, bonusDto.PassiveBonus.ToList());
            //var passiveBonusValue = passiveBonuses.Sum(x => x.GetBonus(bonusDto).GetFixedAmount());

            var calcStr = new CalculatedString();

            calcStr.AddIfNotZero("Base", null, BaseValue.GetValueOrDefault());
            calcStr.AddPartsByRef(passiveBonuses, bonusDto);
            var newBase = calcStr.GetValueAsInt();

            return((newBase - 10) / 2);
        }
Esempio n. 4
0
        public string GetRange(GetBonusDto bonusDto)
        {
            //SetCorrectMaterial(bonusDto);
            var range = 0;

            if (Item.RangeIncrement.HasValue)
            {
                range += Item.RangeIncrement.GetValueOrDefault();
            }

            var calcStr = new CalculatedString();

            calcStr.AddPartsByRef(GetItemBonuses(bonusDto).Where(x => x.ShouldApplyToSubType(Configuration.RangeIncrement)).ToList(), bonusDto);
            if (calcStr.GetValueAsInt() != 0)
            {
                range += calcStr.GetValueAsInt();
            }

            if (range == 0)
            {
                return("");
            }
            return(range + "ft");
        }