少年修仙传客户端代码仓库
client_Zxw
2019-03-28 13bdbb2404eb32d9274f8973162ab71c53d55d60
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
7个文件已修改
190 ■■■■■ 已修改文件
System/EquipTrain/EquipTrainCandidateBehaviour.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainModel.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainWin.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FairyAu/FairyApplyWin.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FairyAu/FairyModel.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HeavenBattle/HeavenBattleInfo.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ItemTip/EquipTipUtility.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainCandidateBehaviour.cs
@@ -85,8 +85,12 @@
            if (force || this.candidate.trainLevel.dirty)
            {
                m_Description2.text = string.Format("洗练等级:{0}级", this.candidate.trainLevel.Fetch());
                m_Description2.color = UIHelper.GetUIColor(TextColType.Black, true);
                var trainLevel = this.candidate.trainLevel.Fetch();
                if (!string.IsNullOrEmpty(this.candidate.equipGuid.value))
                {
                    m_Description2.text = string.Format("洗练等级:{0}级", trainLevel);
                    m_Description2.color = UIHelper.GetUIColor(TextColType.Black, true);
                }
            }
        }
System/EquipTrain/EquipTrainModel.cs
@@ -11,7 +11,7 @@
        public readonly LogicInt selectedPlace = new LogicInt();
        public readonly LogicInt equipTrainLevel = new LogicInt();
        public readonly LogicInt equipTrainMaxLevel = new LogicInt();
        public readonly LogicInt material = new LogicInt();
        public readonly LogicInt3 material = new LogicInt3();
        public readonly LogicInt inevitableMaterialCount = new LogicInt();
        public readonly LogicEnum<TrainOperateType> operateType = new LogicEnum<TrainOperateType>(TrainOperateType.None);
        public readonly LogicList<EquipTrainCandidate> candidatePlaces = new LogicList<EquipTrainCandidate>();
@@ -54,7 +54,7 @@
            selectedPlace.value = 0;
            equipTrainLevel.value = 0;
            equipTrainMaxLevel.value = 0;
            material.value = 0;
            material.value = Int3.zero;
            inevitableMaterialCount.value = 0;
            operateType.value = TrainOperateType.None;
            candidatePlaces.Clear();
@@ -127,10 +127,8 @@
                return;
            }
            var need = GetMaterialNeed(equipPosition);
            var itemId = GetTrainMaterial(equipPosition);
            var own = packModel.GetItemCountByID(PackType.Item, itemId);
            if (need > own)
            var material = GetTrainMaterial(equipPosition);
            if (material.z > material.y)
            {
                SysNotifyMgr.Instance.ShowTip("WashStone1");
                return;
@@ -369,12 +367,19 @@
        public int GetTrainLevel(Int2 equipPosition)
        {
            var equip = equipModel.GetEquip(equipPosition);
            if (string.IsNullOrEmpty(equip))
            {
                return 0;
            }
            if (!equipTrains.ContainsKey(equipPosition.x))
            {
                return 0;
            }
            return equipTrains[equipPosition.x].GetTrainLevel(equipPosition.y);
            var maxLevel = GetMaxTrainLevel(equipPosition);
            return Mathf.Min(maxLevel, equipTrains[equipPosition.x].GetTrainLevel(equipPosition.y));
        }
        public int GetTotalLevel(int level)
@@ -389,9 +394,9 @@
        public int GetMaterialNeed(Int2 equipPosition)
        {
            var star = starModel.GetEquipStarLevel(equipPosition);
            var level = GetTrainLevel(equipPosition);
            var type = GetTrainType(equipPosition.y);
            var data = EquipWashConfig.Get(type, star + 1);
            var data = EquipWashConfig.Get(type, level);
            return data.config.costCount;
        }
@@ -404,6 +409,12 @@
        public int GetMaxTrainLevel(Int2 equipPosition)
        {
            var equip = equipModel.GetEquip(equipPosition);
            if (string.IsNullOrEmpty(equip))
            {
                return 0;
            }
            var star = starModel.GetEquipStarLevel(equipPosition);
            var type = GetTrainType(equipPosition.y);
            var config = WashLevelMaxConfig.Get(type, star);
@@ -473,7 +484,33 @@
        public Int3 GetTrainedProperties(Int2 equipPosition)
        {
            return equipTrains.ContainsKey(equipPosition.x) ? equipTrains[equipPosition.x].GetTrainedProperties(equipPosition.y) : Int3.zero;
            var equip = equipModel.GetEquip(equipPosition);
            if (string.IsNullOrEmpty(equip))
            {
                return Int3.zero;
            }
            if (!equipTrains.ContainsKey(equipPosition.x))
            {
                return Int3.zero;
            }
            var maxLevel = GetMaxTrainLevel(equipPosition);
            var trainedProperties = equipTrains[equipPosition.x].GetTrainedProperties(equipPosition.y);
            var type = GetTrainType(equipPosition.y);
            var data = EquipWashConfig.Get(type, maxLevel);
            var property1 = 0;
            var property2 = 0;
            var property3 = 0;
            if (data != null)
            {
                property1 = Mathf.Min(trainedProperties.x, data.config.attMax1);
                property2 = Mathf.Min(trainedProperties.y, data.config.attMax2);
                property3 = Mathf.Min(trainedProperties.z, data.config.attMax3);
            }
            return new Int3(property1, property2, property3);
        }
        private List<int> GetTrainablePlaces(int level)
@@ -537,18 +574,20 @@
            inevitableMaterialCount.value = CalculateInevitableMaterialCount(equipPosition);
        }
        private int GetTrainMaterial(Int2 equipPosition)
        private Int3 GetTrainMaterial(Int2 equipPosition)
        {
            if (GetEquipPlaceTrainState(equipPosition) == TrainState.Allowable)
            {
                var star = starModel.GetEquipStarLevel(equipPosition);
                var type = GetTrainType(equipPosition.y);
                var data = EquipWashConfig.Get(type, star + 1);
                return data.config.costItem;
                var level = GetTrainLevel(equipPosition);
                var data = EquipWashConfig.Get(type, level);
                var count = packModel.GetItemCountByID(PackType.Item, data.config.costItem);
                var need = GetMaterialNeed(equipPosition);
                return new Int3(data.config.costItem, count, need);
            }
            else
            {
                return 0;
                return Int3.zero;
            }
        }
System/EquipTrain/EquipTrainWin.cs
@@ -179,8 +179,7 @@
            if (force || model.material.dirty)
            {
                var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.value);
                DisplayMaterial(equipPosition, model.material.Fetch());
                DisplayMaterial(model.material.Fetch());
            }
            if (force || model.inevitableMaterialCount.dirty)
@@ -201,17 +200,9 @@
        }
        private void DisplayMaterial(Int2 equipPosition, int itemId)
        private void DisplayMaterial(Int3 material)
        {
            var own = 0;
            var need = 0;
            if (itemId > 0)
            {
                need = model.GetMaterialNeed(equipPosition);
                own = packModel.GetItemCountByID(PackType.Item, itemId);
            }
            m_MaterialCell.Display(itemId, need, own);
            m_MaterialCell.Display(material.x, material.y, material.z);
        }
        private void DisplayInevitableMaterial(Int2 equipPosition, int need)
@@ -330,7 +321,7 @@
            public ItemBehaviour m_Material;
            public Text m_MaterialCount;
            public void Display(int itemId, int need, int own)
            public void Display(int itemId, int own, int need)
            {
                if (itemId > 0)
                {
@@ -339,7 +330,7 @@
                    m_MaterialCount.gameObject.SetActive(true);
                    m_Material.SetItem(itemId, 1);
                    var enough = own >= need;
                    m_MaterialCount.text = string.Format("{0}/{1}", UIHelper.AppendColor(enough ? TextColType.White : TextColType.Red, own.ToString(), true), need);
                    m_MaterialCount.text = string.Format("{0}/{1}", UIHelper.AppendColor(enough ? TextColType.Green : TextColType.Red, own.ToString(), true), need);
                }
                else
                {
@@ -378,7 +369,7 @@
                    var enough = own >= need;
                    m_InevitableMaterialCount.text = string.Format("{0}/{1}",
                        UIHelper.AppendColor(enough ? TextColType.White : TextColType.Red, own.ToString(), true), need);
                        UIHelper.AppendColor(enough ? TextColType.Green : TextColType.Red, own.ToString(), true), need);
                    if (diamond > 0)
                    {
System/FairyAu/FairyApplyWin.cs
@@ -222,7 +222,7 @@
            var auctionModel = ModelCenter.Instance.GetModel<AuctionInquiryModel>();
            if (!auctionModel.IsFamilyQuit())
            {
                SysNotifyMgr.Instance.ShowTip("ExitFairyError_Auction");
                SysNotifyMgr.Instance.ShowTip("Paimai8");
                return;
            }
System/FairyAu/FairyModel.cs
@@ -113,10 +113,18 @@
        #region 发包
        public void SendKickFairy(uint playerID)
        {
            C0F09_tagCDeleteFamilyMember kickPack = new C0F09_tagCDeleteFamilyMember();
            kickPack.MemberID = playerID;
            GameNetSystem.Instance.SendInfo(kickPack);
            var auctionModel = ModelCenter.Instance.GetModel<AuctionInquiryModel>();
            if (!auctionModel.IsFamilyQuit((int)playerID))
            {
                SysNotifyMgr.Instance.ShowTip("Paimai7");
                return;
            }
            var pak = new C0F09_tagCDeleteFamilyMember();
            pak.MemberID = playerID;
            GameNetSystem.Instance.SendInfo(pak);
        }
        public void SendApplyFairy(uint id)
        {
            int limit = FuncOpenLVConfig.Get((int)FuncOpenEnum.Fairy).LimitLV;
System/HeavenBattle/HeavenBattleInfo.cs
@@ -7,7 +7,7 @@
namespace Snxxz.UI
{
    [XLua.LuaCallCSharp]
public class HeavenBattleInfo : Singleton<HeavenBattleInfo>
    public class HeavenBattleInfo : Singleton<HeavenBattleInfo>
    {
        public HeavenBattleInfo()
@@ -30,7 +30,7 @@
        }
        #region 仙魔之争的信息
        public int Score1 { get; private set;}   // 仙界阵营积分
        public int Score1 { get; private set; }   // 仙界阵营积分
        public int Score2 { get; private set; }    // 魔界阵营积分
@@ -49,13 +49,13 @@
            this.TopName = info.TopName;
            JsonData jsonData = JsonMapper.ToObject(info.StageRecord);
            foreach(var key in jsonData.Keys)
            foreach (var key in jsonData.Keys)
            {
                int index = int.Parse(key);
                int result = int.Parse(jsonData[key].ToString());
                if(!battleResultDict.ContainsKey(index))
                if (!battleResultDict.ContainsKey(index))
                {
                    battleResultDict.Add(index,result);
                    battleResultDict.Add(index, result);
                }
                else
                {
@@ -65,7 +65,7 @@
                DebugEx.Log("阶段胜利:" + index + "结果:" + result);
            }
            if(bettingResultAct != null)
            if (bettingResultAct != null)
            {
                bettingResultAct();
            }
@@ -74,7 +74,7 @@
        public int GetBattleResultByIndex(int index)
        {
            int result = 0;
            battleResultDict.TryGetValue(index,out result);
            battleResultDict.TryGetValue(index, out result);
            return result;
        }
@@ -82,10 +82,10 @@
        #region 仙魔之争玩家信息
        public int Faction { get; private set; }    // 所属阵营
        public int PlayerScore { get; private set;}    // 积分
        public int PlayerScore { get; private set; }    // 积分
        public int WinCnt { get; private set; }    // 胜场数
        private Dictionary<int, bool> getAwardDict = new Dictionary<int, bool>();  // 胜场奖励领取记录
        private Dictionary<int,List<int>> bettingRecordDict = new Dictionary<int,List<int>>();  // 押注记录 1 阵营1 2 阵营2
        private Dictionary<int, List<int>> bettingRecordDict = new Dictionary<int, List<int>>();  // 押注记录 1 阵营1 2 阵营2
        public event Action bettingRecordAct;
        public void SetHeavenBattlePlayerInfo(HAC03_tagGCXMZZSelfInfo info)
        {
@@ -97,10 +97,10 @@
            this.WinCnt = (int)info.WinCnt;
            string awardRecord = info.WinCntAwardRecord.ToString();
            int sumIndex = ModelCenter.Instance.GetModel<HeavenBattleModel>().heavenAwardDict.Count;
            for(int i = 0; i < sumIndex;i++)
            for (int i = 0; i < sumIndex; i++)
            {
               bool isRecord = MathUtility.GetBitValue(info.WinCntAwardRecord,(ushort)i);
                if(isRecord)
                bool isRecord = MathUtility.GetBitValue(info.WinCntAwardRecord, (ushort)i);
                if (isRecord)
                {
                    getAwardDict.Add(i, true);
                }
@@ -111,10 +111,10 @@
            }
            JsonData jsonData = JsonMapper.ToObject(info.BetRecord);
            foreach(var key in jsonData.Keys)
            foreach (var key in jsonData.Keys)
            {
                int index = int.Parse(key);
                if(jsonData[key].IsArray)
                if (jsonData[key].IsArray)
                {
                    int betRecord = int.Parse(jsonData[key][0].ToString());
                    int betMoney = int.Parse(jsonData[key][1].ToString());
@@ -123,7 +123,7 @@
                        List<int> betlist = new List<int>();
                        betlist.Add(betRecord);
                        betlist.Add(betMoney);
                        bettingRecordDict.Add(index,betlist);
                        bettingRecordDict.Add(index, betlist);
                    }
                    else
                    {
@@ -131,11 +131,11 @@
                        bettingRecordDict[index][1] = betMoney;
                    }
                }
            }
            if(bettingRecordAct != null)
            if (bettingRecordAct != null)
            {
                bettingRecordAct();
            }
@@ -144,7 +144,7 @@
        public bool IsGetAwardByIndex(int index)
        {
            bool isGet = false;
            getAwardDict.TryGetValue(index,out isGet);
            getAwardDict.TryGetValue(index, out isGet);
            return isGet;
        }
@@ -152,8 +152,8 @@
        {
            int record = 0;
            List<int> betlist = null;
            bettingRecordDict.TryGetValue(index,out betlist);
            if(betlist != null)
            bettingRecordDict.TryGetValue(index, out betlist);
            if (betlist != null)
            {
                record = betlist[0];
            }
System/ItemTip/EquipTipUtility.cs
@@ -582,35 +582,21 @@
            var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
            var trainProperty = new TrainProperty();
            var trainLevel = trainModel.GetTrainLevel(equipPosition);
            var star = Mathf.Min(EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV), starModel.GetEquipStarLevel(equipPosition));
            var type = EquipTrainModel.GetTrainType(equipPosition.y);
            var maxConfig = WashLevelMaxConfig.Get(type, star);
            var maxLevel = maxConfig == null ? 1 : maxConfig.levelMax;
            var trainLevel = Mathf.Min(maxLevel, trainModel.GetTrainLevel(equipPosition));
            trainProperty.level = trainLevel;
            var trainConfig = EquipWashConfig.Get(type, trainLevel);
            var trainedProperties = trainModel.GetTrainedProperties(equipPosition);
            var property1 = 0;
            var property2 = 0;
            var property3 = 0;
            var type = EquipTrainModel.GetTrainType(item.config.EquipPlace);
            for (int i = 1; i < trainLevel - 1; i++)
            {
                var data = EquipWashConfig.Get(type, i);
                if (data != null)
                {
                    property1 += data.config.attMax1;
                    property2 += data.config.attMax2;
                    property3 += data.config.attMax3;
                }
            }
            property1 += trainedProperties.x;
            property2 += trainedProperties.y;
            property3 += trainedProperties.z;
            var dataLevel1 = EquipWashConfig.Get(type, 1);
            trainProperty.properties = new List<Int2>();
            trainProperty.properties.Add(new Int2(dataLevel1.config.attType1, property1));
            trainProperty.properties.Add(new Int2(dataLevel1.config.attType2, property2));
            trainProperty.properties.Add(new Int2(dataLevel1.config.attType3, property3));
            trainProperty.properties.Add(new Int2(trainConfig.config.attType1, Mathf.Min(trainedProperties.x, trainConfig.config.attMax1)));
            trainProperty.properties.Add(new Int2(trainConfig.config.attType2, Mathf.Min(trainedProperties.y, trainConfig.config.attMax2)));
            trainProperty.properties.Add(new Int2(trainConfig.config.attType3, Mathf.Min(trainedProperties.z, trainConfig.config.attMax3)));
            return trainProperty;
        }