Beispiel #1
0
 public void Add(
     IFormBuilder form, IDamageRelatedStatBuilder stat,
     IDamageRelatedStatBuilder vp1, IDamageRelatedStatBuilder vp2, IDamageRelatedStatBuilder vp3,
     Func <IStatBuilder, IStatBuilder, IStatBuilder, IValueBuilder> value)
 {
     Add(form, stat, new[] { vp1, vp2, vp3 }, ss => value(ss[0], ss[1], ss[2]));
 }
Beispiel #2
0
        public IStatBuilder Of(IDamageRelatedStatBuilder damage)
        {
            var damageCoreBuilder = new StatBuilderAdapter(damage.WithHits);
            var coreBuilder       = new ParametrisedCoreStatBuilder <ICoreBuilder <Pool> >(damageCoreBuilder, Pool,
                                                                                           (p, s) => StatFactory.CopyWithSuffix(s, $"LeechTo({p.Build()})", typeof(int)));

            return(new StatBuilder(StatFactory, coreBuilder));
        }
        private ValueBuilder CombineHandsByAverage(IDamageRelatedStatBuilder statToCombine)
        {
            var mhWeight = SkillUsesHandAsMultiplier(AttackDamageHand.MainHand);
            var ohWeight = SkillUsesHandAsMultiplier(AttackDamageHand.OffHand);

            return(CombineByWeightedAverage(
                       statToCombine.With(AttackDamageHand.MainHand).Value, mhWeight,
                       statToCombine.With(AttackDamageHand.OffHand).Value, ohWeight));
        }
 private ValueBuilder CombineSource(
     IDamageRelatedStatBuilder statToCombine, Func <IDamageRelatedStatBuilder, IValueBuilder> handCombiner)
 => ValueFactory.If(_stat.SkillHitDamageSource.Value.Eq((int)DamageSource.Attack))
 .Then(handCombiner(statToCombine))
 .ElseIf(_stat.SkillHitDamageSource.Value.Eq((int)DamageSource.Spell))
 .Then(statToCombine.With(DamageSource.Spell).Value)
 .ElseIf(_stat.SkillHitDamageSource.Value.Eq((int)DamageSource.Secondary))
 .Then(statToCombine.With(DamageSource.Secondary).Value)
 .Else(0);
 private void AddForSkillAndAilments(GivenStatCollection collection,
                                     IFormBuilder form, IDamageRelatedStatBuilder stat, IDamageRelatedStatBuilder valueStat)
 {
     collection.Add(form, stat.WithSkills, valueStat.WithSkills.Value);
     foreach (var ailment in Enums.GetValues <Ailment>())
     {
         var ailmentBuilder = Ailment.From(ailment);
         collection.Add(form, stat.With(ailmentBuilder), valueStat.With(ailmentBuilder).Value);
     }
 }
Beispiel #6
0
 private void Add(
     IFormBuilder form, IDamageRelatedStatBuilder stat,
     IReadOnlyList <IDamageRelatedStatBuilder> valueParameters,
     Func <IReadOnlyList <IStatBuilder>, IValueBuilder> value)
 {
     Add(form, stat.With(AttackDamageHand.MainHand),
         value(valueParameters.Select(s => s.With(AttackDamageHand.MainHand)).ToList()));
     Add(form, stat.With(AttackDamageHand.OffHand),
         value(valueParameters.Select(s => s.With(AttackDamageHand.OffHand)).ToList()));
     Add(form, stat.With(DamageSource.Spell),
         value(valueParameters.Select(s => s.With(DamageSource.Spell)).ToList()));
     Add(form, stat.With(DamageSource.Secondary),
         value(valueParameters.Select(s => s.With(DamageSource.Secondary)).ToList()));
 }
        private void AddDamageWithModifiers(GivenStatCollection collection,
                                            IDamageRelatedStatBuilder damage, Func <DamageType, IDamageRelatedStatBuilder> damageForType)
        {
            var form = BaseAdd;

            foreach (var type in Enums.GetValues <DamageType>().Except(DamageType.RandomElement))
            {
                var forType = damageForType(type);
                AddForSkillAndAilments(collection, form, damage.With(AttackDamageHand.MainHand),
                                       forType.With(AttackDamageHand.MainHand));
                AddForSkillAndAilments(collection, form, damage.With(AttackDamageHand.OffHand),
                                       forType.With(AttackDamageHand.OffHand));
                AddForSkillAndAilments(collection, form, damage.With(DamageSource.Spell),
                                       forType.With(DamageSource.Spell));
                AddForSkillAndAilments(collection, form, damage.With(DamageSource.Secondary),
                                       forType.With(DamageSource.Secondary));
                collection.Add(form, damage.WithSkills(DamageSource.OverTime),
                               forType.WithSkills(DamageSource.OverTime).Value);
            }
        }
Beispiel #8
0
 public void Add(
     IFormBuilder form, IDamageRelatedStatBuilder stat,
     IDamageRelatedStatBuilder valueParameter, Func <IStatBuilder, IValueBuilder> value)
 {
     Add(form, stat, new[] { valueParameter }, ss => value(ss.Single()));
 }
 private static IStat BuildMainHandSkillSingle(IDamageRelatedStatBuilder builder)
 => Build(builder.WithSkills.With(AttackDamageHand.MainHand)).Single();
 public static IDamageRelatedStatBuilder WithSkills(this IDamageRelatedStatBuilder @this,
                                                    DamageSource damageSource)
 => @this.WithSkills.With(damageSource);