Exemple #1
0
        public KeyValuePair<JewelAttributeType, float> SpecialAttribute; // 饰品特殊属性(单条)

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Jewel
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造饰品装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="type"></param>
        /// <param name="jewelAttributeType"></param>
        public Jewel(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
            int cur, int dur,
            JewelType type, JewelAttributeType jewelAttributeType)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Jewel)
        {
            Type = (byte) type;
            JewelAttribute = jewelAttributeType;
            SpecialAttribute = new KeyValuePair<JewelAttributeType, float>(jewelAttributeType, 0);
        }
Exemple #2
0
        public KeyValuePair <JewelAttributeType, float> SpecialAttribute; // 饰品特殊属性(单条)

        #endregion

        /// <summary>
        /// 类型:方法
        /// 名称:Jewel
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造饰品装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="type"></param>
        /// <param name="jewelAttributeType"></param>
        public Jewel(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
                     int cur, int dur,
                     JewelType type, JewelAttributeType jewelAttributeType)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Jewel)
        {
            Type             = (byte)type;
            JewelAttribute   = jewelAttributeType;
            SpecialAttribute = new KeyValuePair <JewelAttributeType, float>(jewelAttributeType, 0);
        }
Exemple #3
0
        public Dictionary <int, KeyValuePair <AttributeCode, float> > ForgingAttributes; // 锻造附加属性

        /// <summary>
        /// 类型:方法
        /// 名称:Armor
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造防具装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="type"></param>
        public Armor(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
                     int cur, int dur,
                     ArmorType type)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Armor)
        {
            Type              = type;
            DefensePoints     = new[] { 0, 0 };
            ForgingAttributes = new Dictionary <int, KeyValuePair <AttributeCode, float> >
            {
                { -1, new KeyValuePair <AttributeCode, float>(AttributeCode.Null, 0) }
            };
        }
Exemple #4
0
        public Dictionary<int, KeyValuePair<AttributeCode, float>> ForgingAttributes; // 锻造附加属性

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Armor
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造防具装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="type"></param>
        public Armor(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
            int cur, int dur,
            ArmorType type)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Armor)
        {
            Type = type;
            DefensePoints = new[] {0, 0};
            ForgingAttributes = new Dictionary<int, KeyValuePair<AttributeCode, float>>
            {
                {-1, new KeyValuePair<AttributeCode, float>(AttributeCode.Null, 0)}
            };
        }
Exemple #5
0
        public KeyValuePair<AttributeCode, float> RandomAttribute; // 随机属性(单条)

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Equipment
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造实例,只能由子类调用
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixed"></param>
        /// <param name="allocated"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="durability"></param>
        /// <param name="type"></param>
        protected Equipment(int @fixed, int allocated, string name, OccupationCode occupation, int limit, bool upgrade,
            int cur, int durability, EquipmentType type)
        {
            FixedId = @fixed;
            AllocatedId = allocated;
            Name = name;
            Occupation = (byte) occupation;
            LevelLimit = limit;
            IsCanUpgrade = upgrade;
            CurrentLevel = cur;
            Durability = durability;
            IsUsing = false;
            EquipType = type;
            FixedAttributes = new Dictionary<AttributeCode, float>(new EnumComparer<AttributeCode>())
            {
                {AttributeCode.Null, 0}
            };
            RandomAttribute = new KeyValuePair<AttributeCode, float>(AttributeCode.Null, 0);
        }
Exemple #6
0
        public KeyValuePair <AttributeCode, float> RandomAttribute; // 随机属性(单条)

        /// <summary>
        /// 类型:方法
        /// 名称:Equipment
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造实例,只能由子类调用
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixed"></param>
        /// <param name="allocated"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="durability"></param>
        /// <param name="type"></param>
        protected Equipment(int @fixed, int allocated, string name, OccupationCode occupation, int limit, bool upgrade,
                            int cur, int durability, EquipmentType type)
        {
            FixedId         = @fixed;
            AllocatedId     = allocated;
            Name            = name;
            Occupation      = (byte)occupation;
            LevelLimit      = limit;
            IsCanUpgrade    = upgrade;
            CurrentLevel    = cur;
            Durability      = durability;
            IsUsing         = false;
            EquipType       = type;
            FixedAttributes = new Dictionary <AttributeCode, float>(new EnumComparer <AttributeCode>())
            {
                { AttributeCode.Null, 0 }
            };
            RandomAttribute = new KeyValuePair <AttributeCode, float>(AttributeCode.Null, 0);
        }
Exemple #7
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateOccupation
 /// 作者:taixihuase
 /// 作用:变更职业类型
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="code"></param>
 /// <param name="name"></param>
 public void UpdateOccupation(OccupationCode code, string name)
 {
     Type = code;
     Name = name;
 }
Exemple #8
0
        private bool _apply; // 启用属性

        /// <summary>
        /// 类型:方法
        /// 名称:Occupation
        /// 作者:taixihuase
        /// 作用:构造默认职业类
        /// 编写日期:2015/8/20
        /// </summary>
        /// <param name="code"></param>
        /// <param name="name"></param>
        public Occupation(OccupationCode code = OccupationCode.Common, string name = "")
        {
            Type   = code;
            Name   = name;
            _apply = false;
        }
Exemple #9
0
        public Dictionary <int, KeyValuePair <AttributeCode, float> > ForgingAttributes; // 锻造附加属性

        /// <summary>
        /// 类型:方法
        /// 名称:Weapon
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造武器装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="elem"></param>
        /// <param name="distance"></param>
        /// <param name="type"></param>
        /// <param name="weaponAttackType"></param>
        /// <param name="weaponElement"></param>
        /// <param name="speed"></param>
        public Weapon(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
                      int cur, int dur, int elem, float speed, float distance,
                      WeaponType type, WeaponAttackType weaponAttackType, WeaponElementType weaponElement)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Weapon)
        {
            Type = type;

            #region 武器属性初始化

            WeaponAttack = weaponAttackType;
            if (weaponAttackType == WeaponAttackType.Both)
            {
                AttackLimit =
                    new Dictionary <WeaponAttackType, KeyValuePair <int, int> >(new EnumComparer <WeaponAttackType>())
                {
                    [WeaponAttackType.Magic]    = new KeyValuePair <int, int>(0, 0),
                    [WeaponAttackType.Physical] = new KeyValuePair <int, int>(0, 0)
                };
            }
            else
            {
                AttackLimit =
                    new Dictionary <WeaponAttackType, KeyValuePair <int, int> >(new EnumComparer <WeaponAttackType>())
                {
                    [weaponAttackType] = new KeyValuePair <int, int>(0, 0)
                };
            }

            #endregion

            ForgingAttributes = new Dictionary <int, KeyValuePair <AttributeCode, float> >
            {
                { -1, new KeyValuePair <AttributeCode, float>(AttributeCode.Null, 0) }
            };
            FixedAttackSpeed    = speed;
            FixedAttackDistance = distance;

            #region 武器元素初始化

            WeaponElement        = weaponElement;
            CurrentElementEnergy = elem;
            if (weaponElement != WeaponElementType.Null)
            {
                ElementAttributes =
                    new KeyValuePair <WeaponElementType, Dictionary <AttributeCode, float> >(weaponElement,
                                                                                             new Dictionary <AttributeCode, float>(new EnumComparer <AttributeCode>())
                {
                    { (AttributeCode)Enum.Parse(typeof(AttributeCode), "Enhance_" + weaponElement), 0 }
                });

                int num = Convert.ToInt32(Enum.Parse(typeof(WeaponElementType), weaponElement.ToString()));
                int mul = 0;
                while ((num += mul * DataConstraint.ElementMaxSize) <=
                       Enum.GetValues(typeof(ElementExtraAttribute)).Length)
                {
                    var s = Enum.GetName(typeof(ElementExtraAttribute), num);
                    if (s != null)
                    {
                        ElementAttributes.Value.Add((AttributeCode)Enum.Parse(typeof(AttributeCode), s), 0);
                    }
                    mul++;
                }
            }
            else
            {
                ElementAttributes =
                    new KeyValuePair <WeaponElementType, Dictionary <AttributeCode, float> >(WeaponElementType.Null,
                                                                                             new Dictionary <AttributeCode, float>(new EnumComparer <AttributeCode>())
                {
                    { AttributeCode.Null, 0 }
                });
            }

            #endregion
        }
Exemple #10
0
        public Dictionary<int, KeyValuePair<AttributeCode, float>> ForgingAttributes; // 锻造附加属性

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Weapon
        /// 作者:taixihuase
        /// 作用:通过数据库中获得的数据构造武器装备实例
        /// 编写日期:2015/8/16
        /// </summary>
        /// <param name="fixedId"></param>
        /// <param name="allocatedId"></param>
        /// <param name="name"></param>
        /// <param name="occupation"></param>
        /// <param name="limit"></param>
        /// <param name="upgrade"></param>
        /// <param name="cur"></param>
        /// <param name="dur"></param>
        /// <param name="elem"></param>
        /// <param name="distance"></param>
        /// <param name="type"></param>
        /// <param name="weaponAttackType"></param>
        /// <param name="weaponElement"></param>
        /// <param name="speed"></param>
        public Weapon(int fixedId, int allocatedId, string name, OccupationCode occupation, int limit, bool upgrade,
            int cur, int dur, int elem, float speed, float distance, 
            WeaponType type, WeaponAttackType weaponAttackType, WeaponElementType weaponElement)
            : base(fixedId, allocatedId, name, occupation, limit, upgrade, cur, dur, EquipmentType.Weapon)
        {
            Type = type;

            #region 武器属性初始化

            WeaponAttack = weaponAttackType;
            if (weaponAttackType == WeaponAttackType.Both)
            {
                AttackLimit =
                    new Dictionary<WeaponAttackType, KeyValuePair<int, int>>(new EnumComparer<WeaponAttackType>())
                    {
                        [WeaponAttackType.Magic] = new KeyValuePair<int, int>(0, 0),
                        [WeaponAttackType.Physical] = new KeyValuePair<int, int>(0, 0)
                    };
            }
            else
            {
                AttackLimit =
                    new Dictionary<WeaponAttackType, KeyValuePair<int, int>>(new EnumComparer<WeaponAttackType>())
                    {
                        [weaponAttackType] = new KeyValuePair<int, int>(0, 0)
                    };
            }

            #endregion

            ForgingAttributes = new Dictionary<int, KeyValuePair<AttributeCode, float>>
            {
                {-1, new KeyValuePair<AttributeCode, float>(AttributeCode.Null, 0)}
            };
            FixedAttackSpeed = speed;
            FixedAttackDistance = distance;

            #region 武器元素初始化

            WeaponElement = weaponElement;
            CurrentElementEnergy = elem;
            if (weaponElement != WeaponElementType.Null)
            {
                ElementAttributes =
                    new KeyValuePair<WeaponElementType, Dictionary<AttributeCode, float>>(weaponElement,
                        new Dictionary<AttributeCode, float>(new EnumComparer<AttributeCode>())
                        {
                            {(AttributeCode) Enum.Parse(typeof (AttributeCode), "Enhance_" + weaponElement), 0}
                        });

                int num = Convert.ToInt32(Enum.Parse(typeof (WeaponElementType), weaponElement.ToString()));
                int mul = 0;
                while ((num += mul*DataConstraint.ElementMaxSize) <=
                       Enum.GetValues(typeof (ElementExtraAttribute)).Length)
                {
                    var s = Enum.GetName(typeof (ElementExtraAttribute), num);
                    if (s != null)
                    {
                        ElementAttributes.Value.Add((AttributeCode) Enum.Parse(typeof (AttributeCode), s), 0);
                    }
                    mul++;
                }
            }
            else
            {
                ElementAttributes =
                    new KeyValuePair<WeaponElementType, Dictionary<AttributeCode, float>>(WeaponElementType.Null,
                        new Dictionary<AttributeCode, float>(new EnumComparer<AttributeCode>())
                        {
                            {AttributeCode.Null, 0}
                        });
            }

            #endregion
        }
Exemple #11
0
        private bool _apply; // 启用属性

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 类型:方法
        /// 名称:Occupation
        /// 作者:taixihuase
        /// 作用:构造默认职业类
        /// 编写日期:2015/8/20
        /// </summary>
        /// <param name="code"></param>
        /// <param name="name"></param>
        public Occupation(OccupationCode code = OccupationCode.Common, string name = "")
        {
            Type = code;
            Name = name;
            _apply = false;
        }
Exemple #12
0
 /// <summary>
 /// 类型:方法
 /// 名称:UpdateOccupation
 /// 作者:taixihuase
 /// 作用:变更职业类型
 /// 编写日期:2015/8/20
 /// </summary>
 /// <param name="code"></param>
 /// <param name="name"></param>
 public void UpdateOccupation(OccupationCode code, string name)
 {
     Type = code;
     Name = name;
 }