예제 #1
0
 public Creature(Creature other)
     : base(other)
 {
     BaseAttributes            = other.BaseAttributes.Clone();
     ModifiedAttributes        = BaseAttributes.Clone();
     _usedAttacksOfOpportunity = 0;
 }
예제 #2
0
        public virtual void ReadAttributesXML(XmlNode xmlNode)
        {
            bool readBase     = false;
            bool readModified = false;

            try
            {
                foreach (XmlNode childNode in xmlNode.ChildNodes)
                {
                    if (childNode.Name == "BaseAttributes")
                    {
                        BaseAttributes.ReadXML(childNode.ChildNodes[0]);
                        readBase = true;
                    }
                    else if (childNode.Name == "ModifiedAttributes")
                    {
                        ModifiedAttributes.ReadXML(childNode.ChildNodes[0]);
                        readModified = true;
                    }
                }
            }
            catch (XmlException e)
            {
                MessageBox.Show(e.ToString());
            }

            if (readBase && !readModified)
            {
                ModifiedAttributes = BaseAttributes.Clone();
            }
        }
예제 #3
0
 //初始化属性
 protected void InitAttributes()
 {
     //base
     Attributes = BaseAttributes.Clone();
     InitEquipAttributes();
     HP        = Attributes.HP;
     MP        = Attributes.MP;
     Stamina   = Attributes.Stamina;
     Strength  = Attributes.Strength;
     Dexterity = Attributes.Dexterity;
     Mental    = Attributes.Mental;
     Steady    = Data.Steady;
 }