少年修仙传客户端代码仓库
client_Wu Xijin
2018-09-12 87b962e643fdbfba0a40e688ef561e6327ede275
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
6个文件已修改
12个文件已添加
463 ■■■■■ 已修改文件
Core/GameEngine/DataToCtl/PackageRegedit.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA514_tagCMPrayElixir.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA514_tagCMPrayElixir.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA321_tagMCPrayElixirResult.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA321_tagMCPrayElixirResult.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA321_tagMCPrayElixirResult.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA321_tagMCPrayElixirResult.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/LingDanTips.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/PrayDrugCell.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/PrayDrugCell.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/PrayForDurgModel.cs 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/PrayForDurgModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/PrayforDrugWin.cs 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/PrayforDrugWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzItemCell.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Rune/RuneModel.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Rune/RuneMosaicWin.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/ModelCenter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -164,6 +164,7 @@
        Register(typeof(HA309_tagMCEquipPartSuiteLVInfo), typeof(DTCA309_tagMCEquipPartSuiteLVInfo));   //得到套装数据
        Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer));   //得到合成结果回应
        Register(typeof(HA317_tagMCAllEquipAttrActiveInfo), typeof(DTCA317_tagMCAllEquipAttrActiveInfo));   //得到激活全身星级和全身强化的信息
        Register(typeof(HA321_tagMCPrayElixirResult), typeof(DTCA321_tagMCPrayElixirResult)); //祈福丹药结果
        #region 背包
        Register(typeof(H0724_tagRolePackCanUseCount), typeof(DTC0724_tagRolePackCanUseCount));
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA514_tagCMPrayElixir.cs
New file
@@ -0,0 +1,16 @@
using UnityEngine;
using System.Collections;
// A5 14 祈福丹药 #tagCMPrayElixir
public class CA514_tagCMPrayElixir : GameNetPackBasic {
    public CA514_tagCMPrayElixir () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA514;
    }
    public override void WriteToBytes () {
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA514_tagCMPrayElixir.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5bde2875341bd7c49962b151d98e4195
timeCreated: 1536719781
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA321_tagMCPrayElixirResult.cs
New file
@@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;
using Snxxz.UI;
// A3 21 祈福丹药结果 #tagMCPrayElixirResult
public class DTCA321_tagMCPrayElixirResult : DtcBasic {
    PrayForDurgModel prayModel { get { return ModelCenter.Instance.GetModel<PrayForDurgModel>(); } }
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA321_tagMCPrayElixirResult vNetData = vNetPack as HA321_tagMCPrayElixirResult;
        prayModel.SetPrayResult(vNetData);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA321_tagMCPrayElixirResult.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0388f4972c8e8d84c93f7797c0ce87a2
timeCreated: 1536719781
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HA3_Function/HA321_tagMCPrayElixirResult.cs
New file
@@ -0,0 +1,19 @@
using UnityEngine;
using System.Collections;
// A3 21 祈福丹药结果 #tagMCPrayElixirResult
public class HA321_tagMCPrayElixirResult : GameNetPackBasic {
    public uint ItemID;    // 物品ID
    public byte PrayCnt;    // 今日祈福次数
    public HA321_tagMCPrayElixirResult () {
        _cmd = (ushort)0xA321;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out ItemID, vBytes, NetDataType.DWORD);
        TransBytes (out PrayCnt, vBytes, NetDataType.BYTE);
    }
}
Core/NetworkPackage/ServerPack/HA3_Function/HA321_tagMCPrayElixirResult.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 047cdded69879da4181bd2c1bbd0e426
timeCreated: 1536719781
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/BlastFurnace/LingDanTips.cs
@@ -49,6 +49,7 @@
        [SerializeField]
        private Button _makeDanBtn;
        [SerializeField] Button prayDurgBtn;
        [SerializeField] FurnaceFireChooseWin ChooseWin;
        [SerializeField] UIEffect bgEffect;
@@ -95,6 +96,10 @@
            _danDrugCtrl.lockType = EnhanceLockType.KeepVertical;
            _toggleGroup = _danDrugCtrl.GetComponent<ToggleGroup>();
            _makeDanBtn.onClick.AddListener(OnClickMakeDan);
            prayDurgBtn.AddListener(()=>
            {
                WindowCenter.Instance.Open<PrayforDrugWin>();
            });
            FurnaceModel.RefreshStoveModelEvent += RefreshStoveModel;
            FurnaceModel.RefreshAddSpecMatEvent += SetSpecMatItemCell;
            _randomLineCtrl.OnRefreshCell += RefreshRandomLineCell;
System/BlastFurnace/PrayDrugCell.cs
New file
@@ -0,0 +1,55 @@
using UnityEngine;
using UnityEngine.UI;
using EnhancedUI.EnhancedScroller;
using TableConfig;
namespace Snxxz.UI
{
    public class PrayDrugCell : MonoBehaviour
    {
        [SerializeField] CommonItemBaisc itemBaisc;
        [SerializeField] UIEffect effect;
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        PrayForDurgModel prayModel { get { return ModelCenter.Instance.GetModel<PrayForDurgModel>(); } }
        public void SetDisplayModel(int itemId)
        {
            ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
            if(itemConfig == null)
            {
                itemBaisc.gameObject.SetActive(false);
                if(effect.IsPlaying)
                {
                    effect.Stop();
                }
            }
            else
            {
                int effectId = prayModel.GetEffectIdById(itemId);
                if(effectId != 0)
                {
                    effect.effect = effectId;
                    effect.Play();
                }
                else
                {
                    if(effect.IsPlaying)
                    {
                        effect.Stop();
                    }
                }
                itemBaisc.gameObject.SetActive(true);
                ItemCellModel cellModel = new ItemCellModel(itemId);
                itemBaisc.Init(cellModel);
                itemBaisc.cellBtn.RemoveAllListeners();
                itemBaisc.cellBtn.AddListener(()=>
                {
                    ItemAttrData attrData = new ItemAttrData(itemId);
                    tipsModel.SetItemTipsModel(attrData);
                });
            }
        }
    }
}
System/BlastFurnace/PrayDrugCell.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cf5babd996559ba41b01936b0a94c660
timeCreated: 1536667518
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/BlastFurnace/PrayForDurgModel.cs
New file
@@ -0,0 +1,116 @@
using LitJson;
using System;
using System.Collections.Generic;
using System.Linq;
using TableConfig;
namespace Snxxz.UI
{
    public class PrayForDurgModel : Model
    {
        BlastFurnaceModel blastModel { get { return ModelCenter.Instance.GetModel<BlastFurnaceModel>(); } }
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        Dictionary<int, int> prayDrugDict = new Dictionary<int, int>(); //丹药id 特效id
        public override void Init()
        {
            SetPrayDrugCondi();
            SetPrayDrugDict();
        }
        public override void UnInit()
        {
        }
        #region 读取本地配置
        public int costMoney { get; private set; }
        public int everyDayNum { get; private set; }
        private void SetPrayDrugCondi()
        {
            FuncConfigConfig func = Config.Instance.Get<FuncConfigConfig>("GodAlchemy");
            costMoney = int.Parse(func.Numerical2);
            everyDayNum = int.Parse(func.Numerical3);
        }
        /// <summary>
        /// 得到所有祈求丹药数据
        /// </summary>
        private Dictionary<int, int> SetPrayDrugDict()
        {
            FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("GodAlchemyShow");
            JsonData jsonData = JsonMapper.ToObject(funcConfig.Numerical1);
            prayDrugDict.Clear();
            if (jsonData.IsArray)
            {
                for (int i = 0; i < jsonData.Count; i++)
                {
                    if (jsonData[i].IsArray)
                    {
                        int itemId = int.Parse(jsonData[i][0].ToString());
                        if (jsonData[i].Count > 1)
                        {
                            int effectId = int.Parse(jsonData[i][1].ToString());
                            prayDrugDict.Add(itemId, effectId);
                        }
                        else
                        {
                            prayDrugDict.Add(itemId, 0);
                        }
                    }
                }
            }
            return prayDrugDict;
        }
        #endregion
        #region 协议
        public int itemId { get; private set; }
        public int alreadyPrayNum { get; private set;}
        public void SetPrayResult(HA321_tagMCPrayElixirResult elixirResult)
        {
            itemId = (int)elixirResult.ItemID;
            alreadyPrayNum = elixirResult.PrayCnt;
        }
        public void SendPrayElixir()
        {
            CA514_tagCMPrayElixir prayElixir = new CA514_tagCMPrayElixir();
            GameNetSystem.Instance.SendInfo(prayElixir);
        }
        #endregion
        List<int> prayIdlist = new List<int>();
        public List<int> GetPrayDruglist()
        {
            prayIdlist.Clear();
            List<AlchemyConfig> configs = blastModel.alchemyModellist;
            foreach(var key in prayDrugDict.Keys)
            {
                for (int i = 0; i < configs.Count; i++)
                {
                    if (blastModel.StoveLV >= configs[i].BlastFurnaceLV)
                    {
                        List<int> idlist = blastModel.GetPreviewMakeDruglist(configs[i]).Keys.ToList();
                        if(idlist.Contains(key))
                        {
                            AttrFruitConfig fruitConfig = Config.Instance.Get<AttrFruitConfig>(key);
                            if (!playerPack.IsReachMaxUseDrug(fruitConfig))
                            {
                                prayIdlist.Add(key);
                            }
                            break;
                        }
                    }
                }
            }
            return prayIdlist;
        }
        public int GetEffectIdById(int drugId)
        {
            int effectId = 0;
            prayDrugDict.TryGetValue(drugId,out effectId);
            return effectId;
        }
    }
}
System/BlastFurnace/PrayForDurgModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9daef4307100edf43a11679d8c407d48
timeCreated: 1536671165
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/BlastFurnace/PrayforDrugWin.cs
New file
@@ -0,0 +1,116 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
namespace Snxxz.UI
{
    public class PrayforDrugWin : Window
    {
        [SerializeField] ScrollerController ctrl;
        [SerializeField] Button prayBtn;
        [SerializeField] Text costText;
        [SerializeField] Button closeBtn;
        [Header("最大格子数")]
        [SerializeField] int gridCount = 100;
        [Header("每行数量")]
        [SerializeField] int columnCout = 5;
        PrayForDurgModel PrayModel { get { return ModelCenter.Instance.GetModel<PrayForDurgModel>(); } }
        List<int> praylist;
        protected override void BindController()
        {
            ctrl.OnRefreshCell += RefreshPrayDrug;
        }
        protected override void AddListeners()
        {
            closeBtn.AddListener(CloseClick);
            prayBtn.AddListener(ClickPrayBtn);
        }
        protected override void OnPreOpen()
        {
            praylist = PrayModel.GetPrayDruglist();
            UpdatePrayPack();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        private void SetDisplayUI()
        {
            costText.text = PrayModel.costMoney.ToString();
        }
        private void ClickPrayBtn()
        {
            if(PrayModel.alreadyPrayNum >= PrayModel.everyDayNum)
            {
                MessageWin.Inst.ShowFixedTip("今日祈福次数已满");
                return;
            }
            if(UIHelper.GetMoneyCnt(1) >= (ulong)PrayModel.costMoney)
            {
                PrayModel.SendPrayElixir();
            }
            else
            {
                WindowCenter.Instance.Open<RechargeTipWin>();
            }
        }
        private void UpdatePrayPack()
        {
            if (ctrl.GetNumberOfCells(ctrl.m_Scorller) == 0)
            {
                ctrl.Refresh();
                var _line = gridCount / columnCout;
                for (int i = 0; i < _line; i++)
                {
                    ctrl.AddCell(ScrollerDataType.Header, i);
                }
                ctrl.Restart();
            }
            else
            {
                ctrl.m_Scorller.RefreshActiveCellViews();
            }
        }
        private void RefreshPrayDrug(ScrollerDataType type, CellView cell)
        {
            var _line = cell.index;
            int length = cell.transform.childCount;
            for (int i = 0; i < length; i++)
            {
                var _index = _line * length + i;
                PrayDrugCell prayCell = cell.transform.GetChild(i).GetComponent<PrayDrugCell>();
                if(_index < praylist.Count)
                {
                    prayCell.SetDisplayModel(praylist[_index]);
                }
                else
                {
                    prayCell.SetDisplayModel(0);
                }
            }
        }
    }
}
System/BlastFurnace/PrayforDrugWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e78dc3625a4636348b8ef7501bdb51a2
timeCreated: 1536667028
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Dogz/DogzItemCell.cs
@@ -15,7 +15,6 @@
        {
            dogzModel.GetDogzItemList();
            ItemModel model = null;
            DebugEx.Log("Display:" + index + "数据长度:" + dogzModel.dogzItemList.Count);
            if (index < dogzModel.dogzItemList.Count)
            {
                model = dogzModel.dogzItemList[index];
System/Rune/RuneModel.cs
@@ -691,10 +691,6 @@
                    }
                }
            }
            if (OnRefreshRuneHole != null)
            {
                OnRefreshRuneHole();
            }
            for (int i = 0; i < RUNE_HOLE_COUNT; i++)
            {
                if (!serverInited)
@@ -702,7 +698,7 @@
                    break;
                }
                int k = 1 << i;
                var oldOpen = (holeState & k) == k;
                var oldOpen = (oldHoleState & k) == k;
                if (!oldOpen && IsRuneHoleOpen(i))
                {
                    if (openNewHoleEvent != null)
@@ -711,6 +707,10 @@
                    }
                }
            }
            if (OnRefreshRuneHole != null)
            {
                OnRefreshRuneHole();
            }
            UpdateRedpoint();
            UpdateBreakRedpoint();
            UpdateSpecialHoleRedpoint();
System/Rune/RuneMosaicWin.cs
@@ -67,6 +67,8 @@
        }
        bool m_IsRuneLvUp = false;
        int m_SpecialHoleUnlocking = -1;
        Coroutine m_CacheCoroutine;
        #region Built-in
        protected override void BindController()
        {
@@ -102,6 +104,7 @@
            m_ContainerSpecial.gameObject.SetActive(false);
            OpenOrCloseSelect(false);
            model.sltRuneHole = -1;
            m_SpecialHoleUnlocking = -1;
            foreach (var _hole in runeHoleDatas)
            {
                _hole.SetSelect(false);
@@ -123,6 +126,14 @@
            model.OnRefreshRuneHole -= OnRuneHoleRefresh;
            model.OnRefreshRuneExp -= OnUpdateRuneHoleInfo;
            model.openNewHoleEvent -= OpenNewHoleEvent;
            m_SpecialHoleUnlocking = -1;
            if (m_CacheCoroutine != null)
            {
                StopCoroutine(m_CacheCoroutine);
                m_CacheCoroutine = null;
            }
        }
        protected override void OnAfterClose()
@@ -134,8 +145,17 @@
        {
            if (model.IsSpeicalHole(hole))
            {
                m_SpecialHoleUnlocking = hole;
                EffectMgr.Instance.PlayUIEffect(3068, 2500, runeHoleDatas[hole].Container.parent, false);
                m_CacheCoroutine = StartCoroutine(Co_RefreshHole());
            }
        }
        IEnumerator Co_RefreshHole()
        {
            yield return WaitingForSecondConst.WaitMS800;
            m_SpecialHoleUnlocking = -1;
            OnRuneHoleRefresh();
        }
        private void UnlockSpecialHole()
@@ -227,7 +247,7 @@
        void OnRuneHoleClick(int _hole)
        {
            if (model.IsRuneHoleOpen(_hole))
            if (model.IsRuneHoleOpen(_hole) && m_SpecialHoleUnlocking != _hole)
            {
                for (int i = 0; i < runeHoleDatas.Count; i++)
                {
@@ -284,6 +304,10 @@
            model.runeLevelUpRedpoint.state = RedPointState.None;
            model.runeReplaceRedpoint.state = RedPointState.None;
            if (model.sltRuneHole == -1 || !model.IsRuneHoleOpen(model.sltRuneHole))
            {
                return;
            }
            if (model.sltRuneHole == m_SpecialHoleUnlocking)
            {
                return;
            }
@@ -403,7 +427,7 @@
            for (int i = 0; i < runeHoleDatas.Count; i++)
            {
                RuneData data = model.GetHoleRune(i);
                runeHoleDatas[i].SetRuneHole(!model.IsRuneHoleOpen(i));
                runeHoleDatas[i].SetRuneHole(!model.IsRuneHoleOpen(i) || m_SpecialHoleUnlocking == i);
                if (data == null || !model.IsRuneHoleOpen(i))
                {
                    runeHoleDatas[i].Display(0, 0);
System/WindowBase/ModelCenter.cs
@@ -192,6 +192,7 @@
            RegisterModel<TreasureSoulModel>();
            RegisterModel<FairyGrabBossModel>();
            RegisterModel<GodBeastModel>();
            RegisterModel<PrayForDurgModel>();
            inited = true;
        }