Example #1
0
 public override bool TakeAction()
 {
     UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
     if (userTrump != null && userTrump.PropertyInfo.Count > 0)
     {
         GeneralProperty property = userTrump.PropertyInfo.Find(m => m.AbilityType == propertyID);
         if (property != null)
         {
             abilityLv = property.AbilityLv;
             // short upLv = MathUtils.Addition(property.AbilityLv, (short)1, TrumpPropertyInfo.MaxTrumpPropertyLv);
             //trumpProperty = new ConfigCacheSet<TrumpPropertyInfo>().FindKey(property.AbilityType, upLv);
             trumpProperty = new ConfigCacheSet<TrumpPropertyInfo>().FindKey(property.AbilityType, property.AbilityLv);
             if (trumpProperty != null)
             {
                 int upItemNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, trumpProperty.ItemID);
                 if (upItemNum >= trumpProperty.ItemNum)
                 {
                     isItem = 1;
                 }
                 if (ContextUser.GameCoin >= trumpProperty.GameCoin)
                 {
                     isCoin = 1;
                 }
                 if (ContextUser.ObtainNum >= trumpProperty.ObtainNum)
                 {
                     isObtain = 1;
                 }
                 successNum = trumpProperty.SuccessNum.ToString();
                 ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(trumpProperty.ItemID);
                 if (itemInfo != null)
                 {
                     itemName = itemInfo.ItemName;
                 }
             }
         }
     }
     return true;
 }
Example #2
0
 /// <summary>
 /// 附加属性升级是否满足条件
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public static bool IsMeetUpPropertyLv(GameUser user, TrumpPropertyInfo trumpProperty)
 {
     int upItemNum = GetUserItemNum(user.UserID, trumpProperty.ItemID);
     if (trumpProperty != null && user.GameCoin >= trumpProperty.GameCoin && user.ObtainNum >= trumpProperty.ObtainNum && upItemNum >= trumpProperty.ItemNum)
     {
         return true;
     }
     return false;
 }