Example #1
0
        public CombatAbilityAttack(CombatGeneral general)
            : base(general)
        {
            if (general.IsSelfAbility==2)
            {
                _ability = General.TriggerAbility;
                General.TempAbility = General.TriggerAbility;

            }
            else
            {
                _ability = General.Ability;
                General.TempAbility = General.Ability;
            }

            general.IsSelfAbility = 0;
        }
Example #2
0
 /// <summary>
 /// 随机一个技能
 /// </summary>
 /// <param name="userID"></param>
 /// <returns></returns>
 public static AbilityInfo GetRandomAbility(string userID)
 {
     AbilityInfo changeAbility = new AbilityInfo();
     int abilityStyle = 1;
     var abilityInfoList = new ConfigCacheSet<AbilityInfo>().FindAll(m => m.AbilityStyle == abilityStyle);
     if (abilityInfoList.Count > 0)
     {
         UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(userID, TrumpInfo.CurrTrumpID);
         if (userTrump != null && userTrump.SkillInfo.Count > 0)
         {
             foreach (SkillInfo info in userTrump.SkillInfo)
             {
                 AbilityInfo abilityInfo = new ConfigCacheSet<AbilityInfo>().FindKey(info.AbilityID);
                 if (abilityInfo != null)
                 {
                     abilityInfoList.Remove(abilityInfo);
                 }
             }
         }
         int randomNum = RandomUtils.GetRandom(0, abilityInfoList.Count);
         changeAbility = abilityInfoList[randomNum];
     }
     return changeAbility;
 }