AutoFightEndCommand.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. local AutoFightEndCommand = class('AutoFightEndCommand', framework.SimpleCommand)
  2. function AutoFightEndCommand:ctor()
  3. end
  4. function AutoFightEndCommand:execute(notification)
  5. local facade = global.Facade
  6. local autoProxy = facade:retrieveProxy( global.ProxyTable.Auto )
  7. local inputProxy = facade:retrieveProxy( global.ProxyTable.PlayerInputProxy )
  8. print("---------------------- auto fight end")
  9. -- model:
  10. facade:sendNotification(global.NoticeTable.ClearAllInputState)
  11. facade:sendNotification(global.NoticeTable.ClearAllAutoState)
  12. facade:sendNotification(global.NoticeTable.InputIdle)
  13. -- tips
  14. autoProxy:ClearAutoTarget()
  15. --
  16. facade:sendNotification( global.NoticeTable.AutoFightEndTips )
  17. SLBridge:onLUAEvent(LUA_EVENT_AUTOFIGHT_TIPS_SHOW, false)
  18. --取消无怪使用随机 定时器
  19. local AssistProxy = global.Facade:retrieveProxy(global.ProxyTable.AssistProxy)
  20. AssistProxy:resetNoMonsterSchedule()
  21. local mainPlayer = global.gamePlayerController:GetMainPlayer()
  22. if mainPlayer and mainPlayer:GetHateID() then
  23. mainPlayer:SetHateID(nil)
  24. end
  25. end
  26. return AutoFightEndCommand