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


C# ShareCacheStruct.GetEffectNum方法代码示例

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


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

示例1: GetMaxLife

        private int GetMaxLife()
        {
            int genLv = 0;
            int currMaxLv = 0;
            GameUser userinfo = new PersonalCacheStruct<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 ShareCacheStruct<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 ShareCacheStruct<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 ShareCacheStruct<CrystalInfo>().FindKey(item.CrystalID).AbilityID;
                    var cacheSetCrystal = new ShareCacheStruct<CrystalInfo>();
                    var crystalInfo = cacheSetCrystal.FindKey(item.CrystalID);
                    AbilityType abilityType = crystalInfo != null ? crystalInfo.AbilityID : AbilityType.AttackLife;
                    decimal effectNum = 0;
                    CrystalLvInfo lvInfo = new ShareCacheStruct<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 ShareCacheStruct<ItemEquAttrInfo>().FindKey(item.ItemID, AbilityType.ShengMing);
                    if (equAttr != null)
                    {
                        lifeNum = MathUtils.Addition(lifeNum, equAttr.GetEffectNum(item.ItemLv), int.MaxValue);
                    }
                    //���������
                    var user = new PersonalCacheStruct<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:daneric,项目名称:Scut-samples,代码行数:101,代码来源:UserGeneral.cs

示例2: GetEquAttrEffect

 private static int GetEquAttrEffect(UserItemInfo item, AbilityType abilityType)
 {
     ItemEquAttrInfo equAttr = new ShareCacheStruct<ItemEquAttrInfo>().FindKey(item.ItemID, abilityType);
     return (equAttr != null ? equAttr.GetEffectNum(item.ItemLv) : 0);
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:5,代码来源:UserEmbattleQueue.cs


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