local GoldHeroReprint_Model = {} local private = {} local EventSystem = require('Event/EventSystem') function GoldHeroReprint_Model.OnStartup() EventSystem.Regist(EventID.UI_DirectGift_GiftInfoUpdate, private.UpdateDirectGiftFreeRp) private.ActivityType = MDL.OperationActivity.ActivityType.GoldHeroReprint private.ActivityInfo = {} end function private.InitActivityInfo() local activityTypeInfo = MDL.OperationActivity.GetOperationActivityInfo(private.ActivityType) if activityTypeInfo then for k,activityInfo in pairs(activityTypeInfo) do if UTL.Time.GetServerTimestamp() >= activityInfo.startTime and UTL.Time.GetServerTimestamp() <= activityInfo.endTime then private.ActivityInfo = activityInfo end end end end function GoldHeroReprint_Model.GetGoldHeroReprintActivityID() if not private.ActivityInfo.activityId then private.InitActivityInfo() end return private.ActivityInfo.activityId end function GoldHeroReprint_Model.GetGoldHeroReprintActivityInfo() if not private.ActivityInfo.activityId then private.InitActivityInfo() end return private.ActivityInfo end function GoldHeroReprint_Model.CheckIsShowEntry() -- 活动开启时间内 return CTL.OperationActivity.IsOperationActivityTypeOpen(private.ActivityType) and CTL.OperationActivity.IsOperationActivityTypeUnlock(private.ActivityType) and MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.GoldHeroReprint) end -- 主城红点 function GoldHeroReprint_Model.GetGoldHeroReprintRedPoint() if GoldHeroReprint_Model.CheckCanDrawCardRedPoint() or GoldHeroReprint_Model.CheckDirectGiftRedPoint() then return true end return false end function GoldHeroReprint_Model.IsActivityInFuncTime() if private.ActivityInfo then local endFuncTime = private.ActivityInfo.endTime local nowTime = UTL.Time.GetServerTimestamp() if endFuncTime > nowTime then return true end return false end end -- 城镇入口复用金将模板的TownIcon function GoldHeroReprint_Model.GetTownHomeIconByGoldenHeroID(heroID) for k,v in DataSheetManager.GoldHeroActivityModeData:GetEnumerator() do if v.SynergyBossHeroID == heroID then return v.TownIcon end end end -- 可抽卡红点 function GoldHeroReprint_Model.CheckCanDrawCardRedPoint() if GoldHeroReprint_Model.CheckIsShowEntry() then local activityId = private.ActivityInfo.activityId local drawCardPoolID = MDL.OperationActivity.ActivityBaseData[private.ActivityType]:GetDataByActivityID(activityId).DrawCardPoolID local itemId, countInBag = CTL.ActivityGacha.GetConsumeItemInfos(drawCardPoolID) -- 道具大于1 if countInBag > 0 then return true end end return false end -- 礼包可领取红点 function GoldHeroReprint_Model.CheckDirectGiftRedPoint() if GoldHeroReprint_Model.CheckIsShowEntry() then local activityId = private.ActivityInfo.activityId local drawCardPoolID = MDL.OperationActivity.ActivityBaseData[private.ActivityType]:GetDataByActivityID(activityId).DrawCardPoolID local itemId, countInBag = CTL.ActivityGacha.GetConsumeItemInfos(drawCardPoolID) -- 特惠礼包可领取 return CTL.DirectGift.IsHasFreeGift(MDL.DirectGift.DirectGiftType.Base, activityId) end return false end return GoldHeroReprint_Model