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


C# ConfigCacheSet.FindKey方法代码示例

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


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

示例1: AddBack

        /// <summary>
        /// 初始化背包
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static void AddBack(GameUser user)
        {
            var cacheSet = new GameDataCacheSet<UserPack>();
            var cacheSetBackPack = new ConfigCacheSet<BackpackConfigInfo>();
            var userPack = cacheSet.FindKey(user.UserID);

            if (userPack == null)
            {
                userPack = new UserPack();

                userPack.UserID = user.UserID.ToInt();
                userPack.CreateDate = DateTime.Now;
                var backpackConfig = cacheSetBackPack.FindKey(BackpackType.ZhuangBei);
                if (backpackConfig != null)
                {
                    var packType = new PackType();
                    packType.BackpackType = BackpackType.ZhuangBei;
                    packType.OpenNum = 0;
                    packType.Position = backpackConfig.DefaultNum;
                }

                backpackConfig = cacheSetBackPack.FindKey(BackpackType.YongBing);
                if (backpackConfig != null)
                {
                    var packType = new PackType();
                    packType.BackpackType = BackpackType.YongBing;
                    packType.OpenNum = 0;
                    packType.Position = backpackConfig.DefaultNum;
                }

                backpackConfig = cacheSetBackPack.FindKey(BackpackType.HunJi);
                if (backpackConfig != null)
                {
                    var packType = new PackType();
                    packType.BackpackType = BackpackType.HunJi;
                    packType.OpenNum = 0;
                    packType.Position = backpackConfig.DefaultNum;
                }

                backpackConfig = cacheSetBackPack.FindKey(BackpackType.BeiBao);
                if (backpackConfig != null)
                {
                    var packType = new PackType();
                    packType.BackpackType = BackpackType.BeiBao;
                    packType.OpenNum = 0;
                    packType.Position = backpackConfig.DefaultNum;
                    user.GridNum = MathUtils.Addition(user.GridNum, backpackConfig.DefaultNum);
                }
            }

        }
开发者ID:jinfei426,项目名称:Scut,代码行数:56,代码来源:BackPackHelper.cs

示例2: CreateSkillLvInfo

 public static List<SkillLvInfo> CreateSkillLvInfo(CombatGeneral general)
 {
     List<SkillLvInfo> _skillLvList = new List<SkillLvInfo>();
     if (general.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
     {
         var abilityCacheSet = new ConfigCacheSet<AbilityInfo>();
         var skillLvSet = new ConfigCacheSet<SkillLvInfo>();
         UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(general.UserID, TrumpInfo.CurrTrumpID) ?? new UserTrump();
         if (userTrump.LiftNum > 0)
         {
             userTrump.SkillInfo.Foreach(obj =>
             {
                 var abilityInfo = abilityCacheSet.FindKey(obj.AbilityID) ?? new AbilityInfo();
                 if (abilityInfo.AttackType == AttackType.Trigger)
                 {
                     var temp = skillLvSet.FindKey(obj.AbilityID, obj.AbilityLv);
                     if (temp != null)
                     {
                         _skillLvList.Add(temp);
                     }
                 }
                 return true;
             });
         }
     }
     return _skillLvList;
 }
开发者ID:kehaoran74,项目名称:Scut,代码行数:27,代码来源:TrumpAbilityAttack.cs

示例3: ShowLairReward

        public static ItemBaseInfo ShowLairReward(LairTreasure lairTreasure, GameUser gameUser, LairTreasureType lairTreasureType)    //��ʾ��õ���Ʒ
        {
            var cacheSetItem = new ConfigCacheSet<ItemBaseInfo>();
            ItemBaseInfo itemBaseInfo = null;
            var lairRewardList = new ConfigCacheSet<LairRewardInfo>().FindAll(s => s.LairPosition == lairTreasure.LairPosition && s.LairTreasureType == lairTreasureType.ToInt());
            if (lairRewardList.Count >0)
            {
                var lairRewardInfo = lairRewardList[RandomUtils.GetRandom(0, lairRewardList.Count)];
                itemBaseInfo = cacheSetItem.FindKey(lairRewardInfo.ItemID);
                if (itemBaseInfo != null)
                {
                    UserItemHelper.AddUserItem(gameUser.UserID, lairRewardInfo.ItemID, lairTreasure.Num);
                }
            }

            return itemBaseInfo;
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:17,代码来源:LairTreasuerHelp.cs

示例4: GetAbilityEffect

 /// <summary>
 /// 获取技能等级加成
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="generalId"></param>
 /// <param name="abilityId"></param>
 /// <returns></returns>
 public static decimal GetAbilityEffect(string userId, int generalId, int abilityId)
 {
     var userAbility = _cacheSetUserAbility.FindKey(userId);
     decimal effectValue = 0;
     if (userAbility != null && userAbility.AbilityList != null)
     {
         var ability2 =
             userAbility.AbilityList.Find(
                 s => s.AbilityID == abilityId && s.GeneralID == generalId);
         if (ability2 != null)
         {
             var cacheSetAbilityLv = new ConfigCacheSet<AbilityLvInfo>();
             var abilityLv = cacheSetAbilityLv.FindKey(ability2.AbilityID, ability2.AbilityLv);
             if (abilityLv != null)
             {
                 effectValue = abilityLv.EffectValue;
             }
         }
     }
     return effectValue;
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:28,代码来源:AbilityDispose.cs

示例5: KarmaAddition

        /// <summary>
        /// 缘分加成
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="general"></param>
        public static void KarmaAddition(string userId, CombatGeneral general)
        {
            var cacheSetKarma = new ConfigCacheSet<KarmaInfo>();
            var karmaInfo = cacheSetKarma.FindKey(general.GeneralID);
            if (karmaInfo != null && karmaInfo.KarmaList != null && karmaInfo.KarmaList.Count > 0)
            {
                var karmaList = karmaInfo.KarmaList;
                foreach (var karma in karmaList)
                {
                    bool isKarma = true;
                    string[] valueIDArray = karma.ValueID.Split(',');
                    switch (karma.KarmaType)
                    {
                        case KarmaType.YongBing:
                            foreach (var id in valueIDArray)
                            {
                                if (embattleList.Find(s => s.GeneralID == id.ToInt()) == null)
                                {
                                    isKarma = false;
                                    break;
                                }
                            }
                            if (isKarma)
                            {
                                KarmaAdditionValue(karma, general);
                            }


                            break;
                        case KarmaType.ZhuangBei:
                            var cacheSetItem = new GameDataCacheSet<UserItemPackage>();
                            var userItem = cacheSetItem.FindKey(userId);
                            if (userItem != null && userItem.ItemPackage != null)
                            {

                                foreach (var id in valueIDArray)
                                {
                                    if (userItem.ItemPackage.Find(s => s.ItemID == id.ToInt() && s.GeneralID == general.GeneralID) == null)
                                    {
                                        isKarma = false;
                                        break;
                                    }
                                }
                                if (isKarma)
                                {
                                    KarmaAdditionValue(karma, general);
                                }

                            }
                            break;
                        case KarmaType.JiNen:
                            var cacheSetAbility = new GameDataCacheSet<UserAbility>();
                            var ability = cacheSetAbility.FindKey(userId);
                            if (ability != null && ability.AbilityList != null)
                            {

                                var abilityList = ability.AbilityList;

                                foreach (var id in valueIDArray)
                                {
                                    if (abilityList.Find(s => s.AbilityID == id.ToInt() && s.GeneralID == general.GeneralID) == null)
                                    {
                                        isKarma = false;
                                        break;
                                    }
                                }
                                if (isKarma)
                                {
                                    KarmaAdditionValue(karma, general);
                                }
                            }
                            break;
                        case KarmaType.ShuiJing:
                            var cacheSetCrystal = new GameDataCacheSet<UserCrystalPackage>();
                            var userCrystal = cacheSetCrystal.FindKey(userId);

                            if (userCrystal != null && userCrystal.CrystalPackage != null)
                            {

                                var crystalList = userCrystal.CrystalPackage;

                                foreach (var id in valueIDArray)
                                {
                                    if (crystalList.Find(s => s.CrystalID == id.ToInt() && s.GeneralID == general.GeneralID) == null)
                                    {
                                        isKarma = false;
                                        break;
                                    }
                                }
                                if (isKarma)
                                {
                                    KarmaAdditionValue(karma, general);
                                }
                            }
                            break;
//.........这里部分代码省略.........
开发者ID:jinfei426,项目名称:Scut,代码行数:101,代码来源:UserEmbattleQueue.cs

示例6: GetDailyItem

        /// <summary>
        /// ����ճ�������Ʒ����
        /// </summary>
        /// <param name="userLv"></param>
        /// <returns></returns>
        public UserItemInfo GetDailyItem(short userLv)
        {
            UserItemInfo userItem = null;
            int index = (int)TaskStar - 1;
            var cacheSet = new ConfigCacheSet<DailyTaskInfo>();
            DailyTaskInfo dtaskInfo = cacheSet.FindKey(TaskID);
            string[] NumRank = dtaskInfo.QishiNumRank.ToNotNullString().Split(new char[] { ',' });
            int num = NumRank.Length > index && index >= 0 ? NumRank[index].ToInt() : 0;
            if (num <= 0)
            {
                return userItem;
            }

            string[] QishiRank = dtaskInfo.QishiRank.ToNotNullString().Split(new char[] { ',' });
            string[] UserLvRank = dtaskInfo.UserLvRank.ToNotNullString().Split(new char[] { ',' });
            if (QishiRank.Length > 0 && QishiRank.Length == UserLvRank.Length)
            {
                int itemIndex = GetItemIndex(UserLvRank, userLv);
                int itemID = QishiRank.Length > itemIndex ? QishiRank[itemIndex].ToInt() : 0;
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(itemID);
                if (itemInfo != null)
                {
                    userItem = new UserItemInfo();
                    userItem.ItemID = itemInfo.ItemID;
                    userItem.Num = num;
                }
            }
            return userItem;
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:34,代码来源:UserTask.cs

示例7: GetDailyExpNum

 /// <summary>
 /// ����ճ�������������
 /// ��ʽ���Ǽ� * ��ɫ�ȼ� * ϵ��
 /// </summary>
 /// <returns></returns>
 public int GetDailyExpNum(short userLv)
 {
     var cacheSet = new ConfigCacheSet<DailyTaskInfo>();
     int num = (int)Math.Floor((short)TaskStar * userLv * cacheSet.FindKey(TaskID).ExpRatioNum);
     return num.IsValid(0, int.MaxValue) ? num : 0;
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:11,代码来源:UserTask.cs

示例8: TakeAction

        public override bool TakeAction()
        {
            Int16 potenceNum = 0;
            Int16 thoughtNum = 0;
            Int16 intelligenceNum = 0;
            var cacheSetUserGeneral = new GameDataCacheSet<UserGeneral>();
            var cacheSetUserItem = new GameDataCacheSet<UserItemPackage>();
            var cacheSetBringUp = new ConfigCacheSet<BringUpInfo>();
            if (_ops == 1)
            {
                var attributeSetArray = ConfigEnvSet.GetString("UserBringUp.Set").Split(',');
                short multiple = attributeSetArray[_multipleType.ToShort() - 1].ToShort();
                var bringUpInfo = cacheSetBringUp.FindKey(_bringUpType.ToInt());
                var userItem = cacheSetUserItem.FindKey(UserId.ToString());
                var item = userItem != null && userItem.ItemPackage != null
                               ? userItem.ItemPackage.Find(s => s.ItemID == ConfigEnvSet.GetInt("User.DrugItemID"))
                               : null;
                var userGeneral = cacheSetUserGeneral.FindKey(UserId.ToString(), _generalId);
                if (_bringUpType == BringUpType.BaiJinPeiYang && ContextUser.VipLv < 3)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1217_NotBaiJin;
                    return false;
                }
                if (_bringUpType == BringUpType.ZhiZunPeiYang && ContextUser.VipLv < 5)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1217_NotZhiZhun;
                    return false;
                }
                if (userGeneral == null || bringUpInfo == null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().LoadDataError;
                    return false;
                }
                if (userGeneral.Potential <= 0)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1217_NotPotential;
                    return false;
                }

                if (bringUpInfo.UseUpType == 2 && ContextUser.GoldNum < (bringUpInfo.UseUpNum * multiple))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
                    return false;
                }
                if (bringUpInfo.UseUpType == 1 && (item == null || item.Num < (bringUpInfo.UseUpNum * multiple)))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1217_NotItem;
                    return false;
                }
                var attributeChancePren = new int[3];
                var attributeChance = bringUpInfo.AttributeChance;
                attributeChancePren[0] = attributeChance.PotenceNum * 10;
                attributeChancePren[1] = attributeChance.ThoughtNum * 10;
                attributeChancePren[2] = attributeChance.IntelligenceNum * 10;
                GetGeneralAttribute(attributeChancePren);

                foreach (var attributeIndex in _attributeIndexD)
                {
                    switch (attributeIndex.Value)
                    {
                        //力量
                        case 0:
                            var potenceValueArray = bringUpInfo.AttributeValueChance.PotenceValue.Split(',');
                            var potenceNumArray = bringUpInfo.AttributeValueChance.PotenceNum.Split(',');
                            potenceNum = GetAttributeValue(potenceValueArray, potenceNumArray);
                            potenceNum = (potenceNum * multiple).ToShort();

                            break;
                        //魂力
                        case 1:
                            var thoughtValueArray = bringUpInfo.AttributeValueChance.ThoughtValue.Split(',');
                            var thoughtNumArray = bringUpInfo.AttributeValueChance.ThoughtNum.Split(',');
                            thoughtNum = GetAttributeValue(thoughtValueArray, thoughtNumArray);
                            thoughtNum = (thoughtNum * multiple).ToShort();
                            break;
                        //智力
                        case 2:
                            var intelligenceValueArray = bringUpInfo.AttributeValueChance.IntelligenceValue.Split(',');
                            var intelligenceNumArray = bringUpInfo.AttributeValueChance.IntelligenceNum.Split(',');
                            intelligenceNum = GetAttributeValue(intelligenceValueArray, intelligenceNumArray);
                            intelligenceNum = (intelligenceNum * multiple).ToShort();
                            break;
                    }
                }
                userGeneral.PotenceNum = potenceNum;
                userGeneral.ThoughtNum = thoughtNum;
                userGeneral.IntelligenceNum = intelligenceNum;
                _potenceNum = userGeneral.PowerNum + potenceNum;
                _thoughtNum = userGeneral.SoulNum + thoughtNum;
                _intelligenceNum = userGeneral.IntellectNum + intelligenceNum;
                if (userGeneral.Potential <= 0 || userGeneral.Potential < (userGeneral.PotenceNum + userGeneral.ThoughtNum + userGeneral.IntelligenceNum))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St1217_NotPotential;
//.........这里部分代码省略.........
开发者ID:0jpq0,项目名称:Scut,代码行数:101,代码来源:Action1217.cs

示例9: GetMaxLife

        private int GetMaxLife()
        {
            int genLv = 0;
            int currMaxLv = 0;
            GameUser userinfo = new GameDataCacheSet<GameUser>().FindKey(UserID);
            if (userinfo != null)
            {
                currMaxLv = userinfo.UserLv;
            }
            if (currMaxLv > 0 && GeneralLv > currMaxLv)
            {
                genLv = userinfo.UserLv;
            }
            else
            {
                genLv = GeneralLv;
            }
            //��ʼ����+(�ȼ�-1)*ְҵ�ӳ� + װ������+����ˮ������+ħ����������+������+��ħ����
            int lifeNum = 0;
            CareerInfo careerInfo = new ConfigCacheSet<CareerInfo>().FindKey(CareerID);
            if (careerInfo == null)
            {
                return lifeNum;
            }
            var tempLv = MathUtils.Subtraction(genLv, 1, 0);
            if (IsUserGeneral)
            {
                lifeNum = MathUtils.Addition(careerInfo.LifeNum, careerInfo.LifeIncreaseNum * tempLv, int.MaxValue);
            }
            else
            {
                GeneralInfo generalInfo = new ConfigCacheSet<GeneralInfo>().FindKey(GeneralID);
                if (generalInfo != null)
                {
                    lifeNum = MathUtils.Addition(generalInfo.LifeNum, careerInfo.LifeIncreaseNum * tempLv, int.MaxValue);
                }
            }
            //����ˮ������
            var packageCrystal = UserCrystalPackage.Get(UserID);
            if (packageCrystal != null && packageCrystal.CrystalPackage != null)
            {
                UserCrystalInfo[] crystalList = packageCrystal.CrystalPackage.FindAll(m => m.GeneralID.Equals(GeneralID)).ToArray();
                foreach (UserCrystalInfo item in crystalList)
                {
                    short upLv = 0;
                    if (item.CrystalLv < 10)
                    {
                        upLv = item.CrystalLv; //item.CrystalLv.Addition(1, short.MaxValue);
                    }
                    else
                    {
                        upLv = 10;
                    }
                    //AbilityType abilityType = new ConfigCacheSet<CrystalInfo>().FindKey(item.CrystalID).AbilityID;
                    var cacheSetCrystal = new ConfigCacheSet<CrystalInfo>();
                    var crystalInfo = cacheSetCrystal.FindKey(item.CrystalID);
                    AbilityType abilityType = crystalInfo != null ? crystalInfo.AbilityID : AbilityType.AttackLife;
                    decimal effectNum = 0;
                    CrystalLvInfo lvInfo = new ConfigCacheSet<CrystalLvInfo>().FindKey(item.CrystalID, upLv);
                    if (lvInfo != null)
                    {
                        effectNum = lvInfo.AbilityNum;
                    }
                    if (abilityType == AbilityType.ShengMing)
                    {
                        lifeNum = MathUtils.Addition(lifeNum, effectNum.ToInt(), int.MaxValue);
                    }
                }
            }
            //װ������
            var package = UserItemPackage.Get(UserID);
            if (package != null && package.ItemPackage != null)
            {
                var equList = package.ItemPackage.FindAll(m => !m.IsRemove && m.GeneralID.Equals(GeneralID) && m.ItemStatus.Equals(ItemStatus.YongBing));
                foreach (var item in equList)
                {
                    ItemEquAttrInfo equAttr = new ConfigCacheSet<ItemEquAttrInfo>().FindKey(item.ItemID, AbilityType.ShengMing);
                    if (equAttr != null)
                    {
                        lifeNum = MathUtils.Addition(lifeNum, equAttr.GetEffectNum(item.ItemLv), int.MaxValue);
                    }
                    //���������
                    var user = new GameDataCacheSet<GameUser>().FindKey(UserID);
                    if (user != null && user.SparePartList != null && user.SparePartList.Count > 0)
                    {
                        var sparepartList = user.SparePartList.FindAll(m => string.Equals(m.UserItemID, item.UserItemID));
                        foreach (var sparepart in sparepartList)
                        {
                            foreach (var property in sparepart.Propertys)
                            {
                                if (property.AbilityType == AbilityType.ShengMing)
                                {
                                    lifeNum = MathUtils.Addition(lifeNum, property.Num.ToInt());
                                }
                            }
                        }
                    }
                }
            }
            //ħ������������������
//.........这里部分代码省略.........
开发者ID:rongxiong,项目名称:Scut,代码行数:101,代码来源:UserGeneral.cs

示例10: TakeAction

        public override bool TakeAction()
        {
            var cacheEnvSet = new ConfigCacheSet<ConfigEnvSet>();
            var envset = cacheEnvSet.FindKey("CombatMaxBout");
            if (envset != null)
            {

            }
            PlotNPCInfo npcInfo = new ConfigCacheSet<PlotNPCInfo>().FindKey(PlotNpcID);
            if (npcInfo == null)
            {
                return false;
            }
            PlotInfo plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(npcInfo.PlotID);
            if (plotInfo == null)
            {
                return false;
            }
            //判断是否有下一关
            int nextLayerNum = MathUtils.Addition(ContextUser.UserExtend.LayerNum, 1);
            int nextHurdleNum = MathUtils.Addition(ContextUser.UserExtend.HurdleNum, 1);
            if ((UserHelper.IsLastLayer(plotInfo) || !IsGotoNextLayer(nextLayerNum)))
            {
                if (UserHelper.IsKill(ContextUser, npcInfo.PlotID))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St4303_PlotNotEnableLayerNum;
                    return false;
                }
            }

            if (ops != 1 && UserHelper.IsPromptBlood(ContextUser.UserID))
            {
                ErrorCode = 1;
                ErrorInfo = LanguageManager.GetLang().St4002_PromptBlood;
                return false;
            }
            //原因:灵件背包满时未提示
            if (ops != 1 && UserHelper.IsSpareGridNum(ContextUser, 0))
            {
                ErrorCode = 1;
                ErrorInfo = LanguageManager.GetLang().St_User_SpareBeiBaoMsg;
                return false;
            }

            if (ops != 1 && !string.IsNullOrEmpty(plotInfo.EnchantID) && plotInfo.EnchantProbability > 0 && EnchantHelper.IsEnchantPackage(ContextUser.UserID))
            {
                ErrorCode = 1;
                ErrorInfo = LanguageManager.GetLang().St4002_EnchantPackageFull;
                return false;
            }

            if (ContextUser.UserStatus == UserStatus.SaoDang)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4007_Saodanging;
                return false;
            }
            if (ContextUser.UseMagicID == 0)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4004_NoUseMagic;
                return false;
            }
            if (new GameDataCacheSet<UserEmbattle>().FindAll(Uid, m => m.MagicID == ContextUser.UseMagicID).Count == 0)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4004_EmbattleEmpty;
                return false;
            }
            //PlotNPCInfo npcInfo = new ConfigCacheSet<PlotNPCInfo>().FindKey(PlotNpcID);
            if (IsPlotOut(npcInfo))
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4303_PlotNotEnable;
                return false;
            }

            UserHelper.UserGeneralPromptBlood(ContextUser);//佣兵自动使用绷带补血

            //触发战斗
            ISingleCombat plotCombater = CombatFactory.TriggerPlot(ContextUser, PlotNpcID);
            if (plotCombater == null)
            {
                return false;
            }
            var cacheSet = new GameDataCacheSet<UserPlotCombat>();
            userPlotCombat = cacheSet.FindKey(ContextUser.UserID, PlotNpcID);
            if (userPlotCombat == null)
            {
                userPlotCombat = new UserPlotCombat()
                {
                    UserID = ContextUser.UserID,
                    PlotNpcID = PlotNpcID
                };
                cacheSet.Add(userPlotCombat);
                userPlotCombat = cacheSet.FindKey(ContextUser.UserID, PlotNpcID);
            }
            userPlotCombat.PlotID = npcInfo.PlotID;
            userPlotCombat.CombatDate = DateTime.Now;
//.........这里部分代码省略.........
开发者ID:huyanoperation,项目名称:Scut,代码行数:101,代码来源:Action4303.cs

示例11: GetSelfAbilityEffectList

 /// <summary>
 /// 被动魂技效果
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public static List<SelfAbilityEffect> GetSelfAbilityEffectList(string userId, short role)
 {
     List<SelfAbilityEffect> selfAbilityEffectList = new List<SelfAbilityEffect>();
     var cacheSetUserAbility = new GameDataCacheSet<UserAbility>();
     var cacheSetUserEmbattle = new GameDataCacheSet<UserEmbattle>();
     var cacheSetAbilityInfo = new ConfigCacheSet<AbilityInfo>();
     var userAbility = cacheSetUserAbility.FindKey(userId);
     var userMagic = new GameDataCacheSet<UserMagic>().Find(userId, s => s.IsEnabled);
     if (userAbility != null && userAbility.AbilityList != null)
     {
         var userEmbattleList = cacheSetUserEmbattle.FindAll(userId, s => s.MagicID == userMagic.MagicID);
         userEmbattleList.ForEach(obj =>
         {
             if (obj.GeneralID > 0)
             {
                 var abilityList =
                     userAbility.AbilityList.FindAll(s => s.GeneralID == obj.GeneralID);
                 abilityList.ForEach(ability =>
                 {
                     var abilityInfo = cacheSetAbilityInfo.FindKey(ability.AbilityID);
                     if (abilityInfo != null && abilityInfo.IsActive == 1)
                     {
                         SelfAbilityEffect selfAbilityEffect = new SelfAbilityEffect();
                         selfAbilityEffect.GeneralID = obj.GeneralID;
                         selfAbilityEffect.EffectID1 = abilityInfo.EffectID1;
                         selfAbilityEffect.FntHeadID = abilityInfo.FntHeadID;
                         selfAbilityEffect.IsIncrease = abilityInfo.IsIncrease;
                         selfAbilityEffect.Position = obj.Position;
                         selfAbilityEffect.Role = role;
                         selfAbilityEffectList.Add(selfAbilityEffect);
                     }
                 });
             }
         });
     }
     return selfAbilityEffectList;
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:42,代码来源:UserAbilityHelper.cs

示例12: DoRefresh

        /// <summary>
        /// ˢ����ȴʱ��
        /// </summary>
        /// <returns>����ʣ����ȴʱ��</returns>
        public int DoRefresh()
        {
            int coldTime = 0;
            var cache = new ConfigCacheSet<ItemBaseInfo>();
            ItemBaseInfo itemInfo = cache.FindKey(ItemID);
            if (itemInfo != null && (itemInfo.PropType == 3 || itemInfo.PropType == 9))
            {
                TimeSpan ts = DateTime.Now - ChangeTime;

                coldTime = MathUtils.Subtraction(itemInfo.EffectNum, (int)Math.Floor(ts.TotalSeconds), 0);
                coldTime = MathUtils.Addition(coldTime, 0, itemInfo.EffectNum);
            }
            return coldTime;
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:18,代码来源:UserProps.cs

示例13: BuildPacket

        public override void BuildPacket()
        {
            var cacheSetItem = new ConfigCacheSet<ItemBaseInfo>();
            PushIntoStack(_cityInfoList.Count);
            foreach (var city in _cityInfoList)
            {

                List<PlotInfo> plotList = _cacheSetPlot.FindAll(s => s.CityID == city.CityID && s.PlotType == plotType);

                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(plotList.Count);
                foreach (PlotInfo item in plotList)
                {
                    UserPlotInfo userPlot = UserPlotHelper.GetUserPlotInfo(ContextUser.UserID, item.PlotID);
                    int isKill = PlotHelper.IsKill(ContextUser.UserID, item.PlotID, cityID) ? 1 : 0;
                    DataStruct dsItemPlot = new DataStruct();
                    dsItemPlot.PushIntoStack(item.PlotID);
                    dsItemPlot.PushIntoStack(item.PlotSeqNo.ToShort());
                    dsItemPlot.PushIntoStack(item.PlotName.ToNotNullString());
                    dsItemPlot.PushIntoStack(item.BossHeadID.ToNotNullString());
                    dsItemPlot.PushIntoStack(GetPlotStatus(userPlot, plotType));
                    dsItemPlot.PushIntoStack(userPlot == null ? 1 : (int)userPlot.StarScore);
                    dsItemPlot.PushIntoStack(isKill);
                    dsItemPlot.PushIntoStack(item.HonourNum);
                    dsItemPlot.PushIntoStack(item.GameCoin);
                    dsItemPlot.PushIntoStack(item.PlotDesc);
                    dsItemPlot.PushIntoStack(item.PlotLv);
                    dsItemPlot.PushIntoStack(ConfigEnvSet.GetInt("Plot.BattleEnergyNum"));
                    dsItemPlot.PushIntoStack(PlotHelper.GetPlotChallengeNum(UserId.ToString(), item.PlotID));
                    dsItemPlot.PushIntoStack(item.ChallengeNum);
                    dsItemPlot.PushIntoStack(userPlot == null ? 0 : userPlot.PlotNum);
                    dsItem.PushIntoStack(dsItemPlot);
                    var itemArray = item.ItemRank.Split(',');
                    dsItemPlot.PushIntoStack(itemArray.Length);
                    foreach (var s in itemArray)
                    {
                        var sArray = s.Split('=');
                        var itemInfo = cacheSetItem.FindKey(sArray.Length > 0 ? sArray[0].ToInt() : 0);
                        DataStruct dsItemInfo = new DataStruct();
                        dsItemInfo.PushIntoStack(itemInfo != null ? itemInfo.ItemName : string.Empty);
                        dsItemInfo.PushIntoStack(sArray.Length > 1 ? sArray[1].ToInt() : 0);
                        dsItemPlot.PushIntoStack(dsItemInfo);
                    }
                }

                dsItem.PushIntoStack(city.CityID);
                dsItem.PushIntoStack(city.CityName.ToNotNullString());

                PushIntoStack(dsItem);
            }
            PushIntoStack(resetNum);
            PushIntoStack(_backpackType);
        }
开发者ID:0jpq0,项目名称:Scut,代码行数:53,代码来源:Action4001.cs

示例14: TakeAction

 public override bool TakeAction()
 {
     var cacheSetUserPack = new GameDataCacheSet<UserPack>();
     var cacheSetBackPack = new ConfigCacheSet<BackpackConfigInfo>();
     var backpackConfigInfo = cacheSetBackPack.FindKey(1);
  
     
     var userPack = cacheSetUserPack.FindKey(UserId.ToString());
     var packType = userPack != null && userPack.PackTypeList != null ? userPack.PackTypeList.Find(s => s.BackpackType.ToInt() == 1) : null;
     
     if (backpackConfigInfo == null)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
         ErrorInfo = LanguageManager.GetLang().LoadDataError;
         return false;
     }
     if (ContextUser.GoldNum < backpackConfigInfo.RequiredGoldNum)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
         ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
         return false;
     }
     if (packType != null && packType.OpenNum >= backpackConfigInfo.MaxOpenNum)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
         ErrorInfo = LanguageManager.GetLang().St1110_OverExpansion;
         return false;
     }
     if (userPack == null)
     {
         userPack = new UserPack(UserId);
         packType = new PackType();
         userPack.CreateDate = DateTime.Now;
         packType.OpenNum = 1;
         packType.BackpackType = BackpackType.HunJi;
         packType.OpenNum = MathUtils.Addition(backpackConfigInfo.DefaultNum, backpackConfigInfo.EveryAddNum);
         userPack.PackTypeList.AddChildrenListener(packType);
         cacheSetUserPack.Add(userPack, UserId);
         
         
     }
     else
     {
         if (packType == null)
         {
             packType = new PackType();
             userPack.CreateDate = DateTime.Now;
             packType.OpenNum = 1;
             packType.BackpackType = BackpackType.HunJi;
             packType.OpenNum = MathUtils.Addition(backpackConfigInfo.DefaultNum, backpackConfigInfo.EveryAddNum); cacheSetUserPack.Add(userPack, UserId);
         }
         else
         {
             userPack.UpdateNotify(obj =>
             {
                 packType.OpenNum = MathUtils.Subtraction(packType.OpenNum, 1);
                 packType.OpenNum = MathUtils.Addition(packType.OpenNum, backpackConfigInfo.EveryAddNum);
                 return true;
             });
         }
     }
     MathUtils.DiffDate(DateTime.Now.Date).TotalDays.ToInt();
     return true;
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:64,代码来源:Action10000.cs


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