源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

653 lines
20 KiB

пре 4 недеља
  1. require("game.proto.210.Require210")
  2. require("game.skill.SkillManager")
  3. require("game.skill.SkillMainView")
  4. require("game.skill.CareerSkillView")
  5. require("game.skill.PassiveSkillView")
  6. require("game.skill.SkillUIItem")
  7. require("game.skill.SkillUIAttrOne")
  8. require("game.skill.SkillUIDetailItem")
  9. require("game.skill.SkillUIListItem")
  10. require("game.skill.SpecialSkillView")
  11. require("game.skill.SkillUpLevelPreView")
  12. require("game.skill.SkillConfigView")
  13. require("game.skill.SkillUIModel")
  14. SkillUIController = SkillUIController or BaseClass(BaseController)
  15. local SkillUIController = SkillUIController
  16. function SkillUIController:__init()
  17. SkillUIController.Instance = self
  18. self.model = SkillManager:getInstance()
  19. self.skillui_model = SkillUIModel:getInstance()
  20. self:AddAllEvents()
  21. self:RegisterAllProtocals()
  22. end
  23. function SkillUIController:AddAllEvents()
  24. --游戏登录成功
  25. local game_start_func = function ( )
  26. self.model:ClearData()
  27. setTimeout(function()
  28. self.request_21002 = true
  29. self.model:Fire(SkillManager.REQUEST_CCMD_EVENT,21002)
  30. self:StartCheckNetSlowTimer()
  31. GlobalEventSystem:Fire(EventName.GET_DAILY_LIGHT_SKILL)
  32. -- self:SendFmtToGame(13086)
  33. end,0.5)
  34. end
  35. GlobalEventSystem:Bind(EventName.FAST_GAME_START, game_start_func)
  36. local function onRequestHandler(...)
  37. local args = {...}
  38. if args[1] == 21001 then
  39. self:SendFmtToGame(args[1],"i",args[2])
  40. elseif args[1] == 21003 then
  41. self:SendFmtToGame(args[1],"i",args[2])
  42. elseif args[1] == 21004 then
  43. self:SendFmtToGame(args[1],"i",args[2])
  44. elseif args[1] == 21011 then
  45. self:SendFmtToGame(args[1], "i", args[2])
  46. elseif args[1] == 21014 then
  47. self:SendFmtToGame(args[1], "ii", args[2],args[3])
  48. else
  49. self:SendFmtToGame(args[1])
  50. end
  51. end
  52. self.model:Bind(SkillManager.REQUEST_CCMD_EVENT,onRequestHandler)
  53. local function onOpenSkillViewHandler(index,select_up_skill)
  54. if self.SkillMainView == nil then
  55. self.SkillMainView = SkillMainView.New()
  56. end
  57. if self.SkillMainView:HasOpen() and index ~= 4 then
  58. self.SkillMainView:Close()
  59. else
  60. self.SkillMainView:Open(index,select_up_skill)
  61. end
  62. end
  63. GlobalEventSystem:Bind(EventName.OPEN_SKILL_VIEW,onOpenSkillViewHandler)
  64. --点按技能快捷栏后响应
  65. local function skill_shortCut_click (skillId, skill_attack_type, target_compress_id)
  66. self:PressSkillHandler(skillId, skill_attack_type, target_compress_id)
  67. end
  68. GlobalEventSystem:Bind(FightEvent.SKILL_SHORTCUT_CLICK,skill_shortCut_click)
  69. local function save_skill_shortcut (pos, itype, plan, id, is_auto )
  70. self:request13008(pos, itype, plan, id, is_auto )
  71. end
  72. local function request13007 ()
  73. self:request13007()
  74. end
  75. local function request13009 (pos)
  76. self:request13009(pos)
  77. end
  78. local function request13010 (pos1,pos2,plan)
  79. self:request13010(pos1,pos2,plan)
  80. end
  81. local function request14705 ()
  82. self:request14705()
  83. end
  84. local function request14706 (skill_id)
  85. self:request14706(skill_id)
  86. end
  87. GlobalEventSystem:Bind(EventName.GET_SKILL_SHORTCUT,request13007)
  88. GlobalEventSystem:Bind(EventName.SAVE_SKILL_SHORTCUT,save_skill_shortcut)
  89. GlobalEventSystem:Bind(EventName.REPLACE_SKILL_SHORTCUT,request13010)
  90. GlobalEventSystem:Bind(EventName.DELETE_SKILL_SHORTCUT,request13009)
  91. GlobalEventSystem:Bind(EventName.GET_DAILY_LIGHT_SKILL,request14705)
  92. GlobalEventSystem:Bind(EventName.SWITCH_DAILY_LIGHT_SKILL,request14706)
  93. -- 升级 重新请求天赋技能点数
  94. local function onLevelUp(lv)
  95. --120级,设置一下幻光技能未为自动切换
  96. if lv == 120 then
  97. local is_auto_daily_skill = self.skillui_model:IsAutoChangeDailySkillid()
  98. if not is_auto_daily_skill then
  99. self.skillui_model:SetAutoChangeDailyState(true)
  100. end
  101. end
  102. if RoleManager:getInstance():GetMainRoleVo().level == 500 then
  103. self.model:Fire(SkillManager.REQUEST_CCMD_EVENT,21010)
  104. end
  105. self.skillui_model:CheckRedDot()
  106. end
  107. RoleManager.Instance.mainRoleInfo:Bind(EventName.CHANGE_LEVEL, onLevelUp)
  108. local function role_turn(var,value)
  109. self.skillui_model:CheckRedDot()
  110. end
  111. RoleManager:getInstance():GetMainRoleVo():BindOne("turn",role_turn)
  112. local function onOpenSkillUpLevelPreView(skill_vo) --打开技能等级预览界面
  113. if self.SkillUpLevelPreView == nil then
  114. self.SkillUpLevelPreView = SkillUpLevelPreView.New()
  115. end
  116. self.SkillUpLevelPreView:Open()
  117. self.SkillUpLevelPreView:SetData(skill_vo)
  118. end
  119. self.skillui_model:Bind(SkillUIModel.OPEN_SKILL_UPLEVEL_PREVIEW, onOpenSkillUpLevelPreView)
  120. local function onCloseSkillUpLevelPreView(skill_vo) --打开技能等级预览界面
  121. if self.SkillUpLevelPreView then
  122. self.SkillUpLevelPreView:Close()
  123. end
  124. end
  125. self.skillui_model:Bind(SkillUIModel.CLOSE_SKILL_UPLEVEL_PREVIEW, onCloseSkillUpLevelPreView)
  126. local function onOpenSkillConfigView() --打开技能配置界面
  127. if self.SkillConfigView == nil then
  128. self.SkillConfigView = SkillConfigView.New()
  129. end
  130. self.SkillConfigView:Open()
  131. self.SkillConfigView:SetData()
  132. end
  133. self.skillui_model:Bind(SkillUIModel.OPEN_SKILL_CONFIG_VIEW, onOpenSkillConfigView)
  134. local function onSceneChangeHandler()
  135. self:ChangeScene()
  136. end
  137. self:Bind(SceneEventType.SCENE_CHANGED, onSceneChangeHandler)
  138. self:Bind(SceneEventType.SCENE_REENTER, onSceneChangeHandler)
  139. end
  140. function SkillUIController:RegisterAllProtocals()
  141. self:RegisterProtocal(13007, "handler13007") --获取快捷栏
  142. self:RegisterProtocal(13008, "handler13008") --保存快捷栏
  143. self:RegisterProtocal(13010, "handler13010") --替换快捷键
  144. self:RegisterProtocal(13086, "handler13086") --怒气技能
  145. self:RegisterProtocal(21001, "handler21001") --职业技能升级
  146. self:RegisterProtocal(21002, "handler21002") --职业技能列表
  147. self:RegisterProtocal(21003, "handler21003") --主技能分支强化
  148. self:RegisterProtocal(14705, "handler14705") --查询幻光技能
  149. self:RegisterProtocal(14706, "handler14706") --切换幻光技能
  150. self:RegisterProtocal(14707, "handler14707") --幻光技能获得通知
  151. --self:RegisterProtocal(21004, "handler21004") --被动升级
  152. --self:RegisterProtocal(21010, "handler21010")
  153. --self:RegisterProtocal(21011, "handler21011")
  154. --self:RegisterProtocal(21012, "handler21012")
  155. --self:RegisterProtocal(21013, "handler21013")
  156. --self:RegisterProtocal(21014, "handler21014")
  157. --self:RegisterProtocal(21015, "handler21015")
  158. -- self:RegisterProtocal(44008, "handler44008")
  159. -- self:RegisterProtocal(44009, "handler44009")
  160. -- self:RegisterProtocal(44010, "handler44010")
  161. -- self:RegisterProtocal(44011, "handler44011")
  162. end
  163. function SkillUIController:request13007()
  164. self:SendFmtToGame(13007)
  165. end
  166. function SkillUIController:request13008(pos, itype, plan, id, is_auto )
  167. self:SendFmtToGame(13008, "cccic",pos, itype, plan, id, is_auto)
  168. end
  169. function SkillUIController:request13010( pos1,pos2, plan )
  170. self:SendFmtToGame(13010, "ccc",pos1,pos2,plan)
  171. end
  172. function SkillUIController:request14705( )
  173. self:SendFmtToGame(14705)
  174. end
  175. function SkillUIController:request14706( skill_id )
  176. self:SendFmtToGame(14706, "i", skill_id)
  177. end
  178. function SkillUIController:handler13007( ... )
  179. local len = self:ReadFmt("h") --Int16
  180. self.model.shortcutList = {}
  181. self.model.skillUseList = {}
  182. self.model.all_plan_skill = {}
  183. local skill_vo
  184. for index = 1, len do
  185. local plan = self:ReadFmt("c")
  186. self.model.all_plan_skill[plan] = {}
  187. self.model.all_plan_skill[plan].skillUseList = {}
  188. self.model.all_plan_skill[plan].shortcutList = {}
  189. local len_2 = self:ReadFmt("h") --Int16
  190. for inde_2 = 1, len_2 do
  191. local vo = {}
  192. vo.pos,
  193. vo.type,
  194. vo.id,
  195. vo.is_auto = self:ReadFmt("ccic")
  196. if vo.id ~= 0 then
  197. skill_vo = self.model:getSkill(vo.id)
  198. if skill_vo then
  199. self.model.all_plan_skill[plan].skillUseList[vo.id] = skill_vo
  200. self.model.all_plan_skill[plan].shortcutList[vo.pos] = vo
  201. end
  202. end
  203. end
  204. end
  205. local cur_plan = self.cur_shortcut_plan or 1
  206. if self.model.all_plan_skill[cur_plan] then
  207. self.model.shortcutList = self.model.all_plan_skill[cur_plan].shortcutList
  208. self.model.skillUseList = self.model.all_plan_skill[cur_plan].skillUseList
  209. end
  210. SkillManager.Instance:Fire(SkillManager.UPDATE_SKILL_LIST)
  211. end
  212. function SkillUIController:handler13008( ... )
  213. local result = self:ReadFmt("c")
  214. if result == 1 then
  215. Message.show("替换成功")
  216. self:request13007()
  217. else
  218. Message.show("替换失败")
  219. end
  220. end
  221. function SkillUIController:handler13009( ... )
  222. local result = self:ReadFmt("c")
  223. if result == 1 then
  224. self:request13007()
  225. end
  226. end
  227. function SkillUIController:handler13010( ... )
  228. local result = self:ReadFmt("c")
  229. if result == 1 then
  230. Message.show("替换成功")
  231. self:request13007()
  232. else
  233. Message.show("替换失败")
  234. end
  235. end
  236. --怒气值变更
  237. function SkillUIController:handler13086( )
  238. local angry_value, max_angry_value = self:ReadFmt("hh")
  239. RoleManager.Instance.mainRoleInfo.max_angry_value = max_angry_value
  240. RoleManager.Instance.mainRoleInfo:ChangeVar("angry_value", angry_value, false, true)
  241. end
  242. function SkillUIController:handler14705( ... )
  243. local scmd = SCMD14705.New(true)
  244. self.model:SetDailyLightSkillList(scmd)
  245. GlobalEventSystem:Fire(EventName.UPDATE_DAILY_LIGHT_SKILL)
  246. self.model:Fire(SkillManager.UPDATE_SKILL_LIST)
  247. end
  248. function SkillUIController:handler14706( ... )
  249. local scmd = SCMD14706.New(true)
  250. if scmd.result == 1 then
  251. local skill_id = scmd.skill_id
  252. self.model:SetSwitchDailyLightSkill(skill_id)
  253. GlobalEventSystem:Fire(EventName.UPDATE_DAILY_LIGHT_SKILL)
  254. local skill_vo = self.model:getSkill(skill_id)
  255. Message.show(string.format("已切换至%s", skill_vo:getName()))
  256. else
  257. ErrorCodeShow(scmd.result)
  258. end
  259. end
  260. function SkillUIController:handler14707( )
  261. local scmd = SCMD14707.New(true)
  262. -- if scmd.skill_id > 0 then
  263. -- --120001 是第一个幻光技能,需要飘动画
  264. -- local id = 0
  265. -- local ignore_fly = nil
  266. -- local ignore_auto_task = true
  267. -- if scmd.skill_id == 120001 then
  268. -- id = 9
  269. -- ignore_fly = false
  270. -- ignore_auto_task = false
  271. -- GlobalEventSystem:Fire(EventName.HIDE_FUNC_OPEN_ICON,{[1] = {type =2, id=9}}) --隐藏幻光技能
  272. -- end
  273. -- local skill_data = {skill_id = scmd.skill_id, show_time = 15, ignore_auto_task = ignore_auto_task, id = id, ignore_fly = ignore_fly}
  274. -- FuncOpenController.Instance:ShowSkill(skill_data)
  275. -- end
  276. end
  277. function SkillUIController:handler21001()
  278. local scmd = SCMD21001.New(true)
  279. if scmd.errcode ~= 1 then
  280. ErrorCodeShow(scmd.errcode)
  281. --物品不足,提示购买
  282. if scmd.errcode == 1003 then
  283. local skill_vo = self.model:getSkill(scmd.skill_id)
  284. if not skill_vo then
  285. skill_vo = SkillVo.New(scmd.skill_id)
  286. skill_vo = 0
  287. end
  288. local show_type_id = 0
  289. local goods = skill_vo:GetNextConditionByKey("goods")
  290. if goods and goods[1][1] and goods[1][2] then
  291. local type_id = tonumber(goods[1][1])
  292. local cfg = ShopModel:getInstance():GetShopTypeIdBuyCFG(type_id)
  293. if cfg and TableSize(cfg) > 0 then
  294. show_type_id = type_id
  295. end
  296. end
  297. if show_type_id ~= 0 then
  298. ShopModel:getInstance():Fire(ShopModel.OPEN_SHOP_BUY_TIP_VIEW,show_type_id)
  299. end
  300. end
  301. else
  302. --延时一点点做客升级技能的切换操作
  303. local function delay_func()
  304. self.skillui_model:Fire(SkillUIModel.SKILL_UP_SUCCESS, scmd.skill_id)
  305. end
  306. setTimeout(delay_func, 0.2)
  307. self.skillui_model.is_level_up = true
  308. GlobalEventSystem:Fire(EventName.PLAY_UI_EFFECT_SOUND,LuaSoundManager.SOUND_UI.SUCCESS)
  309. end
  310. end
  311. function SkillUIController:handler21002()
  312. if self.request_21002 then
  313. self.model:Fire(SkillManager.RESET_SKILL_LIST)
  314. self.request_21002 = false
  315. end
  316. self.model:CreateSkillList()
  317. self.skillui_model:CheckRedDot()
  318. GlobalEventSystem:Fire(EventName.UPDATE_BUFF_VIEW)
  319. end
  320. function SkillUIController:handler21003()
  321. local scmd = SCMD21003.New(true)
  322. if scmd.errcode ~= 1 then
  323. ErrorCodeShow(scmd.errcode)
  324. else
  325. self.model:Fire(SkillManager.SKILL_LEVEL_UP)
  326. end
  327. end
  328. function SkillUIController:handler21004()
  329. local scmd = SCMD21004.New(true)
  330. if scmd.errcode ~= 1 then
  331. ErrorCodeShow(scmd.errcode)
  332. end
  333. end
  334. function SkillUIController:handler21010( )
  335. local scmd = SCMD21010.New(true)
  336. end
  337. function SkillUIController:handler21011( )
  338. local scmd = SCMD21011.New(true)
  339. if scmd.errcode == 1 then
  340. --更新数据
  341. self.model:Fire(SkillManager.REQUEST_CCMD_EVENT,21010)
  342. else
  343. ErrorCodeShow(scmd.errcode)
  344. end
  345. end
  346. function SkillUIController:handler21012( )
  347. local scmd = SCMD21012.New(true)
  348. if scmd.errcode == 1 then
  349. else
  350. ErrorCodeShow(scmd.errcode)
  351. end
  352. end
  353. function SkillUIController:handler21013( )
  354. local scmd = SCMD21013.New(true)
  355. end
  356. function SkillUIController:handler21014( )
  357. local scmd = SCMD21014.New(true)
  358. if scmd.errcode == 1 then
  359. else
  360. ErrorCodeShow(scmd.errcode)
  361. end
  362. end
  363. function SkillUIController:handler21015( )
  364. local scmd = SCMD21015.New(true)
  365. SkillManager:getInstance():SetReplaceSkillInfo(scmd)
  366. end
  367. --按下技能
  368. function SkillUIController:PressSkillHandler(skill_id, skill_attack_type, target_compress_id)
  369. if Scene.Instance:GetRole(RoleManager.Instance.mainRoleInfo.role_id):IsRide() then
  370. FosterModel:GetInstance():Fire(FosterConst.Change_Ride_Status,0)
  371. end
  372. local can_pk = true
  373. if skill_attack_type ~= SkillManager.SKILL_ATTACK_TYPE.ONLY_SHOW_RANGE then
  374. if not self.model:CanAttack(skill_id,true) then
  375. can_pk = false
  376. else
  377. can_pk = true
  378. end
  379. -- OperateManager.Instance:StopMove()
  380. end
  381. if can_pk == false then
  382. if skill_attack_type ~= SkillManager.SKILL_ATTACK_TYPE.ONLY_FIRE_ATTACK and not SkillManager:getInstance():isInRigidity() then
  383. skill_attack_type = SkillManager.SKILL_ATTACK_TYPE.ONLY_SHOW_RANGE
  384. self.model:setCurrentSkillId(nil)
  385. GlobalEventSystem:Fire(FightEvent.RELEASE_MAIN_SKILL,nil,skill_id,target_compress_id,skill_attack_type)
  386. end
  387. return
  388. end
  389. self.model:setCurrentSkillId(skill_id)
  390. local skillvo = self.model:getCurrentSkill()
  391. if skillvo and skillvo:GetSelectType() == 1 then --对自己释放技能
  392. GlobalEventSystem:Fire(FightEvent.RELEASE_MAIN_SKILL,nil,nil,target_compress_id,skill_attack_type)
  393. else
  394. Scene.Instance:MainRoleAttackTarget()
  395. end
  396. end
  397. function SkillUIController:handler44008()
  398. local vo = SCMD44008.New(true)
  399. -- PrintTable(vo)
  400. self.model.start_time = vo.start_time
  401. self.model.server_time = vo.server_time
  402. self.model.every_time_dot = vo.every_time_dot
  403. self.model.max_dot = vo.max_dot
  404. --只有变身状态才需要进行定时器 变化
  405. if self.model.curr_god_state == 2 or self.model.curr_god_state == 3 then
  406. if self.add_god_dot_timer_id then
  407. GlobalTimerQuest:CancelQuest(self.add_god_dot_timer_id)
  408. self.add_god_dot_timer_id = false
  409. end
  410. if self.reduce_god_dot_timer_id then
  411. GlobalTimerQuest:CancelQuest(self.reduce_god_dot_timer_id)
  412. self.reduce_god_dot_timer_id = false
  413. end
  414. if vo.start_time > 0 then --代表累加
  415. local dot = math.floor(vo.server_time - vo.start_time) * vo.every_time_dot + vo.anger_dot
  416. dot = math.min(dot,self.model.max_dot)
  417. if dot >= vo.max_dot then
  418. self.model:ChangeVar("curr_god_dot", vo.max_dot, nil, true)
  419. if self.add_god_dot_timer_id then
  420. GlobalTimerQuest:CancelQuest(self.add_god_dot_timer_id)
  421. self.add_god_dot_timer_id = false
  422. end
  423. return
  424. end
  425. self.model:ChangeVar("curr_god_dot", dot)
  426. if not self.add_god_dot_timer_id then
  427. local function onTimer()
  428. local dot = self.model.curr_god_dot + self.model.every_time_dot
  429. dot = math.min(dot,self.model.max_dot)
  430. self.model:ChangeVar("curr_god_dot", dot)
  431. if dot >= self.model.max_dot then
  432. if self.add_god_dot_timer_id then
  433. GlobalTimerQuest:CancelQuest(self.add_god_dot_timer_id)
  434. self.add_god_dot_timer_id = false
  435. end
  436. return
  437. end
  438. end
  439. self.add_god_dot_timer_id = GlobalTimerQuest:AddPeriodQuest(onTimer, 1, -1)
  440. end
  441. elseif vo.start_time == 0 then --代表减少
  442. --神格副本持续变身
  443. if SceneManager.Instance:IsContinueChangeGodScene() then
  444. local dot = self.model.max_dot - 1
  445. self.model:ChangeVar("curr_god_dot", dot)
  446. else
  447. local real_switch_cd = vo.server_time + vo.switch_cd - TimeUtil:getServerTime( )
  448. local every_time_dot = vo.max_dot / real_switch_cd
  449. local dot = self.model.max_dot - 1
  450. --这里 不能加 因为切场景会需要当前的curr_god_dot的值
  451. -- self.model:ChangeVar("curr_god_dot", dot)
  452. local dot = self.model.curr_god_dot - 1
  453. self.model.switch_cd = real_switch_cd
  454. if real_switch_cd <= 0 then
  455. if self.reduce_god_dot_timer_id then
  456. GlobalTimerQuest:CancelQuest(self.reduce_god_dot_timer_id)
  457. self.reduce_god_dot_timer_id = false
  458. end
  459. self.model:ChangeVar("curr_god_dot", 0, nil, true, true)
  460. return
  461. end
  462. self.model:ChangeVar("curr_god_dot", dot)
  463. if not self.reduce_god_dot_timer_id then
  464. local function onTimer()
  465. self.model.switch_cd = self.model.switch_cd - 1
  466. local dot = self.model.curr_god_dot - every_time_dot
  467. dot = math.max(0,dot)
  468. self.model:ChangeVar("curr_god_dot", dot)
  469. if self.model.switch_cd <= 0 then
  470. if self.reduce_god_dot_timer_id then
  471. GlobalTimerQuest:CancelQuest(self.reduce_god_dot_timer_id)
  472. self.reduce_god_dot_timer_id = false
  473. end
  474. self.model:ResetThreeAttackIndex(true)
  475. end
  476. end
  477. self.reduce_god_dot_timer_id = GlobalTimerQuest:AddPeriodQuest(onTimer,1,real_switch_cd)
  478. end
  479. end
  480. end
  481. setTimeout(function ()
  482. self.model:Fire(SkillManager.UPDATE_SKILL_LIST)
  483. end,0.1)
  484. else
  485. if self.add_god_dot_timer_id then
  486. GlobalTimerQuest:CancelQuest(self.add_god_dot_timer_id)
  487. self.add_god_dot_timer_id = false
  488. end
  489. if self.reduce_god_dot_timer_id then
  490. GlobalTimerQuest:CancelQuest(self.reduce_god_dot_timer_id)
  491. self.reduce_god_dot_timer_id = false
  492. end
  493. self.model:ChangeVar("curr_god_dot", 0, nil, true, true)
  494. end
  495. end
  496. function SkillUIController:handler44009()
  497. local vo = SCMD44009.New(true)
  498. if vo then
  499. self.model.is_receive44009 = true
  500. if vo.errcode == 1 then
  501. self.model:ResetThreeAttackIndex(true)
  502. else
  503. ErrorCodeShow(vo.errcode)
  504. end
  505. end
  506. end
  507. function SkillUIController:handler44010()
  508. local anger_dot = UserMsgAdapter.ReadFmt("h") or 0
  509. --local vo = SCMD44010.New(true)
  510. if self.model.curr_god_state == 2 then
  511. local dot = self.model.curr_god_dot + anger_dot
  512. dot = math.min(dot,self.model.max_dot)
  513. self.model:ChangeVar("curr_god_dot", dot)
  514. end
  515. end
  516. function SkillUIController:handler44011()
  517. local vo = SCMD44011.New(true)
  518. if vo.type == 2 then --变身结束
  519. self.model.curr_god_state = -1
  520. self.model.curr_god_dot = 0
  521. self.model.max_dot = 0
  522. --强制设置为 0
  523. RoleManager.Instance.mainRoleInfo:ChangeVar("god_id",0)
  524. setTimeout(function ()
  525. self.model:Fire(SkillManager.UPDATE_SKILL_LIST)
  526. end,0.1)
  527. else
  528. RoleManager.Instance.mainRoleInfo:ChangeVar("god_id",GuideModel.CHANGE_GOD_ID)
  529. setTimeout(function ()
  530. self.model:Fire(SkillManager.UPDATE_SKILL_LIST)
  531. end,0.1)
  532. end
  533. end
  534. function SkillUIController:StartCheckNetSlowTimer()
  535. if self.countdown_time_id then
  536. GlobalTimerQuest:CancelQuest(self.countdown_time_id)
  537. self.countdown_time_id = nil
  538. end
  539. local function onTimer()
  540. if self.request_21002 then
  541. self.model:Fire(SkillManager.REQUEST_CCMD_EVENT,21002)
  542. self.model:Fire(SkillManager.REQUEST_CCMD_EVENT,21010)
  543. self.model:Fire(SkillManager.REQUEST_CCMD_EVENT,21013)
  544. else
  545. if self.countdown_time_id then
  546. GlobalTimerQuest:CancelQuest(self.countdown_time_id)
  547. self.countdown_time_id = nil
  548. end
  549. end
  550. end
  551. self.countdown_time_id = GlobalTimerQuest:AddPeriodQuest(onTimer,8)
  552. end
  553. --技能材料变化
  554. function SkillUIController:UpSkillGoodsChange( )
  555. self.skillui_model:CheckRedDot()
  556. end
  557. function SkillUIController:ChangeScene()
  558. local sceneInfo = SceneManager.Instance:GetSceneInfo()
  559. if not sceneInfo then return end
  560. local config = Config.Skillscenesetting
  561. local plan = 1
  562. for k,v in pairs(config) do
  563. if v.scene_type == sceneInfo.type then
  564. plan = v.scheme
  565. break
  566. end
  567. end
  568. if self.model.cur_shortcut_plan ~= plan then
  569. self.model.cur_shortcut_plan = plan
  570. if self.all_plan_skill and self.all_plan_skill[plan] then
  571. self.model.shortcutList = self.model.all_plan_skill[plan].shortcutList
  572. self.model.skillUseList = self.model.all_plan_skill[plan].skillUseList
  573. end
  574. self.model:Fire(SkillManager.RESET_SKILL_LIST)
  575. end
  576. end