少年修仙传客户端代码仓库
client_Wu Xijin
2018-12-07 a679a222c170b36608d803ef3fab3f3b294a4c55
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
3个文件已修改
240 ■■■■■ 已修改文件
System/KnapSack/Logic/PackModelInterface.cs 121 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Realm/RealmBossShow.cs 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/RoleParticulars/RoleParticularModel.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/PackModelInterface.cs
@@ -130,38 +130,24 @@
                {
                    List<int> legendIdlist = new List<int>();
                    List<int> legendValuelist = new List<int>();
                    if (itemTipsModel.legendAttrIDPreviewDict.ContainsKey(itemConfig.EquipPlace))
                    switch (itemConfig.EquipPlace)
                    {
                        foreach (var attrType in itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace].Keys)
                        {
                            switch (attrType)
                            {
                                case LegendAttrType.Pursuit:
                                    legendIdlist.AddRange(itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
                                    break;
                                case LegendAttrType.Fixed:
                                    legendIdlist.AddRange(itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
                                    break;
                            }
                        }
                    }
                    int i = 0;
                    for (i = 0; i < legendIdlist.Count; i++)
                    {
                        if (itemTipsModel.legendAttrColorValuePreviewDict.ContainsKey(legendIdlist[i]))
                        {
                            if (itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.ItemColor))
                            {
                                legendValuelist.Add(itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]][itemConfig.ItemColor]);
                            }
                        }
                        else if (itemTipsModel.legendAttrLvValuePreviewDict.ContainsKey(legendIdlist[i]))
                        {
                            if (itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.LV))
                            {
                                legendValuelist.Add(itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]][itemConfig.LV]);
                            }
                        }
                        case 11:
                            CalculateWingsLegendAttr(itemConfig,out legendIdlist, out legendValuelist);
                            break;
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 12:
                            CalculateEquipLegendAttr(itemConfig,out legendIdlist,out legendValuelist);
                            break;
                    }
                    if (legendIdlist.Count == legendValuelist.Count)
@@ -190,6 +176,79 @@
          
        }
        private void CalculateEquipLegendAttr(ItemConfig itemConfig,out List<int> legendIdlist, out List<int> legendValuelist)
        {
            legendIdlist = new List<int>();
            legendValuelist = new List<int>();
            string attrCntKey = StringUtility.Contact(itemConfig.ItemColor, itemConfig.StarLevel);
            var attrIDDict = itemTipsModel.legendAttrIDPreviewDict;
            var attrCntDict = itemTipsModel.legendAttrCntPreviewDict;
            if (attrIDDict.ContainsKey(itemConfig.EquipPlace))
            {
                var attrTypeDict = itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace];
                foreach (var attrType in attrTypeDict.Keys)
                {
                    var attrIds = attrTypeDict[attrType];
                    int attrCnt = 0;
                    if (attrCntDict.ContainsKey(attrCntKey))
                    {
                        attrCnt = attrCntDict[attrCntKey][attrType];
                    }
                    for(int i = 0; i < attrIds.Count; i++)
                    {
                        if(attrCnt > i)
                        {
                            legendIdlist.Add(attrIds[i]);
                        }
                    }
                }
            }
            for (int i = 0; i < legendIdlist.Count; i++)
            {
                if (itemTipsModel.legendAttrColorValuePreviewDict.ContainsKey(legendIdlist[i]))
                {
                    if (itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.ItemColor))
                    {
                        legendValuelist.Add(itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]][itemConfig.ItemColor]);
                    }
                }
                else if (itemTipsModel.legendAttrLvValuePreviewDict.ContainsKey(legendIdlist[i]))
                {
                    if (itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.LV))
                    {
                        legendValuelist.Add(itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]][itemConfig.LV]);
                    }
                }
            }
        }
        private void CalculateWingsLegendAttr(ItemConfig itemConfig,out List<int> legendIdlist, out List<int> legendValuelist)
        {
            legendIdlist = new List<int>();
            legendValuelist = new List<int>();
            var attrCntDict = itemTipsModel.wingsLegendAttrCntPreviewDict;
            var attrValueDict = itemTipsModel.wingsLegendAttrValuePreviewDict;
            int attrCnt = 0;
            if (attrCntDict.ContainsKey(itemConfig.LV))
            {
                attrCnt = attrCntDict[itemConfig.LV];
            }
            if (attrValueDict.ContainsKey(itemConfig.LV))
            {
                var  attrIdDict = attrValueDict[itemConfig.LV];
                foreach (var attrId in attrIdDict.Keys)
                {
                    if(legendIdlist.Count < attrCnt)
                    {
                        legendIdlist.Add(attrId);
                        legendValuelist.Add(attrIdDict[attrId][0]);
                    }
                }
            }
        }
        #region 预览定制属性逻辑处理
        public bool CheckIsCustomItem(ItemConfig itemConfig)
        {
System/Realm/RealmBossShow.cs
@@ -12,6 +12,7 @@
        [SerializeField, Header("特效位置")] Vector3 m_EffectPosition = Vector3.zero;
        GameObject clothesModel;
        GameObject secondaryModel;
        Animator clothesAnimator;
        Transform showPoint;
@@ -124,23 +125,10 @@
            var secondary = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWeapon2);
            var _secondaryId = secondary == null ? 0 : (int)secondary.itemInfo.ItemID;
            int _suitLevel = 0;
            if (clothes != null)
            {
                if (clothes.itemInfo.IsSuite == 1)
                {
                    if (clothes.GetUseDataModel(30) != null && clothes.GetUseDataModel(30)[0] != 0)
                    {
                        _suitLevel = clothes.GetUseDataModel(30)[0];
                    }
                }
            }
            #endregion
            showPoint = m_HeroStage;
            var _hero = ShowHero(_job, _clothesId, _suitLevel, _weaponId, _wingsId, _secondaryId);
            var _hero = ShowHero(_job, _clothesId, _weaponId, _wingsId, _secondaryId);
            if (_hero != null)
            {
                SitDown();
@@ -212,11 +200,37 @@
                clothesModel = null;
                clothesAnimator = null;
            }
            if (secondaryModel != null)
            {
                Destroy(secondaryModel);
                secondaryModel = null;
            }
        }
        GameObject ShowHero(int _job, int _clothes, int suitID, int _weaponId, int _wingsId, int _secondaryId)
        GameObject ShowHero(int _job, int _clothes, int _weaponId, int _wingsId, int _secondaryId)
        {
            PutOnClothes(_job, _clothes, suitID);
            PutOnClothes(_job, _clothes);
            var jobConfig = Config.Instance.Get<JobSetupConfig>(_job);
            var secondaryResId = 0;
            if (_secondaryId == 0)
            {
                if (_job == 1)
                {
                    secondaryResId = _clothes + 2900;
                }
                else
                {
                    secondaryResId = jobConfig.BaseEquip[2];
                }
            }
            else
            {
                var item = Config.Instance.Get<ItemConfig>(_secondaryId);
                secondaryResId = item == null ? jobConfig.BaseEquip[2] : item.ChangeOrd;
            }
            PutOnSecondary(_job, secondaryResId);
            return clothesModel;
        }
@@ -229,7 +243,7 @@
            }
        }
        public void PutOnClothes(int _job, int itemID, int suitID)
        public void PutOnClothes(int _job, int itemID)
        {
            var newClothes = 0;
            var config = Config.Instance.Get<JobSetupConfig>(_job);
@@ -250,12 +264,38 @@
                newClothes = config.BaseEquip[0];
            }
            LoadClothes(newClothes);
            LoadClothesEffect(_job, itemID, suitID);
            LoadClothes(newClothes, _job);
        }
        private void LoadClothes(int resID)
        private void PutOnSecondary(int _job, int secondaryResId)
        {
            if (_job == 2)
            {
                return;
            }
            if (secondaryResId != 0)
            {
                var prefab = InstanceResourcesLoader.LoadModelRes(secondaryResId);
                if (!prefab)
                {
                    var config = Config.Instance.Get<JobSetupConfig>(_job);
                    secondaryResId = config.BaseEquip[2];
                    prefab = InstanceResourcesLoader.LoadModelRes(secondaryResId);
                }
                if (prefab)
                {
                    if (secondaryModel == null)
                    {
                        secondaryModel = Instantiate(prefab, Constants.Special_Hide_Position, Quaternion.identity);
                        var parent = clothesModel.transform.GetChildTransformDeeply(GAStaticDefine.SecondaryBindBoneName[_job - 1]);
                        secondaryModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
                    }
                }
            }
        }
        private void LoadClothes(int resID,int job)
        {
            var prefab = InstanceResourcesLoader.LoadModelRes(resID,true);
            if (clothesModel == null)
@@ -268,6 +308,10 @@
            LayerUtility.SetLayer(clothesModel, LayerUtility.Player, false);
            var skinnedMeshRenderer = clothesModel.GetComponentInChildren<SkinnedMeshRenderer>(true);
            var mat = MaterialLoader.LoadClothesMaterial(resID, false, IsSuit(job, resID));
            skinnedMeshRenderer.material = mat;
            LayerUtility.SetLayer(skinnedMeshRenderer.gameObject, LayerUtility.Player, false);
            clothesModel.SetActive(true);
            clothesModel.transform.SetParentEx(showPoint, Vector3.zero, Quaternion.identity, Vector3.one);
@@ -287,12 +331,12 @@
            }
        }
        public void LoadClothesEffect(int job, int clothedID, int suitLevel)
        public bool IsSuit(int job, int clothedID)
        {
            var _equipModel = ModelCenter.Instance.GetModel<PlayerPackModel>().GetSinglePackModel(PackType.rptEquip);
            if (_equipModel == null)
            {
                return;
                return false;
            }
            int _suitCount = 0;
@@ -306,7 +350,7 @@
            if (_itemModel == null)
            {
                return;
                return false;
            }
            int _rank = _itemModel.chinItemModel.LV;
@@ -344,27 +388,7 @@
                }
            }
            PutOnEffect(clothedID, _suitCount >= 5);
        }
        public void PutOnEffect(int clothedID, bool isSuit)
        {
            if (clothesModel == null)
            {
                return;
            }
            var smRenderer = clothesModel.GetComponentInChildren<SkinnedMeshRenderer>();
            if (smRenderer == null)
            {
                return;
            }
            var newMat = MaterialLoader.LoadClothesMaterial(clothedID, true, isSuit);
            if (newMat != null)
            {
                smRenderer.material = newMat;
            }
            return _suitCount >= 5;
        }
    }
}
System/RoleParticulars/RoleParticularModel.cs
@@ -693,10 +693,9 @@
                        }
                    }
                }
                if (_suitCount == 5)
                if (_suitCount >= 5)
                {
                    int _type = 1;
                    return _type * 1000 + rolePropData.Job * 100 + _rank;
                    return _suitCount;
                }
                return 0;
            }