public EquipmentForm(EquipmentClass equipped, string eqPart) { equipment = equipped; InitializeComponent(); this.Text = eqPart; AddBoxRanges(); LoadEquipment(); this.Icon = null; }
private void legsButton_Click(object sender, EventArgs e) { EquipmentForm Form = new EquipmentForm(equipment, "Legs"); Form.ShowDialog(); //spara ändringar till equipment variabeln equipment = Form.equipment; UpdateValues(); }
private void offhandButton_Click(object sender, EventArgs e) { if (dualWieldCheck.Checked == false) { EquipmentForm Form = new EquipmentForm(equipment, "Off Hand"); Form.ShowDialog(); //spara ändringar till equipment variabeln equipment = Form.equipment; UpdateValues(); } else { EquipmentForm Form = new EquipmentForm(equipment, "Dual Wield"); Form.ShowDialog(); //spara ändringar till equipment variabeln equipment = Form.equipment; UpdateValues(); } }
public void Update_Stats(EquipmentClass equipment, int charLevel, string charClass, int paragonLevel) { Update_BaseStats(charLevel, charClass, paragonLevel); // strength = baseStrength + equipment.strength; dexterity = baseDexterity + equipment.dexterity; intelligence = baseIntelligence + equipment.intelligence; vitality = baseVitality + equipment.vitality; critChance = baseCritChance + equipment.critChance; critDamage = baseCritDamage + equipment.critDmg; //baseHP formulan #region baseHP Formula if (charLevel <= 35) { baseHP = vitality * 10 + 36 + 4 * charLevel; } else { baseHP = vitality * (charLevel - 25) + (36 + 4 * charLevel); } #endregion //baseDodge formeln #region baseDodge Formula //räknas ut men visas inte på skärm, än if (true) { int tempDexterity = dexterity; if (tempDexterity >= 100) { tempDexterity -= 100; if (tempDexterity >= 400) { tempDexterity -= 400; if (tempDexterity >= 500) { tempDexterity -= 500; baseDodge = tempDexterity * 0.0001 + 0.3; } else { baseDodge = tempDexterity * 0.0002 + 0.2; } } else { baseDodge = tempDexterity * 0.00025 + 0.1; } } else { baseDodge = tempDexterity * 0.001; } } #endregion //base armor och resistance armor = strength + equipment.armor; baseResistance = 0.1 * intelligence; //alla resistancer allResistance = (int)baseResistance + equipment.allRes; physicalResistance = allResistance + equipment.physRes; coldResistance = allResistance + equipment.coldRes; fireResistance = allResistance + equipment.fireRes; lightningResistance = allResistance + equipment.lightRes; poisonResistance = allResistance + equipment.poiRes; arcaneResistance = allResistance + equipment.arcRes; //totala HPn HP = (int)Math.Round(baseHP * ((decimal)equipment.HP / 100 + 1)); //bas skada plus primary attribut på klasserna if (charClass == "Barbarian") { maxDmg = Damage.maxDamage(equipment.maxDmg, strength, skillDamage); minDmg = Damage.minDamage(equipment.minDmg, strength, skillDamage); DPS = Math.Round(Damage.DPS(equipment.avgDmg, strength, skillDamage, equipment.attacksPerSecond, critChance, critDamage), 2); dualMaxDmg = Damage.maxDamage(equipment.dualMaxDmg, strength, skillDamage); dualMinDmg = Damage.minDamage(equipment.dualMinDmg, strength, skillDamage); dualDPS = Math.Round(Damage.DPS(equipment.dualAvgDmg, strength, skillDamage, equipment.dualAttacksPerSecond, critChance, critDamage), 2); } if (charClass == "Demon Hunter" || charClass == "Monk") { maxDmg = Damage.maxDamage(equipment.maxDmg, dexterity, skillDamage); minDmg = Damage.minDamage(equipment.minDmg, dexterity, skillDamage); DPS = Math.Round(Damage.DPS(equipment.avgDmg, dexterity, skillDamage, equipment.attacksPerSecond, critChance, critDamage), 2); dualMaxDmg = Damage.maxDamage(equipment.dualMaxDmg, dexterity, skillDamage); dualMinDmg = Damage.minDamage(equipment.dualMinDmg, dexterity, skillDamage); dualDPS = Math.Round(Damage.DPS(equipment.dualAvgDmg, dexterity, skillDamage, equipment.dualAttacksPerSecond, critChance, critDamage), 2); } if (charClass == "Wizard" || charClass == "Witch Doctor") { maxDmg = Damage.maxDamage(equipment.maxDmg, intelligence, skillDamage); minDmg = Damage.minDamage(equipment.minDmg, intelligence, skillDamage); DPS = Math.Round(Damage.DPS(equipment.avgDmg, intelligence, skillDamage, equipment.attacksPerSecond, critChance, critDamage), 2); dualMaxDmg = Damage.maxDamage(equipment.dualMaxDmg, intelligence, skillDamage); dualMinDmg = Damage.minDamage(equipment.dualMinDmg, intelligence, skillDamage); dualDPS = Math.Round(Damage.DPS(equipment.dualAvgDmg, intelligence, skillDamage, equipment.dualAttacksPerSecond, critChance, critDamage),2); } }