少年修仙传客户端代码仓库
client_Zxw
2018-09-10 d0d3863d7f55cbddaacb9d603aa16dd01f7aeb97
2614 前端 神兽开发
1个文件已修改
88 ■■■■■ 已修改文件
System/Strengthening/GodBeastModel.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Strengthening/GodBeastModel.cs
@@ -13,28 +13,30 @@
// 关于神兽强化
public class GodBeastModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
{
    public Dictionary<int, int> Absorption_Dic=new Dictionary<int, int>();//获取选择的物品
    public Dictionary<int, int> Absorption_Dic = new Dictionary<int, int>();//获取选择的物品
    public event Action AbsorbEvent;
    public int ItemInde=0;//物品下标
    public int ItemInde = 0;//物品下标
    public ItemModel Crystal_ItemModel;
    DogzModel Dogz_model;
    DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
    public override void Init()
    {
    }
    public void OnBeforePlayerDataInitialize()
    {
    }
    public void OnPlayerLoginOk()
    {
    }
    public override void UnInit()
    {
    }
    public void AbsorbEventUpdate()
@@ -44,6 +46,80 @@
            AbsorbEvent();
        }
    }
    private Dictionary<int, int> AllEnhancedPropertiesDic = new Dictionary<int, int>();//key:为属性编号,value是属性值
    public Dictionary<int, int> AllEnhancedProperties(int GodBeastNumber)//获取整只神兽强化属性
    {
        AllEnhancedPropertiesDic.Clear();
        List<ItemModel> itemModel = dogz_model.GetDogzEquips(GodBeastNumber);
        if (itemModel == null)
        {
            return AllEnhancedPropertiesDic;
        }
        for (int i = 0; i < itemModel.Count; i++)
        {
            ItemModel item = itemModel[i];
            var IudetDogzEquipPlus = item.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
            if (IudetDogzEquipPlus != null)
            {
                int lv = IudetDogzEquipPlus[0];
                if (lv > 0)
                {
                    var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(item.EquipPlace, lv);
                    int[] AttType = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attType);
                    int[] AttValue = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attValue);
                    for (int j = 0; j < AttType.Length; j++)
                    {
                        if (AllEnhancedPropertiesDic.ContainsKey(AttType[j]))
                        {
                            var value = AllEnhancedPropertiesDic[(AttType[j])];
                            AllEnhancedPropertiesDic[(AttType[j])] = value + AttValue[j];
                        }
                        else
                        {
                            AllEnhancedPropertiesDic.Add(AttType[j], AttValue[j]);
                        }
                    }
                }
            }
        }
        return AllEnhancedPropertiesDic;
    }
    private Dictionary<int, int> SiteEnhancementAttributeDic = new Dictionary<int, int>();//key:为属性编号,value是属性值
    public Dictionary<int, int> SiteEnhancementAttribute(int GodBeastNumber, int GodBeastPart)//获取某只神兽身上某个装备属性值
    {
        SiteEnhancementAttributeDic.Clear();
        List<ItemModel> itemModel = dogz_model.GetDogzEquips(GodBeastNumber);
        if (itemModel == null)
        {
            return SiteEnhancementAttributeDic;
        }
        for (int i = 0; i < itemModel.Count; i++)
        {
            ItemModel item = itemModel[i];
            var IudetDogzEquipPlus = item.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
            if (IudetDogzEquipPlus != null && item.EquipPlace == GodBeastPart && IudetDogzEquipPlus[0] > 0)
            {
                var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(item.EquipPlace, IudetDogzEquipPlus[0]);
                int[] AttType = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attType);
                int[] AttValue = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attValue);
                for (int j = 0; j < AttType.Length; j++)
                {
                    if (SiteEnhancementAttributeDic.ContainsKey(AttType[j]))
                    {
                        SiteEnhancementAttributeDic[(AttType[j])] = AttValue[j];
                    }
                    else
                    {
                        SiteEnhancementAttributeDic.Add(AttType[j], AttValue[j]);
                    }
                }
            }
        }
        return SiteEnhancementAttributeDic;
    }
}