/// <summary> /// 技能升级是否满足条件 /// </summary> /// <param name="user"></param> /// <param name="skillLvInfo"></param> /// <returns></returns> public static bool IsMeetUpSkillLv(GameUser user, SkillLvInfo skillLvInfo) { int upItemNum = GetUserItemNum(user.UserID, skillLvInfo.ItemID); if (skillLvInfo != null && user.GameCoin >= skillLvInfo.GameCoin && user.ObtainNum >= skillLvInfo.ObtainNum && upItemNum >= skillLvInfo.ItemNum) { return(true); } return(false); }
/// <summary> /// 破盾 /// </summary> /// <param name="general"></param> /// <param name="abilityType"></param> /// <returns></returns> public static bool AttackPoDun(CombatGeneral general, AbilityType abilityType) { SkillLvInfo skillLvInfo = CreateSkillLvInfo(general).Find(m => m.EffType == abilityType); if (skillLvInfo != null && RandomUtils.IsHit(skillLvInfo.Probability)) { return(true); } return(false); }
/// <summary> /// 血量低于特定值时加成 /// </summary> /// <param name="abilityType"></param> /// <returns></returns> private static decimal LifeLowerTnumEffNum(CombatGeneral general, AbilityType abilityType) { SkillLvInfo skillLvInfo = CreateSkillLvInfo(general).Find(m => m.EffType == abilityType); if (skillLvInfo != null) { if (skillLvInfo.Tnum > 1 && general.LifeNum <= skillLvInfo.Tnum && RandomUtils.IsHit(skillLvInfo.Probability)) { return(skillLvInfo.EffNum); } else if (skillLvInfo.Tnum < 1) { decimal tnum = skillLvInfo.Tnum * general.LifeMaxNum; if (tnum >= general.LifeNum && RandomUtils.IsHit(skillLvInfo.Probability)) { return(skillLvInfo.EffNum); } } } return(0); }