当前位置: 首页>>代码示例>>C#>>正文


C# GameDataCacheSet.RefreshMaxLife方法代码示例

本文整理汇总了C#中GameDataCacheSet.RefreshMaxLife方法的典型用法代码示例。如果您正苦于以下问题:C# GameDataCacheSet.RefreshMaxLife方法的具体用法?C# GameDataCacheSet.RefreshMaxLife怎么用?C# GameDataCacheSet.RefreshMaxLife使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameDataCacheSet的用法示例。


在下文中一共展示了GameDataCacheSet.RefreshMaxLife方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        private CombatGeneral Create(UserEmbattle embattle, double inspirePercent, short replacePotion)
        {
            GameUser userInfo = UserCacheGlobal.CheckLoadUser(embattle.UserID);
            UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(embattle.UserID, embattle.GeneralID);
            if (userGeneral == null || userInfo == null)
            {
                return null;
            }

            AbilityInfo ability = new ConfigCacheSet<AbilityInfo>().FindKey(userGeneral.AbilityID);
            CareerInfo careerInfo = new ConfigCacheSet<CareerInfo>().FindKey(userGeneral.CareerID);

            if (ability == null || careerInfo == null)
            {
                throw new Exception("职业或技能为空");
            }
            //职业加成
            decimal baojiNum = GetCareerAddition(careerInfo, AbilityType.BaoJi);
            decimal bishaNum = GetCareerAddition(careerInfo, AbilityType.BiSha);
            decimal renxingNum = GetCareerAddition(careerInfo, AbilityType.RenXing);
            decimal hitNum = GetCareerAddition(careerInfo, AbilityType.MingZhong);
            decimal shanbiNum = GetCareerAddition(careerInfo, AbilityType.ShanBi);
            decimal gedangNum = GetCareerAddition(careerInfo, AbilityType.GeDang);
            decimal pojiNum = GetCareerAddition(careerInfo, AbilityType.PoJi);
            //公会技能加成

            short powerNum = MathUtils.Addition(userGeneral.PowerNum, userGeneral.TrainingPower, short.MaxValue);
            short soulNum = MathUtils.Addition(userGeneral.SoulNum, userGeneral.TrainingSoul, short.MaxValue);
            short intellectNum = MathUtils.Addition(userGeneral.IntellectNum, userGeneral.TrainingIntellect, short.MaxValue);
            GameUser user = new GameDataCacheSet<GameUser>().FindKey(embattle.UserID);
            if (user != null && !string.IsNullOrEmpty(user.MercenariesID) && userGeneral.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
            {
                powerNum = MathUtils.RoundCustom(powerNum * CombatHelper.GetGuildAbilityNum(user.UserID, GuildAbilityType.PowerNum)).ToShort();
                soulNum = MathUtils.RoundCustom(soulNum * CombatHelper.GetGuildAbilityNum(user.UserID, GuildAbilityType.SoulNum)).ToShort();
                intellectNum = MathUtils.RoundCustom(intellectNum * CombatHelper.GetGuildAbilityNum(user.UserID, GuildAbilityType.IntellectNum)).ToShort();
            }

            if (embattle.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
            {
                //法宝基础属性加成
                powerNum = MathUtils.Addition(powerNum, TrumpAbilityAttack.TrumpPropertyNum(embattle.UserID, embattle.GeneralID, AbilityType.PowerNum));
                soulNum = MathUtils.Addition(soulNum, TrumpAbilityAttack.TrumpPropertyNum(embattle.UserID, embattle.GeneralID, AbilityType.SoulNum));
                intellectNum = MathUtils.Addition(intellectNum, TrumpAbilityAttack.TrumpPropertyNum(embattle.UserID, embattle.GeneralID, AbilityType.IntelligenceNum));

                //法宝--技能属性转换获得的值
                //法宝--技能属性转换获得的值
                decimal trumpPower = TrumpAbilityAttack.ConversionPropertyNum(embattle.UserID, powerNum, soulNum, intellectNum, AbilityType.PowerNum);
                decimal trumpsoul = TrumpAbilityAttack.ConversionPropertyNum(embattle.UserID, powerNum, soulNum, intellectNum, AbilityType.SoulNum);
                decimal trumpintellect = TrumpAbilityAttack.ConversionPropertyNum(embattle.UserID, powerNum, soulNum, intellectNum, AbilityType.IntelligenceNum);
                powerNum = MathUtils.Addition(trumpPower.ToShort(), powerNum);
                soulNum = MathUtils.Addition(trumpsoul.ToShort(), soulNum);
                intellectNum = MathUtils.Addition(trumpintellect.ToShort(), intellectNum);
            }

            if (userGeneral.LifeMaxNum == 0 || userGeneral.LifeNum > userGeneral.LifeMaxNum)
            {
                userGeneral.RefreshMaxLife();
                userGeneral.LifeNum = userGeneral.LifeMaxNum;
            }
            //
            decimal effectValue = 0;// AbilityDispose.GetAbilityEffect(embattle.UserID, embattle.GeneralID, ability.AbilityID);
            decimal selfEffectValue = 0;
            List<AbilityInfo> selfAbilityList = AbilityDispose.GetSelfAbilityList(embattle.UserID, embattle.GeneralID,
                                                                                  ability.AbilityID, out selfEffectValue);
            CombatGeneral general = new CombatGeneral()
            {
                UserID = embattle.UserID,
                Position = embattle.Position,
                GeneralID = embattle.GeneralID,
                CombatType = _combatType,
                GeneralName = userGeneral.GeneralName,
                HeadID = userGeneral.HeadID,
                CareerID = userGeneral.CareerID,
                CareerType = careerInfo.CareerType,
                IsMove = careerInfo.IsMove,
                LifeNum = userGeneral.LifeNum,
                LifeMaxNum = userGeneral.LifeMaxNum,
                Lv = userGeneral.GeneralLv,
                Momentum = (short)CombatMomentum,
                Ability = ability,
                IsAttrMove = ability.IsMove,
                BaojiNum = MathUtils.Addition(CombatBaojiNum, baojiNum, decimal.MaxValue),
                BishaNum = bishaNum,
                RenxingNum = renxingNum,
                HitNum = MathUtils.Addition(userGeneral.HitProbability, hitNum, decimal.MaxValue),
                ShanbiNum = shanbiNum,
                GedangNum = gedangNum,
                PojiNum = pojiNum,
                BattleStatus = BattleStatus.Normal,
                PowerNum = powerNum,
                SoulNum = soulNum,
                IntellectNum = intellectNum,
                ExtraAttack = new CombatProperty(),
                ExtraDefense = new CombatProperty(),
                InspirePercent = inspirePercent,
                Fatigue = userInfo.Fatigue,
                UserStatus = userInfo.UserStatus,
                IsMonster = false,
                IsWait = false,
                EffectValue = effectValue,
//.........这里部分代码省略.........
开发者ID:jinfei426,项目名称:Scut,代码行数:101,代码来源:UserEmbattleQueue.cs

示例2: TakeAction

        public override bool TakeAction()
        {
            var package = UserCrystalPackage.Get(Uid);
            UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, generalID);
            UserCrystalInfo userCrystal = package.CrystalPackage.Find(m => m.UserCrystalID.Equals(userCrystalID));
            if (userCrystal == null || userGeneral == null)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                return false;
            }

            var userCrystalArray = package.CrystalPackage.FindAll(m => m.IsSale == 2 && m.GeneralID.Equals(0));
            var crystalArray = package.CrystalPackage.FindAll(m => m.IsSale == 2 && m.GeneralID.Equals(generalID));
            if (ops == 0)
            {
                if (userCrystal.IsSale == 2 && userCrystal.GeneralID != 0)
                {
                    if (userCrystalArray.Count >= ContextUser.CrystalNum)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1307_FateBackpackFull;
                        return false;
                    }

                    if (userCrystalArray.Count < ContextUser.CrystalNum &&
                       userCrystal.GeneralID > 0 &&
                       userCrystal.Position > 0)
                    {
                        userCrystal.GeneralID = 0;
                        userCrystal.Position = 0;
                        package.SaveCrystal(userCrystal);
                        //package.DelayChange();
                    }
                }
            }
            if (potion > IsGridOpen(userGeneral.GeneralLv))
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St1213_GridNumNotEnough;
                return false;
            }
            else if (ops == 1)
            {
                if (userCrystal.IsSale == 2)
                {
                    CrystalInfo crystalInfo = new ConfigCacheSet<CrystalInfo>().FindKey(userCrystal.CrystalID);
                    if (crystalInfo == null)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        return false;
                    }

                    if (crystalArray.Count >= UserHelper.GetOpenNum(userGeneral.GeneralLv))
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1309_OpenNumNotEnough;
                        return false;
                    }

                    foreach (UserCrystalInfo crystal in crystalArray)
                    {
                        CrystalInfo crystalInfo2 = new ConfigCacheSet<CrystalInfo>().FindKey(crystal.CrystalID);
                        if (crystalInfo2 != null && crystalInfo.AbilityID == crystalInfo2.AbilityID)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St1309_TheSameFate;
                            return false;
                        }
                    }

                    UserCrystalInfo[] potionCrystalArray = package.CrystalPackage.FindAll(m => m.GeneralID == generalID && m.Position == potion).ToArray();
                    if (potionCrystalArray.Length > 0)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1309_TheGridFullSameFate;
                        return false;
                    }

                    if (userCrystal.IsSale == 2 &&
                         userCrystal.GeneralID == 0 &&
                         userCrystal.Position == 0)
                    {
                        userCrystal.GeneralID = generalID;
                        userCrystal.Position = potion;
                        package.SaveCrystal(userCrystal);
                    }
                }
            }
            userGeneral.RefreshMaxLife();
            return true;
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:91,代码来源:Action1309.cs

示例3: TakeAction

        public override bool TakeAction()
        {
            UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, generalID);
            if (userGeneral == null)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                return false;
            }
            if (ops == 0)
            {
                //用户装备更换
                var package = UserItemPackage.Get(Uid);
                if (package == null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    return false;
                }
                UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(userItemID));
                if (userItem == null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    return false;
                }
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem.ItemID);
                if (itemInfo != null)
                {
                    if (string.IsNullOrEmpty(itemInfo.CareerRange) || itemInfo.CareerRange.IndexOf(userGeneral.CareerID.ToString()) == -1)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1203_CareerError;
                        return false;
                    }
                    //佣兵装备部位为空才能更换
                    var generalItem = package.ItemPackage.Find(s => !s.IsRemove && s.Equparts == itemInfo.EquParts && s.GeneralID == userGeneral.GeneralID && s.ItemStatus == ItemStatus.YongBing);
                    if (generalItem != null)
                    {
                        generalItem.GeneralID = 0;
                        generalItem.ItemStatus = ItemStatus.BeiBao;
                        package.SaveItem(generalItem);
                        userItem.GeneralID = generalID;
                        userItem.ItemStatus = ItemStatus.YongBing;
                        package.SaveItem(userItem);
                    }
                    else
                    {
                        userItem.GeneralID = generalID;
                        userItem.ItemStatus = ItemStatus.YongBing;
                        package.SaveItem(userItem);
                    }
                    //int equCount = UserItemHelper.GetItems(Uid).FindAll(
                    //    m => new UserItemHelper(m).EquPartsID == (int)itemInfo.EquParts && m.GeneralID == userGeneral.GeneralID && m.ItemStatus == ItemStatus.YongBing).Count;
                    //if (equCount == 0)
                    //{
                    //    userItem.GeneralID = generalID;
                    //    userItem.ItemStatus = ItemStatus.YongBing;
                    //    package.SaveItem(userItem);
                    //}
                }
            }
            else if (ops == 1)
            {
                //卸下
                //if (UserItemHelper.CheckItemOut(ContextUser, ItemStatus.BeiBao))
                //{
                //    ErrorCode = LanguageManager.GetLang().ErrorCode;
                //    ErrorInfo = LanguageManager.GetLang().St1606_GridNumNotEnough;
                //    return false;
                //}
                string str = string.Empty;
                if (UserPackHelper.PackIsFull(ContextUser, BackpackType.ZhuangBei, 1, out str))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1606_GridNumNotEnough;
                    ErrorInfo = str;
                    return false;
                }
                var package = UserItemPackage.Get(Uid);
                UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(userItemID));

                if (userItem != null && userItem.GeneralID > 0 && userItem.ItemStatus == ItemStatus.YongBing)
                {
                    userItem.GeneralID = 0;
                    userItem.ItemStatus = ItemStatus.BeiBao;
                    package.SaveItem(userItem);
                }

            }
            userGeneral.RefreshMaxLife();
            return true;
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:90,代码来源:Action1203.cs

示例4: TakeAction

 public override bool TakeAction()
 {
     ErrorCode = _ops;
     int goldNum = ConfigEnvSet.GetInt("SparePart.PropertyGoldNum");
     if (_ops == 1)
     {
         ErrorInfo = string.Format(LanguageManager.GetLang().St1216_EnableSpartProperty, goldNum, _position);
     }
     else if (_ops == 2)
     {
         if (ContextUser.GoldNum < goldNum)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
             return false;
         }
         if (ContextUser.EnableSpareProperty(_sparepartID, out _sparePart))
         {
             ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, goldNum);
             //ContextUser.Update();
             var itempackage = UserItemPackage.Get(ContextUser.UserID);
             UserItemInfo userItem = itempackage.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(_sparePart.UserItemID));
             if (userItem != null && userItem.ItemStatus.Equals(ItemStatus.YongBing))
             {
                 var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, userItem.GeneralID);
                 if (userGeneral != null) userGeneral.RefreshMaxLife();
             }
         }
         else
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             return false;
         }
     }
     return true;
 }
开发者ID:0jpq0,项目名称:Scut,代码行数:36,代码来源:Action1216.cs

示例5: TakeAction

        public override bool TakeAction()
        {
            //int maxEquNum = ConfigEnvSet.GetInt("UserQueue.EquStrengMaxNum");
            //int coldTime = ConfigEnvSet.GetInt("UserItem.EquColdTime");

            //铜钱不足
            var package = UserItemPackage.Get(Uid);
            userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(userItemID)) ?? new UserItemInfo();
            if (ops == StrongOnce)
            {
                // 强化 1 次用钱
                strongMoney = new UserItemHelper(userItem, 1).StrongMoney;
            }
            else if (ops == StrongTenTimes)
            {
                // 强化 10 次用钱
                strongMoney = new UserItemHelper(userItem, 10).StrongMoney;
            }
            short strongMaxLv = (ContextUser.UserLv * 3).ToShort(); //MathUtils.Addition(ContextUser.UserLv, 1.ToShort()); //强化最高等级
            if (ContextUser.GameCoin < strongMoney)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St_GameCoinNotEnough;
                return false;
            }

            //UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, userItem.GeneralID);
            //if (userGeneral != null && userItem.ItemLv >= strongMaxLv)
            //{
            //    ErrorCode = LanguageManager.GetLang().ErrorCode;
            //    ErrorInfo = LanguageManager.GetLang().St1204_EquGeneralMaxLv;
            //    return false;
            //}

            if (userItem.ItemLv >= strongMaxLv)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St1204_EquMaxLv;
                return false;
            }

            itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem.ItemID);
            if (itemInfo != null)
            {
                itemEquArray = new ConfigCacheSet<ItemEquAttrInfo>().FindAll(m => m.ItemID == itemInfo.ItemID);
            }

            if (strongMoney > ContextUser.GameCoin)
            {
                isStrong = 1;
            }
            else if (userItem.ItemLv >= strongMaxLv)
            {
                isStrong = 2;
            }

            UpdateUserItem(ContextUser, userItem, strongMoney);
            //日常任务-强化
            TaskHelper.TriggerDailyTask(Uid, 4001);

            UserGeneral general = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, userItem.GeneralID);
            if (general != null)
            {
                general.RefreshMaxLife();
            }
            return true;
        }
开发者ID:0jpq0,项目名称:Scut,代码行数:67,代码来源:Action1204.cs

示例6: TakeAction

        public override bool TakeAction()
        {
            ErrorCode = _ops;
            //1:镶嵌 2:卸下 3:出售
            if (_ops == 1)
            {
                if (string.IsNullOrEmpty(_userItemID))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    return false;
                }
                UserSparePart[] sparePartsArray = ContextUser.SparePartList.FindAll(m => m.UserItemID.Equals(_userItemID)).ToArray();
                if (sparePartsArray.Length > 0)
                {
                    //原因:装备上镶嵌超出开启位置数量的灵件
                    if (ContextUser.UserExtend != null)
                    {
                        if (_position > ContextUser.UserExtend.MaxLayerNum)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St1213_GridNumNotEnough;
                            return false;
                        }
                        if (sparePartsArray.Length >= ContextUser.UserExtend.MaxLayerNum)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St1213_OpenNumNotEnough;
                            return false;
                        }
                    }
                    foreach (UserSparePart part in sparePartsArray)
                    {
                        if (part.Position == _position)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St1213_GridPotionFull;
                            return false;
                        }
                    }
                }

                var sparePart = ContextUser.SparePartList.Find(m => m.UserSparepartID.Equals(_sparepartID));
                if (sparePart != null && string.IsNullOrEmpty(sparePart.UserItemID))
                {
                    sparePart.UpdateNotify(obj =>
                    {
                        sparePart.UserItemID = _userItemID;
                        sparePart.SetPosition(_position);
                        return true;
                    });
                    UserLogHelper.AppendSparePartLog(ContextUser.UserID, sparePart, 3);
                    //ContextUser.UpdateSparePart();

                    var package = UserItemPackage.Get(Uid);
                    UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(sparePart.UserItemID));
                    if (userItem != null && userItem.ItemStatus.Equals(ItemStatus.YongBing))
                    {
                        var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(Uid, userItem.GeneralID);
                        if (userGeneral != null) userGeneral.RefreshMaxLife();
                    }
                }
            }
            else if (_ops == 2)
            {
                int currNum = ContextUser.SparePartList.FindAll(m => string.IsNullOrEmpty(m.UserItemID)).Count;
                if (currNum >= ContextUser.UserExtend.SparePartGridNum)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1213_GridNumFull;
                    return false;
                }
                var sparePart = ContextUser.SparePartList.Find(m => m.UserSparepartID.Equals(_sparepartID));
                if (sparePart != null && !string.IsNullOrEmpty(sparePart.UserItemID))
                {
                    var package = UserItemPackage.Get(Uid);
                    UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(sparePart.UserItemID));

                    sparePart.UpdateNotify(obj =>
                    {
                        sparePart.SetPosition(0);
                        sparePart.UserItemID = string.Empty;
                        return true;
                    });
                    UserLogHelper.AppendSparePartLog(ContextUser.UserID, sparePart, 3);
                    if (userItem != null && userItem.ItemStatus.Equals(ItemStatus.YongBing))
                    {
                        var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(Uid, userItem.GeneralID);
                        if (userGeneral != null) userGeneral.RefreshMaxLife();
                    }
                }
            }
            else if (_ops == 3)
            {
                var sparePart = ContextUser.SparePartList.Find(m => m.UserSparepartID.Equals(_sparepartID));
                if (sparePart != null)
                {
                    var sparePartInfo = new ConfigCacheSet<SparePartInfo>().FindKey(sparePart.SparePartId) ?? new SparePartInfo();
                    ContextUser.GameCoin = MathUtils.Addition(ContextUser.GameCoin, sparePartInfo.CoinPrice);
                    ContextUser.UserExtend.UpdateNotify(obj =>
                        {
//.........这里部分代码省略.........
开发者ID:0jpq0,项目名称:Scut,代码行数:101,代码来源:Action1213.cs

示例7: TakeAction

 public override bool TakeAction()
 {
     UserItemInfo useritem = null;
     var itemPackage = UserItemPackage.Get(ContextUser.UserID);
     var package = UserEnchant.Get(ContextUser.UserID);
     if (itemPackage == null || package == null)
     {
         return false;
     }
     useritem = itemPackage.ItemPackage.Find(m => !m.IsRemove && m.UserItemID == userItemID);
     if (ops == 0)
     {
         int currNum = package.EnchantPackage.FindAll(m => string.IsNullOrEmpty(m.UserItemID)).Count;
         if (currNum >= ContextUser.UserExtend.EnchantGridNum)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St1259_EnchantGridNumFull;
             return false;
         }
         var uEnchantInfo = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID);
         if (uEnchantInfo != null && !string.IsNullOrEmpty(uEnchantInfo.UserItemID))
         {
             useritem = itemPackage.ItemPackage.Find(m => !m.IsRemove && m.UserItemID == uEnchantInfo.UserItemID);
             uEnchantInfo.Position = 0;
             uEnchantInfo.UserItemID = string.Empty;
             package.SaveEnchant(uEnchantInfo);
             if (useritem != null && useritem.ItemStatus.Equals(ItemStatus.YongBing))
             {
                 var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(Uid, useritem.GeneralID);
                 if (userGeneral != null) userGeneral.RefreshMaxLife();
             }
         }
     }
     else if (ops == 1)
     {
         if (useritem == null || useritem.Equparts != EquParts.WuQi)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St1259_UserItemNotWuQi;
             return false;
         }
         int openGridNum = EnchantHelper.EnchantOpenGridNum(useritem.ItemLv);
         if (potion > openGridNum)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St1213_GridNumNotEnough;
             return false;
         }
         var userEnchantArray = package.EnchantPackage.FindAll(m => m.UserItemID == userItemID);
         if (userEnchantArray.Count >= openGridNum)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St1213_OpenNumNotEnough;
             return false;
         }
         foreach (var info in userEnchantArray)
         {
             if (info.Position == potion)
             {
                 ErrorCode = LanguageManager.GetLang().ErrorCode;
                 ErrorInfo = LanguageManager.GetLang().St1259_EnchantOpenGridFull;
                 return false;
             }
         }
         var uEnchantInfo = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID);
         if (uEnchantInfo != null && string.IsNullOrEmpty(uEnchantInfo.UserItemID))
         {
             uEnchantInfo.Position = (short)potion;
             uEnchantInfo.UserItemID = userItemID;
             package.SaveEnchant(uEnchantInfo);
             var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(Uid, useritem.GeneralID);
             if (userGeneral != null) userGeneral.RefreshMaxLife();
         }
     }
     return true;
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:76,代码来源:Action1259.cs

示例8: ResetProperty

        private void ResetProperty()
        {
            //洗涤属性
            var sparePart = ContextUser.SparePartList.Find(m => m.UserSparepartID.Equals(_sparepartID));
            if (sparePart != null)
            {
                var sparePartInfo = new ConfigCacheSet<SparePartInfo>().FindKey(sparePart.SparePartId) ?? new SparePartInfo();
                sparePart.UpdateNotify(obj =>
                {
                    for (int i = 0; i < sparePart.Propertys.Count; i++)
                    {
                        if (!sparePart.Propertys[i].IsEnable) continue;
                        if (_partPropertys.Length > 0 && Array.Exists(_partPropertys, m => m.ToInt() - 1 == i)) continue;

                        sparePart.Propertys[i] = UserSparePart.RandomProperty(sparePartInfo, false, sparePart.Propertys);
                        var package = UserItemPackage.Get(Uid);
                        UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(sparePart.UserItemID));
                        if (userItem != null && userItem.ItemStatus.Equals(ItemStatus.YongBing))
                        {
                            var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(Uid, userItem.GeneralID);
                            if (userGeneral != null) userGeneral.RefreshMaxLife();
                        }
                    }
                    return true;
                });
                _sparePart = ContextUser.SparePartList.Find(m => m.UserSparepartID.Equals(_sparepartID));
                //ContextUser.UpdateSparePart();
            }
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:29,代码来源:Action1214.cs


注:本文中的GameDataCacheSet.RefreshMaxLife方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。