Esempio n. 1
0
        public SkillDamage(string name, SkillDamage skill1, SkillDamage skill2)
        {
            float cumulProba = 0;

            // Override name if any
            if (name != null)
            {
                Name = name;
            }
            else
            {
                Name = skill1.Name + " + " + skill2.Name;
            }

            // Merge probabilities from both skills
            foreach (var item1 in skill1.Hits)
            {
                foreach (var item2 in skill2.Hits)
                {
                    Merge((item1.Proba * item2.Proba) / 100,
                          item1.Damage + item2.Damage);
                }
            }
            // Merge probabilities with same damage
            Hits.Sort();
            foreach (var item in Hits)
            {
                cumulProba     += item.Proba;
                item.CumulProba = cumulProba;
            }
            CalculateMeanValue();
        }
Esempio n. 2
0
 public void Build()
 {
     if (_skillCalculator == null)
     {
         _skillCalculator = new SkillDamage(Name, MinAccuracy,
                                            BaseDamage, MajorBonus, MinorBonus);
     }
 }
Esempio n. 3
0
 public Skill(string name, uint minAccuracy, int baseDamage, float majorBonus, float minorBonus)
 {
     Name             = name;
     MinAccuracy      = minAccuracy;
     BaseDamage       = baseDamage;
     MajorBonus       = majorBonus;
     MinorBonus       = minorBonus;
     _skillCalculator = new SkillDamage(Name, MinAccuracy,
                                        BaseDamage, MajorBonus, MinorBonus);
 }