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


C# GameDataCacheSet.ResetEmbatleReplace方法代码示例

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


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

示例1: DoResumeLife

 /// <summary>
 /// 恢复血量
 /// </summary>
 /// <param name="userEmbattleList"></param>
 private void DoResumeLife(CacheList<CombatEmbattle> userEmbattleList, double resumeLife)
 {
     foreach (CombatEmbattle combatEmbattle in userEmbattleList)
     {
         if (!string.IsNullOrEmpty(combatEmbattle.UserID))
         {
             var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(combatEmbattle.UserID, combatEmbattle.GeneralID);
             if (userGeneral != null && userGeneral.IsOver)
             {
                 userGeneral.LifeNum = (int)Math.Floor(combatEmbattle.LiveMaxNum * resumeLife);
                 if (userGeneral.ReplacePosition > 0)
                 {
                     userGeneral.ResetEmbatleReplace();
                 }
                 //userGeneral.Update();
             }
         }
     }
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:23,代码来源:PlotCombat.cs

示例2: Create


//.........这里部分代码省略.........
            }

            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,
                AbilityInfoList = AbilityDispose.GetTriggerAbilityList(embattle.UserID, embattle.GeneralID, ability.AbilityID),
                SelfAbilityInfoList = selfAbilityList,
                SelfEffectValue = selfEffectValue
            };

            if (_combatType == CombatType.User)
            {
                //玩家竞技都是满血
                general.LifeNum = general.LifeMaxNum;
                userGeneral.ResetEmbatleReplace();
            }

            //判断是否替补佣兵
            if (replacePotion == general.Position)
            {
                if (_combatType == CombatType.Country && general.LifeNum > 0)
                {
                    general.ReplacePosition = userGeneral.ReplacePosition;
                }
                if (general.ReplacePosition > 0)
                {
                    general.Position = general.ReplacePosition;
                }
                else
                {
                    general.IsWait = true;
                }
            }
            SetExtraProperty(general);
            AbilityAddition(selfAbilityList, general);
            KarmaAddition(embattle.UserID, general);
            SJTAddition(embattle, general);
            
            return general;
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:101,代码来源:UserEmbattleQueue.cs

示例3: EmbattlePostion

 /// <summary>
 /// 佣兵位置还原
 /// </summary>
 /// <param name="userID"></param>
 /// <returns></returns>
 public static void EmbattlePostion(string userID)
 {
     var magicList = new GameDataCacheSet<UserMagic>().FindAll(userID, m => m.MagicType == MagicType.MoFaZhen && m.IsEnabled);
     if (magicList.Count > 0)
     {
         var embattleList = new GameDataCacheSet<UserEmbattle>().FindAll(userID, m => m.MagicID == magicList[0].MagicID);
         foreach (UserEmbattle embattle in embattleList)
         {
             var userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(userID, embattle.GeneralID);
             if (userGeneral != null)
             {
                 userGeneral.ResetEmbatleReplace();
                 userGeneral.LifeNum = userGeneral.LifeMaxNum;
             }
         }
     }
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:22,代码来源:CombatHelper.cs


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