Exemplo n.º 1
0
        /// <summary>
        /// 公会技能加成效果
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="abilityType"></param>
        /// <returns></returns>
        public static decimal GetGuildAbilityNum(string userID, GuildAbilityType abilityType)
        {
            decimal  effectNum = 0;
            GameUser user      = new PersonalCacheStruct <GameUser>().FindKey(userID);

            if (user != null && user.PropertyInfo != null && user.PropertyInfo.Count > 0)
            {
                var          abilitiesList = user.PropertyInfo;
                GuildAbility ability       = abilitiesList.Find(m => m.Type == abilityType);
                if (ability != null)
                {
                    effectNum = MathUtils.Addition(effectNum, ability.Num, decimal.MaxValue);
                }
            }
            effectNum = MathUtils.Addition(effectNum, 1, decimal.MaxValue);
            return(effectNum);
        }
Exemplo n.º 2
0
 protected override object this[string index]
 {
     get
     {
         #region
         switch (index)
         {
             case "ID": return ID;
             case "IsCityCombat": return IsCityCombat;
             case "GuildAbilityType": return GuildAbilityType;
             case "AbilityName": return AbilityName;
             case "AbilityHead": return AbilityHead;
             case "PreAbility": return PreAbility;
             case "PreAbilityLv": return PreAbilityLv;
             case "AbilityDesc": return AbilityDesc;
             case "Version": return Version;
             default: throw new ArgumentException(string.Format("GuildAbilityInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
     set
     {
         #region
         switch (index)
         {
             case "ID":
                 _ID = value.ToInt();
                 break;
             case "IsCityCombat":
                 _IsCityCombat = value.ToBool();
                 break;
             case "GuildAbilityType":
                 _GuildAbilityType = value.ToEnum<GuildAbilityType>();
                 break;
             case "AbilityName":
                 _AbilityName = value.ToNotNullString();
                 break;
             case "AbilityHead":
                 _AbilityHead = value.ToNotNullString();
                 break;
             case "PreAbility":
                 _PreAbility = value as List<string> ?? new List<string>();
                 break;
             case "PreAbilityLv":
                 _PreAbilityLv = value.ToNotNullString();
                 break;
             case "AbilityDesc":
                 _AbilityDesc = value.ToNotNullString();
                 break;
             case "Version":
                 _Version = value.ToInt();
                 break;
             default: throw new ArgumentException(string.Format("GuildAbilityInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
 }
Exemplo n.º 3
0
        protected override object this[string index]
        {
            get
            {
                #region
                switch (index)
                {
                case "ID": return(ID);

                case "IsCityCombat": return(IsCityCombat);

                case "GuildAbilityType": return(GuildAbilityType);

                case "AbilityName": return(AbilityName);

                case "AbilityHead": return(AbilityHead);

                case "PreAbility": return(PreAbility);

                case "PreAbilityLv": return(PreAbilityLv);

                case "AbilityDesc": return(AbilityDesc);

                case "Version": return(Version);

                default: throw new ArgumentException(string.Format("GuildAbilityInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
            set
            {
                #region
                switch (index)
                {
                case "ID":
                    _ID = value.ToInt();
                    break;

                case "IsCityCombat":
                    _IsCityCombat = value.ToBool();
                    break;

                case "GuildAbilityType":
                    _GuildAbilityType = value.ToEnum <GuildAbilityType>();
                    break;

                case "AbilityName":
                    _AbilityName = value.ToNotNullString();
                    break;

                case "AbilityHead":
                    _AbilityHead = value.ToNotNullString();
                    break;

                case "PreAbility":
                    _PreAbility = value as List <string> ?? new List <string>();
                    break;

                case "PreAbilityLv":
                    _PreAbilityLv = value.ToNotNullString();
                    break;

                case "AbilityDesc":
                    _AbilityDesc = value.ToNotNullString();
                    break;

                case "Version":
                    _Version = value.ToInt();
                    break;

                default: throw new ArgumentException(string.Format("GuildAbilityInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 公会技能加成效果
 /// </summary>
 /// <param name="userID"></param>
 /// <param name="abilityType"></param>
 /// <returns></returns>
 public static decimal GetGuildAbilityNum(string userID, GuildAbilityType abilityType)
 {
     decimal effectNum = 0;
     GameUser user = new GameDataCacheSet<GameUser>().FindKey(userID);
     if (user != null && user.PropertyInfo != null && user.PropertyInfo.Count > 0)
     {
         var abilitiesList = user.PropertyInfo;
         GuildAbility ability = abilitiesList.Find(m => m.Type == abilityType);
         if (ability != null)
         {
             effectNum = MathUtils.Addition(effectNum, ability.Num, decimal.MaxValue);
         }
     }
     effectNum = MathUtils.Addition(effectNum, 1, decimal.MaxValue);
     return effectNum;
 }