少年修仙传客户端代码仓库
client_linchunjie
2018-09-17 c91b4ffece820ab89acce869280a8647692596bf
3610 法宝之魂改为由各个法宝单独觉醒,取消激活条件
10个文件已修改
344 ■■■■ 已修改文件
System/Treasure/DragSelectComponent.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureData.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureLevelUpWin.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureMeridianBehaviour.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureNewGotBehaviour.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureSoulBehaviour.cs 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureSoulModel.cs 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureSoulWin.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureStageTipWin.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureUnlockCell.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/DragSelectComponent.cs
@@ -23,7 +23,8 @@
        {
            if (Input.touchCount > 1 || NewBieCenter.Instance.inGuiding
                || WindowCenter.Instance.CheckOpen<TreasureNewStageWin>()
                || WindowCenter.Instance.CheckOpen<PotentialItemUseWin>())
                || WindowCenter.Instance.CheckOpen<PotentialItemUseWin>()
                || WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>())
            {
                m_StartDrag = false;
                return;
System/Treasure/TreasureData.cs
@@ -558,6 +558,7 @@
        public int func { get; private set; }
        public Item item { get; private set; }
        public int treasure { get; private set; }
        public int treasureSoul { get; private set; }
        public int exp { get; set; }
        public int stateSfxId { get; private set; }
        public const int selectedSfxId = 5144;
@@ -661,6 +662,7 @@
        Func,
        Item,
        Treasure,
        TreasureSoul,
    }
}
System/Treasure/TreasureLevelUpWin.cs
@@ -460,6 +460,7 @@
                    case TreasureStageUnlock.Skill:
                    case TreasureStageUnlock.Func:
                    case TreasureStageUnlock.Treasure:
                    case TreasureStageUnlock.TreasureSoul:
                        m_Controller.AddCell(ScrollerDataType.Header, stage.stage);
                        break;
                }
@@ -503,20 +504,6 @@
                        m_TreasureChallengeLimit.text = Language.Get("TreasureGetRequire", _taskConfig.lv);
                        break;
                }
            }
        }
        private void OpenTreasureStageTip(int _stage, RectTransform _target)
        {
            model.selectedStage = _stage;
            if (model.treasureStepUpShow)
            {
                return;
            }
            if (!WindowCenter.Instance.CheckOpen<TreasureStageTipWin>())
            {
                TreasureStageTipWin.SetTargetPosition(_target);
                WindowCenter.Instance.Open<TreasureStageTipWin>();
            }
        }
@@ -991,6 +978,10 @@
                    WindowCenter.Instance.Open<MainInterfaceWin>();
                    CloseImmediately();
                    break;
                case TreasureStageUnlock.TreasureSoul:
                    TreasureSoulActiveWin.treasureSoulId = stage.treasureSoul;
                    WindowCenter.Instance.Open<TreasureSoulActiveWin>(true);
                    break;
            }
        }
@@ -1160,6 +1151,11 @@
                        m_CurrentStageIcon.SetSprite(_treasureConfig.Icon);
                        m_TreasureStageDesc.text = Language.Get("TreasureLevelUpTreasure", _treasureConfig.Name);
                        break;
                    case TreasureStageUnlock.TreasureSoul:
                        var _treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(_nextStage.treasureSoul);
                        m_CurrentStageIcon.SetSprite(_treasureSoulConfig.Icon);
                        m_TreasureStageDesc.text = Language.Get("TreasureLevelUpTreasureSoul", _treasureSoulConfig.Name);
                        break;
                }
            }
            else
System/Treasure/TreasureMeridianBehaviour.cs
@@ -188,6 +188,14 @@
                        m_Descs[0].text = treasureConfig.Name;
                        m_Icon.rectTransform.sizeDelta = new Vector2(86, 86);
                        break;
                    case TreasureStageUnlock.TreasureSoul:
                        m_Descs[0].gameObject.SetActive(true);
                        m_Descs[0].color = UIHelper.s_LightYellow;
                        var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(m_TreasureStage.treasureSoul);
                        m_Icon.SetSprite(treasureSoulConfig.Icon);
                        m_Descs[0].text = treasureSoulConfig.Name;
                        m_Icon.SetNativeSize();
                        break;
                }
            }
        }
System/Treasure/TreasureNewGotBehaviour.cs
@@ -71,6 +71,16 @@
                            m_FuncName.text = treasureConfig.Name;
                        }
                        break;
                    case TreasureStageUnlock.TreasureSoul:
                        m_ContaienrTreasure.gameObject.SetActive(true);
                        var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(treasureStage.treasureSoul);
                        if (treasureSoulConfig != null)
                        {
                            m_TreasureIcon.SetSprite(treasureSoulConfig.Icon);
                            m_Func.text = Language.Get("TreasureUnlockNewTreasureSoul");
                            m_FuncName.text = treasureSoulConfig.Name;
                        }
                        break;
                }
            }
        }
System/Treasure/TreasureSoulBehaviour.cs
@@ -38,27 +38,27 @@
        {
            model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent;
            model.treasureSoulEvent += TreasureSoulEvent;
            achievementModel.achievementCompletedEvent += AchievementCompletedEvent;
            //achievementModel.achievementCompletedEvent += AchievementCompletedEvent;
        }
        private void OnDisable()
        {
            model.treasureSelectSoulChangeEvent -= TreasureSelectSoulChangeEvent;
            model.treasureSoulEvent -= TreasureSoulEvent;
            achievementModel.achievementCompletedEvent -= AchievementCompletedEvent;
            //achievementModel.achievementCompletedEvent -= AchievementCompletedEvent;
        }
        private void AchievementCompletedEvent(int _id)
        {
            int achievementId = 0;
            if (model.TryGetLockAchievement(treasureSoulId, out achievementId))
            {
                if (achievementId == _id)
                {
                    DisplayState();
                }
            }
        }
        //private void AchievementCompletedEvent(int _id)
        //{
        //    int achievementId = 0;
        //    if (model.TryGetLockAchievement(treasureSoulId, out achievementId))
        //    {
        //        if (achievementId == _id)
        //        {
        //            DisplayState();
        //        }
        //    }
        //}
        public void Display(int _id)
        {
@@ -88,25 +88,27 @@
                }
                else
                {
                    int achievementId = 0;
                    bool unlock = true;
                    if (model.TryGetLockAchievement(treasureSoulId, out achievementId))
                    {
                        Achievement achievement;
                        if (achievementModel.TryGetAchievement(achievementId, out achievement))
                        {
                            unlock = achievement.completed;
                        }
                    }
                    if (unlock)
                    {
                        m_SoulState.text = Language.Get("TreasureSoul_Awaking");
                    }
                    else
                    {
                        var successConfig = Config.Instance.Get<SuccessConfig>(achievementId);
                        m_SoulState.text = Language.Get("TreasureSoulRealm", successConfig.NeedCnt);
                    }
                    m_SoulState.text = Language.Get("TreasureSoul_Awaking");
                    //int achievementId = 0;
                    //bool unlock = true;
                    //if (model.TryGetLockAchievement(treasureSoulId, out achievementId))
                    //{
                    //    Achievement achievement;
                    //    if (achievementModel.TryGetAchievement(achievementId, out achievement))
                    //    {
                    //        unlock = achievement.completed;
                    //    }
                    //}
                    //if (unlock)
                    //{
                    //    m_SoulState.text = Language.Get("TreasureSoul_Awaking");
                    //}
                    //else
                    //{
                    //    var successConfig = Config.Instance.Get<SuccessConfig>(achievementId);
                    //    m_SoulState.text = Language.Get("TreasureSoulRealm", successConfig.NeedCnt);
                    //}
                }
            }
        }
System/Treasure/TreasureSoulModel.cs
@@ -10,7 +10,6 @@
    {
        Dictionary<int, TreasureSpecialData> treasureSoulDict = new Dictionary<int, TreasureSpecialData>();
        List<int> treasureSouls = new List<int>();
        Dictionary<int, List<int>> soulAchievements = new Dictionary<int, List<int>>();
        public Dictionary<int, int> signAddProperty = new Dictionary<int, int>();
        public int signAddTreasure { get; private set; }
@@ -42,8 +41,6 @@
        {
            packModel.RefreshItemCountAct += RefreshItemCountAct;
            PlayerStrengthengDatas.RefreshEquipUpgradLvAct += RefreshEquipSTRLv;
            achievementModel.achievementProgressUpdateEvent += AchievementUpdate;
            achievementModel.achievementCompletedEvent += AchievementUpdate;
            ParseConfig();
        }
@@ -69,8 +66,6 @@
        {
            packModel.RefreshItemCountAct -= RefreshItemCountAct;
            PlayerStrengthengDatas.RefreshEquipUpgradLvAct -= RefreshEquipSTRLv;
            achievementModel.achievementProgressUpdateEvent -= AchievementUpdate;
            achievementModel.achievementCompletedEvent -= AchievementUpdate;
        }
        void ParseConfig()
@@ -85,7 +80,6 @@
                }
                treasureSouls.Add(configs[i].PrivilegeID);
                treasureSoulDict.Add(configs[i].PrivilegeID, new TreasureSpecialData((TreasurePrivilege)configs[i].PrivilegeID));
                soulAchievements.Add(configs[i].PrivilegeID, new List<int>(configs[i].successList));
            }
            var funcConfig = Config.Instance.Get<FuncConfigConfig>("MWSignDayAttr");
            var jsonData = LitJson.JsonMapper.ToObject(funcConfig.Numerical1);
@@ -101,82 +95,9 @@
            return treasureSouls;
        }
        public bool TryGetLockAchievement(int _id,out int achievementId)
        {
            achievementId = 0;
            List<int> list;
            if (soulAchievements.TryGetValue(_id, out list))
            {
                for (int i = 0; i < list.Count; i++)
                {
                    var config = Config.Instance.Get<SuccessConfig>(list[i]);
                    if (config != null && config.Type == 1)
                    {
                        achievementId = list[i];
                        return true;
                    }
                }
            }
            return false;
        }
        public bool TryGetAchievements(int _id,out List<int> list)
        {
            return soulAchievements.TryGetValue(_id, out list);
        }
        public bool IsCompleteLockAchievement(int _id)
        {
            TreasureSpecialData special;
            if (TryGetTreasureSoul(_id, out special))
            {
                if (special.active)
                {
                    return true;
                }
                int achievementId;
                if (TryGetLockAchievement(_id, out achievementId))
                {
                    Achievement achievement;
                    return achievementModel.TryGetAchievement(achievementId, out achievement) && achievement.completed;
                }
            }
            return true;
        }
        public bool IsCompleteAllAchievement(int _id)
        {
            if (soulAchievements.ContainsKey(_id))
            {
                var list = soulAchievements[_id];
                bool allCompleted = true;
                for (int i = 0; i < list.Count; i++)
                {
                    Achievement achievement;
                    achievementModel.TryGetAchievement(list[i], out achievement);
                    if (achievement == null || (!achievement.completed && !Achievement.IsReach(achievement.id, achievement.progress)))
                    {
                        allCompleted = false;
                    }
                }
                return allCompleted;
            }
            return false;
        }
        public bool TryGetTreasureSoul(int _id, out TreasureSpecialData special)
        {
            return treasureSoulDict.TryGetValue(_id, out special);
        }
        public void ActiveTreasureSoul(int _id)
        {
            if (IsCompleteAllAchievement(_id))
            {
                CA512_tagCMActiveMWSoul pak = new CA512_tagCMActiveMWSoul();
                pak.ID = (byte)_id;
                GameNetSystem.Instance.SendInfo(pak);
            }
        }
        public int GetTreasureSoulValue(int _soulId)
@@ -222,17 +143,6 @@
            }
        }
        private void AchievementUpdate(int _id)
        {
            foreach (var soulId in soulAchievements.Keys)
            {
                if (soulAchievements[soulId].Contains(_id))
                {
                    UpdateAchievementRedpoint(soulId);
                }
            }
        }
        public void UpdateTreasureSoulStrenthen()
        {
            UpdateRedpoint((int)TreasurePrivilege.StrengthenAdd);
@@ -254,19 +164,18 @@
                }
                bool beforeActived = special.active;
                special.active = _data.State == 1;
                if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
                    && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding)
                {
                    TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID;
                    WindowCenter.Instance.Open<TreasureSoulActiveWin>();
                }
                //if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
                //    && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding)
                //{
                //    TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID;
                //    WindowCenter.Instance.Open<TreasureSoulActiveWin>();
                //}
                if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd)
                {
                    if (treasureSoulEvent != null)
                    {
                        treasureSoulEvent((int)_data.PriID);
                    }
                    UpdateAchievementRedpoint((int)_data.PriID);
                    UpdateRedpoint((int)_data.PriID);
                    continue;
                }
@@ -277,7 +186,6 @@
                special.presentGetCount = (int)_data.CurValue;
                special.itemGet = _data.ItemAwardState == 1;
                UpdateRedpoint((int)_data.PriID);
                UpdateAchievementRedpoint((int)_data.PriID);
                if (treasureSoulEvent != null)
                {
                    treasureSoulEvent((int)_data.PriID);
@@ -358,37 +266,11 @@
            }
        }
        private void UpdateAchievementRedpoint(int _id)
        {
            if (treasureSoulDict.ContainsKey(_id) && soulAchievements.ContainsKey(_id))
            {
                var special = treasureSoulDict[_id];
                special.activeRedpoint.state = RedPointState.None;
                if (!FuncOpen.Instance.IsFuncOpen(126) || !IsOpenTreasureSoul(_id) || special.active)
                {
                    return;
                }
                var list = soulAchievements[_id];
                bool allCompleted = true;
                for (int i = 0; i < list.Count; i++)
                {
                    Achievement achievement;
                    achievementModel.TryGetAchievement(list[i], out achievement);
                    if (achievement == null || (!achievement.completed && !Achievement.IsReach(achievement.id, achievement.progress)))
                    {
                        allCompleted = false;
                    }
                }
                special.activeRedpoint.state = allCompleted ? RedPointState.Simple : RedPointState.None;
            }
        }
        private void UpdateRedpoints()
        {
            foreach (var special in treasureSoulDict.Keys)
            {
                UpdateRedpoint(special);
                UpdateAchievementRedpoint(special);
            }
        }
    }
@@ -403,7 +285,6 @@
        public Dictionary<int, int> propertyDict { get; private set; }
        public Redpoint redpoint { get; private set; }
        public Redpoint privilegeRedpoint { get; private set; }
        public Redpoint activeRedpoint { get; private set; }
        public int treasureId { get; set; }
        public bool active { get; set; }
@@ -485,7 +366,6 @@
            }
            redpoint = new Redpoint(TreasureModel.TREASURE_SOUL_ID, TreasureModel.TREASURE_SOUL_ID * 100 + (int)type);
            activeRedpoint = new Redpoint(redpoint.id, redpoint.id * 100 + 1);
            switch (_type)
            {
                case TreasurePrivilege.DemonJarAtk:
System/Treasure/TreasureSoulWin.cs
@@ -26,7 +26,6 @@
        [SerializeField] UIEffect m_SoulEffect;
        [SerializeField] Button m_Active;
        [SerializeField] Text m_ActiveText;
        [SerializeField] Button m_GotoRealm;
        [SerializeField] List<TreasureSoulPattern> m_TreasureSouls;
@@ -35,9 +34,6 @@
        [SerializeField] RectTransform m_ContainerPreview;
        [SerializeField] Text m_PreviewTitle;
        [SerializeField] List<PropertyBehaviour> m_PreviewPropretys;
        [SerializeField] RectTransform m_ContainerCondition;
        [SerializeField] ScrollerController m_ConditonControl;
        TreasureSoulModel m_Model;
        TreasureSoulModel model
@@ -58,9 +54,9 @@
            }
        }
        AchievementModel achievementModel
        TreasureModel treasureModel
        {
            get { return ModelCenter.Instance.GetModel<AchievementModel>(); }
            get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
        }
@@ -76,10 +72,8 @@
        protected override void AddListeners()
        {
            m_Active.onClick.AddListener(Active);
            m_GotoRealm.onClick.AddListener(GotoRealm);
            m_CloseBtn.onClick.AddListener(CloseClick);
            m_ScollerControl.OnRefreshCell += OnRefreshCell;
            m_ConditonControl.OnRefreshCell += OnRefreshConditionCell;
        }
        protected override void OnPreOpen()
@@ -87,7 +81,6 @@
            model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
            model.treasureSoulEvent += TreasureSoulEvent;
            achievementModel.achievementCompletedEvent += AchievementCompletedEvent;
            m_TreasureSoulBtn.state = TitleBtnState.Click;
            Display();
        }
@@ -115,7 +108,6 @@
            model.treasureSelectSoulChangeEvent -= TreasureSelectSoulChangeEvent;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
            model.treasureSoulEvent -= TreasureSoulEvent;
            achievementModel.achievementCompletedEvent -= AchievementCompletedEvent;
            for (int i = 0; i < m_TreasureSouls.Count; i++)
            {
                m_TreasureSouls[i].Dispose();
@@ -131,15 +123,6 @@
            }
        }
        #endregion
        private void AchievementCompletedEvent(int _id)
        {
            List<int> list;
            if (model.TryGetAchievements(model.selectSoul, out list) && list.Contains(_id))
            {
                DisplaySelect();
            }
        }
        private void Display()
        {
@@ -228,19 +211,16 @@
        private void Active()
        {
            model.ActiveTreasureSoul(model.selectSoul);
        }
        private void GotoRealm()
        {
            WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RealmFunc1);
            var config = Config.Instance.Get<TreasurePrivilegeConfig>(model.selectSoul);
            treasureModel.selectedTreasure = config.treasureId;
            treasureModel.currentCategory = TreasureCategory.Human;
            WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.TreasureCollectSoul);
        }
        private void DisplaySelect()
        {
            TreasureSpecialData special;
            model.TryGetTreasureSoul(model.selectSoul, out special);
            m_ContainerCondition.gameObject.SetActive(false);
            if (special != null)
            {
                var config = Config.Instance.Get<TreasurePrivilegeConfig>((int)special.type);
@@ -256,27 +236,8 @@
                    m_SelectSoulImg.material = special.active ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial();
                    m_SelectSoulImg.SetNativeSize();
                    if (special.active)
                    {
                        m_Active.gameObject.SetActive(false);
                        m_GotoRealm.gameObject.SetActive(false);
                    }
                    else
                    {
                        if (!model.IsCompleteLockAchievement(model.selectSoul))
                        {
                            m_Active.gameObject.SetActive(false);
                            m_GotoRealm.gameObject.SetActive(false);
                        }
                        else
                        {
                            m_Active.gameObject.SetActive(true);
                            m_GotoRealm.gameObject.SetActive(false);
                            m_Active.SetInteractable(m_ActiveText, model.IsCompleteAllAchievement(model.selectSoul));
                            m_ContainerCondition.gameObject.SetActive(true);
                            DisplayCondition();
                        }
                    }
                    m_Active.gameObject.SetActive(!special.active);
                    m_ContainerPreview.gameObject.SetActive(!special.active);
                    m_SoulEffect.StopImediatly();
                    if (!special.active)
@@ -458,33 +419,6 @@
                    }
                    break;
            }
        }
        private void DisplayCondition()
        {
            m_ContainerCondition.gameObject.SetActive(true);
            List<int> list;
            model.TryGetAchievements(model.selectSoul, out list);
            m_ConditonControl.Refresh();
            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    var config = Config.Instance.Get<SuccessConfig>(list[i]);
                    if (config != null && config.Type == 1)
                    {
                        continue;
                    }
                    m_ConditonControl.AddCell(ScrollerDataType.Header, list[i]);
                }
            }
            m_ConditonControl.Restart();
        }
        private void OnRefreshConditionCell(ScrollerDataType type, CellView cell)
        {
            var _cell = cell as TreasureSoulAchievementCell;
            _cell.Display(cell.index);
        }
        int Compare(int x, int y)
System/Treasure/TreasureStageTipWin.cs
@@ -135,6 +135,13 @@
                    m_StageName.text = treasureConfig.Name;
                    m_Description.text = UIHelper.ReplaceNewLine(treasureConfig.Verse.Length > 0 ? treasureConfig.Verse[0] : string.Empty);
                    break;
                case TreasureStageUnlock.TreasureSoul:
                    m_ContainerFuncSoul.gameObject.SetActive(true);
                    var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(m_TreasureStage.treasureSoul);
                    m_Icon.SetSprite(treasureSoulConfig.Icon);
                    m_StageName.text = treasureSoulConfig.Name;
                    m_Description.text = UIHelper.ReplaceNewLine(treasureSoulConfig.Description);
                    break;
            }
        }
System/Treasure/TreasureUnlockCell.cs
@@ -31,7 +31,7 @@
                    var _stage = treasure.treasureStages[i];
                    if (stage < _stage.stage &&
                        (_stage.unlockType == TreasureStageUnlock.Func || _stage.unlockType == TreasureStageUnlock.Skill
                        || _stage.unlockType == TreasureStageUnlock.Treasure))
                        || _stage.unlockType == TreasureStageUnlock.Treasure || _stage.unlockType == TreasureStageUnlock.TreasureSoul))
                    {
                        last = false;
                        break;
@@ -66,6 +66,14 @@
                                m_Func.text = Language.Get("TreasureUnlockNewTreasure");
                            }
                            break;
                        case TreasureStageUnlock.TreasureSoul:
                            var treasureSoulConfig = Config.Instance.Get<TreasureConfig>(treasureStage.treasureSoul);
                            if (treasureSoulConfig != null)
                            {
                                m_Icon.SetSprite(treasureSoulConfig.Icon);
                                m_Func.text = Language.Get("TreasureUnlockNewTreasureSoul");
                            }
                            break;
                    }
                    m_Button.AddListener(() =>
                    {