| | |
| | | {
|
| | | Dictionary<int, List<TrialExchangeConfig>> trialTokenExchangeDict = new Dictionary<int, List<TrialExchangeConfig>>();
|
| | | Dictionary<int, int> lineToTokenClassDict;
|
| | | Dictionary<int, Dictionary<int, int[]>> trialRewardDict = new Dictionary<int, Dictionary<int, int[]>>();
|
| | | public Dictionary<int, List<int>> trialClassTokens = new Dictionary<int, List<int>>();
|
| | | public List<int> trialTokens = new List<int>();
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
| | | }
|
| | | var funcConfig = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("LineToItemStage");
|
| | | lineToTokenClassDict = ConfigParse.GetDic<int, int>(funcConfig.Numerical1);
|
| | |
|
| | | var trialRewards = ConfigManager.Instance.GetAllValues<TrialRewardsConfig>();
|
| | | for (int i = 0; i < trialRewards.Count; i++)
|
| | | {
|
| | | Dictionary<int, int[]> dict = null;
|
| | | if (!trialRewardDict.TryGetValue(trialRewards[i].lineId, out dict))
|
| | | {
|
| | | dict = new Dictionary<int, int[]>();
|
| | | trialRewardDict.Add(trialRewards[i].lineId, dict);
|
| | | }
|
| | | dict.Add(trialRewards[i].grade, trialRewards[i].rewards);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | public bool TryGetTrialExchanges(int lv, out List<TrialExchangeConfig> list)
|
| | | {
|
| | | return trialTokenExchangeDict.TryGetValue(lv, out list);
|
| | | }
|
| | |
|
| | | public bool TryGetTrialRewards(int lineId, int grade, out int[] rewards)
|
| | | {
|
| | | rewards = null;
|
| | | if (trialRewardDict.ContainsKey(lineId))
|
| | | {
|
| | | if (trialRewardDict[lineId].ContainsKey(grade))
|
| | | {
|
| | | rewards = trialRewardDict[lineId][grade];
|
| | | return rewards != null && rewards.Length > 0;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public List<int> GetTotalClass()
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public int GetExchangeItemByJob(TrialExchangeConfig config)
|
| | | {
|
| | | if (config == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | if (config.exchangeItemID.Length == 1)
|
| | | {
|
| | | return config.exchangeItemID[0];
|
| | | }
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | if (job - 1 < config.exchangeItemID.Length && job - 1 >= 0)
|
| | | {
|
| | | return config.exchangeItemID[job - 1];
|
| | | }
|
| | | return config.exchangeItemID[0];
|
| | | }
|
| | |
|
| | | #region 红点
|
| | | void UpdateRedpoint()
|
| | | {
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | var exchangeItemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(config.exchangeItemID);
|
| | | var exchangeItemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(GetExchangeItemByJob(config));
|
| | | if (exchangeItemConfig.EquipPlace == 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (EquipCompare(config.exchangeItemID) == 1)
|
| | | if (EquipCompare(GetExchangeItemByJob(config)) == 1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | var itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(list[i].exchangeItemID);
|
| | | var itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(GetExchangeItemByJob(list[i]));
|
| | | if (SatisfyExchangeBetter(list[i].id) && itemConfig.EquipPlace != 0)
|
| | | {
|
| | | _id = list[i].id;
|