| | |
| | | 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;
|
| | | }
|
| | | }
|