2755【前端】仙盟联赛积分奖励新增只根据排名变化奖励
| | |
| | | var rankKey = UIHelper.GetIntervalAward(fairyLeagueModel.integralRankAwardDict.Keys, _index + 1);
|
| | | if (rankKey != -1)
|
| | | {
|
| | | var _awardItem = fairyLeagueModel.integralRankAwardDict[rankKey][0];
|
| | | var _per = fairyLeagueModel.integralRankAwardPer[fairyLeagueModel.fairyLeagueGroupId - 1];
|
| | | var _count = (int)Mathf.Max(_awardItem.item.count * ((float)_per / 100), 1);
|
| | | m_AwardItem.Init(_awardItem.item.id, _count, _awardItem.isBind);
|
| | | var _item = fairyLeagueModel.integralRankAwardDict[rankKey][0];
|
| | | var _per = 100;
|
| | | if ((fairyLeagueModel.fairyLeagueGroupId - 1) >= 0
|
| | | && (fairyLeagueModel.fairyLeagueGroupId - 1) < fairyLeagueModel.integralRankAwardPer.Length)
|
| | | {
|
| | | _per = fairyLeagueModel.integralRankAwardPer[fairyLeagueModel.fairyLeagueGroupId - 1];
|
| | | }
|
| | | var _count = (int)Mathf.Max(_item.count * (_item.isPer == 1 ? ((float)_per / 100) : 1), 1);
|
| | | m_AwardItem.Init(_item.id, _count, _item.bind);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private set;
|
| | | }
|
| | | public readonly int buffTypeId = 22203;
|
| | | public Dictionary<int, List<AwardItem>> integralRankAwardDict = new Dictionary<int, List<AwardItem>>();
|
| | | public Dictionary<int, List<IntegralRankItem>> integralRankAwardDict = new Dictionary<int, List<IntegralRankItem>>();
|
| | | public int[] integralRankAwardPer { get; private set; }
|
| | | public int integralAddition { get; private set; }
|
| | | public Dictionary<int, int[]> crystalSortDict { get; private set; }
|
| | |
| | | foreach (Match match in _regex.Matches(cfg.Numerical1))
|
| | | {
|
| | | var _rank = int.Parse(match.Groups[1].Value);
|
| | | List<AwardItem> _list = ParseAward(StringUtility.Contact('[', match.Groups[2].Value, ']'));
|
| | | var _value = StringUtility.Contact('[', match.Groups[2].Value, ']');
|
| | | List<IntegralRankItem> _list = ParseAward(LitJson.JsonMapper.ToObject<int[][]>(_value));
|
| | | integralRankAwardDict.Add(_rank, _list);
|
| | | }
|
| | | integralRankAwardPer = JsonMapper.ToObject<int[]>(cfg.Numerical2);
|
| | |
| | | _item.item.id = _array[i][0];
|
| | | _item.item.count = _array[i][1];
|
| | | _item.isBind = _array[i][2];
|
| | | _list.Add(_item);
|
| | | }
|
| | | }
|
| | | return _list;
|
| | | }
|
| | |
|
| | | private List<IntegralRankItem> ParseAward(int[][] itemsArray)
|
| | | {
|
| | | List<IntegralRankItem> _list = new List<IntegralRankItem>();
|
| | | if (itemsArray != null)
|
| | | {
|
| | | for (int i = 0; i < itemsArray.Length; i++)
|
| | | {
|
| | | IntegralRankItem _item = new IntegralRankItem();
|
| | | _item.id = itemsArray[i][0];
|
| | | _item.count = itemsArray[i][1];
|
| | | _item.bind = itemsArray[i][2];
|
| | | _item.isPer = itemsArray[i].Length > 3 ? itemsArray[i][3] : 1;
|
| | | _list.Add(_item);
|
| | | }
|
| | | }
|
| | |
| | | public int IsFinalMatch;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct IntegralRankItem
|
| | | {
|
| | | public int id;
|
| | | public int count;
|
| | | public int bind;
|
| | | public int isPer;
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class AwardItemUI
|
| | | {
|
| | |
| | | m_FightTimeTxt.text = TimeUtility.SecondsToHMS(_data.FightTime);
|
| | | m_WinImg.gameObject.SetActive(_data.IsWin);
|
| | | var _rankKey = UIHelper.GetIntervalAward(model.integralRankAwardDict.Keys, _index + 1);
|
| | | var _Award = model.integralRankAwardDict[_rankKey][0];
|
| | | var _per = model.integralRankAwardPer[model.fairyLeagueGroupId - 1];
|
| | | var _count = (int)Mathf.Max(_Award.item.count * ((float)_per / 100), 1);
|
| | | m_IntegralAward.Init(_Award.item.id, _count, _Award.isBind);
|
| | | var _item = model.integralRankAwardDict[_rankKey][0];
|
| | | var _per = 100;
|
| | | if ((model.fairyLeagueGroupId - 1) >= 0
|
| | | && (model.fairyLeagueGroupId - 1) < model.integralRankAwardPer.Length)
|
| | | {
|
| | | _per = model.integralRankAwardPer[model.fairyLeagueGroupId - 1];
|
| | | }
|
| | | var _count = (int)Mathf.Max(_item.count * (_item.isPer == 1 ? ((float)_per / 100) : 1), 1);
|
| | | m_IntegralAward.Init(_item.id, _count, _item.bind);
|
| | | m_IntegralAward.itemCnt.text = StringUtility.Contact("X", _count);
|
| | | m_ContainChampion.gameObject.SetActive(model.fairyLeagueGroupId == 5 && _index == model.GetBattleFirstPlayer());
|
| | | m_ChampionAwardBtn.onClick.RemoveAllListeners();
|
| | |
| | | if (_dict != null)
|
| | | {
|
| | | _rankKey = UIHelper.GetIntervalAward(_dict.Keys, (int)PlayerDatas.Instance.worldLv);
|
| | | _Award = _dict[_rankKey][0];
|
| | | var _Award = _dict[_rankKey][0];
|
| | | m_ChampionAward.Init(_Award.item.id, Mathf.Min(1, _Award.item.count), _Award.isBind);
|
| | | m_ChampionAwardBtn.onClick.AddListener(() =>
|
| | | {
|