少年修仙传客户端代码仓库
client_linchunjie
2018-11-02 bae136ea1c672982dea5a48d46ebfe1a70b64346
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已删除
9个文件已修改
507 ■■■■ 已修改文件
Core/GameEngine/Model/Config/PetClassCostConfig.cs 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BetterItemGet/BetterEquipGetModel.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/BetterItemGetBehaviour.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/PackModelInterface.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/AutoTrainTipsPWin.cs 268 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/AutoTrainTipsPWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/PetAttributeMethods.cs 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/PetAttributeWin.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/PlayerPetDatas.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PetClassCostConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Thursday, November 01, 2018
//    [  Date ]:           Saturday, January 06, 2018
//--------------------------------------------------------
using UnityEngine;
@@ -11,12 +11,11 @@
    
    public partial class PetClassCostConfig : ConfigBase {
        public int ID { get ; private set ; }
        public int PetID { get ; private set ; }
        public int Rank { get ; private set ; }
        public int UpNeedExp { get ; private set ; }
        public int AtkAdd { get ; private set ; }
        public int NeedExpTotal { get ; private set ; }
        public int ID { get ; private set ; }
        public int PetID { get ; private set ; }
        public int Rank { get ; private set ; }
        public int UpNeedExp { get ; private set ; }
        public int AtkAdd { get ; private set ; }
        public override string getKey()
        {
@@ -26,17 +25,15 @@
        public override void Parse() {
            try
            {
                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
                PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
                Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
                UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
                AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
                NeedExpTotal=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0;
                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
                PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0;
                Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
                UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0;
                AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0;
            }
            catch (Exception ex)
            {
Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta
@@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: a58409c48a307e24eb39a8c2e933c8e8
timeCreated: 1541079969
licenseType: Free
timeCreated: 1515213576
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs
@@ -6,7 +6,6 @@
public class CA704_tagCMPetClassUP : GameNetPackBasic {
    public byte PetItemIndex;    //宠物数据背包索引
    public ushort UseItemCnt;    //消耗材料个数
    public byte IsAutoBuy;    //是否自动购买
    public CA704_tagCMPetClassUP () {
        combineCmd = (ushort)0x03FE;
@@ -16,7 +15,6 @@
    public override void WriteToBytes () {
        WriteBytes (PetItemIndex, NetDataType.BYTE);
        WriteBytes (UseItemCnt, NetDataType.WORD);
        WriteBytes (IsAutoBuy, NetDataType.BYTE);
    }
}
System/BetterItemGet/BetterEquipGetModel.cs
@@ -27,6 +27,8 @@
            modelInterface.RefreshGetBetterEquipEvent += OnGetBetterEquip;
            playerPack.RefreshPackAct += OnPackageRefresh;
            playerPack.RefreshItemCountAct += OnPackageItemRefresh;
            KnapsackTimeCDMgr.Instance.RefresCoolTimeAct += UpdateCoolTime;
            ParseConfig();
        }
        public override void UnInit()
@@ -34,6 +36,7 @@
            modelInterface.RefreshGetBetterEquipEvent -= OnGetBetterEquip;
            playerPack.RefreshPackAct -= OnPackageRefresh;
            playerPack.RefreshItemCountAct -= OnPackageItemRefresh;
            KnapsackTimeCDMgr.Instance.RefresCoolTimeAct -= UpdateCoolTime;
        }
        public void OnBeforePlayerDataInitialize()
@@ -57,6 +60,22 @@
        }
        #endregion
        private void UpdateCoolTime(string guid)
        {
            ItemModel _equip = null;
            if (TryGetBetterEquip(guid,out _equip))
            {
                var coolData = KnapsackTimeCDMgr.Instance.GetItemCoolById(guid);
                bool isCoolEnd = coolData == null || coolData.GetRemainTime() <= 0 ? true : false;
                if(isCoolEnd)
                {
                    PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn,guid);
                    ReportConfirmBetterEquip(guid);
                }
            }
        }
        public bool TryGetBetterEquip(string _guid, out ItemModel _equip)
        {
            return betterEquipModels.TryGetValue(_guid, out _equip);
@@ -147,9 +166,10 @@
                        {
                            showEquipRefreshEvent();
                        }
                        if(betterModel.chinItemModel.ItemColor < 3)
                        if(CheckIsAutoEquip(betterModel))
                        {
                            KnapsackTimeCDMgr.Instance.Register(betterModel.itemInfo.ItemGUID, betterModel.itemId, autoEquipCoolTime);
                        }
                    }
                }
@@ -162,8 +182,20 @@
                    }
                }
            }
        }
        private bool CheckIsAutoEquip(ItemModel itemModel)
        {
            if (itemModel == null) return false;
            int playerLv = PlayerDatas.Instance.baseData.LV;
            if (playerLv > autoEquipLvLimit) return false;
            if (itemModel.chinItemModel.ItemColor < 3)
            {
                return true;
            }
            return false;
        }
        IEnumerator Co_DelayRefreshBetterEquip(string _guid)
@@ -174,6 +206,11 @@
            {
                showEquipRefreshEvent();
            }
            var betterModel = playerPack.GetItemModelByGUID(_guid);
            if (CheckIsAutoEquip(betterModel))
            {
                KnapsackTimeCDMgr.Instance.Register(betterModel.itemInfo.ItemGUID, betterModel.itemId, autoEquipCoolTime);
            }
        }
        private void OnPackageRefresh(PackType _packType)
System/KnapSack/BetterItemGetBehaviour.cs
@@ -21,6 +21,8 @@
        [SerializeField] Text m_EquipName;
        [SerializeField] Button m_Close;
        [SerializeField] Text m_FunctionTitle;
        [SerializeField] GameObject coolObj;
        [SerializeField] Text coolTimeText;
        [SerializeField] Button m_Puton;
        [SerializeField] Button m_BetterEquipDetail;
        ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
@@ -32,6 +34,7 @@
            m_Close.AddListener(CloseBetterEquip);
            m_Puton.AddListener(PutOnBetterEquip);
            m_BetterEquipDetail.AddListener(ShowBetterEquipDetails);
            KnapsackTimeCDMgr.Instance.RefresCoolTimeAct += UpdateCoolTime;
        }
        private void OnDisable()
@@ -39,6 +42,27 @@
            m_Close.RemoveAllListeners();
            m_Puton.RemoveAllListeners();
            m_BetterEquipDetail.RemoveAllListeners();
            KnapsackTimeCDMgr.Instance.RefresCoolTimeAct -= UpdateCoolTime;
        }
        private void UpdateCoolTime(string guid)
        {
            if (!string.IsNullOrEmpty(model.currentEquipGuid))
            {
                ItemModel betterEquip;
                if (model.TryGetBetterEquip(model.currentEquipGuid, out betterEquip))
                {
                    var coolData = KnapsackTimeCDMgr.Instance.GetItemCoolById(model.currentEquipGuid);
                    bool isCoolEnd = coolData == null || coolData.GetRemainTime() <= 0 ? true : false;
                    coolObj.SetActive(!isCoolEnd);
                    m_FunctionTitle.gameObject.SetActive(isCoolEnd);
                    if (!isCoolEnd)
                    {
                        int remainTime = (int)coolData.GetRemainTime();
                        coolTimeText.text = StringUtility.Contact("(",remainTime,")");
                    }
                }
            }
        }
        public void ShowBetterEquip()
@@ -119,8 +143,8 @@
            m_EquipName.text = itemConfig.ItemName;
            m_EquipName.color = UIHelper.GetUIColor(itemConfig.ItemColor, true);
            m_FunctionTitle.text = Language.Get(itemConfig.ItemColor >= 3 ? "GoodEquip_See" : "GoodEquip_FitUp");
            m_EquipBehaviour.Init(betterModel, true);
            UpdateCoolTime(betterModel.itemInfo.ItemGUID);
        }
        IEnumerator Co_Delay(string _guid)
System/KnapSack/Logic/PackModelInterface.cs
@@ -45,6 +45,9 @@
        private int[] pushItemIds;
        public int[] pushBuffTypeIds;
        private List<int> equipBaseAttrlist = new List<int>();
        public int promptUseLvLimit { get; private set;}
        public int[] promptUseIdsLimit { get; private set; }
        public override void Init()
        {
            _equipGSFormula = Config.Instance.Get<FuncConfigConfig>("EquipGSFormula");
@@ -60,6 +63,10 @@
         
            _itemPush = Config.Instance.Get<FuncConfigConfig>("ItemPush");
            preciousItemType = ConfigParse.GetMultipleStr<int>(_itemPush.Numerical1);
            FuncConfigConfig noPromptUsetItem = Config.Instance.Get<FuncConfigConfig>("NoPromptUsetItem");
            promptUseLvLimit = int.Parse(noPromptUsetItem.Numerical2);
            promptUseIdsLimit = ConfigParse.GetMultipleStr<int>(noPromptUsetItem.Numerical1);
            _drugIDFunc = Config.Instance.Get<FuncConfigConfig>("LifePotionlist");
            drugIDs = ConfigParse.GetMultipleStr<int>(_drugIDFunc.Numerical1);
            _oneKeySellFunc = Config.Instance.Get<FuncConfigConfig>("OneKeySellItemType");
@@ -511,6 +518,16 @@
            }
            if(promptUseIdsLimit.Contains(itemModel.itemId))
            {
                int playerLv = PlayerDatas.Instance.baseData.LV;
                if(playerLv < promptUseLvLimit)
                {
                    isReach = false;
                    return isReach;
                }
            }
            ulong canUseCnt = 0;
            if(playerPack.IsReachUseLimit(itemModel.itemInfo.ItemGUID,out canUseCnt))
            {
System/Pet/AutoTrainTipsPWin.cs
File was deleted
System/Pet/AutoTrainTipsPWin.cs.meta
File was deleted
System/Pet/PetAttributeMethods.cs
@@ -85,10 +85,8 @@
        PetInfoConfig petInfoConfig;
        bool isAutoTrain = false;
        List<GameObject> Skillimage = new List<GameObject>();
        private bool IsZidong = false;
        private void OnEnable()
        {
            IsZidong = false;
            timePlay = 0;
            Skillimage.Clear();
            Skillimage.Add(Skillimage1);
@@ -496,13 +494,16 @@
            {
                if (petmodel._DicPetBack.ContainsKey(petInfoConfig.ID))
                {
                    petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1,0);
                    petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1);
                }
            }
            else
            {
                ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
            }
            // petTrainBtn.RemoveAllListeners();
        }
        private void ClickPetAutoTrainBtn()
@@ -510,20 +511,7 @@
            int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, petmodel.petUpgradeToolId);
            if (haveCnt < costNum)
            {
                if (!isAutoTrain)
                {
                    WindowCenter.Instance.Open<AutoTrainTipsPWin>();
                }
                else
                {
                    AutoTrainTipsPWin.IsFairy = false;
                    isAutoTrain = false;
                    IsZidong = false;
                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
                    StopCoroutine("FairyJadeD");
                }
                ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
                return;
            }
            isAutoTrain = !isAutoTrain;
@@ -560,7 +548,7 @@
                        if (petmodel.Wait)
                        {
                            petmodel.Wait = false;
                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum,0);
                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum);
                        }
                    }
                    else
@@ -568,7 +556,7 @@
                        if (petmodel.Wait)
                        {
                            petmodel.Wait = false;
                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt,0);
                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt);
                        }
                    }
@@ -577,12 +565,9 @@
            }
            else
            {
                if (!IsZidong)
                {
                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
                    isAutoTrain = false;
                }
                petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
                isAutoTrain = false;
            }
        }
        #endregion
@@ -659,6 +644,8 @@
                    ridingModel.property = PropertyTip.Pet;
                    ridingModel.RidingId = PetID;
                    WindowCenter.Instance.Open<TargetPetAttrWin>();
                    //  WindowCenter.Instance.Get<TargetPetAttrWin>().PropertyMountAndPet(PropertyTip.Pet, PetID);
                });
                if (petmodel._DicPetBack[PetID].PetClass >= PetModel.MaxRank)//满阶
                {
@@ -709,53 +696,6 @@
            PetClassCostConfig _tagPetClass = PetClassCostConfig.GetPetIdAndRank(PetID, PetModel.MaxRank);
            FragmentUnlockTip.SetActive(false);
            FullAttTip.SetActive(true);
        }
        public void FairyJadeDomesticate()//仙玉驯养
        {
            int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级
            if (NumberLv > petmodel._DicPetBack[typePetID].PetClass && !WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>() && AutoTrainTipsPWin.IsFairy)
            {
                isAutoTrain = true;
                petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
                IsZidong = true;
                StartCoroutine("FairyJadeD");
            }
        }
        IEnumerator FairyJadeD()//仙玉驯养
        {
            int number = AutoTrainTipsPWin.DomesticateNumber;//所需的颗数
            int NumberLv = AutoTrainTipsPWin._Lvnumber;//等级所需的等级
            while (NumberLv > petmodel._DicPetBack[typePetID].PetClass)
            {
                if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())
                {
                    isAutoTrain = false;
                    IsZidong =false;
                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
                    StopCoroutine("FairyJadeD");
                    yield break;
                }
                if (petmodel.Wait)
                {
                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
                    int exp = PetClassCostConfig.GetPetIdAndRank(typePetID, petmodel._DicPetBack[typePetID].PetClass).NeedExpTotal;
                    int NeedNum = ridingModel.PetAndHorseNeedDanNum(exp);
                    petmodel.SendPetTrainQuest(petmodel._DicPetBack[typePetID].ItemPlace, NeedNum, 1);//向服务端发包坐骑经验单
                    petmodel.Wait = false;
                }
                yield return null;
            }
            if (isAutoTrain)
            {
                AutoTrainTipsPWin.IsFairy = false;
                isAutoTrain = false;
                IsZidong = false;
                petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
                StopCoroutine("FairyJadeD");
                yield break;
            }
            yield break;
        }
    }
}
System/Pet/PetAttributeWin.cs
@@ -224,9 +224,7 @@
                    return;
                }
            }
            petmodel.SigPetId = petId;
            TypePetID = petId;
            _PetAttributeMethods.ModelShow(petId);
        }
@@ -318,7 +316,6 @@
                    if (Pet != 0)
                    {
                        TypePetID = Pet;
                        petmodel.SigPetId = Pet;
                        return;
                    }
                }
@@ -334,7 +331,6 @@
                    if (Value.UnLockNeedItemID == ItemId)
                    {
                        TypePetID = Value.ID;
                        petmodel.SigPetId = TypePetID;
                        return;
                    }
                }
@@ -345,7 +341,6 @@
                if (petmodel.DeblockingRedPoint[key].state == RedPointState.Simple)
                {
                    TypePetID = key;
                    petmodel.SigPetId = TypePetID;
                    return;
                }
            }
@@ -355,19 +350,16 @@
                if (petmodel.CultivateRedPoint[key].state == RedPointState.Simple)
                {
                    TypePetID = key;
                    petmodel.SigPetId = TypePetID;
                    return;
                }
            }
            if (petmodel.PetNow != 0)
            {
                TypePetID = petmodel.PetNow;
                petmodel.SigPetId = TypePetID;
            }
            else
            {
                TypePetID = sortlist[0].ID;
                petmodel.SigPetId = TypePetID;
            }
        }
        private int JunpIndex()
@@ -397,7 +389,6 @@
                    if (value.ID == petID[0])
                    {
                        TypePetID = petID[0];
                        petmodel.SigPetId = TypePetID;
                    }
                }
                //m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
@@ -432,13 +423,6 @@
                return 0;
            }
            return Index;
        }
        public void FairyJadeDomesticate()
        {
            _PetAttributeMethods.FairyJadeDomesticate();
        }
    }
}
System/Pet/PlayerPetDatas.cs
@@ -48,7 +48,6 @@
    public bool IsOk = false;
    private int PetDanExp = 0;//灵宠丹经验
    public int SigPetId = 0;//用来标记当前选中的坐骑ID
    public List<int> ListEffectSkill = new List<int>();
    PlayerPackModel _playerPack;
    PlayerPackModel playerPack
@@ -175,12 +174,11 @@
        }
    }
    public void SendPetTrainQuest(int petIndex, int number,int _IsAutoBuy)
    public void SendPetTrainQuest(int petIndex, int number)
    {
        CA704_tagCMPetClassUP _tagCA704 = new CA704_tagCMPetClassUP();
        _tagCA704.PetItemIndex = (byte)petIndex;
        _tagCA704.UseItemCnt = (ushort)number;
        _tagCA704.IsAutoBuy = (byte)_IsAutoBuy;
        GameNetSystem.Instance.SendInfo(_tagCA704);
    }
    #endregion