public NodeValue?Calculate(IValueCalculationContext context)
        {
            var original        = _transformedValue.Calculate(context);
            var skillBaseDamage = context.GetValue(_skillDamage, NodeType.Base);

            return(new[] { original, skillBaseDamage }.Sum());
        }
예제 #2
0
        public NodeValue?Calculate(IValueCalculationContext context)
        {
            var original        = _transformedValue.Calculate(context);
            var skillBaseDamage = context.GetValue(_skillDamage, NodeType.Base, context.CurrentPath);

            return(original.SumWhereNotNull(skillBaseDamage));
        }
 static NodeValue?Calculate(IValueCalculationContext context, IValue application, IValue period)
 {
     return((RuthlessBlowBonusCalculation?)application.Calculate(context).SingleOrNull() switch
     {
         RuthlessBlowBonusCalculation.Never => new NodeValue(0),
         RuthlessBlowBonusCalculation.Average => period.Calculate(context),
         RuthlessBlowBonusCalculation.Always => new NodeValue(1),
         _ => null
     });
        public NodeValue?Calculate(IValueCalculationContext context)
        {
            // Make sure paths for conversion chains are created
            context.GetValue(_source, NodeType.UncappedSubtotal, PathDefinition.MainPath);

            var modifiedContext = new ModifiedValueCalculationContext(context, GetPaths);

            return(_transformedValue.Calculate(modifiedContext));
        }
        public NodeValue? Calculate(IValueCalculationContext context)
        {
            var value = _transformedValue.Calculate(context);
            if (value is null)
                return null;

            var conversion = context.GetValue(ConvertTo) ?? new NodeValue(0);
            var gain = context.GetValue(GainAs) ?? new NodeValue(0);
            return value * (conversion + gain) / 100;
        }
예제 #6
0
        public NodeValue?Calculate(IValueCalculationContext context)
        {
            var value = _transformedValue.Calculate(context);

            if (value is null)
            {
                return(null);
            }

            var conversion = context.GetValue(_barConversion) ?? new NodeValue(0);

            return(value * (1 - conversion).Clip(0, 1));
        }
예제 #7
0
        public NodeValue?Calculate(IValueCalculationContext context)
        {
            var value = _transformedValue.Calculate(context);

            if (value is null)
            {
                return(null);
            }

            var conversion = context.GetValue(_barFooConversion) ?? new NodeValue(0);
            var gain       = context.GetValue(_barFooGain) ?? new NodeValue(0);

            return(value * (conversion + gain));
        }
        public NodeValue?Calculate(IValueCalculationContext context)
        {
            var modifiedContext = new ModifiedValueCalculationContext(context, getValue: GetValues);

            return(_transformedValue.Calculate(modifiedContext));
        }
 public NodeValue?Calculate(IValueCalculationContext valueCalculationContext) =>
 _value.Calculate(valueCalculationContext);
예제 #10
0
 public NotValue(IValue value) : base(c => !value.Calculate(c).IsTrue(), "Not(" + value + ")")
 {
 }
예제 #11
0
        public NodeValue?Calculate(IValueCalculationContext context)
        {
            var value = _transformedValue.Calculate(context);

            return(value.Select(d => Math.Round(d, _decimals)));
        }
예제 #12
0
 public NotValue(IValue value) : base(c => !value.Calculate(c).IsTrue(), $"Not({value})")
 {
 }