少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace vnxbqy.UI
{
    public class OperationAccumulateRecharge : OperationBase
    {
        //ActNum活动编号,根据重置字段决定是否多日累充,区分 DaysAccumulateRecharge和 AccumulateRecharge
        public List<Reward> rewards = new List<Reward>();
        public override bool SatisfyOpenCondition()
        {
            return PlayerDatas.Instance.baseData.LV >= limitLv;
        }
 
        public override string ToDisplayTime()
        {
            var textBuilder = OperationTimeHepler.textBuilder;
            textBuilder.Length = 0;
            textBuilder.Append(startDate.ToDisplay());
            if (startDate != endDate)
            {
                textBuilder.Append("—");
                textBuilder.Append(endDate.ToDisplay());
            }
            return textBuilder.ToString();
        }
 
        public override void Reset()
        {
            base.Reset();
            rewards.Clear();
        }
 
        public void ParseAccumulateRecharge(HAA1D_tagMCActTotalRechargeInfo package)
        {
            for (int i = 0; i < package.AwardDays; i++)
            {
                var _reward = package.AwardDayInfo[i];
                Reward reward = new Reward();
                for (int k = 0; k < _reward.AwardCount; k++)
                {
                    Recharge recharge = new Recharge();
                    recharge.requireGold = UIHelper.GetRealCoin((int)_reward.AwardInfo[k].NeedGold);
                    recharge.index = _reward.AwardInfo[k].AwardIndex;
                    for (int q = 0; q < _reward.AwardInfo[k].AwardItemCount; q++)
                    {
                        var _item = _reward.AwardInfo[k].AwardItem[q];
                        recharge.items.Add(new Item()
                        {
                            id = (int)_item.ItemID,
                            count = _item.ItemCount,
                            bind = _item.IsBind,
                        });
                    }
                    reward.recharges.Add(recharge);
                }
                rewards.Add(reward);
            }
        }
 
        public Reward GetReward(DateTime time)
        {
            if (rewards.Count == 0)
            {
                return null;
            }
            var index = Mathf.Min(rewards.Count - 1, IndexOfTime(time));
            return rewards[index];
        }
 
        public class Reward
        {
            public List<Recharge> recharges = new List<Recharge>();
        }
 
        public class Recharge
        {
            public int index;
            public float requireGold;
            public List<Item> items = new List<Item>();
        }
 
        public struct Item
        {
            public int id;
            public int bind;
            public int count;
        }
    }
}