少年修仙传客户端代码仓库
5761 子 【开发】【1.5】新增300级后的成长基金 / 【前端】【1.5】新增300级后的成长基金
3个文件已修改
237 ■■■■■ 已修改文件
System/Vip/FairyJadeInvestmentItem.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Vip/FairyJadeInvestmentModel.cs 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Vip/FairyJadeInvestmentWin.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Vip/FairyJadeInvestmentItem.cs
@@ -93,7 +93,8 @@
                        m_ReceiveAwardBtn.RemoveAllListeners();
                        m_ReceiveAwardBtn.AddListener(() =>
                        {
                            fairyJadeInvestmentModel.SendInvestment(3, indexID);
                            int type = fairyJadeInvestmentModel.GetType();
                            fairyJadeInvestmentModel.SendInvestment(type, indexID);
                        });
                    }
                    else
@@ -117,7 +118,8 @@
                            m_ReceiveAwardBtn.RemoveAllListeners();
                            m_ReceiveAwardBtn.AddListener(() =>
                            {
                                fairyJadeInvestmentModel.SendInvestment(3, indexID);
                                int type = fairyJadeInvestmentModel.GetType();
                                fairyJadeInvestmentModel.SendInvestment(type, indexID);
                            });
                        }
                        else
@@ -182,7 +184,6 @@
            int InvestmentGrade = fairyJadeInvestmentModel.GetInvestmentGrade();
            if (Dit.ContainsKey(Lv))
            {
                int grade = 3;
                if (InvestmentGrade != 0)
                {
@@ -274,9 +275,9 @@
            int ShowLineNumber = 0;
            int type = fairyJadeInvestmentModel.GetType();
            if (fairyJadeInvestmentModel.InfoSeriorsTypeDic.ContainsKey(type))
            if (fairyJadeInvestmentModel.InvestmentAmountTypeDic.ContainsKey(type))
            {
                var dit = fairyJadeInvestmentModel.InfoSeriorsTypeDic[type];
                var dit = fairyJadeInvestmentModel.InvestmentAmountTypeDic[type];
                foreach (var key in dit.Keys)
                {
                    if (dit[key] == grade)
@@ -299,9 +300,9 @@
            else
            {
                int type = fairyJadeInvestmentModel.GetType();
                if (fairyJadeInvestmentModel.InfoSeriorsTypeDic.ContainsKey(type))
                if (fairyJadeInvestmentModel.InvestmentAmountTypeDic.ContainsKey(type))
                {
                    var dit = fairyJadeInvestmentModel.InfoSeriorsTypeDic[type];
                    var dit = fairyJadeInvestmentModel.InvestmentAmountTypeDic[type];
                    if (dit.ContainsKey(fairyJadeInvestmentModel.SelectNumber))
                    {
                        grade = dit[fairyJadeInvestmentModel.SelectNumber];
@@ -339,9 +340,9 @@
            else
            {
                int type = fairyJadeInvestmentModel.GetType();
                if (fairyJadeInvestmentModel.InfoSeriorsTypeDic.ContainsKey(type))
                if (fairyJadeInvestmentModel.InvestmentAmountTypeDic.ContainsKey(type))
                {
                    var dit = fairyJadeInvestmentModel.InfoSeriorsTypeDic[type];
                    var dit = fairyJadeInvestmentModel.InvestmentAmountTypeDic[type];
                    if (dit.ContainsKey(fairyJadeInvestmentModel.SelectNumber))
                    {
                        grade = dit[fairyJadeInvestmentModel.SelectNumber];
System/Vip/FairyJadeInvestmentModel.cs
@@ -25,16 +25,11 @@
[XLua.LuaCallCSharp]
public class FairyJadeInvestmentModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
{
    //   public Dictionary<int, FairyJadeInvestmentClass> FairyJadeInvestmentDic = new Dictionary<int, FairyJadeInvestmentClass>();//等级(0-300级)
    public Dictionary<int, Dictionary<int, FairyJadeInvestmentClass>> FairyJadeInvestmentTypeDic = new Dictionary<int, Dictionary<int, FairyJadeInvestmentClass>>();//根据投资类型来存储奖励类型和金额(类型3,4,5);
  //  public Dictionary<int, int> InfoSeriors = new Dictionary<int, int>();//奖励领取信息//key为索引,Value(0,未领,其他值未领的钱数)等级(0-300级)
    public Dictionary<int, Dictionary<int, int>> InfoSeriorsTypeDic = new Dictionary<int, Dictionary<int, int>>();//根据类型存储奖励信息
    public Dictionary<int, Dictionary<int, int>> InvestmentAmountTypeDic = new Dictionary<int, Dictionary<int, int>>();//根据类型获得投资金额
   // public Dictionary<int, int> InvestmentAmountDic = new Dictionary<int, int>();//投资金额
    public Dictionary<int, BinningClass> BinningDic = new Dictionary<int, BinningClass>();//根据类型获取各个类型投资的档位金额和分档
    public static Action FairyJadeInfoSeriorsUpdate;
   // public int InvestGold = 0; // 投资额度
   // public int InvestmentGrade = 0;//0未投,1档,2,档,3,档,4档
    public int SelectNumber = 0;//记录想要投资的钱数
    public int RecordSelectNumberMax = 0;//用来标记最大可投资额度
    public List<int> MultipleList = new List<int>();
@@ -100,7 +95,7 @@
                }
            }
        }
        if (PlayerDatas.Instance.baseData.LV >= 300 && !isOpen)
        if (PlayerDatas.Instance.baseData.LV > 500 && !isOpen)
        {
            return false;
        }
@@ -135,15 +130,11 @@
    {
        IsOk = false;
        IsRedpoint = false;
       // InvestGold = 0;
        SelectNumber = 0;
        RecordSelectNumberMax = 0;
        InvestmentAmountTypeDic.Clear();
        InfoSeriorsTypeDic.Clear();
        FairyJadeInvestmentTypeDic.Clear();
        // FairyJadeInvestmentDic.Clear();
        // InvestmentAmountDic.Clear();
        // InfoSeriors.Clear();
        Assignment();
    }
@@ -158,7 +149,6 @@
        PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;
        FairyJadeInvestmentWin.FairyJadeInvestmentRedPointEvent -= FairyJadeInvestmentRedPoint;
        FairyJadeInvestmentWin.FairyJadeInvestmentRedPointEvent += FairyJadeInvestmentRedPoint;
        DebugEx.LogError(InfoSeriorsTypeDic);
    }
    private void FairyJadeInvestmentRedPoint()
@@ -204,6 +194,7 @@
                    fairyJadeInvestment.Type = value.type;
                    fairyJadeInvestment.NeedDay = value.needDay;
                    fairyJadeInvestment.NeedLv = value.needLV;
                    SetInfoSeriors(value.type, fairyJadeInvestment.ID);
                    MonthlyInvestmentModel.MonthlyInvestmentItem FairyJadeItem = new MonthlyInvestmentModel.MonthlyInvestmentItem();
                    var _jsonData = LitJson.JsonMapper.ToObject(value.award);
                    foreach (string key in _jsonData.Keys)
@@ -227,14 +218,7 @@
                {
                    var dict = FairyJadeInvestmentTypeDic[value.type];
                    FairyJadeInvestmentClass fairyJadeInvestment = new FairyJadeInvestmentClass();
                    if (value.id >= 310)
                    {
                        fairyJadeInvestment.ID = value.id % 100;
                    }
                    else
                    {
                        fairyJadeInvestment.ID = value.id % 10;
                    }
                    fairyJadeInvestment.ID = fairyJadeInvestment.ID = value.id % 100;
                    SetInfoSeriors(value.type, fairyJadeInvestment.ID);
                    fairyJadeInvestment.Type = value.type;
                    fairyJadeInvestment.NeedDay = value.needDay;
@@ -267,7 +251,6 @@
                }
            }
        }
        // DebugEx.LogError(FairyJadeInvestmentTypeDic);
    }
    private void SetInfoSeriors(int type, int id)
@@ -296,84 +279,10 @@
    public void Assignment()
    {
        AssignmentType();
        //var InvestConfig = Config.Instance.GetAllValues<InvestConfig>();
        //if (FairyJadeInvestmentDic.Count > 0)
        //{
        //    return;
        //}
        //foreach (var value in InvestConfig)
        //{
        //    if (value.type == 3 && !FairyJadeInvestmentDic.ContainsKey(value.needLV))
        //    {
        //        FairyJadeInvestmentClass fairyJadeInvestment = new FairyJadeInvestmentClass();
        //        if (value.id >= 310)
        //        {
        //            fairyJadeInvestment.ID = value.id % 100;
        //        }
        //        else
        //        {
        //            fairyJadeInvestment.ID = value.id % 10;
        //        }
        //        if (!InfoSeriors.ContainsKey(fairyJadeInvestment.ID))
        //        {
        //            InfoSeriors.Add(fairyJadeInvestment.ID, 0);
        //        }
        //        fairyJadeInvestment.Type = value.type;
        //        fairyJadeInvestment.NeedDay = value.needDay;
        //        fairyJadeInvestment.NeedLv = value.needLV;
        //        MonthlyInvestmentModel.MonthlyInvestmentItem FairyJadeItem = new MonthlyInvestmentModel.MonthlyInvestmentItem();
        //        var _jsonData = LitJson.JsonMapper.ToObject(value.award);
        //        foreach (string key in _jsonData.Keys)
        //        {
        //            var _job = int.Parse(key);
        //            var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
        //            for (int j = 0; j < _itemArray.Length; j++)
        //            {
        //                FairyJadeItem.Add(_job, new AwardItem()
        //                {
        //                    item = new Item(_itemArray[j][0], _itemArray[j][1]),
        //                    isBind = _itemArray[j][2],
        //                });
        //            }
        //        }
        //        fairyJadeInvestment.FairyJadeInvestmentItem = FairyJadeItem;
        //        FairyJadeInvestmentDic.Add(value.needLV, fairyJadeInvestment);
        //    }
        //}
        //  DebugEx.LogError(FairyJadeInvestmentDic);
    }
    public void GetInfoSeriors(HA337_tagMCGoldInvestInfo vNetData)//接受信息
    {
        //if (vNetData.InvestType == 3)
        //{
        //    InvestmentAmount();
        //    InvestGold = (int)vNetData.InvestGold;
        //    if (InvestmentAmountDic.ContainsKey(InvestGold))
        //    {
        //        InvestmentGrade = InvestmentAmountDic[InvestGold];
        //    }
        //    else
        //    {
        //        InvestmentGrade = 0;
        //    }
        //    for (int i = 0; i < vNetData.RewardRecordCnt; i++)
        //    {
        //        if (InfoSeriors.ContainsKey((int)vNetData.InvestRewardList[i].RewardIndex))
        //        {
        //            InfoSeriors[(int)vNetData.InvestRewardList[i].RewardIndex] = (int)vNetData.InvestRewardList[i].RewardValue;
        //        }
        //    }
        //    if (FairyJadeInfoSeriorsUpdate != null)
        //    {
        //        FairyJadeInfoSeriorsUpdate();
        //    }
        //    if (IsOk)
        //    {
        //        InvestmentRedPoint();
        //    }
        //}
        if (vNetData.InvestType == 3 || vNetData.InvestType == 4 || vNetData.InvestType == 5)
        {
            InvestmentAmount();
@@ -382,8 +291,10 @@
                var dit = InvestmentAmountTypeDic[vNetData.InvestType];
                if (dit.ContainsKey((int)vNetData.InvestGold))
                {
                    BinningDic[vNetData.InvestType].Money = (int)vNetData.InvestGold;
                    BinningDic[vNetData.InvestType].Binning = dit[(int)vNetData.InvestGold];
                    BinningClass binningClass = new BinningClass();
                    binningClass.Money= (int)vNetData.InvestGold;
                    binningClass.Binning= dit[(int)vNetData.InvestGold];
                    BinningDic[vNetData.InvestType] = binningClass;
                }
            }
@@ -399,6 +310,7 @@
                }
                InfoSeriorsTypeDic[vNetData.InvestType] = Dit;
            }
            InvestmentRedPoint();
            if (FairyJadeInfoSeriorsUpdate != null)
            {
                FairyJadeInfoSeriorsUpdate();
@@ -426,14 +338,6 @@
    {
        InvestmentAmountType();
        SetBinning();
        //if (InvestmentAmountDic.Count <= 0)
        //{
        //    InvestmentAmountDic.Add(VipInvestModel.GetInvestGold(3, 0), 1);
        //    InvestmentAmountDic.Add(VipInvestModel.GetInvestGold(3, 1), 2);
        //    InvestmentAmountDic.Add(VipInvestModel.GetInvestGold(3, 2), 3);
        //    InvestmentAmountDic.Add(VipInvestModel.GetInvestGold(3, 3), 4);
        //    RecordSelectNumberMax = VipInvestModel.GetInvestGold(3, 3);
        //}
    }
    private void SetBinning()
@@ -442,12 +346,12 @@
        {
            return;
        }
        BinningClass binning = new BinningClass();
        binning.Money = 0;
        binning.Money = 0;
        BinningDic.Add(3, binning);
        BinningDic.Add(4, binning);
        BinningDic.Add(5, binning);
        BinningClass binning1 = new BinningClass();
        BinningClass binning2 = new BinningClass();
        BinningClass binning3 = new BinningClass();
        BinningDic.Add(3, binning1);
        BinningDic.Add(4, binning2);
        BinningDic.Add(5, binning3);
    }
    private void InvestmentAmountType()
    {
@@ -490,7 +394,7 @@
            type += 1;
            if (PlayerLV >= key)
            {
                int indexID = Dit[key].ID;
                int indexID = Dit[key].ID;
                if (InvestmentGrade != 0)
                {
                    var dit = GetInfoSeriors();
@@ -637,8 +541,10 @@
            return 3;
        }
        bool Isbool3 = false;
        if (FairyJadeInvestmentTypeDic.ContainsKey(3) && InfoSeriorsTypeDic.ContainsKey(3))
        {
            int typeGrade = GetInvestmentGradeT(3);
            var dit = FairyJadeInvestmentTypeDic[3];
            var dit1 = InfoSeriorsTypeDic[3];
            foreach (var key in dit.Keys)
@@ -650,6 +556,21 @@
                    if (IsReceive == 0)
                    {
                        Isbool3 = true;
                    }
                    else
                    {
                        List<AwardItem> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
                        int AtPresentNumber = 0;
                        if (IsReceive != 0)
                        {
                            List<AwardItem> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
                            AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
                            AtPresentNumber = itemAdd.item.count;
                        }
                        if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
                        {
                            Isbool3 = true;
                        }
                    }
                }
            }
@@ -665,6 +586,7 @@
        bool Isbool4 = false;
        if (FairyJadeInvestmentTypeDic.ContainsKey(4) && InfoSeriorsTypeDic.ContainsKey(4))
        {
            int typeGrade = GetInvestmentGradeT(4);
            var dit = FairyJadeInvestmentTypeDic[4];
            var dit1 = InfoSeriorsTypeDic[4];
            foreach (var key in dit.Keys)
@@ -676,6 +598,22 @@
                    if (IsReceive == 0)
                    {
                        Isbool4 = true;
                    }
                    else
                    {
                        List<AwardItem> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
                        int AtPresentNumber = 0;
                        if (IsReceive != 0)
                        {
                            List<AwardItem> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
                            AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
                            AtPresentNumber = itemAdd.item.count;
                        }
                        if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
                        {
                            Isbool3 = true;
                        }
                    }
                }
            }
@@ -691,6 +629,7 @@
        bool Isbool5 = false;
        if (FairyJadeInvestmentTypeDic.ContainsKey(5) && InfoSeriorsTypeDic.ContainsKey(5))
        {
            int typeGrade = GetInvestmentGradeT(5);
            var dit = FairyJadeInvestmentTypeDic[5];
            var dit1 = InfoSeriorsTypeDic[5];
            foreach (var key in dit.Keys)
@@ -703,6 +642,21 @@
                    {
                        Isbool5 = true;
                    }
                    else
                    {
                        List<AwardItem> fairyJadeInvestmentItem = dit[key].FairyJadeInvestmentItem.GetAwardItem(typeGrade);
                        int AtPresentNumber = 0;
                        if (IsReceive != 0)
                        {
                            List<AwardItem> fairyJadeInvestmentItemAdd = dit[key].FairyJadeInvestmentItem.GetAwardItem(IsReceive);
                            AwardItem itemAdd = fairyJadeInvestmentItemAdd[0];
                            AtPresentNumber = itemAdd.item.count;
                        }
                        if (fairyJadeInvestmentItem[0].item.count > AtPresentNumber)
                        {
                            Isbool3 = true;
                        }
                    }
                }
            }
        }
@@ -713,6 +667,16 @@
        }
        return type;
    }
    private int GetInvestmentGradeT(int Type)
    {
        int InvestmentGrade = 0;
        if (BinningDic.ContainsKey(Type))
        {
            InvestmentGrade = BinningDic[Type].Binning;
        }
        return InvestmentGrade;
    }
    public int GetInvestmentGrade()//获取投资档位
    {
        int InvestmentGrade = 0;
System/Vip/FairyJadeInvestmentWin.cs
@@ -276,11 +276,11 @@
        private void InvestmentButton()//仙玉投资
        {
            int InvestGold = fairyJadeInvestmentModel.GetInvestGold();
            if (PlayerDatas.Instance.baseData.LV > 300)
            {
                MessageWin.Inst.ShowFixedTip(Language.Get("HasExceededTheInvestmentGrade_Z"));
                return;
            }
            //if (PlayerDatas.Instance.baseData.LV > 300)
            //{
            //    MessageWin.Inst.ShowFixedTip(Language.Get("HasExceededTheInvestmentGrade_Z"));
            //    return;
            //}
            if (InvestGold > 0)
            {
                ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), string.Format(Language.Get("FairyJadeInvestment_2"), fairyJadeInvestmentModel.SelectNumber - InvestGold), (bool isOk) =>
@@ -336,7 +336,8 @@
            int getFairyJade = (int)UIHelper.GetMoneyCnt(1);
            if (getFairyJade >= (fairyJade - InvestGold))
            {
                fairyJadeInvestmentModel.InvestmentMonthlyInvestment(3, fairyJade);
                int type = fairyJadeInvestmentModel.GetType();
                fairyJadeInvestmentModel.InvestmentMonthlyInvestment(type, fairyJade);
            }
            else
            {
@@ -374,9 +375,9 @@
        {
            var money = fairyJadeInvestmentModel.SelectNumber;
            int ype = fairyJadeInvestmentModel.GetType();
            if (fairyJadeInvestmentModel.InfoSeriorsTypeDic.ContainsKey(ype))
            if (fairyJadeInvestmentModel.InvestmentAmountTypeDic.ContainsKey(ype))
            {
                var dit = fairyJadeInvestmentModel.InfoSeriorsTypeDic[ype];
                var dit = fairyJadeInvestmentModel.InvestmentAmountTypeDic[ype];
                if (dit.ContainsKey(money))
                {
                    var type = dit[money];
@@ -392,21 +393,6 @@
                    }
                }
            }
            //if (fairyJadeInvestmentModel.InvestmentAmountDic.ContainsKey(money))
            //{
            //    var type = fairyJadeInvestmentModel.InvestmentAmountDic[money];
            //    if (GearPositionList.Contains(type))
            //    {
            //        int Inedx = GearPositionList.IndexOf(type);
            //        m_Image1.SetSprite(IconList1[Inedx]);
            //        m_Image1.SetNativeSize();
            //        m_Image2.SetSprite(IconList2[Inedx]);
            //        m_Image2.SetNativeSize();
            //        m_Image3.SetSprite(IconList3[Inedx]);
            //        m_Image3.SetNativeSize();
            //    }
            //}
        }
    }