| | |
| | | case DailyQuestType.AllianceBoss2:
|
| | | GotoAllianceBoss(_id, 1);
|
| | | break;
|
| | | case DailyQuestType.HazyRegion:
|
| | | WindowCenter.Instance.Close<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<CrossServerWin>(false, 2);
|
| | | break;
|
| | | //case DailyQuestType.JadeDynastyBoss:
|
| | | // WindowCenter.Instance.Close<DailyQuestWin>();
|
| | | // WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 3);
|
| | |
| | |
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | #region Built-in
|
| | |
| | |
|
| | | private void DailyQuestProgressUpdateEvent(int id)
|
| | | {
|
| | | if (id == (int)DailyQuestType.HazyRegion)
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | if (config != null && id == config.RelatedID)
|
| | | {
|
| | | DisplayTimes();
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var itemCount = packModel.GetItemCountByID(PackType.Item, dailyQuestOpenTime.DayItemID);
|
| | | if (itemCount <= 0)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.diamond < dailyQuestOpenTime.BuyNeedMoney)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | |
| | |
|
| | | void DisplayTimes()
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | var limitTimes = dailyQuestOpenTime.DayTimes;
|
| | |
|
| | | var totalTimes = dailyQuestModel.GetDailyQuestTotalTimes((int)DailyQuestType.HazyRegion);
|
| | | var completedTimes = dailyQuestModel.GetDailyQuestCompletedTimes((int)DailyQuestType.HazyRegion);
|
| | | var times = Mathf.Clamp(totalTimes - completedTimes, 0, totalTimes);
|
| | | m_Times.text = StringUtility.Contact(times, "/", totalTimes);
|
| | | var times = Mathf.Clamp(totalTimes - completedTimes, 0, limitTimes);
|
| | | m_Times.text = StringUtility.Contact(times, "/", limitTimes);
|
| | | }
|
| | |
|
| | | void DisplayOpenTime()
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!model.TryAddTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<HazyRegionBuyTimesWin>();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void DailyQuestProgressUpdateEvent(int id)
|
| | | {
|
| | | if (id == (int)DailyQuestType.HazyRegion)
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | if (config != null && id == config.RelatedID)
|
| | | {
|
| | | DisplayTimes();
|
| | | }
|
| | |
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | incidentType = (HazyRegionIncidentType)config.incidentType;
|
| | |
|
| | | DisplayBase();
|
| | | DisplayItems();
|
| | | DisplayState();
|
| | | DisplaySelect();
|
| | | DisplayBoss();
|
| | | //DisplayBase();
|
| | | //DisplayItems();
|
| | | //DisplayState();
|
| | | //DisplaySelect();
|
| | | //DisplayBoss();
|
| | |
|
| | | model.selectIncidentRefresh -= SelectIncidentRefresh;
|
| | | model.selectIncidentRefresh += SelectIncidentRefresh;
|
| | |
| | |
|
| | | private void SelectIncidentRefresh()
|
| | | {
|
| | | DisplaySelect();
|
| | | //DisplaySelect();
|
| | | }
|
| | |
|
| | | private void OnHazyRegionIncidentRefresh()
|
| | | {
|
| | | DisplayState();
|
| | | //DisplayState();
|
| | | }
|
| | |
|
| | | private void OnSelect()
|
| | |
| | |
|
| | | public void Display()
|
| | | {
|
| | | DisplayPoint();
|
| | | //DisplayPoint();
|
| | | DisplayIncidents();
|
| | | }
|
| | |
|
| | |
| | | public event Action<int> onHazyRegionStateRefresh; //0-结束拜访 1-开始拜访 2-强制刷新
|
| | | public event Action onHazyRegionIncidentRefresh;
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | |
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var funcConfig = FuncConfigConfig.Get("ImmortalDomainStrength");
|
| | | limitPoint = int.Parse(funcConfig.Numerical1);
|
| | | }
|
| | |
|
| | | public bool TryGetIncident(int id, out Incident incident)
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | public bool TryAddTimes()
|
| | | {
|
| | | var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
|
| | | var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
|
| | | var limitTimes = dailyQuestOpenTime.DayTimes;
|
| | |
|
| | | var totalTimes = dailyQuestModel.GetDailyQuestTotalTimes((int)DailyQuestType.HazyRegion);
|
| | | var completedTimes = dailyQuestModel.GetDailyQuestCompletedTimes((int)DailyQuestType.HazyRegion);
|
| | | var times = Mathf.Clamp(totalTimes - completedTimes, 0, limitTimes);
|
| | |
|
| | | if (times >= limitTimes)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | public ICollection<int> GetAllIncidents()
|
| | | {
|
| | | return m_Incidents.Keys;
|
| | | }
|
| | |
|
| | | public int GetIncidentId(int mapId, int lineId)
|
| | | {
|
| | | var configs = HazyRegionConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (config.dungeonId == mapId && config.lineId == lineId)
|
| | | {
|
| | | return config.id;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void DisplayErrorRemind(int error)
|
| | |
| | | case HazyRegionIncidentType.FairyGrass:
|
| | | case HazyRegionIncidentType.ReikiGrass:
|
| | | case HazyRegionIncidentType.Precious:
|
| | | dungeonModel.SingleChallenge(config.dungeonId, config.lineId);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | void CloseHazyRegionIncident()
|
| | | {
|
| | | m_IncidentPanel.Dispose();
|
| | | m_IncidentPanel.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | void CloseHazyRegionEntrance()
|
| | | {
|
| | | m_EntrancePanel.Dispose();
|
| | | m_EntrancePanel.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | private void OnHazyRegionStateRefresh(int state)
|
| | |
| | | normalTasks.Add(new ConfigInitTask("LegendPropertyValueConfig", () => { LegendPropertyValueConfig.Init(); }, () => { return LegendPropertyValueConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("LegendPropertyConfig", () => { LegendPropertyConfig.Init(); }, () => { return LegendPropertyConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("EquipSuitNameConfig", () => { EquipSuitNameConfig.Init(); }, () => { return EquipSuitNameConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("ReikiRootConfig", () => { ReikiRootConfig.Init(); }, () => { return ReikiRootConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("ReikiRootConfig", () => { ReikiRootConfig.Init(); }, () => { return ReikiRootConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("HazyRegionConfig", () => { HazyRegionConfig.Init(); }, () => { return HazyRegionConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |