少年修仙传客户端代码仓库
lcy
2024-12-10 cf97e6827af1b16cff9b26f99e906aa75bde130a
10300 仙缘礼包支持多档
2个文件已修改
67 ■■■■ 已修改文件
System/LoopAct/FairyAffinity/FairyAffinityRechargeGiftActModel.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/LoopAct/FairyAffinity/FairyAffinityRechargeGiftActWin.cs 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/LoopAct/FairyAffinity/FairyAffinityRechargeGiftActModel.cs
@@ -29,7 +29,6 @@
        public event Action<int> onStateUpdate;
        public Redpoint redPoint = new Redpoint(MainRedDot.FairyAffinityRepoint, MainRedDot.FairyAffinityRepoint * 10 + 4); //可能挂多个父红点
        public int getGiftCount;//仙缘礼包购买x次可获得积福奖励
        private int GiftAwardRecord; //领取状态
@@ -51,7 +50,6 @@
            storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
            vipModel.rechargeCountEvent += VipModel_rechargeCountEvent;
            OpenServerActivityCenter.Instance.Register(activityID, this, activityType);
            getGiftCount = int.Parse(FuncConfigConfig.Get("FairyAffinity").Numerical3);
        }
        public void OnBeforePlayerDataInitialize()
@@ -146,8 +144,10 @@
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(operaType, out act);
            if (act == null) return 0;
            if (GetBuyTotalCnt() < count) return 0;
            if (act == null)
                return 0;
            if (GetBuyTotalCnt() < count)
                return 0;
            if (((int)Math.Pow(2, count) & GiftAwardRecord) == 0)
            {
                return 1;
System/LoopAct/FairyAffinity/FairyAffinityRechargeGiftActWin.cs
@@ -44,8 +44,13 @@
            model.PlayAnimationSync += OnPlaySyncAnimation;
            if (curValue == 0)
                return;
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
            if (act == null) return;
            int awardShowIndex = GetAwardShowIndex();
            var awardInfo = act.buyCountGifts[awardShowIndex];
            int freeState = model.GetBuyGiftState(0);
            int cntState = model.GetBuyGiftState(model.getGiftCount);
            int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
            for (int i = 0; i < freeTweenList.Count; i++)
            {
@@ -121,8 +126,13 @@
                buyCountGiftTweenList[i].Stop();
                buyCountGiftTweenList[i].SetStartState();
            }
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
            if (act == null) return;
            int awardShowIndex = GetAwardShowIndex();
            var awardInfo = act.buyCountGifts[awardShowIndex];
            int freeState = model.GetBuyGiftState(0);
            int cntState = model.GetBuyGiftState(model.getGiftCount);
            int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
            for (int i = 0; i < freeTweenList.Count; i++)
            {
@@ -189,11 +199,10 @@
        {
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
            int freeState = model.GetBuyGiftState(0);
            int cntState = model.GetBuyGiftState(model.getGiftCount);
            var awardInfo = act.buyCountGifts[0];
            var awards = awardInfo.AwardItemList;
            int freeState = model.GetBuyGiftState(0);
            for (int i = 0; i < freeItems.Count; i++)
            {
@@ -228,7 +237,9 @@
                }
            }
            awardInfo = act.buyCountGifts[GetIndex(model.getGiftCount)];
            int awardShowIndex = GetAwardShowIndex();
            awardInfo = act.buyCountGifts[awardShowIndex];
            int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
            awards = awardInfo.AwardItemList;
            for (int i = 0; i < buyCountGiftItems.Count; i++)
            {
@@ -243,7 +254,7 @@
                    {
                        if (cntState == 1)
                        {
                            model.SendGetAward(model.getGiftCount);
                            model.SendGetAward(awardInfo.NeedBuyCount);
                        }
                        else
                        {
@@ -263,13 +274,15 @@
                }
            }
            int totalBuyCnt = model.GetBuyTotalCnt();
            buyCountGiftSlider.value = totalBuyCnt / (float)model.getGiftCount;
            buyCountGiftSliderText.text = string.Format("{0}/{1}", totalBuyCnt, model.getGiftCount);
            buyCountGiftText.text = Language.Get("FairyAffinity11", Mathf.Max(0, model.getGiftCount - totalBuyCnt));
            int totalBuyCnt = model.GetBuyTotalCnt();
            int needBuyCount = awardInfo.NeedBuyCount;
            buyCountGiftSlider.value = totalBuyCnt / (float)needBuyCount;
            buyCountGiftSliderText.text = string.Format("{0}/{1}", totalBuyCnt,needBuyCount);
            buyCountGiftText.text = Language.Get("FairyAffinity11", Mathf.Max(0, needBuyCount));
            model.IsPlayAnimation = true;
        }
        private void OnRefreshCell(ScrollerDataType type, CellView cell)
        {
@@ -347,28 +360,13 @@
            return seconds;
        }
        private int GetIndex(int cnt)
        {
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
            if (act == null) return 0;
            for (int i = 0; i < act.buyCountGifts.Count; i++)
            {
                if (act.buyCountGifts[i].NeedBuyCount == cnt)
                {
                    return i;
                }
            }
            return 0;
        }
        private int GetAwardShowIndex()
        {
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
            if (act == null) return 0;
            for (int i = 0; i < act.buyCountGifts.Count; i++)
            for (int i = 1; i < act.buyCountGifts.Count; i++)
            {
                if (model.GetBuyGiftState(act.buyCountGifts[i].NeedBuyCount) != 2)
                {
@@ -390,8 +388,13 @@
                buyCountGiftTweenList[i].Stop();
                buyCountGiftTweenList[i].SetStartState();
            }
            OperationRechargeGiftAct act;
            OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
            if (act == null) return ;
            int awardShowIndex = GetAwardShowIndex();
            var awardInfo = act.buyCountGifts[awardShowIndex];
            int freeState = model.GetBuyGiftState(0);
            int cntState = model.GetBuyGiftState(model.getGiftCount);
            int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
            for (int i = 0; i < freeTweenList.Count; i++)
            {