示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public Amulet(Amulet a) : base(a)
 {
     this.effect = a.effect;
 }