本文整理汇总了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();
}
}
}
}
示例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;
}
示例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;
}
}
}
}