少年修仙传客户端代码仓库
client_Zxw
2018-09-11 a50d5a3cfbc1e1e639e0c118cca494e596da8426
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
5个文件已修改
2个文件已添加
353 ■■■■ 已修改文件
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA513_tagCMUnlockRuneHole.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA513_tagCMUnlockRuneHole.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ClientVersion/VersionUtility.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/DailyQuest/DayRemind.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonFightWin.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Rune/RuneModel.cs 225 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Rune/RuneMosaicWin.cs 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA513_tagCMUnlockRuneHole.cs
New file
@@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;
// A5 13 解锁符印孔 #tagCMUnlockRuneHole
public class CA513_tagCMUnlockRuneHole : GameNetPackBasic {
    public byte HoleIndex;    // 孔索引
    public CA513_tagCMUnlockRuneHole () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA513;
    }
    public override void WriteToBytes () {
        WriteBytes (HoleIndex, NetDataType.BYTE);
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA513_tagCMUnlockRuneHole.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3f6185b8e05fd074f9e72468aa164715
timeCreated: 1536652620
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/ClientVersion/VersionUtility.cs
@@ -168,7 +168,7 @@
        step = Step.Completed;
    }
    const string maoerGameAppId = "498mrgame";
    const string maoerGameAppId = "mrgame";
    public bool IsMaoErGame()
    {
        return VersionConfig.Get().appId == maoerGameAppId;
System/DailyQuest/DayRemind.cs
@@ -44,6 +44,7 @@
    public const string OSTIMEGIFT_REDPOINT = "OSTimeGift_Redpoint";
    public const string OSGIFT_REDPOINT = "OSGitf_Redpoint";
    public const string TASK_SKILL_HOLE = "TaskSkillHole";
    public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole";
    public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
    public bool GetDayRemind(string _remindKey)
@@ -96,6 +97,7 @@
        SetDayRemind(OSTIMEGIFT_REDPOINT);
        SetDayRemind(OSGIFT_REDPOINT);
        SetDayRemind(TASK_SKILL_HOLE);
        SetDayRemind(RUNE_SPECIAL_HOLE);
    }
    private void SetDayRemind(string _key)
System/Dungeon/DungeonFightWin.cs
@@ -119,6 +119,22 @@
            DropItemManager.pickUpCallBack -= OnPickItem;
            MainInterfaceWin.Event_Duplicates -= OnChangeFuncBtnPosEvent;
            model.dungeonCoolDownEvent -= OnLeaveMapTimeEvent;
            try
            {
                var mapId = PlayerDatas.Instance.baseData.MapID;
                var mapConfig = Config.Instance.Get<MapConfig>(mapId);
                if (mapConfig != null && mapConfig.MapFBType != (int)MapType.OpenCountry)
                {
                    throw new NullReferenceException();
                }
            }
            catch (Exception ex)
            {
                Debug.Log(ex.Message);
                ExceptionCatcher.ReportException("副本战斗界面异常关闭", ex.Message);
            }
        }
        protected override void OnAfterClose()
System/Rune/RuneModel.cs
@@ -8,7 +8,7 @@
namespace Snxxz.UI
{
    public class RuneModel : Model, IBeforePlayerDataInitialize
    public class RuneModel : Model, IBeforePlayerDataInitialize,IPlayerLoginOk
    {
        RuneComposeModel m_RuneComposeModel;
        RuneComposeModel runeComposeModel {
@@ -20,7 +20,7 @@
        public override void Init()
        {
            ParseConfig();
            for (int i = 0; i < 8; i++)
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                Redpoint redpoint = new Redpoint(10801, 1080101 + i);
                runeHoleRedpoints.Add(redpoint);
@@ -28,6 +28,7 @@
            }
            FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
        }
        private void OnFuncStateChangeEvent(int func)
@@ -46,11 +47,18 @@
        public void OnBeforePlayerDataInitialize()
        {
            ClearRuneData();
            serverInited = false;
        }
        public void OnPlayerLoginOk()
        {
            serverInited = true;
        }
        #region 配置
        public const int RUNE_TYPE = 30;
        public const int RUNE_CREAMTYPE = 31;
        public const int RUNE_HOLE_COUNT = 9;
        public Dictionary<int, Dictionary<int, float>> runeAttrDic = new Dictionary<int, Dictionary<int, float>>();
        public Dictionary<int, float> runeAttrAdditionDic = new Dictionary<int, float>();
        public Dictionary<int, float> runeExpDic = new Dictionary<int, float>();
@@ -61,7 +69,8 @@
        public string runeExpFormula { get; private set; }
        public int runePackMaxNum { get; private set; }
        public Dictionary<int, int> doublePropRuneInlayDict { get; private set; }
        public Dictionary<int,SpecialRuneHoleCondition> specialHoles = new Dictionary<int, SpecialRuneHoleCondition>();
        int[] specialRedLevels = null;
        private void ParseConfig()
        {
@@ -77,15 +86,25 @@
                    runeExpAddition = float.Parse(FuncConfigConfig.GetRuneNeedExpFormula().Numerical3);
                    runeEliteAdditonDic = ConfigParse.GetDic<int, float>(FuncConfigConfig.GetRuneNeedExpFormula().Numerical4);
                    runeExpFormula = FuncConfigConfig.GetRuneNeedExpFormula().Numerical1;
                    FuncConfigConfig cfg = Config.Instance.Get<FuncConfigConfig>("RuneUnlock");
                    if (cfg != null)
                    FuncConfigConfig config = Config.Instance.Get<FuncConfigConfig>("RuneUnlock");
                    if (config != null)
                    {
                        runeUnlockArray = ConfigParse.GetMultipleStr<int>(cfg.Numerical1);
                        runeUnlockArray = ConfigParse.GetMultipleStr<int>(config.Numerical1);
                        var costDict = ConfigParse.GetDic<int, int>(config.Numerical2);
                        var levelDict = ConfigParse.GetDic<int, int>(config.Numerical3);
                        foreach (var _hole in costDict.Keys)
                        {
                            specialHoles.Add(_hole, new SpecialRuneHoleCondition()
                            {
                                cost = costDict[_hole],
                                level = levelDict.ContainsKey(_hole) ? levelDict[_hole] : 0,
                            });
                    }
                    cfg = Config.Instance.Get<FuncConfigConfig>("RunePackageNum");
                    runePackMaxNum = int.Parse(cfg.Numerical1);
                    }
                    config = Config.Instance.Get<FuncConfigConfig>("RunePackageNum");
                    runePackMaxNum = int.Parse(config.Numerical1);
                    var config = Config.Instance.Get<FuncConfigConfig>("RuneMaxLV");
                    config = Config.Instance.Get<FuncConfigConfig>("RuneMaxLV");
                    runeQualityMaxLevel = ConfigParse.GetDic<int, int>(config.Numerical1);
                    var maxlevel = runeQualityMaxLevel != null ? runeQualityMaxLevel.Values.Last() : 0;
@@ -104,8 +123,11 @@
                        doublePropertyRunes.Add(_cfg.TagItemID);
                    }
                    cfg = Config.Instance.Get<FuncConfigConfig>("RuneDoubleInlayCnt");
                    doublePropRuneInlayDict = ConfigParse.GetDic<int, int>(cfg.Numerical1);
                    config = Config.Instance.Get<FuncConfigConfig>("RuneDoubleInlayCnt");
                    doublePropRuneInlayDict = ConfigParse.GetDic<int, int>(config.Numerical1);
                    config = Config.Instance.Get<FuncConfigConfig>("RuneSpecialRedLevel");
                    specialRedLevels = ConfigParse.GetMultipleStr<int>(config.Numerical1);
                }
                );
@@ -113,6 +135,16 @@
        private static StringBuilder _textBuilder = new StringBuilder();
        static readonly string replaceValStr = "level";
        bool serverInited = false;
        private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
        {
            if (refreshType == PlayerDataRefresh.LV)
            {
                UpdateSpecialHoleRedpoint();
            }
        }
        public int GetRuneMaxLevel(int _itemColor)
        {
@@ -288,43 +320,45 @@
        public Redpoint runeReplaceRedpoint = new Redpoint(1080130);
        private List<Redpoint> runeHoleRedpoints = new List<Redpoint>();
        public Redpoint runeMosaicRedpoint { get { return m_RuneMosaicRedpoint; } }
        public Redpoint specialRuneRemindRedpoint = new Redpoint(10801, 1080140);
        public Redpoint GetRedpoint(int _hole)
        {
            return runeHoleRedpoints[_hole];
        }
        //public void UpdateRedpoint()
        //{
        //    for (int i = 0; i < runeHoleRedpoints.Count; i++)
        //    {
        //        runeHoleRedpoints[i].state = RedPointState.None;
        //    }
        //    if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Rune))
        //    {
        //        return;
        //    }
        //    for (int i = 0; i < runeHoleRedpoints.Count; i++)
        //    {
        //        RuneData runeData = GetHoleRune(i);
        //        if (runeData != null)
        //        {
        //            if (RuneSplinters >= GetRuneNeedExp(runeData.id, runeData.lv)
        //                && runeData.lv < RuneMaxLevel)
        //            {
        //                runeHoleRedpoints[i].state = RedPointState.Simple;
        //            }
        //            else if (CanEquipBetterRune(i))
        //            {
        //                runeHoleRedpoints[i].state = RedPointState.Simple;
        //            }
        //        }
        //        else if (CanMosaicRune(i))
        //        {
        //            runeHoleRedpoints[i].state = RedPointState.Simple;
        //        }
        //    }
        //}
        void UpdateSpecialHoleRedpoint()
        {
            specialRuneRemindRedpoint.state = RedPointState.None;
            if (DayRemind.Instance.GetDayRemind(DayRemind.RUNE_SPECIAL_HOLE))
            {
                return;
            }
            foreach (var hole in specialHoles.Keys)
            {
                if (IsRuneHoleOpen(hole))
                {
                    continue;
                }
                if (PlayerDatas.Instance.baseData.LV >= specialHoles[hole].level
                    && PlayerDatas.Instance.baseData.LV >= specialRedLevels[0]
                    && PlayerDatas.Instance.baseData.LV < specialRedLevels[1])
                {
                    specialRuneRemindRedpoint.state = RedPointState.Simple;
                    break;
                }
            }
        }
        public void SetDayRemind()
        {
            if (specialRuneRemindRedpoint.state == RedPointState.Simple)
            {
                DayRemind.Instance.SetDayRemind(DayRemind.RUNE_SPECIAL_HOLE, true);
                UpdateSpecialHoleRedpoint();
            }
        }
        /// <summary>
        /// 新版符印红点
        ///1.有可操作的时候仅按优先级显示1个红点
@@ -447,7 +481,7 @@
        public bool CanLevelUpRune(out int _hole)
        {
            _hole = 0;
            for (int i = 0; i < 8; i++)
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                if (CanLevelUpRune(i))
                {
@@ -613,8 +647,11 @@
            UpdateRedpoint();
            UpdateBreakRedpoint();
        }
        public event Action<int> openNewHoleEvent;
        public void OnRuneHoleRefresh(HA31F_tagMCRuneInfo vNetData)
        {
            uint oldHoleState = holeState;
            holeState = vNetData.RuneHoleOpenState;
            for (byte i = 0; i < vNetData.Count; i++)
            {
@@ -658,12 +695,92 @@
            {
                OnRefreshRuneHole();
            }
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                if (!serverInited)
                {
                    break;
                }
                int k = 1 << i;
                var oldOpen = (holeState & k) == k;
                if (!oldOpen && IsRuneHoleOpen(i))
                {
                    if (openNewHoleEvent != null)
                    {
                        openNewHoleEvent(i);
                    }
                }
            }
            UpdateRedpoint();
            UpdateBreakRedpoint();
            UpdateSpecialHoleRedpoint();
        }
        public void UnlockSpecialHole(int hole)
        {
            if (IsSpeicalHole(hole))
            {
                if (IsRuneHoleOpen(hole))
                {
                    return;
                }
                int error = 0;
                if (!TestUnlockSpeicalHole(hole, out error))
                {
                    ProcessUnlockError(error, specialHoles[hole]);
                    return;
                }
                CA513_tagCMUnlockRuneHole pak = new CA513_tagCMUnlockRuneHole();
                pak.HoleIndex = (byte)hole;
                GameNetSystem.Instance.SendInfo(pak);
            }
        }
        public bool TestUnlockSpeicalHole(int hole, out int error)
        {
            error = 0;
            SpecialRuneHoleCondition speicalHole;
            if (specialHoles.TryGetValue(hole, out speicalHole))
            {
                if (PlayerDatas.Instance.baseData.LV < speicalHole.level)
                {
                    error = 1;
                    return false;
                }
                if (PlayerDatas.Instance.baseData.Gold < speicalHole.cost)
                {
                    error = 2;
                    return false;
                }
                return true;
            }
            return false;
        }
        public void ProcessUnlockError(int error, SpecialRuneHoleCondition specialHole)
        {
            switch (error)
            {
                case 1:
                    SysNotifyMgr.Instance.ShowTip("RuneSpecialHoleLevelError", specialHole.level);
                    break;
                case 2:
                    WindowCenter.Instance.Open<RechargeTipWin>();
                    break;
            }
        }
        public bool IsSpeicalHole(int hole)
        {
            return specialHoles.ContainsKey(hole);
        }
        public bool IsRuneHoleOpen(int hole)
        {
            if (holeState < 1) return false;
            if (holeState < 1)
            {
                return false;
            }
            int k = 1 << hole;
            if ((holeState & k) == k)
            {
@@ -688,7 +805,7 @@
        public bool IsEmptyHole()
        {
            for (int i = 0; i < 8; i++)
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                if (IsRuneHoleOpen(i) && !runeHoleData.ContainsKey(i))
                {
@@ -888,7 +1005,7 @@
        public bool CanEquipHoleRune(int id, int _color, out int _hole)
        {
            _hole = 0;
            for (int i = 0; i < 8; i++)
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                if (!IsRuneHoleOpen(i))
                {
@@ -980,13 +1097,16 @@
        public int GetOpenTowerCnt()
        {
            int Cnt = 0;
            for (int i = 0; i < 8; i++)
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                if (IsRuneHoleOpen(i))
                {
                    Cnt++;
                }
                else break;
                else
                {
                    break;
                }
            }
            return Cnt;
        }
@@ -1064,6 +1184,13 @@
        }
        #endregion
    }
    public struct SpecialRuneHoleCondition
    {
        public int level;
        public int cost;
    }
    public class RuneData
    {
        /// <summary>
System/Rune/RuneMosaicWin.cs
@@ -45,10 +45,17 @@
        [SerializeField] RectTransform m_ContainerGetRune;
        [SerializeField] Button m_GotoGetRuneBtn;
        [SerializeField] RectTransform m_ContainerSpecial;
        [SerializeField] Button m_UnlockSpecialHole;
        [SerializeField] Text m_SpecialCostRemind;
        [SerializeField] Text m_SpecialLevelRemind;
        [SerializeField] Text m_RuneUnlockTip;
        [SerializeField] UIEffect m_RuneLvUpEffect;
        Color m_LevelUpCacheColor;
        bool selectSpeicalHole = false;
        RuneModel m_Model;
        RuneModel model
@@ -72,6 +79,7 @@
            m_RuneLevelUpBtn.onClick.AddListener(OnRuneUpBtn);
            m_RunePreviewBtn.onClick.AddListener(OnRunePreviewBtn);
            m_GotoGetRuneBtn.onClick.AddListener(OnGotoGetRune);
            m_UnlockSpecialHole.onClick.AddListener(UnlockSpecialHole);
            for (int i = 0; i < runeHoleBtns.Count; i++)
            {
                var _index = i;
@@ -86,10 +94,12 @@
        {
            model.OnRefreshRuneHole += OnRuneHoleRefresh;
            model.OnRefreshRuneExp += OnUpdateRuneHoleInfo;
            model.openNewHoleEvent += OpenNewHoleEvent;
            m_RuneLevelUpBtn.gameObject.SetActive(false);
            m_RuneReplaceBtn.gameObject.SetActive(false);
            m_ContainerGetRune.gameObject.SetActive(false);
            m_ContainerSpecial.gameObject.SetActive(false);
            OpenOrCloseSelect(false);
            model.sltRuneHole = -1;
            foreach (var _hole in runeHoleDatas)
@@ -105,18 +115,33 @@
            {
                OnRuneHoleClick(CheckOpenSelect());
            }
            model.SetDayRemind();
        }
        protected override void OnPreClose()
        {
            model.OnRefreshRuneHole -= OnRuneHoleRefresh;
            model.OnRefreshRuneExp -= OnUpdateRuneHoleInfo;
            model.openNewHoleEvent -= OpenNewHoleEvent;
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void OpenNewHoleEvent(int hole)
        {
            if (model.IsSpeicalHole(hole))
            {
            }
        }
        private void UnlockSpecialHole()
        {
            model.UnlockSpecialHole(model.sltRuneHole);
        }
        private void OnGotoGetRune()
        {
@@ -171,7 +196,17 @@
        int CheckOpenSelect()
        {
            for (int i = 0; i < 8; i++)
            if (model.specialRuneRemindRedpoint.state == RedPointState.Simple && !NewBieCenter.Instance.inGuiding)
            {
                foreach (var hole in model.specialHoles.Keys)
                {
                    if (!model.IsRuneHoleOpen(hole))
                    {
                        return hole;
                    }
                }
            }
            for (int i = 0; i < RuneModel.RUNE_HOLE_COUNT; i++)
            {
                if (model.GetRedpoint(i).state == RedPointState.Simple)
                {
@@ -181,15 +216,19 @@
            return 0;
        }
        void DisSelectAll()
        {
            for (int i = 0; i < RuneModel.RUNE_HOLE_COUNT; i++)
            {
                runeHoleDatas[i].SetSelect(false);
                runeHoleDatas[i].redpoint.gameObject.SetActive(true);
            }
        }
        void OnRuneHoleClick(int _hole)
        {
            if (model.IsRuneHoleOpen(_hole))
            {
                //if (model.sltRuneHole == _hole && model.GetHoleRune(_hole) == null)
                //{
                //    WindowCenter.Instance.Open<RunePackWin>();
                //    return;
                //}
                for (int i = 0; i < runeHoleDatas.Count; i++)
                {
                    if (i != _hole)
@@ -199,6 +238,8 @@
                    }
                }
                model.sltRuneHole = _hole;
                m_RuneUnlockTip.gameObject.SetActive(true);
                m_ContainerSpecial.gameObject.SetActive(false);
                m_RuneLevelUpBtn.gameObject.SetActive(true);
                m_RuneReplaceBtn.gameObject.SetActive(true);
                OnUpdateRuneHoleInfo();
@@ -208,18 +249,41 @@
            }
            else
            {
                if (model.IsSpeicalHole(_hole))
                {
                    DisplaySpecialHole(_hole);
                }
                else
                {
                int[] towerArray = model.runeUnlockArray;
                RuneTowerFloorConfig cfg = Config.Instance.Get<RuneTowerFloorConfig>(towerArray[_hole]);
                var tower = Config.Instance.Get<RuneTowerConfig>(cfg.TowerId);
                SysNotifyMgr.Instance.ShowTip("RuneUnlock", StringUtility.Contact(tower.TowerName, cfg.FloorName));
            }
        }
        }
        private void DisplaySpecialHole(int _hole)
        {
            m_ContainerSpecial.gameObject.SetActive(true);
            m_ContainerSelectRune.gameObject.SetActive(false);
            m_ContainerGetRune.gameObject.SetActive(false);
            m_RuneLevelUpBtn.gameObject.SetActive(false);
            m_RuneReplaceBtn.gameObject.SetActive(false);
            m_RuneUnlockTip.gameObject.SetActive(false);
            DisSelectAll();
            model.sltRuneHole = _hole;
            runeHoleDatas[_hole].SetSelect(true);
            var speical = model.specialHoles[_hole];
            m_SpecialCostRemind.text = Language.Get("RuneSpecialHoleCost", speical.cost);
            m_SpecialLevelRemind.text = Language.Get("RuneSpecialHoleLevel", speical.level);
        }
        private void OnUpdateRuneHoleInfo()
        {
            model.runeLevelUpRedpoint.state = RedPointState.None;
            model.runeReplaceRedpoint.state = RedPointState.None;
            if (model.sltRuneHole == -1)
            if (model.sltRuneHole == -1 || !model.IsRuneHoleOpen(model.sltRuneHole))
            {
                return;
            }