public EnchantedWeaponItem(WeaponItemWeaver magicWeapon, WeaponEnchantment newEnchantment) { if ((magicWeapon.GetEnhancementBonusForCost() + newEnchantment.GetEnhancementBonusForCost()) > MaxEnhancementBonus) { throw new ArgumentOutOfRangeException(string.Format("'{0}' enchantment of '+{1}' value cannot be added to '{2}' of '+{3}' value.{4}Enchantment bonus cannot exceed '+10'", newEnchantment.GetName(), newEnchantment.GetEnhancementBonusForCost(), magicWeapon.GetName(), magicWeapon.GetEnhancementBonusForCost(), Environment.NewLine)); } weaponItem = magicWeapon; enchantment = newEnchantment; }
public static EnchantedWeaponItem RequestEnchantment(WeaponItemWeaver magicWeapon, string enchantment) { var newEnchantment = new WeaponEnchantment(new EnchantmentOrder(EnchantmentDictionary.GetEnchantmentData(enchantment))); return new EnchantedWeaponItem(magicWeapon, newEnchantment); }
public static EnchantedWeaponItem RequestEnchantment(WeaponItemWeaver magicWeapon, string enchantment) { var newEnchantment = new WeaponEnchantment(new EnchantmentOrder(EnchantmentDictionary.GetEnchantmentData(enchantment))); return(new EnchantedWeaponItem(magicWeapon, newEnchantment)); }