Esempio n. 1
0
        /*
         * "Modifiers to Foo also apply to Bar [at x% of their value]":
         * - Applies to NodeType.Base and PathTotal of Bar.
         * - When those nodes request the value of BaseAdd, Increase or More the respective value of
         *   Foo is multiplied by x/100 and added to the original value.
         *   (some do not apply to Base/BaseAdd)
         * - Each Foo, Bar combination will result in one stat with the respective behavior. The value of that stat is
         *   used as the multiplier.
         *   - These stats are explicitly registered so that UI can add the newly affecting modifiers to its tables
         *   - This explicit registration is handled differently by the UI (they are not stats that need to be set by
         *     users). More specialized registration may be necessary.
         * - Also works for "Modifiers to Spell Damage apply to this Skill's Damage Over Time effect".
         *   "this Skill's" is part of the condition (modifier source Local->Skill), everything else is the same
         * - Affects all paths (if behaviors applying to Base of stats partaking in conversions exist, I don't know
         *   whether they should apply to conversion paths)
         * "Modifiers to Claw Foo also apply to Unarmed":
         * - Affecting form nodes open a whole bunch of new issues, e.g. the same form node can be used in different
         *   stats, so this can't be done as a behavior. Solutions need to be solely in the builder implementations.
         * Effectiveness of Added Damage:
         * - Applies to NodeType.BaseAdd of all damage stats
         * - Values of requested form nodes are multiplied by the effectiveness stat's value
         * - Affects all paths (only non-conversion paths have BaseAdd nodes)
         * Rounding:
         * - Each stat can have different rounding behaviors
         * - This can affect nodes of all NodeTypes
         * - Modifies the output of affected nodes by rounding it.
         * - Affects all paths
         * Default values:
         * - Affects NodeType.BaseSet of the stat
         * - Modifies the output by changing null to the default value if the BaseSet nodes of non-main, non-converted
         *   paths are also null
         * - With this, NodeValueAggregators.CalculateBaseSet() should default to null
         * - Only affects the main path
         */

        public Behavior(IEnumerable <IStat> affectedStats, IEnumerable <NodeType> affectedNodeTypes,
                        BehaviorPathInteraction affectedPaths, IValueTransformation transformation)
        {
            AffectedStats     = affectedStats;
            AffectedNodeTypes = affectedNodeTypes;
            AffectedPaths     = affectedPaths;
            Transformation    = transformation;
        }
Esempio n. 2
0
        /*
         * Rounding:
         * - Each stat can have different rounding behaviors
         * - This can affect nodes of all NodeTypes
         * - Modifies the output of affected nodes by rounding it.
         * - Affects all paths
         */

        public Behavior(IReadOnlyList<IStat> affectedStats, IReadOnlyList<NodeType> affectedNodeTypes,
            IBehaviorPathRule affectedPathsRule, IValueTransformation transformation)
            : base(true)
        {
            AffectedStats = affectedStats;
            AffectedNodeTypes = affectedNodeTypes;
            AffectedPathsRule = affectedPathsRule;
            Transformation = transformation;
        }
Esempio n. 3
0
            public FieldInfo(
                [NotNull] string fieldName,
                [CanBeNull] string multiValueSeparator = null,
                [CanBeNull] IValueTransformation valueTransformation = null,
                [CanBeNull] AllowedDifferenceCondition allowedDifferenceCondition = null)
            {
                Assert.ArgumentNotNullOrEmpty(fieldName, nameof(fieldName));

                FieldName                   = fieldName;
                _valueTransformation        = valueTransformation;
                _allowedDifferenceCondition = allowedDifferenceCondition;
                MultiValueSeparator         = multiValueSeparator == null
                                                              ? null
                                                              : multiValueSeparator.Length == 0
                                                                      ? null
                                                                      : multiValueSeparator;
            }
Esempio n. 4
0
 public void Add([NotNull] IValueTransformation valueTransformation)
 {
     _valueTransformations.Add(valueTransformation);
 }
Esempio n. 5
0
 public Transformation(IBehaviorPathRule pathRule, IValueTransformation transformation)
 {
     _pathRule       = pathRule;
     _transformation = transformation;
 }
 public void Remove(IValueTransformation transformation)
 {
     _transformations.Remove(transformation);
     _value = _transformations.Aggregate(_initialValue, (v, t) => t.Transform(v));
     OnValueChanged();
 }
 public void Add(IValueTransformation transformation)
 {
     _value = transformation.Transform(_value);
     _transformations.Add(transformation);
     OnValueChanged();
 }
Esempio n. 8
0
 public Transformation(BehaviorPathInteraction pathInteraction, IValueTransformation transformation)
 {
     _pathInteraction = pathInteraction;
     _transformation  = transformation;
 }