public void ComponerItem(VaraDeAsclepio vara, IMagicItem itemMagico) { if (Items.Contains(itemMagico) && Items.Contains(vara)) { vara.ItemMagico = itemMagico; Items.Remove(itemMagico); } }
public static string GetMagicItemName(IMagicItem item) { var(prefixes, suffixes) = GetAffixes(item); var prefix = prefixes.Any() ? $"{string.Join(' ', prefixes)} " : string.Empty; var suffix = suffixes.Any() ? $" of {string.Join(' ', suffixes)}" : string.Empty; var text = item is ICraftable { PlayerConstructed : true } craftable ? GetCraftableItemName(craftable) : $"{prefix}{GetItemDesc(item as Item)}{suffix}"; return(text); }
public static string GetMagicItemName(IMagicItem item) { var(prefixes, suffixes) = GetAffixes(item); var prefix = prefixes.Any() ? $"{string.Join(' ', prefixes)} " : string.Empty; var suffix = suffixes.Any() ? $" of {string.Join(' ', suffixes)}" : string.Empty; string text; if (item is ICraftable { PlayerConstructed : true } craftableItem) { text = GetCraftableItemName(craftableItem); }
private static (IEnumerable <string>, IEnumerable <string>) GetAffixes(IMagicItem item) { var values = item.Enchantments.Values.Values.Where(v => !string.IsNullOrEmpty(v.AffixName)); var prefixes = values .Where(v => v.Info.Place == EnchantNameType.Prefix) .Select(v => v.AffixName) .ToList(); var suffixes = values .Where(v => v.Info.Place == EnchantNameType.Suffix) .Select(v => v.AffixName) .ToList(); return(prefixes, suffixes); }
public string UseMagicItem(IMagicItem item) { foreach (IItem I in this.Items) { if (I == item) { item1 = this.MagicItem; this.MagicItem = item; Items.Remove(item); Items.Add(item1); return($"{this.Name} ahora está usando {item}"); } else { return("Este personaje no contiene este item"); } } return(""); }
public DarkWizard(string name, IAttackItem attackItem, IDefenseItem defenseItem, IMagicItem magicItem) : base(name, attackItem, defenseItem) { this.MagicItem = magicItem; }