コード例 #1
0
 public Creature(Creature other)
     : base(other)
 {
     BaseAttributes            = other.BaseAttributes.Clone();
     ModifiedAttributes        = BaseAttributes.Clone();
     _usedAttacksOfOpportunity = 0;
 }
コード例 #2
0
ファイル: Actor.cs プロジェクト: JackMules/Dungeoneer
        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;
 }