コード例 #1
0
 static Damages()
 {
     QDamage.Add(new Damage.DamageSource(SpellSlot.Q, DamageType.Physical)
     {
         Damages = new float[] { 10, 70, 130, 190, 250 }
     });
     QDamage.Add(new Damage.BonusDamageSource(SpellSlot.Q, DamageType.Physical)
     {
         DamagePercentages = new float[] { 1, 1, 1, 1, 1 }
     });
 }
コード例 #2
0
ファイル: DamageLibrary.cs プロジェクト: RiotSharp/RiotSharp
 public void SetMonsterDamage(DamageType damageType, float[] damages = null, params Damage.DamageSourceBase[] sources)
 {
     MonsterDamage = new Damage.DamageSourceBoundle();
     MonsterDamage.Add(new Damage.DamageSource(Slot, damageType)
     {
         Damages = damages ?? new float[] { 0, 0, 0, 0, 0 }
     });
     foreach (var source in sources)
     {
         MonsterDamage.Add(source);
     }
 }
コード例 #3
0
ファイル: DamageLibrary.cs プロジェクト: RiotSharp/RiotSharp
            public Damage.DamageSourceBase ToDamageSourceBase(SpellSlot slot)
            {
                var boundle = new Damage.DamageSourceBoundle();

                // Base damage
                boundle.Add(new Damage.DamageSource(slot, DamageType)
                {
                    Damages = Damages
                });

                // All bonus damages
                foreach (var bonus in BonusDamages)
                {
                    boundle.Add(new Damage.BonusDamageSource(slot, bonus.DamageType)
                    {
                        DamagePercentages = bonus.DamagePercentages,
                        ScalingTarget     = bonus.ScalingTarget,
                        ScalingType       = bonus.ScalingType
                    });
                }
                if (ExpresionDamages != null)
                {
                    foreach (var expresionBonusDamage in ExpresionDamages)
                    {
                        boundle.AddExpresion(new Damage.ExpresionDamageSource(expresionBonusDamage.Expression, slot, expresionBonusDamage.DamageType)
                        {
                            DamageType        = expresionBonusDamage.DamageType,
                            DamagePercentages = expresionBonusDamage.DamagePercentages,
                            Variables         =
                                expresionBonusDamage.StaticVariables.Select(x => new Damage.ExpresionStaticVarible(x.Key, x.ScalingTarget, x.ScalingType))
                                .Cast <Damage.IVariable>()
                                .Concat(expresionBonusDamage.TypeVariables.Select(x => new Damage.ExpresionTypeVarible(x.Key, x.DamageType, x.Target, x.Name, x.Parameters)))
                                .Concat(expresionBonusDamage.LevelVariables.Select(x => new Damage.ExpresionLevelVarible(x.Key, x.Slot, x.Damages))),
                            Expression = expresionBonusDamage.Expression,
                            Condition  = expresionBonusDamage.Condition
                        });
                    }
                }

                return(boundle);
            }