Exemple #1
0
 internal Ranged(RangedSlot rangedSlot,
     AttackPower attackPower,
     Hit hit,
     Crit crit)
 {
     RangedSlot = rangedSlot;
     AttackPower = attackPower;
     Hit = hit;
     Crit = crit;
 }
        private static void LoadRanged(Character character, Stats stats, XmlNode searchResults)
        {
            //<ranged>
            //  <weaponSkill rating="0" value="350"/>
            //  <damage dps="295.7" max="823" min="668" percent="0" speed="2.52"/>
            //  <speed hastePercent="0.00" hasteRating="0" value="2.52"/>
            //  <power base="831" effective="1662" increasedDps="118.0" petAttack="365.64" petSpell="213.90"/>
            //  <hitRating increasedHitPercent="4.95" value="78"/>
            //  <critChance percent="30.55" plusPercent="13.14" rating="290"/>
            //</ranged>
            XmlNode characterNode = searchResults.SelectSingleNode("characterTab/ranged");

            XmlNode rangedSkillNode = characterNode.SelectSingleNode("weaponSkill");
            XmlNode rangedDpsNode = characterNode.SelectSingleNode("damage");
            XmlNode rangedSpeedNode = characterNode.SelectSingleNode("speed");
            R.RangedSlot rangedSlot = new R.RangedSlot(
                Convert.ToInt32(rangedSkillNode.Attributes["value"].Value),
                Convert.ToDouble(rangedDpsNode.Attributes["dps"].Value, Util.NumberFormatter),
                Convert.ToInt32(rangedDpsNode.Attributes["min"].Value),
                Convert.ToInt32(rangedDpsNode.Attributes["max"].Value),
                Convert.ToDouble(rangedDpsNode.Attributes["speed"].Value, Util.NumberFormatter));

            XmlNode apNode = characterNode.SelectSingleNode("power");
            R.AttackPower attackPower = new R.AttackPower(
                Convert.ToInt32(apNode.Attributes["base"].Value),
                Convert.ToInt32(apNode.Attributes["effective"].Value),
                Convert.ToDouble(apNode.Attributes["increasedDps"].Value, Util.NumberFormatter),
                Convert.ToDouble(apNode.Attributes["petAttack"].Value, Util.NumberFormatter),
                Convert.ToDouble(apNode.Attributes["petSpell"].Value, Util.NumberFormatter));

            XmlNode hitNode = characterNode.SelectSingleNode("hitRating");
            R.Hit hit = new R.Hit(
                Convert.ToInt32(hitNode.Attributes["value"].Value),
                Convert.ToDouble(hitNode.Attributes["increasedHitPercent"].Value, Util.NumberFormatter),
                character.Level);

            XmlNode critNode = characterNode.SelectSingleNode("critChance");
            R.Crit crit = new R.Crit(
                Convert.ToInt32(critNode.Attributes["rating"].Value),
                Convert.ToDouble(critNode.Attributes["percent"].Value, Util.NumberFormatter),
                Convert.ToDouble(critNode.Attributes["plusPercent"].Value, Util.NumberFormatter));

            Ranged ranged = new Ranged(rangedSlot,
                                       attackPower,
                                       hit,
                                       crit);

            stats.Ranged = ranged;
        }