NewHeroLogic.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. local AbsActExcel = require("excel.absAct")
  2. local Lang = require("common.Lang")
  3. local ObjHuman = require("core.ObjHuman")
  4. local Msg = require("core.Msg")
  5. local Broadcast = require("broadcast.Broadcast")
  6. local Grid = require("bag.Grid")
  7. local BagLogic = require("bag.BagLogic")
  8. local ItemDefine = require("bag.ItemDefine")
  9. local BuyLogic = require("topup.BuyLogic")
  10. local AbsActDefine = require("absAct.AbsActDefine")
  11. local AbsActLogic = require("absAct.AbsActLogic")
  12. local Log = require("common.Log")
  13. local YunYingLogic = require("yunying.YunYingLogic")
  14. ABS_ACT_ID = 9001
  15. --
  16. function initAfterHot()
  17. end
  18. --
  19. function isActive(human, YYInfo, funcConfig)
  20. return not isOpen(human, YYInfo, funcConfig)
  21. end
  22. --
  23. function isOpen(human, YYInfo, funcConfig)
  24. return AbsActLogic.isStarted(human, funcConfig.funcID)
  25. end
  26. --
  27. function isRed(human, YYInfo, funcConfig)
  28. return false
  29. end
  30. --
  31. function getLeftTime(human, YInfo, funcConfig)
  32. local ret, endTime, startTime = AbsActLogic.isStarted(human, ABS_ACT_ID)
  33. if ret == true then
  34. return endTime - os.time()
  35. else
  36. return 0
  37. end
  38. end
  39. function getNewHeroID(human)
  40. local startedFlag, endTime, startTime = AbsActLogic.isStarted(human, ABS_ACT_ID)
  41. if not startedFlag then return 0 end
  42. local absActConfig = AbsActExcel.absActivity[ABS_ACT_ID]
  43. if not absActConfig then return 0 end
  44. return absActConfig.icon
  45. end
  46. function getAndSendMsg(human, id, actId)
  47. local now = os.time()
  48. local startedFlag, endTime, startTime = AbsActLogic.isStarted(human, id)
  49. if not startedFlag then return end
  50. local absActConfig = AbsActExcel.absActivity[id]
  51. if not absActConfig then return end
  52. local absAct = human.db.absAct[id]
  53. if not absAct then return end
  54. local msgRet = Msg.gc.GC_ABS_NEWHERO
  55. msgRet.id = absActConfig.icon
  56. msgRet.startTime = startTime
  57. msgRet.endTime = endTime
  58. Msg.send(msgRet, human.fd)
  59. end
  60. function giftBuy(human, id, premiumID)
  61. end