| | |
| | | using LitJson;
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | |
|
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | |
| | | UIEffect realmEffect;
|
| | | int realmEffectCount = 0;
|
| | |
|
| | | public event Action OnTowerPassEvent;
|
| | | public int passedFloor;
|
| | | //可挑战层
|
| | | public int currentFloor {
|
| | | get { |
| | | return passedFloor + 1; |
| | | } |
| | | }
|
| | |
|
| | | public int selectFloorID; //新的大境界未解锁,或者最后一层时,显示可选的最高层
|
| | |
|
| | | public const int REALM_DUNGEON_ID = 31110;
|
| | | public const int Tower_MapId = 31310;
|
| | |
|
| | | public readonly Redpoint levelUpRedpoint = new Redpoint(114, 11401);
|
| | | public readonly Redpoint challengeRedpoint = new Redpoint(114, 11402);
|
| | |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | ActivitiesPushModel pushModel { get { return ModelCenter.Instance.GetModel<ActivitiesPushModel>(); } }
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | selectXXZL = index;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 境界塔
|
| | | public void RequestChallenge()
|
| | | {
|
| | | var error = GetErrorOfChallenge();
|
| | | if (error == 0)
|
| | | {
|
| | | dungeonModel.RequestChallangeDungeon(Tower_MapId, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | | case 1:
|
| | | SysNotifyMgr.Instance.ShowTip("BossRealmHint2", RealmTowerConfig.Get(selectFloorID).NeedRealmLV);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private int GetErrorOfChallenge()
|
| | | {
|
| | | if (RealmTowerConfig.Get(selectFloorID).NeedRealmLV > PlayerDatas.Instance.baseData.realmLevel)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | if (selectFloorID <= passedFloor)
|
| | | {
|
| | | //已通关
|
| | | return 2;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void UpdateRealmTowerInfo(HB217_tagMCRealmTowerInfo netPack)
|
| | | {
|
| | | passedFloor = (int)netPack.Floor;
|
| | |
|
| | | //显示不超过当前的大境界塔层
|
| | | var config = RealmTowerConfig.Get(currentFloor);
|
| | | if (config != null)
|
| | | {
|
| | | int largeRealm = Math.Max(1, RealmConfig.Get(RealmTowerConfig.Get(currentFloor).NeedRealmLV).LvLarge);
|
| | | int largeRealmNow = Math.Max(1, RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel).LvLarge);
|
| | | if (largeRealm > largeRealmNow)
|
| | | {
|
| | | selectFloorID = passedFloor;
|
| | | }
|
| | | else
|
| | | {
|
| | | selectFloorID = currentFloor;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | selectFloorID = passedFloor;
|
| | | }
|
| | | |
| | | OnTowerPassEvent?.Invoke();
|
| | | }
|
| | |
|
| | | public void RequestRefreshMonster()
|
| | | {
|
| | | var sendInfo = new CA508_tagCMDoFBAction();
|
| | | sendInfo.ActionType = 0;
|
| | | sendInfo.ActionInfo = (uint)currentFloor;
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
|
| | | public struct RealmLevelUpEquipCondition
|