少年修仙传客户端代码仓库
client_Zxw
2019-01-04 d3d0662762f352caae67198e5e2a1e4e5d856b5c
System/Mount/PlayerMountDatas.cs
@@ -332,22 +332,23 @@
        }
        int GetMinLV = 100;
        int GetMountID = 0;
        for (int j = 0; j < SortMount.Count; j++)//选取出可升级坐骑等级最低且有未激活技能的坐骑
        List<int> IntListSkill = new List<int>();
        for (int j = 0; j < SortMount.Count; j++)//选取出可升级坐骑等级最低且有未激活技能的坐骑切经验最少
        {
            int Id = SortMount[j].HorseID;
            int GetHorseMaxLv = GetMountSkillMaxLV(Id);
            if (IntList.Contains(Id) && _DicHorse.ContainsKey(Id))
            {
                if (_DicHorse[Id].Lv < GetMinLV && _DicHorse[Id].Lv< GetHorseMaxLv)
                if (_DicHorse[Id].Lv < GetHorseMaxLv)
                {
                    GetMinLV = _DicHorse[Id].Lv;
                    GetMountID = Id;
                    IntListSkill.Add(Id);
                }
            }
        }
        if (GetMountID != 0 && ASingleFeedRedPoint.ContainsKey(GetMountID))
        int SkillHorseId = GetRedPointMountID(IntListSkill);
        if (SkillHorseId != 0 && ASingleFeedRedPoint.ContainsKey(SkillHorseId))
        {
            ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
            ASingleFeedRedPoint[SkillHorseId].state = RedPointState.Simple;
            return;
        }
@@ -372,7 +373,7 @@
    }
    public int GetMinExpMount()
    {
    {
        foreach (var key in ASingleFeedRedPoint.Keys)//当存在驯养红点时选中当有红点的那只
        {
            if (ASingleFeedRedPoint[key].state == RedPointState.Simple)
@@ -382,11 +383,25 @@
        }
        int GetMountID = 0;
        int MountLV = 999;
        List<int> IntListSkill = new List<int>();
        foreach (var key in _DicHorse.Keys)
        {
            var mountConfig = Config.Instance.Get<HorseConfig>(key);
            if (_DicHorse[key].Lv < mountConfig.MaxLV)
            {
                IntListSkill.Add(key);
            }
        }
        int SkillHorseId = GetRedPointMountID(IntListSkill);
        if (SkillHorseId != 0)
        {
            GetMountID = SkillHorseId;
            return GetMountID;
        }
        foreach (var key in _DicHorse.Keys)//无红点时跳转选中最低阶数且未满级
        {
            var mountConfig = Config.Instance.Get<HorseConfig>(key);
            if (_DicHorse[key].Lv < MountLV && _DicHorse[key].Lv< mountConfig.MaxLV)
            if (_DicHorse[key].Lv < MountLV && _DicHorse[key].Lv < mountConfig.MaxLV)
            {
                GetMountID = key;
                MountLV = _DicHorse[key].Lv;
@@ -395,6 +410,56 @@
        return GetMountID;
    }
    private int GetRedPointMountID(List<int> MountList)
    {
        int GetSkillMinLv = 999;
        for (int i = 0; i < MountList.Count; i++)
        {
            int SkillminLv = GetSkillLvDis(MountList[i]);
            if (SkillminLv < GetSkillMinLv)
            {
                GetSkillMinLv = SkillminLv;
            }
        }
        int mountId = 0;
        int ExpNumber = 999999999;
        for (int i = 0; i < MountList.Count; i++)
        {
            int SkillLv = GetSkillLvDis(MountList[i]);
            if (SkillLv > GetSkillMinLv)
            {
                continue;
            }
            var Hor1 = HorseUpConfig.GetHorseIDAndLV(MountList[i], SkillLv);
            var Hor2 = HorseUpConfig.GetHorseIDAndLV(MountList[i],_DicHorse[(MountList[i])].Lv);
            int Exp = Hor1.NeedExpTotal - Hor2.NeedExpTotal - _DicHorse[(MountList[i])].Exp;
            if (Exp < ExpNumber)
            {
                ExpNumber = Exp;
                mountId = MountList[i];
            }
        }
        return mountId;
    }
    private int GetSkillLvDis(int MountId)//获取离升级最近的技能等级
    {
        int SkillLv = 0;
        foreach (var key in GetMountSkillAndItem.Keys)
        {
            if (_DicHorse.ContainsKey(MountId) && GetMountSkillAndItem[key].HorseID == MountId)
            {
                if (GetMountSkillAndItem[key].HorseLV > _DicHorse[MountId].Lv)
                {
                    SkillLv = GetMountSkillAndItem[key].HorseLV;
                    return SkillLv;
                }
            }
        }
        return SkillLv;
    }
    public int GetMountSkillMaxLV(int MountId)//获取坐骑最大技能等级
    {
        int SkillLv = 0;