Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public override string GetName()
 {
     return(string.Format("{0}, {1}", weaponItem.GetName(), enchantment.GetName()));
 }
Ejemplo n.º 3
0
 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;
 }