예제 #1
0
파일: Melee.cs 프로젝트: CumpsD/armorylib
 internal Melee(MainHand mainHand,
     OffHand offHand,
     AttackPower attackPower,
     Hit hit,
     Crit crit,
     Expertise expertise)
 {
     MainHand = mainHand;
     OffHand = offHand;
     AttackPower = attackPower;
     Hit = hit;
     Crit = crit;
     Expertise = expertise;
 }
예제 #2
0
        private static void LoadMelee(Character character, Stats stats, XmlNode searchResults)
        {
            //<melee>
            //  <mainHandDamage dps="184.7" max="532" min="429" percent="0" speed="2.60"/>
            //  <offHandDamage dps="138.5" max="242" min="174" percent="0" speed="1.50"/>
            //  <mainHandSpeed hastePercent="0.00" hasteRating="0" value="2.60"/>
            //  <offHandSpeed hastePercent="0.00" hasteRating="0" value="1.50"/>
            //  <power base="528" effective="1218" increasedDps="87.0"/>
            //  <hitRating increasedHitPercent="6.72" value="106"/>
            //  <critChance percent="19.90" plusPercent="7.29" rating="161"/>
            //  <expertise additional="0" percent="2.50" rating="0" value="10"/>
            //</melee>
            XmlNode characterNode = searchResults.SelectSingleNode("characterTab/melee");

            XmlNode mainHandNode = characterNode.SelectSingleNode("mainHandDamage");
            XmlNode mainHandSpeedNode = characterNode.SelectSingleNode("mainHandSpeed");
            M.MainHand mainHand = new M.MainHand(
                Convert.ToDouble(mainHandNode.Attributes["dps"].Value, Util.NumberFormatter),
                Convert.ToInt32(mainHandNode.Attributes["min"].Value),
                Convert.ToInt32(mainHandNode.Attributes["max"].Value),
                Convert.ToDouble(mainHandNode.Attributes["speed"].Value, Util.NumberFormatter));

            XmlNode offHandNode = characterNode.SelectSingleNode("offHandDamage");
            XmlNode offHandSpeedNode = characterNode.SelectSingleNode("offHandSpeed");
            M.OffHand offHand = new M.OffHand(
                Convert.ToDouble(mainHandNode.Attributes["dps"].Value, Util.NumberFormatter),
                Convert.ToInt32(mainHandNode.Attributes["min"].Value),
                Convert.ToInt32(mainHandNode.Attributes["max"].Value),
                Convert.ToDouble(mainHandNode.Attributes["speed"].Value, Util.NumberFormatter));

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

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

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

            XmlNode expertiseNode = characterNode.SelectSingleNode("expertise");
            M.Expertise expertise = new M.Expertise(
                Convert.ToDouble(expertiseNode.Attributes["percent"].Value, Util.NumberFormatter));

            Melee melee = new Melee(mainHand,
                                    offHand,
                                    attackPower,
                                    hit,
                                    crit,
                                    expertise);

            stats.Melee = melee;
        }