local ExpelMonster_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') function ExpelMonster_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, private.RefreshInfoByFunction) end function ExpelMonster_Controller.OpenExpelMonsterMainView() if ExpelMonster_Controller.IsActivityOpen() then CTL.NewYear.OpenMainPanel() UIManager.OpenView(Const_UI_Lua.UIEnum.UIExpelMonsterMain) end end --GMS开关变化时刷新 function private.RefreshInfoByFunction(funcId, isUnlock) if funcId == MDL.Unlock.FunctionType.NewYear or MDL.Unlock.FunctionType.ExpelMonster then if not isUnlock then UIManager.CloseView(Const_UI_Lua.UIEnum.UIExpelMonsterSweepSuccess) UIManager.CloseView(Const_UI_Lua.UIEnum.UIExpelMonsterPreReward) UIManager.CloseView(Const_UI_Lua.UIEnum.UIExpelMonsterMain) end end end function ExpelMonster_Controller.IsActivityOpen() if MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.ExpelMonster) and MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.NewYear) and CTL.OperationActivity.IsOperationActivityTypeOpen(MDL.OperationActivity.ActivityType.NewYear) then local activityType = MDL.OperationActivity.ActivityType.NewYear local info = MDL.OperationActivity.GetOperationActivityInfo(activityType) if info then for activityId, v in pairs(info) do if CTL.OperationActivity.IsOperationActivityOpen(v) then local modeData = MDL.OperationActivity.ActivityBaseData[activityType]:GetDataByActivityID(activityId) local prefabData = DataSheetManager.NewYearPrefabData:GetDataByModeID(modeData.PrefabMode) if prefabData.BossModeType > 0 then if not private.ActivityBossFightData then private.ActivityBossFightData = DataSheetManager.ActivityBossFightData:GetDataByBossModeType(prefabData.BossModeType) end return true end end end end end return false end function ExpelMonster_Controller.IsInSettlementTime() local time = DataSheetManager.ConstData:GetDataByID("ActivityBossFightLockTime").IntListValue return UTL.Time.IsServerInOpeningTime(time[1], time[2]) end function ExpelMonster_Controller.GetSettlementStartTime() local time = DataSheetManager.ConstData:GetDataByID("ActivityBossFightLockTime").IntListValue return UTL.Time.GetServerIntervalTimeByTimeId(time[1]) end function ExpelMonster_Controller.GetSettlementEndTime() local time = DataSheetManager.ConstData:GetDataByID("ActivityBossFightLockTime").IntListValue return UTL.Time.GetServerIntervalTimeByTimeId(time[2]) end function ExpelMonster_Controller.IsCanGetReward() local cfg, isMaxLv = CTL.ExpelMonster.GetNextActivityBossFightGuildCfg() if isMaxLv then return false end return MDL.ExpelMonster.GetGuildScore() >= cfg.IntegrationNumber end function ExpelMonster_Controller.ShowExpelMonsterSummary(msg) UIManager.OpenView(Const_UI_Lua.UIEnum.UIExpelMonsterSummary, msg) end function ExpelMonster_Controller.GetNextActivityBossFightGuildCfg() local id = MDL.ExpelMonster.GetGuildRewardScoreID() local guildRewardGroup = ExpelMonster_Controller.GetGuildRewardGroup() local index = 0 for k,v in DataSheetManager.ActivityBossFightGuildReward:GetEnumerator() do if v.GuildRewardGroup == guildRewardGroup then index = index + 1 if v.ID > id then return v, false end end end return DataSheetManager.ActivityBossFightGuildReward:GetDataByGuildRewardGroup_ID(ExpelMonster_Controller.GetGuildRewardGroup(), index), true end function ExpelMonster_Controller.GetActivityBossFightData(activityId) if not private.ActivityBossFightData then local modeData = MDL.OperationActivity.ActivityBaseData[MDL.OperationActivity.ActivityType.NewYear]:GetDataByActivityID(activityId) local bossModeType = DataSheetManager.NewYearPrefabData:GetDataByModeID(modeData.PrefabMode).BossModeType private.ActivityBossFightData = DataSheetManager.ActivityBossFightData:GetDataByBossModeType(bossModeType) end return private.ActivityBossFightData end function ExpelMonster_Controller.GetDamageGroupID() return private.ActivityBossFightData.DamageGroupID end function ExpelMonster_Controller.GetGuildRewardGroup() return private.ActivityBossFightData.GuildRewardGroup end function ExpelMonster_Controller.GetRankRewardGroup() return private.ActivityBossFightData.RankRewardGroup end return ExpelMonster_Controller