少年修仙传客户端代码仓库
client_linchunjie
2018-09-25 78bfe524ea4776c47f6314e56e97f39970b00fce
System/Strengthening/GodBeastModel.cs
@@ -16,14 +16,20 @@
    public Dictionary<int, int> Absorption_Dic = new Dictionary<int, int>();//获取选择的物品
    public event Action AbsorbEvent;
    public int ItemInde = 0;//物品下标
    public ItemModel Crystal_ItemModel;
    public ItemModel Crystal_ItemModel;//当前所选中的水晶物品
    public int ItemPlace = -1;//神兽装备位置信息
    public  Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
    DogzModel Dogz_model;
    DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
    PlayerPackModel _playerPack;
    PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
    public override void Init()
    {
        if (QualityLimit.Count <= 0)
        {
            string DogzAssist = Config.Instance.Get<FuncConfigConfig>("DogzAssist").Numerical4;//获取不同品质的神兽强化上限
            QualityLimit = ConfigParse.GetDic<int, int>(DogzAssist);
        }
    }
    public void OnBeforePlayerDataInitialize()
@@ -117,7 +123,72 @@
        return SiteEnhancementAttributeDic;
    }
    public int DogZBagIndex = 0;
    public bool IsFullLevel()//是都满级能够继续吸收
    {
        bool IsBool = false;
        int DogZLV = 0;//获取当前神兽等级
        int DogProficiency = 0;//当前神兽的熟练度
        int SingleProficiency = 0;//单倍熟练度
        int DoubleProficiency = 0;//双倍熟练度
        ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, DogZBagIndex);
        if (itemModel == null)
        {
            return false;
        }
        int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
        var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
        var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
        if (IudetDogzEquipPlus != null)
        {
            DogZLV = IudetDogzEquipPlus[0];
            DogProficiency = IudetDogzEquipPlus[1];
        }
        foreach (var key in Absorption_Dic.Keys)
        {
            ItemModel item_Model = playerPack.GetItemModelByIndex(PackType.rptDogzItem, key);
            if (item_Model != null)
            {
                if (item_Model.chinItemModel.Effect1 == 235)
                {
                    var _IudetDogzEquipPlus = item_Model.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
                    SingleProficiency += item_Model.chinItemModel.EffectValueA1 * Absorption_Dic[key];
                    if (_IudetDogzEquipPlus != null)
                    {
                        SingleProficiency += _IudetDogzEquipPlus[1];
                        DoubleProficiency += item_Model.chinItemModel.EffectValueA1;
                    }
                    else
                    {
                        DoubleProficiency += item_Model.chinItemModel.EffectValueA1 * 2 * Absorption_Dic[key];
                    }
                }
            }
        }
        if (true)
        {
            if (DogProficiency + DoubleProficiency >= DogzEquipMaxConfig.upExpTotal)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            if (DogProficiency + SingleProficiency >= DogzEquipMaxConfig.upExpTotal)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}