少年修仙传客户端代码仓库
5761 子 【开发】【1.5】新增300级后的成长基金 / 【前端】【1.5】新增300级后的成长基金
1个文件已修改
79 ■■■■ 已修改文件
System/Vip/FairyJadeInvestmentModel.cs 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Vip/FairyJadeInvestmentModel.cs
@@ -22,7 +22,8 @@
    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, int> InfoSeriorsTwo = new Dictionary<int, int>();//奖励领取信息//key为索引,Value(0,未领,其他值未领的钱数)等级(301-400)
    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 static Action FairyJadeInfoSeriorsUpdate;
    public int InvestGold = 0; // 投资额度
@@ -132,7 +133,6 @@
        FairyJadeInvestmentDic.Clear();
        InvestmentAmountDic.Clear();
        InfoSeriors.Clear();
        InfoSeriorsTwo.Clear();
        Assignment();
    }
@@ -147,6 +147,7 @@
        PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;
        FairyJadeInvestmentWin.FairyJadeInvestmentRedPointEvent -= FairyJadeInvestmentRedPoint;
        FairyJadeInvestmentWin.FairyJadeInvestmentRedPointEvent += FairyJadeInvestmentRedPoint;
        DebugEx.LogError(InfoSeriorsTypeDic);
    }
    private void FairyJadeInvestmentRedPoint()
@@ -171,7 +172,7 @@
    }
    public void AssignmentType()
    private void AssignmentType()
    {
        //根据投资类型来存储奖励信息(类型3,4,5)
        if (FairyJadeInvestmentTypeDic.Count >= 3)
@@ -187,14 +188,7 @@
                {
                    Dictionary<int, FairyJadeInvestmentClass> Dic = new Dictionary<int, FairyJadeInvestmentClass>();
                    FairyJadeInvestmentClass fairyJadeInvestment = new FairyJadeInvestmentClass();
                    if (value.id >= 310)
                    {
                        fairyJadeInvestment.ID = value.id % 100;
                    }
                    else
                    {
                        fairyJadeInvestment.ID = value.id % 10;
                    }
                    fairyJadeInvestment.ID = value.id % 100;
                    fairyJadeInvestment.Type = value.type;
                    fairyJadeInvestment.NeedDay = value.needDay;
                    fairyJadeInvestment.NeedLv = value.needLV;
@@ -229,6 +223,7 @@
                    {
                        fairyJadeInvestment.ID = value.id % 10;
                    }
                    SetInfoSeriors(value.type, fairyJadeInvestment.ID);
                    fairyJadeInvestment.Type = value.type;
                    fairyJadeInvestment.NeedDay = value.needDay;
                    fairyJadeInvestment.NeedLv = value.needLV;
@@ -260,12 +255,34 @@
                }
            }
        }
       // DebugEx.LogError(FairyJadeInvestmentTypeDic);
        // DebugEx.LogError(FairyJadeInvestmentTypeDic);
    }
    private void SetInfoSeriors(int type, int id)
    {
        if (!InfoSeriorsTypeDic.ContainsKey(type))
        {
            Dictionary<int, int> dic = new Dictionary<int, int>();
            dic.Add(id, 0);
            InfoSeriorsTypeDic.Add(type, dic);
        }
        else
        {
            var dict = InfoSeriorsTypeDic[type];
            if (dict.ContainsKey(id))
            {
                dict.Add(id, 0);
            }
            else
            {
                dict[id] = 0;
            }
        }
    }
    public void Assignment()
    {
       // AssignmentType();
        AssignmentType();
        var InvestConfig = Config.Instance.GetAllValues<InvestConfig>();
        if (FairyJadeInvestmentDic.Count > 0)
        {
@@ -310,7 +327,7 @@
                FairyJadeInvestmentDic.Add(value.needLV, fairyJadeInvestment);
            }
        }
      //  DebugEx.LogError(FairyJadeInvestmentDic);
        //  DebugEx.LogError(FairyJadeInvestmentDic);
    }
    public void GetInfoSeriors(HA337_tagMCGoldInvestInfo vNetData)//接受信息
@@ -343,6 +360,24 @@
                InvestmentRedPoint();
            }
        }
        if (vNetData.InvestType == 3 || vNetData.InvestType == 4 || vNetData.InvestType == 5)
        {
            if (InfoSeriorsTypeDic.ContainsKey(vNetData.InvestType))//奖励刷新赋值
            {
                var Dit = InfoSeriorsTypeDic[vNetData.InvestType];
                for (int i = 0; i < vNetData.RewardRecordCnt; i++)
                {
                    if (Dit.ContainsKey((int)vNetData.InvestRewardList[i].RewardIndex))
                    {
                        Dit[(int)vNetData.InvestRewardList[i].RewardIndex] = (int)vNetData.InvestRewardList[i].RewardValue;
                    }
                }
                InfoSeriorsTypeDic[vNetData.InvestType] = Dit;
            }
        }
    }
    public void SendInvestment(int InvestType, int RewardIndex)//领取奖励
@@ -363,6 +398,7 @@
    public void InvestmentAmount()
    {
        InvestmentAmountType();
        if (InvestmentAmountDic.Count <= 0)
        {
            InvestmentAmountDic.Add(VipInvestModel.GetInvestGold(3, 0), 1);
@@ -373,6 +409,21 @@
        }
    }
    private void InvestmentAmountType()
    {
        if (InvestmentAmountTypeDic.Count > 0)
        {
            return;
        }
        Dictionary<int, int> Dic = new Dictionary<int, int>();
        Dic.Add(VipInvestModel.GetInvestGold(3, 0), 1);
        Dic.Add(VipInvestModel.GetInvestGold(3, 1), 2);
        Dic.Add(VipInvestModel.GetInvestGold(3, 2), 3);
        Dic.Add(VipInvestModel.GetInvestGold(3, 3), 4);
        InvestmentAmountTypeDic.Add(3, Dic);
        InvestmentAmountTypeDic.Add(4, Dic);
        InvestmentAmountTypeDic.Add(5, Dic);
    }
    private const int Redpoint_key1 = 20910;
    public Redpoint redPointStre1 = new Redpoint(209, Redpoint_key1);//仙玉投资红点
    public int JumpInedx = 0;