| | |
| | | int playerId = (int)PlayerDatas.Instance.baseData.PlayerID;
|
| | | helpInfoLocalSave = StringUtility.Contact("HelpInfoLocalSave", playerId);
|
| | | GetLocalSaveData();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | {
|
| | | var ratio = (float)addRatio / 100;
|
| | | addRatioStr = StringUtility.Contact(ratio, "%");
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool TryGetCurVipAddCoins(out int addCoins)
|
| | | {
|
| | | addCoins = 0;
|
| | | int vipLv = PlayerDatas.Instance.baseData.VIPLv;
|
| | | var vipDict = VipPrivilegeConfig.GetVipPrivilegeDic(VipPrivilegeType.AssistXianYuanCoinsAdd);
|
| | | if (vipDict == null || vipLv < 1) return false;
|
| | | List<int> vipLvlist = vipDict.Keys.ToList();
|
| | | vipLvlist.Sort();
|
| | | for (int i = vipLvlist.Count - 1; i > -1; i--)
|
| | | {
|
| | | var lv = vipLvlist[i];
|
| | | var coins = vipDict[lv];
|
| | | if (vipLv >= lv && coins > 0)
|
| | | {
|
| | | addCoins = coins;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | public void UpdateAssistList(HB207_tagMCHelpBattleList battleList)
|
| | | {
|
| | | assistPlayerDict.Clear();
|
| | | List<AssistPlayerInfo> playerInfos = new List<AssistPlayerInfo>();
|
| | | assistRefreshNum = battleList.RefreshCount;
|
| | | for(int i = 0; i < battleList.HelpCount; i++)
|
| | | {
|
| | | var info = battleList.HelpPlayerList[i];
|
| | | AssistPlayerInfo playerInfo = new AssistPlayerInfo(info);
|
| | | assistPlayerDict.Add(playerInfo.PlayerID,playerInfo);
|
| | | playerInfos.Add(playerInfo);
|
| | | |
| | | }
|
| | | playerInfos.Sort(CompareByFightPower);
|
| | | for(int i = 0; i < playerInfos.Count; i++)
|
| | | {
|
| | | var playerInfo = playerInfos[i];
|
| | | assistPlayerDict.Add(playerInfo.PlayerID, playerInfo);
|
| | | }
|
| | |
|
| | | if(UpdataAssistPlayerListEvent != null)
|
| | |
| | | {
|
| | | WindowCenter.Instance.Open<DungeonAssistPlayerWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | public int CompareByFightPower(AssistPlayerInfo start,AssistPlayerInfo end)
|
| | | {
|
| | | int x = start.FightPower;
|
| | | int y = end.FightPower;
|
| | | if (x.CompareTo(y) != 0) return -x.CompareTo(y);
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public event Action<int> UpdataAssistPlayerEvent;
|
| | |
| | | {
|
| | | UpdateCheckInResultEvent();
|
| | | }
|
| | | UpdateRedpoint();
|
| | | }
|
| | | private List<AssistResult> assistResults = new List<AssistResult>();
|
| | | public void UpdateAssistResultNotify(HB211_tagMCHelpBattleRecordList recordList)
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region 红点
|
| | | public const int AssistCheckInRedPoint = 7800001;
|
| | | public Redpoint checkInRedpoint = new Redpoint(AssistCheckInRedPoint);
|
| | | public void UpdateRedpoint()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DayDaily)) return;
|
| | |
|
| | | if(IsCheckInOk)
|
| | | {
|
| | | checkInRedpoint.state = RedPointState.None;
|
| | | }
|
| | | else
|
| | | {
|
| | | checkInRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public class AssistResult
|
| | | {
|
| | | public int assistType; // 1 真实的自己 2 自己的镜像
|