void LoadAmulet(XElement itemNode) { var name = (string)itemNode.Attribute("name"); var color = ColorTranslator.FromHtml(itemNode.Attribute("color").Value); var newAmulet = new Amulet(50f, 50f, name, color, GetComponentsInItem(itemNode), new List <string>()); items.Add(newAmulet); }
public void Wear(Amulet a, Level currentLevel) { if (amulet != null) { inventory.Add(new Amulet(amulet)); message.Add("You take off the " + amulet.name + " and wear the " + a.name + "."); } else { message.Add("You wear the " + a.name + "."); } amulet = a; inventory.Remove(a); Affect(a.effect, currentLevel); }
public Amulet(Amulet a) : base(a) { this.effect = a.effect; }