少年修仙传客户端代码仓库
client_Zxw
2019-03-12 087495c94163920abe26a63492696d9a863e3869
3335   强化
1个文件已修改
61 ■■■■■ 已修改文件
System/EquipGem/EquipStrengthModel.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthModel.cs
@@ -17,6 +17,13 @@
    public int PackType;//强化类型
}
public class EquipTypeClass
{
    public int AttType;
    public int AttValue;
    public string StrName;
}
public class EquipStrengthModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
{
    public  Dictionary<int, EquipStrengthClass> EquipStrengthDic = new Dictionary<int, EquipStrengthClass>();//强化数据
@@ -25,6 +32,13 @@
    public event Action EquipStrengthUpdate;//强化数据刷新
    public event Action SelectEquipRefresh;//二级页签刷新
    public event Action SelectLevelRefresh;//一级页签刷新
    private bool isChangeBool = true;
    public bool IsChangeBool
    {
        get { return isChangeBool; }
        set { isChangeBool = value; }
    }
    private int selectLevel = 0;
    public int SelectLevel//装备类别
    {
@@ -145,6 +159,53 @@
        }
        return lv;
    }
    public List<EquipTypeClass> GetEquipValueList(int level, int equipPlace,int addlv=0)
    {
        List<EquipTypeClass> EquipTypeList = new List<EquipTypeClass>();
        int type = GetEquipStrengthType(equipPlace);
        int equiplv = 0;
        int equipIndex = level * 10 + equipPlace;
        if (EquipStrengthDic.ContainsKey(equipIndex))
        {
            equiplv = EquipStrengthDic[equipIndex].EquipPartStarLV;
        }
        equiplv += addlv;
        var itemPlus = ItemPlusConfig.GetTypeAndLevel(type, equiplv);
        if (itemPlus != null)
        {
            int [] attType = itemPlus.attType;
            int [] attValue = itemPlus.attValue;
            for (int i = 0; i < attType.Length; i++)
            {
                EquipTypeClass equipType = new EquipTypeClass();
                equipType.AttType = attType[i];
                equipType.AttValue = attValue[i];
                var config = PlayerPropertyConfig.Get(attType[i]);
                if (config != null)
                {
                    equipType.StrName = config.Name;
                }
                EquipTypeList.Add(equipType);
            }
        }
        return EquipTypeList;
    }
    public ItemPlusConfig GetEquipConfig(int level, int equipPlace)
    {
        ItemPlusConfig itemPlusConfig = new ItemPlusConfig();
        int type = GetEquipStrengthType(equipPlace);
        int equiplv = 0;
        int equipIndex = level * 10 + equipPlace;
        if (EquipStrengthDic.ContainsKey(equipIndex))
        {
            equiplv = EquipStrengthDic[equipIndex].EquipPartStarLV;
        }
        var itemPlus = ItemPlusConfig.GetTypeAndLevel(type, equiplv);
        return itemPlusConfig;
    }
}