コード例 #1
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);
        }
コード例 #2
0
ファイル: Action1257.cs プロジェクト: zxx0367/Scut-samples
        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);
        }