Esempio n. 1
0
 public override bool TakeAction()
 {
     var package = UserEnchant.Get(ContextUser.UserID);
     if (package != null)
     {
         userEnchant = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID);
         if (userEnchant != null)
         {
             matureNum = (decimal)userEnchant.MaxMature / GameConfigSet.MaxEnchantMature;
             maxMature = CombatHelper.EnchantFinalNum(userEnchant);
             enchantInfo = new ConfigCacheSet<EnchantInfo>().FindKey(userEnchant.EnchantID);
             EnchantLvInfo enchantLvInfo = new ConfigCacheSet<EnchantLvInfo>().FindKey(userEnchant.EnchantID,
                                                                                       userEnchant.EnchantLv);
             if (enchantLvInfo != null)
             {
                 abilityNum = TrumpHelper.GetTransformData(enchantLvInfo.Num);
             }
         }
     }
     enchantList = EnchantHelper.EnchantCultureList();
     return true;
 }
Esempio n. 2
0
 public override bool TakeAction()
 {
     string puUserID;
     if (string.IsNullOrEmpty(toUserID))
     {
         puUserID = ContextUser.UserID;
     }
     else
     {
         puUserID = toUserID;
         UserCacheGlobal.LoadOffline(puUserID);
     }
     var package = UserEnchant.Get(puUserID);
     if (package != null)
     {
         userEnchantInfo = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID);
         if (userEnchantInfo != null)
         {
             finalMature = CombatHelper.EnchantFinalNum(userEnchantInfo);
             currExp = userEnchantInfo.CurrExprience;
             enchant = new ConfigCacheSet<EnchantInfo>().FindKey(userEnchantInfo.EnchantID);
             if (enchant != null)
             {
                 enchantLvInfo = new ConfigCacheSet<EnchantLvInfo>().FindKey(enchant.EnchantID, userEnchantInfo.EnchantLv);
                 short uplv = MathUtils.Addition(userEnchantInfo.EnchantLv, (short)1, (short)GameConfigSet.MaxEnchantLv);
                 EnchantLvInfo enchantLv = new ConfigCacheSet<EnchantLvInfo>().FindKey(userEnchantInfo.EnchantID, uplv);
                 upExp = enchantLv == null ? 0 : enchantLv.Experience;
             }
         }
     }
     return true;
 }
Esempio n. 3
0
 /// <summary>
 /// 通关副本掉落附魔符
 /// </summary>
 /// <param name="userID"></param>
 /// <param name="plotID"></param>
 /// <returns></returns>
 private static EnchantInfo GetPrizeEnchant(string userID, int plotID)
 {
     EnchantInfo enchantInfo = new EnchantInfo();
     PlotInfo plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(plotID);
     if (plotInfo != null)
     {
         GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(userID);
         UserFunction userFunction = new GameDataCacheSet<UserFunction>().FindKey(userID, FunctionEnum.Enchant);
         if (userInfo != null && userFunction != null && RandomUtils.IsHit(plotInfo.EnchantProbability))
         {
             string[] enchants = plotInfo.EnchantID.Trim().Split(new[] { ',' });
             int index = RandomUtils.GetRandom(0, enchants.Length);
             int enID = enchants[index].ToInt();
             if (new ConfigCacheSet<EnchantInfo>().FindKey(enID) != null)
             {
                 enchantInfo = new ConfigCacheSet<EnchantInfo>().FindKey(enID);
             }
         }
     }
     return enchantInfo;
 }