少年修仙传客户端代码仓库
client_Hale
2018-11-15 7165fc3a2b22f957a3f1f7d1d61a92cc5d23148c
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已修改
163 ■■■■ 已修改文件
System/DailyQuest/DailyQuestModel.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Strengthening/WashTips.cs 154 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/DailyQuest/DailyQuestModel.cs
@@ -740,21 +740,21 @@
                    }
                    else
                    {
                        if (unLock1 && !unLock2)
                        if (!miss1 && miss2)
                        {
                            return -1;
                        }
                        else if (!unLock1 && unLock2)
                        else if (miss1 && !miss2)
                        {
                            return 1;
                        }
                        else
                        {
                            if (!miss1 && miss2)
                            if (unLock1 && !unLock2)
                            {
                                return -1;
                            }
                            else if (miss1 && !miss2)
                            else if (!unLock1 && unLock2)
                            {
                                return 1;
                            }
@@ -763,6 +763,7 @@
                                return _lhs < _rhs ? -1 : 1;
                            }
                        }
                    }
                }
            }
System/Strengthening/WashTips.cs
@@ -42,6 +42,9 @@
    [SerializeField]
    UIEffect washEffect;
    [SerializeField]
    UIEffect mustWashEffect;
    [SerializeField] float offest = 50;
    #endregion
@@ -50,12 +53,6 @@
    private EquipWashConfig.EquipWashData _tagWashModel;
    private ItemModel _itemModel; //洗练的装备
    private int[] _costMoneylist = null;
    private int _costmoney = 0;
    public int CostMoney
    {
        get { return _costmoney; }
        set { _costmoney = value; }
    }
    private List<WashProCount> _washInfolist;
    private int curWashEquip = 0;
@@ -112,7 +109,7 @@
        _specWashOpenCondition.gameObject.SetActive(true);
        _specWashFullText.gameObject.SetActive(false);
        _equipWashCtrl.OnRefreshCell += RefreshEquipWashCell;
        EquipReinforceEventMgr.Instance.RefreshWashCostMoneyEvent = RefreshCostMoney;
        EquipReinforceEventMgr.Instance.RefreshWashCostMoneyEvent = UpdateMustWash;
        _openSpecWashPro.SetActive(false);
    }
@@ -290,14 +287,6 @@
        {
            _washLevelTitle.text = Language.Get("EquipWash108", washPro.XLAttrLV);
        }
        _costMatCell.gameObject.SetActive(true);
        ItemCellModel cellModel = new ItemCellModel(washModel.washConfig.costItem);
        _costMatCell.Init(cellModel);
        _costMatCell.cellBtn.RemoveAllListeners();
        _costMatCell.cellBtn.onClick.AddListener(() =>
        {
            itemPathModel.SetChinItemModel(washModel.washConfig.costItem);
        });
        #region 刷新物品UI
        if (itemModel == null)
@@ -308,7 +297,6 @@
        else
        {
            noEquipObj.SetActive(false);
            RefreshCostItem(itemModel.packType, itemModel.itemInfo.ItemPlace, itemModel.itemInfo.ItemID);
            _itemModel = itemModel;
            _washEquipCell.gameObject.SetActive(true);
            _washEquipCell.Init(itemModel);
@@ -317,10 +305,9 @@
            {
                itemTipsModel.SetItemTipsModel(PackType.rptEquip, itemModel.itemInfo.ItemGUID);
            });
            RefreshCostMoney();
        }
        UpdateMustWash();
        #endregion
        RefreshSpecWashUI();
@@ -333,17 +320,15 @@
    //刷新材料
    public void RefreshCostItem(PackType type, int index, int id)
    {
        SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
        if (singlePack == null)
            return;
        if (type != PackType.rptItem) return;
        UpdateMustWash();
        _costMatCell.countText.gameObject.SetActive(true);
        int bagItemCount = singlePack.GetItemCountByID(_tagWashModel.washConfig.costItem);
        if (bagItemCount >= _tagWashModel.washConfig.costCount)
            _costMatCell.countText.text = UIHelper.AppendStringColor(TextColType.Green, bagItemCount.ToString(),true) + "/" + _tagWashModel.washConfig.costCount;
        else
            _costMatCell.countText.text = UIHelper.AppendStringColor(TextColType.Red, bagItemCount.ToString()) + "/" + _tagWashModel.washConfig.costCount;
    }
    private void UpdateMustWash()
    {
        UpdateWashMat();
        UpdateMustWashCostMoney();
    }
    public void UpdateWashMat()
@@ -358,21 +343,21 @@
        else
        {
            UpdateItemCell(_tagWashModel.washConfig.costItem, contain_Cost_NormalItem, _tagWashModel.washConfig.costCount);
            UpdateItemCell(equipWashModel.mustWashMatId, contain_Cost_MustAddItem, GetMustAddNum());
            UpdateItemCell(equipWashModel.mustWashMatId, contain_Cost_MustAddItem, GetMustAddCost());
        }
    }
    private void UpdateMustWashCostMoney()
    {
        int costMatId = equipWashModel.mustWashMatId;
        int costNum = GetMustAddCost();
        int haveNum = playerPack.GetItemCountByID(PackType.rptItem,costMatId);
        var storeConfig = StoreConfig.GetStoreCfg(costMatId, 1);
        int matPrice = storeConfig == null ? 0 : storeConfig.MoneyNumber;
        int costMoney = 0;
        if(haveNum < costNum)
        int goldCount = (int)PlayerDatas.Instance.baseData.Gold;
        int costMoney = GetCostMoney();
        if (goldCount >= costMoney)
        {
            costMoney = (costNum - haveNum) * matPrice;
            contain_Cost_Money.text = StringUtility.Contact("<color=#109D06>", costMoney, "</color>");
        }
        else
        {
            contain_Cost_Money.text = StringUtility.Contact("<color=#ff0000>", costMoney, "</color>");
        }
    }
@@ -380,7 +365,7 @@
    {
        ItemCellModel cellModel = new ItemCellModel(itemId);
        itemCell.Init(cellModel);
        itemCell.countText.gameObject.SetActive(true);
        itemCell.countText.gameObject.SetActive(_washProModel.isPutOn);
        int haveNum = playerPack.GetItemCountByID(PackType.rptItem,itemId);
        string matNumStr = string.Empty;
        if (haveNum >= needNum)
@@ -397,6 +382,21 @@
        {
            itemPathModel.SetChinItemModel(itemId);
        });
    }
    private int GetCostMoney()
    {
        int costMatId = equipWashModel.mustWashMatId;
        int costNum = GetMustAddCost();
        int haveNum = playerPack.GetItemCountByID(PackType.rptItem, costMatId);
        var storeConfig = StoreConfig.GetStoreCfg(costMatId, 1);
        int matPrice = storeConfig == null ? 0 : storeConfig.MoneyNumber;
        int costMoney = 0;
        if (haveNum < costNum)
        {
            costMoney = (costNum - haveNum) * matPrice;
        }
        return costMoney;
    }
    /// <summary>
@@ -429,29 +429,13 @@
    /// <returns></returns>
    public int GetMustAddCost()
    {
        if (_tagWashModel == null) return 0;
        int mustAddNum = GetMustAddNum();
        if (_tagWashModel == null || mustAddNum < 1) return 0;
        int index = mustAddNum - 1;
        return mustAddNum > _tagWashModel.mustCosts.Length ? 0 : _tagWashModel.mustCosts[index];
    }
    //刷新仙玉
    public void RefreshCostMoney()
    {
        CostMoney = GetMustAddCost();
        int goldCount = (int)PlayerDatas.Instance.baseData.Gold;
        if (goldCount >= CostMoney)
        {
            _costMoneyText.text = StringUtility.Contact("<color=#109D06>", CostMoney.ToString(), "</color>");
        }
        else
        {
            _costMoneyText.text = StringUtility.Contact("<color=#ff0000>", CostMoney.ToString(), "</color>");
        }
    }
    //刷新特殊洗练UI
    public void RefreshSpecWashUI()
@@ -619,48 +603,52 @@
    {
        if (_washProModel.isPutOn)
        {
            int costMoney = GetCostMoney();
            int goldCount = (int)PlayerDatas.Instance.baseData.Gold;
            int mustAddNum = GetMustAddNum();
            if (equipWashModel.IsEnoughMat(_tagWashModel.washConfig))
            {
                if (CostMoney > 0)
                if (costMoney > 0)
                {
                    if (goldCount >= CostMoney)
                    int costNum = GetMustAddCost();
                    int haveNum = playerPack.GetItemCountByID(PackType.rptItem,equipWashModel.mustWashMatId);
                    string costMat = StringUtility.Contact(haveNum,"/",costNum);
                    if (isOpenPrompting)
                    {
                        if (isOpenPrompting)
                        ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("EquipWash103",costMat,costMoney),
                        Language.Get("ConfirmCancel101"), (bool isOk, bool isToggle) =>
                        {
                            ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("EquipWash103", CostMoney),
                            Language.Get("ConfirmCancel101"), (bool isOk, bool isToggle) =>
                            if (isOk)
                            {
                                if (isOk)
                                if(IsMoneyEnough())
                                {
                                    washEffect.Play();
                                    mustWashEffect.Play();
                                    equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                                }
                            }
                                isOpenPrompting = !isToggle;
                            });
                        }
                        else
                        {
                            washEffect.Play();
                            equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                        }
                            isOpenPrompting = !isToggle;
                        });
                    }
                    else
                    {
                        if (VersionConfig.Get().isBanShu)
                        if(IsMoneyEnough())
                        {
                            SysNotifyMgr.Instance.ShowTip("GoldErr");
                            return;
                            mustWashEffect.Play();
                            equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                        }
                        WindowCenter.Instance.Open<RechargeTipWin>();
                    }
                }
                else
                {
                    washEffect.Play();
                    if(mustAddNum > 0)
                    {
                        mustWashEffect.Play();
                    }
                    else
                    {
                        washEffect.Play();
                    }
                    equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                }
            }
@@ -676,6 +664,18 @@
    }
    private bool IsMoneyEnough()
    {
        int costMoney = GetCostMoney();
        int goldCount = (int)PlayerDatas.Instance.baseData.Gold;
        if(goldCount < costMoney)
        {
            WindowCenter.Instance.Open<RechargeTipWin>();
            return false;
        }
        return true;
    }
    private int GetWashCheckUseGoldAttr()
    {
        int code = 0;