源战役客户端
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.

1412 rivejä
40 KiB

4 viikkoa sitten
  1. StrengthModel = StrengthModel or BaseClass(BaseModel)
  2. StrengthModel.Strengthen = {
  3. IconNoticeList = {
  4. "quiz",
  5. "guildfire",
  6. "angel",
  7. },
  8. }
  9. StrengthModel.UPDATE_VIEW_AFTER_CLICK = "StrengthModel.UPDATE_VIEW_AFTER_CLICK" --在点击前往途径后刷新数据
  10. function StrengthModel:__init()
  11. StrengthModel.Instance = self
  12. self.fight_model = Config.Improvefightnum
  13. self.grade = nil
  14. self.cache_flag = {}
  15. self.module_open_dic = {}
  16. self.state_flag = StateFlag.New()
  17. self.strength_flag_1 = 0
  18. self.strength_flag_2 = 0
  19. self.strength_flag_3 = 0
  20. self.strength_flag_4 = 0
  21. end
  22. function StrengthModel:getInstance()
  23. if StrengthModel.Instance == nil then
  24. StrengthModel.New()
  25. end
  26. return StrengthModel.Instance
  27. end
  28. function StrengthModel:ResetInfo()
  29. self.state_flag:initValue()
  30. self.module_open_dic = {}
  31. end
  32. --获取变强列表
  33. function StrengthModel:GetStrengthList( )
  34. local tb = {}
  35. local cache_flag, func = false
  36. local temp_cache_update_name = {}
  37. for k,v in pairs(Config.ConfigStrength.Func) do
  38. local type_cfg = v
  39. for k2,v2 in pairs(type_cfg) do
  40. --每个函数只执行一遍
  41. local has_updated = temp_cache_update_name[v2.check]
  42. if not has_updated then
  43. temp_cache_update_name[v2.check] = true
  44. local win_id = v2.winId
  45. local sub_id = v2.subId
  46. local special_open_flag = true
  47. --星级套装 要变化下
  48. if win_id == 152 and sub_id == 999 then
  49. sub_id = 1
  50. elseif win_id == 146 and sub_id >= 91 then
  51. -- 珍宝 特殊处理
  52. sub_id = sub_id - 90 -- 判断子系统是否开启
  53. special_open_flag = GetModuleIsOpen(146, 9) -- 判断珍宝外观是否开启
  54. elseif win_id == 149 and sub_id == 99 then
  55. sub_id = 0
  56. end
  57. local key = win_id .. "@".. sub_id
  58. if self.module_open_dic[key] or (GetModuleIsOpen(win_id, sub_id, true) and special_open_flag) then
  59. self.module_open_dic[key] = true
  60. --先判断缓存标识
  61. -- cache_flag = self:GetCacheFlag(v2.check)
  62. -- if cache_flag == true then
  63. -- table.insert(tb, v2)
  64. -- elseif cache_flag == nil then
  65. func = self[v2.check]
  66. if func and func(self) then
  67. table.insert(tb, v2)
  68. end
  69. --end
  70. end
  71. end
  72. end
  73. end
  74. --排序
  75. -- local arg = {"sort_id","winId"}
  76. -- local condition = {Array.LOWER, Array.LOWER}
  77. -- SortTools.MoreKeysSorter(tb, arg, condition)
  78. return tb
  79. end
  80. --设置各个功能函数缓存标识
  81. function StrengthModel:SetCacheFlag(key, value)
  82. local value = value or false
  83. self.cache_flag[key] = value
  84. end
  85. function StrengthModel:GetCacheFlag(key)
  86. return self.cache_flag[key]
  87. end
  88. --是否能变强
  89. function StrengthModel:CanStrength( cur_type )
  90. local cur_type = cur_type or Config.ConfigStrength.ChangeType.All
  91. local can_strength = false
  92. local func, cache_flag
  93. local temp_cache_update_name = {}
  94. if cur_type == Config.ConfigStrength.ChangeType.All then
  95. self.state_flag:initValue()
  96. for k,v in pairs(Config.ConfigStrength.Func) do
  97. local type_cfg = v
  98. can_strength = false
  99. for k2,v2 in pairs(type_cfg) do
  100. --[[func = self[v2.check]
  101. if func and func(self) then
  102. can_strength = true
  103. break
  104. end--]]
  105. --每个函数只执行一遍
  106. local has_updated = temp_cache_update_name[v2.check]
  107. if not has_updated then
  108. temp_cache_update_name[v2.check] = true
  109. func = self[v2.check]
  110. if func and func(self) then
  111. can_strength = true
  112. break
  113. end
  114. end
  115. end
  116. if can_strength then--显示
  117. self.state_flag:addState(Config.ConfigStrength.State_Type[k])
  118. else--隐藏
  119. self.state_flag:delState(Config.ConfigStrength.State_Type[k])
  120. end
  121. end
  122. else
  123. local type_cfg = Config.ConfigStrength.Func[cur_type]
  124. if type_cfg then
  125. for k,v in pairs(type_cfg) do
  126. cache_flag = self:GetCacheFlag(v.check)
  127. if cache_flag == true then
  128. can_strength = true
  129. break
  130. end
  131. end
  132. end
  133. end
  134. if cur_type ~= Config.ConfigStrength.ChangeType.All then
  135. if can_strength then--显示
  136. self.state_flag:addState(Config.ConfigStrength.State_Type[cur_type])
  137. else--隐藏
  138. self.state_flag:delState(Config.ConfigStrength.State_Type[cur_type])
  139. end
  140. end
  141. if self.state_flag then
  142. return self.state_flag:isInstate()
  143. end
  144. end
  145. --AI娘进阶
  146. function StrengthModel:can_jarvis_stren( )
  147. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FJarvis)
  148. self:SetCacheFlag("can_jarvis_stren", val)
  149. return val
  150. end
  151. --AI娘提升
  152. function StrengthModel:can_jarvis_up( )
  153. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FJarvis)
  154. self:SetCacheFlag("can_jarvis_up", val)
  155. return val
  156. end
  157. --AI娘换装
  158. function StrengthModel:can_jarvis_cloth_change( )
  159. local val = FosterModel:GetInstance():CanDressNewEquipWithType(false, FosterConst.ModuleId.FJarvis) or FosterModel:GetInstance():CanDressUpEquipWithType(false, FosterConst.ModuleId.FJarvis)
  160. self:SetCacheFlag("can_jarvis_cloth_change", val)
  161. return val
  162. end
  163. --AI娘升装
  164. function StrengthModel:can_jarvis_cloth_up( )
  165. local val = FosterModel:GetInstance():CanUpEquipWithType(false, FosterConst.ModuleId.FJarvis)
  166. self:SetCacheFlag("can_jarvis_cloth_up", val)
  167. return val
  168. end
  169. --AI娘技能
  170. function StrengthModel:can_jarvis_skill_up( )
  171. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FJarvis)
  172. self:SetCacheFlag("can_jarvis_skill_up", val)
  173. return val
  174. end
  175. --AI娘皮肤
  176. function StrengthModel:can_jarvis_skin_up_or_active( )
  177. local val = FosterModel:GetInstance():CanSkinActOrUp(false, FosterConst.ModuleId.FJarvis)
  178. self:SetCacheFlag("can_jarvis_skin_up_or_active", val)
  179. return val
  180. end
  181. --AI娘珍宝
  182. function StrengthModel:can_jarvis_shape_up_or_active( )
  183. local val = ShapeModel:GetInstance():CheckRedByType(false, FosterConst.ModuleId.FJarvis)
  184. self:SetCacheFlag("can_jarvis_shape_up_or_active", val)
  185. return val
  186. end
  187. --磁炮进阶
  188. function StrengthModel:can_gun_stren( )
  189. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FGun)
  190. self:SetCacheFlag("can_gun_stren", val)
  191. return val
  192. end
  193. --磁炮提升
  194. function StrengthModel:can_gun_up( )
  195. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FGun)
  196. self:SetCacheFlag("can_gun_up", val)
  197. return val
  198. end
  199. --磁炮技能
  200. function StrengthModel:can_gun_skill_up( )
  201. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FGun)
  202. self:SetCacheFlag("can_gun_skill_up", val)
  203. return val
  204. end
  205. --磁炮皮肤
  206. function StrengthModel:can_gun_skin_up_or_active( )
  207. local val = FosterModel:GetInstance():CanSkinActOrUp(false, FosterConst.ModuleId.FGun)
  208. self:SetCacheFlag("can_gun_skin_up_or_active", val)
  209. return val
  210. end
  211. --星翼进阶
  212. function StrengthModel:can_cloud_stren( )
  213. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FCloud)
  214. self:SetCacheFlag("can_cloud_stren", val)
  215. return val
  216. end
  217. --星翼提升
  218. function StrengthModel:can_cloud_up( )
  219. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FCloud)
  220. self:SetCacheFlag("can_cloud_up", val)
  221. return val
  222. end
  223. --星翼技能
  224. function StrengthModel:can_cloud_skill_up( )
  225. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FCloud)
  226. self:SetCacheFlag("can_cloud_skill_up", val)
  227. return val
  228. end
  229. --星翼皮肤
  230. function StrengthModel:can_cloud_skin_up_or_active( )
  231. local val = FosterModel:GetInstance():CanSkinActOrUp(false, FosterConst.ModuleId.FCloud)
  232. self:SetCacheFlag("can_cloud_skin_up_or_active", val)
  233. return val
  234. end
  235. --幻甲进阶
  236. function StrengthModel:can_armour_stren( )
  237. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FArmour)
  238. self:SetCacheFlag("can_armour_stren", val)
  239. return val
  240. end
  241. --幻甲提升
  242. function StrengthModel:can_armour_up( )
  243. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FArmour)
  244. self:SetCacheFlag("can_armour_up", val)
  245. return val
  246. end
  247. --幻甲技能
  248. function StrengthModel:can_armour_skill_up( )
  249. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FArmour)
  250. self:SetCacheFlag("can_armour_skill_up", val)
  251. return val
  252. end
  253. --幻甲皮肤
  254. function StrengthModel:can_armour_up_or_active( )
  255. local val = FosterModel:GetInstance():CanSkinActOrUp(false, FosterConst.ModuleId.FArmour)
  256. self:SetCacheFlag("can_armour_up_or_active", val)
  257. return val
  258. end
  259. --座驾进阶
  260. function StrengthModel:can_horse_stren( )
  261. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FHorse)
  262. self:SetCacheFlag("can_armour_up", val)
  263. return val
  264. end
  265. --座驾提升
  266. function StrengthModel:can_horse_up( )
  267. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FHorse)
  268. self:SetCacheFlag("can_horse_up", val)
  269. return val
  270. end
  271. --座驾换装
  272. function StrengthModel:can_horse_cloth_change( )
  273. local val = FosterModel:GetInstance():CanDressNewEquipWithType(false, FosterConst.ModuleId.FHorse) or FosterModel:GetInstance():CanDressUpEquipWithType(false, FosterConst.ModuleId.FHorse)
  274. self:SetCacheFlag("can_horse_cloth_change", val)
  275. return val
  276. end
  277. --座驾升装
  278. function StrengthModel:can_horse_cloth_up( )
  279. local val = FosterModel:GetInstance():CanUpEquipWithType(false, FosterConst.ModuleId.FHorse)
  280. self:SetCacheFlag("can_horse_cloth_up", val)
  281. return val
  282. end
  283. --座驾技能
  284. function StrengthModel:can_horse_skill_up( )
  285. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FHorse)
  286. self:SetCacheFlag("can_horse_skill_up", val)
  287. return val
  288. end
  289. --座驾珍宝
  290. function StrengthModel:can_horse_shape_up_or_active( )
  291. local val = ShapeModel:GetInstance():CheckRedByType(false, FosterConst.ModuleId.FHorse)
  292. self:SetCacheFlag("can_horse_shape_up_or_active", val)
  293. return val
  294. end
  295. --炫翼进阶
  296. function StrengthModel:can_wing_stren( )
  297. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FWing)
  298. self:SetCacheFlag("can_wing_stren", val)
  299. return val
  300. end
  301. --炫翼提升
  302. function StrengthModel:can_wing_up( )
  303. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FWing)
  304. self:SetCacheFlag("can_wing_up", val)
  305. return val
  306. end
  307. --炫翼技能
  308. function StrengthModel:can_wing_skill_up( )
  309. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FWing)
  310. self:SetCacheFlag("can_wing_skill_up", val)
  311. return val
  312. end
  313. --炫翼珍宝
  314. function StrengthModel:can_wing_shape_up_or_active( )
  315. local val = ShapeModel:GetInstance():CheckRedByType(false, FosterConst.ModuleId.FWing)
  316. self:SetCacheFlag("can_wing_shape_up_or_active", val)
  317. return val
  318. end
  319. --宝具进阶
  320. function StrengthModel:can_pearl_stren( )
  321. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FPearl)
  322. self:SetCacheFlag("can_pearl_stren", val)
  323. return val
  324. end
  325. --宝具提升
  326. function StrengthModel:can_pearl_up( )
  327. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FPearl)
  328. self:SetCacheFlag("can_pearl_up", val)
  329. return val
  330. end
  331. --宝具技能
  332. function StrengthModel:can_pearl_skill_up( )
  333. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FPearl)
  334. self:SetCacheFlag("can_pearl_skill_up", val)
  335. return val
  336. end
  337. --宝具珍宝
  338. function StrengthModel:can_pearl_shape_up_or_active( )
  339. local val = ShapeModel:GetInstance():CheckRedByType(false, FosterConst.ModuleId.FPearl)
  340. self:SetCacheFlag("can_pearl_shape_up_or_active", val)
  341. return val
  342. end
  343. --武器进阶
  344. function StrengthModel:can_weapon_stren( )
  345. local val = FosterModel:GetInstance():CanUpgrade(false, FosterConst.ModuleId.FWeapon)
  346. self:SetCacheFlag("can_weapon_stren", val)
  347. return val
  348. end
  349. --武器提升
  350. function StrengthModel:can_weapon_up( )
  351. local val = FosterModel:GetInstance():CanKernel(false, FosterConst.ModuleId.FWeapon)
  352. self:SetCacheFlag("can_weapon_up", val)
  353. return val
  354. end
  355. --武器技能
  356. function StrengthModel:can_weapon_skill_up( )
  357. local val = FosterModel:GetInstance():CanSkillUpgradeByType(false, FosterConst.ModuleId.FWeapon)
  358. self:SetCacheFlag("can_weapon_skill_up", val)
  359. return val
  360. end
  361. --武器珍宝
  362. function StrengthModel:can_weapon_shape_up_or_active( )
  363. local val = ShapeModel:GetInstance():CheckRedByType(false, FosterConst.ModuleId.FWeapon)
  364. self:SetCacheFlag("can_weapon_shape_up_or_active", val)
  365. return val
  366. end
  367. --职业技能
  368. function StrengthModel:can_careerskill_up( )
  369. local val = SkillUIModel:getInstance():CheckSkillRedDot(false, Config.ConfigSkillUI.TabEnum.CareerSkill)
  370. self:SetCacheFlag("can_careerskill_up", val)
  371. return val
  372. end
  373. --被动技能
  374. function StrengthModel:can_passiveskill_up( )
  375. local val = SkillUIModel:getInstance():CheckSkillRedDot(false, Config.ConfigSkillUI.TabEnum.PassiveSkill)
  376. self:SetCacheFlag("can_passiveskill_up", val)
  377. return val
  378. end
  379. --特殊技能
  380. function StrengthModel:can_specialskill_up( )
  381. local val = SkillUIModel:getInstance():CheckSkillRedDot(false, Config.ConfigSkillUI.TabEnum.SpecialSkill)
  382. self:SetCacheFlag("can_specialskill_up", val)
  383. return val
  384. end
  385. --装备精炼
  386. function StrengthModel:can_equip_stren( )
  387. local val = EquipModel:getInstance():GetEquipRedDotByType(EquipModel.MainTab.Strengthen)
  388. self:SetCacheFlag("can_equip_stren", val)
  389. return val
  390. end
  391. --装备升星
  392. function StrengthModel:can_equip_up( )
  393. local val = EquipModel:getInstance():CheckEvolutionRedDot()
  394. self:SetCacheFlag("can_equip_up", val)
  395. return val
  396. end
  397. --装备升品
  398. function StrengthModel:can_equip_red_up( )
  399. local val = EquipModel:getInstance():CheckRedEquipRedDot()
  400. self:SetCacheFlag("can_equip_red_up", val)
  401. return val
  402. end
  403. --星级套装
  404. function StrengthModel:can_equip_star( )
  405. local val = EquipModel:getInstance():CheckEvolutionStrengthStarRedDot()
  406. self:SetCacheFlag("can_equip_star", val)
  407. return val
  408. end
  409. --宝石镶嵌
  410. function StrengthModel:can_stone_put( )
  411. local val = EquipModel:getInstance():GetEquipRedDotByType(EquipModel.MainTab.Gemstone)
  412. self:SetCacheFlag("can_stone_put", val)
  413. return val
  414. end
  415. --宝石升级
  416. function StrengthModel:can_stone_up( )
  417. local val = ComposeModel:getInstance():GetComposeRedDotByType(ComposeModel.MainTab.Gemstone)
  418. self:SetCacheFlag("can_stone_up", val)
  419. return val
  420. end
  421. -- 幻光激活
  422. function StrengthModel:can_light_active()
  423. local val = LightModel:getInstance():GetLightAllActive()
  424. self:SetCacheFlag("can_light_active", val)
  425. return val
  426. end
  427. -- 幻光升级
  428. function StrengthModel:can_light_up()
  429. local val = LightModel:getInstance():GetLightAllUpGrade()
  430. self:SetCacheFlag("can_light_up", val)
  431. return val
  432. end
  433. --信物升级
  434. function StrengthModel:can_ship_up( )
  435. local mate_model = MateModel:GetInstance()
  436. local val = mate_model:GetShipRedDot()
  437. -- if val then
  438. -- --判断是否有伙伴
  439. -- local basic_data = mate_model:GetBasicInfo( )
  440. -- if not (basic_data and TableSize(basic_data) > 0) then
  441. -- val = false
  442. -- end
  443. -- end
  444. self:SetCacheFlag("can_ship_up", val)
  445. return val
  446. end
  447. --守护合成
  448. function StrengthModel:can_guard_compose( )
  449. local val = ComposeModel:getInstance():GetComposeRedDotByType(ComposeModel.MainTab.Guard)
  450. self:SetCacheFlag("can_guard_compose", val)
  451. return val
  452. end
  453. --饰品合成
  454. function StrengthModel:can_ornaments_compose( )
  455. local val = ComposeModel:getInstance():GetComposeRedDotByType(ComposeModel.MainTab.Ornaments)
  456. self:SetCacheFlag("can_ornaments_compose", val)
  457. return val
  458. end
  459. --橙装合成
  460. function StrengthModel:can_orange_equip_compose( )
  461. local val = ComposeModel:getInstance():GetComposeRedDotByType(ComposeModel.MainTab.Equip)
  462. self:SetCacheFlag("can_orange_equip_compose", val)
  463. return val
  464. end
  465. --宠物升级
  466. function StrengthModel:can_pet_up( )
  467. local val = PetModel:getInstance():GetPetRedDotByType(PetConst.RED_DOT_TYPE.Feed)
  468. self:SetCacheFlag("can_pet_up", val)
  469. return val
  470. end
  471. --宠物升星
  472. function StrengthModel:can_pet_starup( )
  473. local val = PetModel:getInstance():GetPetRedDotByType(PetConst.RED_DOT_TYPE.Evolve)
  474. self:SetCacheFlag("can_pet_starup", val)
  475. return val
  476. end
  477. --宠物宝石
  478. function StrengthModel:can_pet_stone( )
  479. local val = PetModel:getInstance():GetPetRedDotByType(PetConst.RED_DOT_TYPE.Diamond)
  480. self:SetCacheFlag("can_pet_stone", val)
  481. return val
  482. end
  483. --宝宝成长
  484. function StrengthModel:can_baby_up( )
  485. local val = ChildModel:GetInstance():IsRedDotChildTrain()
  486. self:SetCacheFlag("can_baby_up", val)
  487. return val
  488. end
  489. --宝宝技能
  490. function StrengthModel:can_babyskill_up( )
  491. local val = ChildModel:GetInstance():IsRedDotChildSkill()
  492. self:SetCacheFlag("can_babyskill_up", val)
  493. return val
  494. end
  495. --战魂阵型
  496. function StrengthModel:can_warsoul_suit( )
  497. local val = WarSoulModel.getInstance():GetWarSoulRedDotByType(WarSoulModel.MainTab.Suit)
  498. self:SetCacheFlag("can_warsoul_suit", val)
  499. return val
  500. end
  501. --战魂强化
  502. function StrengthModel:can_warsoul_bag( )
  503. local val = WarSoulModel.getInstance():GetWarSoulRedDotByType(WarSoulModel.MainTab.Strength)
  504. self:SetCacheFlag("can_warsoul_bag", val)
  505. return val
  506. end
  507. --战魂升星
  508. function StrengthModel:can_warsoul_svolution( )
  509. local val = WarSoulModel.getInstance():GetWarSoulRedDotByType(WarSoulModel.MainTab.Evolution)
  510. self:SetCacheFlag("can_warsoul_svolution", val)
  511. return val
  512. end
  513. --魂力激活
  514. function StrengthModel:can_soul_power_up( )
  515. local val = SoulPowerModel.getInstance():GetSoulPowerCanGoFinalLv()
  516. self:SetCacheFlag("can_soul_power_up", val)
  517. return val
  518. end
  519. --魂力突破
  520. function StrengthModel:can_soul_break( )
  521. local val = SoulPowerModel.getInstance():GetSoulPOwerCanUpGrade()
  522. self:SetCacheFlag("can_soul_break", val)
  523. return val
  524. end
  525. --放置冒险
  526. function StrengthModel:exp_can_get( )
  527. local exp_model = ExpDunModel:getInstance()
  528. local val = exp_model:GetExpRedByRedType(ExpDunModel.Red_Type.HangUp)
  529. self:SetCacheFlag("exp_can_get", val)
  530. return val
  531. end
  532. --经验加速
  533. function StrengthModel:exp_speed_can_get( )
  534. local exp_model = ExpDunModel:getInstance()
  535. local val = exp_model:GetExpRedByRedType(ExpDunModel.Red_Type.QuickHangUp)
  536. self:SetCacheFlag("exp_speed_can_get", val)
  537. return val
  538. end
  539. --时装激活
  540. function StrengthModel:can_fashion_active( )
  541. local val = FashionModel:getInstance():GetFashionCanActive()
  542. self:SetCacheFlag("can_fashion_active", val)
  543. return val
  544. end
  545. --时装升星
  546. function StrengthModel:can_fashion_up( )
  547. local val = FashionModel:getInstance():GetFashionCanUp()
  548. self:SetCacheFlag("can_fashion_up", val)
  549. return val
  550. end
  551. --装备吞噬
  552. function StrengthModel:can_equip_eat( )
  553. local val = BagModel:getInstance():GetCanSwallowStrength()
  554. self:SetCacheFlag("can_equip_eat", val)
  555. return val
  556. end
  557. -----以下老项目代码----------
  558. ---------------------------------------------------------------------------------------
  559. ---------------------------------------------------------------------------------------
  560. ---------------------------------------------------------------------------------------
  561. -- -- --是否能变强
  562. -- -- function StrengthModel:CanStrength( )
  563. -- -- -- local tb = {}
  564. -- -- -- for k,v in pairs(Config.ConfigStrength.Func) do
  565. -- -- -- local vo = OpenFun.LinkWin[v.winId.."@"..v.subId]
  566. -- -- -- if vo and RoleManager.Instance.mainRoleInfo.level >= vo.openLv then
  567. -- -- -- local func = self[v.check]
  568. -- -- -- if func and func() then
  569. -- -- -- table.insert(tb, v)
  570. -- -- -- break
  571. -- -- -- end
  572. -- -- -- end
  573. -- -- -- end
  574. -- -- -- return #tb>0
  575. -- -- -- return false
  576. -- -- print("===", self.strength_flag_1, self.strength_flag_2, self.strength_flag_3, self.strength_flag_4)
  577. -- -- return self.strength_flag_1 > 0 or self.strength_flag_2 > 0 or self.strength_flag_3 > 0 or self.strength_flag_4 > 0
  578. -- -- end
  579. -- ----------------------------------变强主界面----------------------------------
  580. -- -- --技能进阶
  581. -- -- function StrengthModel:Progress_Skill(max_num)
  582. -- -- local cur = 0
  583. -- -- local mySkillList = SkillManager:getInstance().mySkillList
  584. -- -- if mySkillList and TableSize(mySkillList) > 0 then
  585. -- -- for k,v in pairs(mySkillList) do
  586. -- -- -- if k>=10001 and k<=10007 then
  587. -- -- cur = cur + v.level
  588. -- -- -- end
  589. -- -- end
  590. -- -- end
  591. -- -- return (cur/max_num)*100, cur
  592. -- -- end
  593. -- --装备精炼
  594. -- function StrengthModel:Progress_Equip_Stren(max_num)
  595. -- local cur = 0
  596. -- local cur_data = ""
  597. -- -- local equip_info = EquipModel:getInstance():GetStrenDynamic()
  598. -- local stren_info = {}
  599. -- stren_info[1], stren_info[2], stren_info[3], stren_info[4] = BagModel:getInstance():GetAllAddition() --获取全身1装备精炼数 2星级 3宝石数 4圣印强化数
  600. -- cur = stren_info[1] and stren_info[1] or cur
  601. -- cur_data = cur
  602. -- return (cur/max_num)*100, cur_data
  603. -- end
  604. -- --坐骑升星
  605. -- function StrengthModel:Progress_Horse(max_num)
  606. -- local cur = 0
  607. -- local cur_data = ""
  608. -- local data = HorseModel:getInstance().horse_data
  609. -- if data and data.stage and data.star then
  610. -- cur = (tonumber(data.stage)-1)*10 + tonumber(data.star)
  611. -- cur_data = data.stage.."阶"..data.star.."星"
  612. -- end
  613. -- return (cur/max_num)*100, cur_data
  614. -- end
  615. -- --宝具升星
  616. -- function StrengthModel:Progress_Treasure(max_num)
  617. -- local cur = 0
  618. -- local cur_data = ""
  619. -- local data = NewTalismanModel:getInstance().talisman_upgrade_data
  620. -- if data and data.lv then
  621. -- cur = data.lv
  622. -- end
  623. -- cur_data = cur
  624. -- return (cur/max_num)*100, cur_data
  625. -- end
  626. -- --星灵升星
  627. -- function StrengthModel:Progress_StarSpirit(max_num)
  628. -- local cur = 0
  629. -- local cur_data = ""
  630. -- local data = StarSpiritModel:getInstance():GetStarSpiritDataList()
  631. -- local list = {}
  632. -- local high_stage = 0
  633. -- for k,v in pairs(data) do
  634. -- if v and v.stage and v.stage > high_stage then
  635. -- high_stage = v.stage
  636. -- end
  637. -- end
  638. -- if data and #data > 0 then
  639. -- local high_combat = 0
  640. -- for k,v in pairs(data) do
  641. -- if v.stage == high_stage and v.combat_stage and tonumber(v.combat_stage) > high_combat then
  642. -- high_combat = tonumber(v.combat_stage)
  643. -- cur = (tonumber(v.stage) - 1)*3 + tonumber(v.star)
  644. -- cur_data = v.stage.."阶"..v.star.."星"
  645. -- end
  646. -- end
  647. -- end
  648. -- -- if data and #data > 0 then
  649. -- -- for k,v in pairs(data) do
  650. -- -- cur = cur + v.combat_stage
  651. -- -- end
  652. -- -- end
  653. -- return (cur/max_num)*100, cur_data
  654. -- end
  655. -- --6圣灵强化
  656. -- function StrengthModel:Progress_Pyx(max_num)
  657. -- local cur = 0
  658. -- local cur_data = ""
  659. -- local data = PyxModel:getInstance():GetSpiritList()
  660. -- local list = {}
  661. -- local high_lv = 0
  662. -- for k,v in pairs(data) do
  663. -- if v and v.lv and v.lv >= high_lv then
  664. -- high_lv = v.lv
  665. -- end
  666. -- end
  667. -- for k,v in pairs(data) do
  668. -- if v.lv == high_lv then
  669. -- table.insert(list, v)
  670. -- end
  671. -- end
  672. -- if list and #list > 0 then
  673. -- local high_combat = 0
  674. -- for k,v in pairs(list) do
  675. -- if v.lv and v.lv >= 1 then
  676. -- local key = v.spirit_id.."@"..v.lv
  677. -- local combat = GetFighting(ErlangParser:GetInstance():Parse(Config.Spiritconfig[key].attr))
  678. -- if combat >= high_combat then
  679. -- high_combat = combat
  680. -- cur = v.lv
  681. -- end
  682. -- end
  683. -- end
  684. -- end
  685. -- cur_data = cur
  686. -- return (cur/max_num)*100, cur_data
  687. -- end
  688. -- --宝石镶嵌
  689. -- function StrengthModel:Progress_Jewel(max_num)
  690. -- local cur = 0
  691. -- local cur_data = ""
  692. -- local stren_info = {}
  693. -- stren_info[1], stren_info[2], stren_info[3], stren_info[4] = BagModel:getInstance():GetAllAddition()
  694. -- cur = stren_info[3] and stren_info[3] or cur
  695. -- cur_data = cur
  696. -- return (cur/max_num)*100, cur_data
  697. -- end
  698. -- -- --翅膀强化
  699. -- -- function StrengthModel:Progress_Wing(max_num)
  700. -- -- local cur = 0
  701. -- -- local data = WingModel:getInstance().wing_vo
  702. -- -- if data and data.combat then
  703. -- -- cur = data.combat
  704. -- -- end
  705. -- -- return (cur/max_num)*100, cur
  706. -- -- end
  707. -- -- --装备合成
  708. -- -- function StrengthModel:Progress_Equip_Compose(max_num)
  709. -- -- local cur = 0
  710. -- -- local data = 1
  711. -- -- return (cur/max_num)*100, cur
  712. -- -- end
  713. -- --11套装合成
  714. -- function StrengthModel:Progress_Equip_Suit(max_num)
  715. -- local cur = 0
  716. -- local cur_data = ""
  717. -- local data = GoodsModel:getInstance().wear_equip_list
  718. -- if data then
  719. -- local len = TableSize(data)
  720. -- self.wear_equip_list = {}
  721. -- local function handleEquip()
  722. -- if self.wear_equip_list then
  723. -- for k,v in pairs(self.wear_equip_list) do
  724. -- if v and v.suit_lv and v.suit_slv and v.cell then
  725. -- local pos_2_type_cfg = Config.Equippos2suittype
  726. -- local cfg = Config.Improvesuit
  727. -- if pos_2_type_cfg[v.cell] and pos_2_type_cfg[v.cell].type and cfg[pos_2_type_cfg[v.cell].type.."@"..v.suit_lv.."@"..v.suit_slv.."@"] then
  728. -- cur = cur + cfg[pos_2_type_cfg[v.cell].type.."@"..v.suit_lv.."@"..v.suit_slv.."@"].point
  729. -- end
  730. -- end
  731. -- end
  732. -- end
  733. -- end
  734. -- local function callback(dynamic)
  735. -- if dynamic then
  736. -- self.wear_equip_list[dynamic.cell] = dynamic
  737. -- if TableSize(self.wear_equip_list) == len then
  738. -- handleEquip()
  739. -- end
  740. -- end
  741. -- end
  742. -- for k,v in pairs(data) do
  743. -- if v and v.goods_id then
  744. -- GoodsModel:getInstance():GetDynamic(v.goods_id, callback)
  745. -- end
  746. -- end
  747. -- end
  748. -- return (cur/max_num)*100, cur_data
  749. -- end
  750. -- -- --装备洗练
  751. -- -- function StrengthModel:Progress_Equip_Wash(max_num)
  752. -- -- local cur = 0
  753. -- -- local data = 1
  754. -- -- return (cur/max_num)*100, cur
  755. -- -- end
  756. -- -- if data then
  757. -- -- if data.talent_skills and TableSize(data.talent_skills) > 0 and data.talent_skills.skills and TableSize(data.talent_skills.skills) > 0 then
  758. -- -- for k,v in pairs(data.talent_skills.skills) do
  759. -- -- cur = cur + 1
  760. -- -- end
  761. -- -- end
  762. -- -- end
  763. -- -- return (cur/max_num)*100, cur
  764. -- -- end
  765. -- --神魂升级 暂时还没做
  766. -- -- function StrengthModel:Progress_(max_num)
  767. -- -- -- body
  768. -- -- end
  769. -- --装备替换
  770. -- function StrengthModel:Progress_Equip_repalce(max_num)
  771. -- local cur = 0
  772. -- local cur_data = ""
  773. -- local data = 1
  774. -- local equip_cfg = Config.Equipattr
  775. -- local role_equip = GoodsModel:getInstance().wear_equip_list
  776. -- if data and role_equip and equip_cfg then
  777. -- for k,v in pairs(role_equip) do
  778. -- if v and v.type_id and equip_cfg[v.type_id] then
  779. -- cur = cur + tonumber(equip_cfg[v.type_id].base_rating)
  780. -- end
  781. -- end
  782. -- end
  783. -- return (cur/max_num)*100, cur_data
  784. -- end
  785. -- -- 坐骑装备
  786. -- function StrengthModel:Progress_Equip_horse(max_num)
  787. -- local cur = 0
  788. -- local cur_data = ""
  789. -- local data = GoodsModel:getInstance():GetHorseEquipList()
  790. -- if data then
  791. -- for k,v in pairs(data) do
  792. -- if v and v.type_id and HorseModel:getInstance():GetHorseEquipAttrCfg(v.type_id) then
  793. -- cur = cur + tonumber(HorseModel:getInstance():GetHorseEquipAttrCfg(v.type_id).base_rating)
  794. -- end
  795. -- end
  796. -- end
  797. -- return (cur/max_num)*100, cur_data
  798. -- end
  799. -- -- 神格提升
  800. -- function StrengthModel:Progress_God_Hood(max_num)
  801. -- local cur = 0
  802. -- local cur_data = ""
  803. -- local data, cur_cfg, next_cfg = DeityModel:getInstance():GetCurDeityInfo()
  804. -- if data and cur_cfg then
  805. -- cur = tonumber(cur_cfg.id)
  806. -- cur_data = cur_cfg.name..cur_cfg.lv
  807. -- else
  808. -- cur_data = "暂无"
  809. -- end
  810. -- return (cur/max_num)*100, cur_data
  811. -- end
  812. -- --根据标签id获取对应标签下的item信息
  813. -- function StrengthModel:GetItemListByIndex(id)
  814. -- local list = {}
  815. -- local level = RoleManager.Instance.mainRoleInfo.level
  816. -- local config_data = DeepCopy(Config.Improvefighttask)
  817. -- for i,v in pairs(config_data) do
  818. -- if v.page_id == id and v.sort_id ~= 14 and (level >= v.lv_min and level <= v.lv_max) then --现在先排除14 神魂 还没做这个模块
  819. -- -- if level >= v.lv_min and level <= v.lv_max then
  820. -- -- table.insert(list, v)
  821. -- -- end
  822. -- v.sort_huodong_id = 0
  823. -- local data = self:refresh_data(v)
  824. -- if data ~= nil and self:CheckIsOpenByLevel(data) and not self:CheckSpicalIsOpen(data) then
  825. -- data.per, data.cur_num = self:Get_Per(data)
  826. -- self:Add_need_close(data)
  827. -- table.insert(list, data)
  828. -- end
  829. -- end
  830. -- end
  831. -- local _sort = function( a,b )
  832. -- if a.per >=100 and b.per <100 then
  833. -- return false
  834. -- elseif b.per >=100 and a.per <100 then
  835. -- return true
  836. -- else
  837. -- if a.open_flag > b.open_flag then
  838. -- return true
  839. -- elseif a.open_flag == b.open_flag then
  840. -- if a.sort_huodong_id > b.sort_huodong_id then
  841. -- return false
  842. -- elseif a.sort_huodong_id < b.sort_huodong_id then
  843. -- return true
  844. -- end
  845. -- if a.sort_id >= b.sort_id then
  846. -- return false
  847. -- else
  848. -- return true
  849. -- end
  850. -- else
  851. -- return false
  852. -- end
  853. -- end
  854. -- end
  855. -- table.sort(list, _sort)
  856. -- return list
  857. -- end
  858. -- -- 条件字段中有判断等级开启的level的 可以判断是否到达等级而显示
  859. -- function StrengthModel:CheckIsOpenByLevel(data)
  860. -- local is_open = false
  861. -- local str = ErlangParser:GetInstance():Parse(data.condition)[1]
  862. -- str = Trim(str)
  863. -- local list = Split(str,"_")
  864. -- local task_type = list[1]
  865. -- local task_id = list[2]
  866. -- if task_type == "level" then
  867. -- if RoleManager.Instance.mainRoleInfo.level >= tonumber(task_id) then
  868. -- is_open = true
  869. -- end
  870. -- else
  871. -- is_open = true
  872. -- end
  873. -- return is_open
  874. -- end
  875. -- -- 有些是特殊判断是否需要显示的
  876. -- function StrengthModel:CheckSpicalIsOpen(data)
  877. -- local not_show = false
  878. -- if data.page_id == 5 and data.sort_id == 2 then --投资计划 特殊判断显示
  879. -- if InvestModel:getInstance():IsGetAll(InvestModel.type.normal) and InvestModel:getInstance():IsGetAll(InvestModel.type.high) then
  880. -- not_show = true --不显示
  881. -- end
  882. -- end
  883. -- return not_show
  884. -- end
  885. -- function StrengthModel:refresh_data(data)
  886. -- local str = ErlangParser:GetInstance():Parse(data.condition)[1]
  887. -- str = Trim(str)
  888. -- local list = Split(str,"_")
  889. -- local task_type = list[1]
  890. -- local task_id = list[2]
  891. -- if task_type ~= "level" then
  892. -- task_type = str
  893. -- end
  894. -- data.task_type = task_type
  895. -- data.task_id = task_id
  896. -- local cur_level = RoleManager.Instance.mainRoleInfo.level
  897. -- local open_data = {}
  898. -- if task_type == "level" then
  899. -- if cur_level >= tonumber(task_id) then
  900. -- data.open_flag = 1
  901. -- else
  902. -- data.open_flag = 0
  903. -- end
  904. -- else
  905. -- open_data = Config.ConfigStrength.OpenLv[task_type]
  906. -- if not open_data then return end
  907. -- if cur_level >= open_data.openLv then
  908. -- data.open_flag = 1
  909. -- if task_type == "quiz" then
  910. -- local _data = QuizModel:getInstance():GetQuizState()
  911. -- if _data then
  912. -- if _data.stage == 3 or _data.stage == 0 then
  913. -- data.open_flag = 0
  914. -- end
  915. -- else
  916. -- data.open_flag = 0
  917. -- end
  918. -- self:Activity_time_show(data)
  919. -- elseif task_type == "guildfire" then
  920. -- -- if RoleManager.Instance.mainRoleInfo.guild_id == 0 then
  921. -- -- data.open_flag = 0
  922. -- -- data.huodong_des = "未加入社团"
  923. -- -- else
  924. -- -- local _data = GuildModel:getInstance():GetBonfireActInfo()
  925. -- -- if _data then
  926. -- -- if _data.state == 0 then
  927. -- -- data.open_flag = 0
  928. -- -- end
  929. -- -- else
  930. -- -- data.open_flag = 0
  931. -- -- end
  932. -- -- self:Activity_time_show(data)
  933. -- -- end
  934. -- end
  935. -- else
  936. -- data.open_flag = 0
  937. -- data.huodong_des = data.task_nonopen
  938. -- end
  939. -- end
  940. -- return data
  941. -- end
  942. -- function StrengthModel:Get_Per(data)
  943. -- local per = data.per or 0
  944. -- local cur_num = 0
  945. -- local task_type = data.task_type
  946. -- local task_id = data.task_id
  947. -- local max_num = data.max_num
  948. -- local fun = nil
  949. -- if data.page_id == 1 then --只有第一个标签下的信息才有进度条 因为会有很多相同的id值 所以用sort_id替代id值
  950. -- for k,v in pairs(Config.ConfigStrength.GetProgressFunc) do
  951. -- if tonumber(data.sort_id) == tonumber(v.id) then
  952. -- fun = self[v.func]
  953. -- per, cur_num = fun(self, max_num)
  954. -- end
  955. -- end
  956. -- end
  957. -- -- if per <= 1 then
  958. -- -- per = 1
  959. -- -- elseif per >= 100 then
  960. -- -- per = 100
  961. -- -- end
  962. -- -- if data.page_id == 1 then
  963. -- -- if per >= 100 then
  964. -- -- per = 99
  965. -- -- end
  966. -- -- end
  967. -- return per, cur_num
  968. -- end
  969. -- function StrengthModel:Add_need_close(data)
  970. -- -- body
  971. -- end
  972. -- function StrengthModel:Activity_time_show(data)
  973. -- local index = 1
  974. -- local time_table_list = {}
  975. -- local time_table_list_today = {}
  976. -- for k,v in pairs(Config.Improveactivityhall) do
  977. -- local str_id = ErlangParser:GetInstance():Parse(v.str_id)[1]
  978. -- str_id = Trim(str_id)
  979. -- if str_id == data.task_type then
  980. -- time_table_list[index] = DeepCopy(v)
  981. -- index=index+1
  982. -- end
  983. -- end--获取相应的数据列表
  984. -- index = 1
  985. -- local cur_time = TimeUtil:getServerTime()
  986. -- local now_time = os.date("*t",cur_time)
  987. -- local today = now_time.wday-1--当天周几
  988. -- for k,v in pairs(time_table_list) do
  989. -- local day_list = ErlangParser:GetInstance():Parse(v.adate)[1]
  990. -- local is_today = false
  991. -- for x,y in pairs(day_list) do
  992. -- if tonumber(y) == today then
  993. -- is_today = true
  994. -- break
  995. -- end
  996. -- end
  997. -- if is_today then
  998. -- time_table_list_today[index] = v
  999. -- index = index + 1
  1000. -- end
  1001. -- end
  1002. -- local _sort = function(a,b)
  1003. -- if a.asort > b.asort then
  1004. -- return false
  1005. -- else
  1006. -- return true
  1007. -- end
  1008. -- end
  1009. -- table.sort( time_table_list, _sort )
  1010. -- if TableSize(time_table_list_today) == 0 then
  1011. -- data.IsNull = true
  1012. -- end
  1013. -- local time_inside = false
  1014. -- local isover = false
  1015. -- local next_time = nil
  1016. -- for k,v in pairs(time_table_list_today) do
  1017. -- local opentime = ErlangParser:GetInstance():Parse(v.atime)
  1018. -- if opentime then
  1019. -- if now_time.hour < tonumber(opentime[1][1]) then
  1020. -- next_time = opentime[1]
  1021. -- elseif now_time.hour == tonumber(opentime[1][1]) and now_time.min < tonumber(opentime[1][2]) then
  1022. -- next_time = opentime[1]
  1023. -- elseif now_time.hour == tonumber(opentime[1][1]) and now_time.min == tonumber(opentime[1][2]) and now_time.sec <= tonumber(opentime[1][3]) then
  1024. -- next_time = opentime[1]
  1025. -- end
  1026. -- if next_time then
  1027. -- break
  1028. -- end
  1029. -- end
  1030. -- end
  1031. -- if not next_time then
  1032. -- data.per = 100
  1033. -- data.huodong_des = "over"
  1034. -- else
  1035. -- data.sort_huodong_id = tonumber(next_time[1]) * 1000 + tonumber(next_time[2])
  1036. -- if tonumber(next_time[1]) == 0 then
  1037. -- next_time[1] = "00"
  1038. -- end
  1039. -- if tonumber(next_time[1]) < 10 then
  1040. -- next_time[1] = "0"..tonumber(next_time[1])
  1041. -- end
  1042. -- if tonumber(next_time[2]) == 0 then
  1043. -- next_time[2] = "00"
  1044. -- end
  1045. -- if tonumber(next_time[2]) < 10 then
  1046. -- next_time[2] = "0"..tonumber(next_time[2])
  1047. -- end
  1048. -- data.per = 5
  1049. -- local str = next_time[1]..":"..next_time[2].."开启"
  1050. -- data.huodong_des = str
  1051. -- end
  1052. -- if data.open_flag == 1 then
  1053. -- data.sort_huodong_id = 0
  1054. -- data.huodong_des = ""
  1055. -- data.per = 5
  1056. -- end
  1057. -- end
  1058. -- ------------------------------------------挑战失败推送--------------------------------------
  1059. -- --挑战失败界面的"变强"推送 boss挑战失败界面 BossResultView 副本失败 DungeonResultView 世界boss失败 ReliveView
  1060. -- function StrengthModel:GetStrengthPush()
  1061. -- local list = {}
  1062. -- local strong_list = {}
  1063. -- local level = RoleManager.Instance.mainRoleInfo.level
  1064. -- local config_data = DeepCopy(Config.Improvefighttask)
  1065. -- for k,v in pairs(config_data) do
  1066. -- if v.page_id == 1 and v.sort_id <= 6 and (level >= v.lv_min and level <= v.lv_max) then
  1067. -- if self:IsFuncOpenLevel(v) then
  1068. -- local data = self:New_Get_Per(v)
  1069. -- if data then
  1070. -- table.insert(list, data)
  1071. -- end
  1072. -- end
  1073. -- end
  1074. -- end
  1075. -- if #list >= 4 then
  1076. -- local sort_func = function(a,b) --对变强途径排序 最小值的排在前面
  1077. -- if a.per >= b.per then
  1078. -- return false
  1079. -- else
  1080. -- return true
  1081. -- end
  1082. -- end
  1083. -- table.sort( list, sort_func )
  1084. -- for k,v in pairs(list) do --拿出最前面的四个最小值
  1085. -- if k <= 4 then
  1086. -- local strong_way = {winId = v.tagplace, subId = v.sub_tag, per = v.per}
  1087. -- table.insert(strong_list, strong_way)
  1088. -- end
  1089. -- end
  1090. -- else
  1091. -- return Config.ConfigBoss.StrongWay
  1092. -- end
  1093. -- return strong_list
  1094. -- end
  1095. -- function StrengthModel:New_Get_Per(data)
  1096. -- local per = data.per or 0
  1097. -- local task_type = data.task_type
  1098. -- local task_id = data.task_id
  1099. -- local max_num = data.max_num
  1100. -- local fun = nil
  1101. -- if data.page_id == 1 then
  1102. -- -- for k,v in pairs(Config.ConfigStrength.StrongWay) do
  1103. -- -- if tonumber(data.sort_id) == tonumber(v.id) then
  1104. -- -- fun = self[v.func]
  1105. -- -- per = fun(self, max_num)
  1106. -- -- data.per = per or 0
  1107. -- -- end
  1108. -- -- end
  1109. -- for k,v in pairs(Config.ConfigStrength.GetProgressFunc) do
  1110. -- if tonumber(data.sort_id) == tonumber(v.id) then
  1111. -- fun = self[v.func]
  1112. -- per = fun(self, max_num)
  1113. -- data.per = per or 0
  1114. -- end
  1115. -- end
  1116. -- end
  1117. -- return data
  1118. -- end
  1119. -- --是否是模块开启等级
  1120. -- function StrengthModel:IsFuncOpenLevel(data)
  1121. -- local str = ErlangParser:GetInstance():Parse(data.condition)[1]
  1122. -- str = Trim(str)
  1123. -- local list = Split(str,"_")
  1124. -- local task_type = list[1]
  1125. -- local task_id = list[2]
  1126. -- if task_type ~= "level" then return false end
  1127. -- if RoleManager.Instance.mainRoleInfo.level >= tonumber(task_id) then
  1128. -- return true
  1129. -- end
  1130. -- return false
  1131. -- end
  1132. -- function StrengthModel:SetStrengthFlag(type,value)
  1133. -- local t1 = math.floor(type / 20)
  1134. -- local t2 = type % 20
  1135. -- local flag = (t2 > 0 and t1 + 1 or t1)
  1136. -- local bit_num = (t2 == 0 and 20 or t2)
  1137. -- if flag == 1 then
  1138. -- if value then
  1139. -- self.strength_flag_1 = bit.bor(self.strength_flag_1, bit.lshift(1,bit_num))
  1140. -- else
  1141. -- self.strength_flag_1 = bit.band(self.strength_flag_1, bit.bnot(bit.lshift(1,bit_num)))
  1142. -- end
  1143. -- -- self:ChangeVar("strength_flag_1", self.strength_flag_1, nil, true)
  1144. -- elseif flag == 2 then
  1145. -- if value then
  1146. -- self.strength_flag_2 = bit.bor(self.strength_flag_2, bit.lshift(1,bit_num))
  1147. -- else
  1148. -- self.strength_flag_2 = bit.band(self.strength_flag_2, bit.bnot(bit.lshift(1,bit_num)))
  1149. -- end
  1150. -- -- self:ChangeVar("strength_flag_2", self.strength_flag_2, nil, true)
  1151. -- elseif flag == 3 then
  1152. -- if value then
  1153. -- self.strength_flag_3 = bit.bor(self.strength_flag_3, bit.lshift(1,bit_num))
  1154. -- else
  1155. -- self.strength_flag_3 = bit.band(self.strength_flag_3, bit.bnot(bit.lshift(1,bit_num)))
  1156. -- end
  1157. -- -- self:ChangeVar("strength_flag_3", self.strength_flag_3, nil, true)
  1158. -- elseif flag == 4 then
  1159. -- if value then
  1160. -- self.strength_flag_4 = bit.bor(self.strength_flag_4, bit.lshift(1,bit_num))
  1161. -- else
  1162. -- self.strength_flag_4 = bit.band(self.strength_flag_4, bit.bnot(bit.lshift(1,bit_num)))
  1163. -- end
  1164. -- end
  1165. -- end
  1166. --获得死亡复活变强配置
  1167. function StrengthModel:GetStrongWayCfg( )
  1168. local lv = RoleManager.Instance.mainRoleInfo.level
  1169. for k,v in pairs(Config.Rbstronger) do
  1170. if lv >= v.lv_min and lv <= v.lv_max then
  1171. local result = stringtotable(v.grade)
  1172. for kk,vv in pairs(result) do
  1173. vv.module_id = vv[1]
  1174. vv.sub_id = vv[2]
  1175. end
  1176. return result
  1177. end
  1178. end
  1179. return nil
  1180. end
  1181. --是否是其他特殊选项
  1182. function StrengthModel:IsOtherOption(module_id, module_sub)
  1183. if not module_id or not module_sub then
  1184. return false
  1185. end
  1186. local key = module_id .. "@" .. module_sub
  1187. local t =
  1188. {
  1189. ["159@1"] = true,
  1190. ["451@5"] = true,
  1191. ["450@2"] = true,
  1192. }
  1193. return t[key]
  1194. end
  1195. --获得死亡复活变强配置
  1196. function StrengthModel:GetOtherOption( )
  1197. local b = false
  1198. local option_res = ""
  1199. local modue_id = 450
  1200. local module_sub = 2
  1201. local module_name = ""
  1202. local vip = RoleManager.Instance:GetMainRoleVo().vip_flag
  1203. local sub_tab_id = false
  1204. if not RechargeActivityModel:getInstance():IsFirstRechager() then
  1205. b = true
  1206. local career = RoleManager.Instance.mainRoleInfo.career
  1207. if career == 1 or career == 2 then
  1208. option_res = "ui_item_first_rechager_1"
  1209. else
  1210. option_res = "ui_item_first_rechager_2"
  1211. end
  1212. modue_id = 159
  1213. module_sub = 1
  1214. module_name = "首充"
  1215. elseif vip < 3 then
  1216. b = true
  1217. option_res = "ui_item_vip_3"
  1218. module_name = "VIP3"
  1219. sub_tab_id = 3
  1220. elseif vip < 4 then
  1221. b = true
  1222. option_res = "ui_item_vip_4"
  1223. module_name = "VIP4"
  1224. sub_tab_id = 4
  1225. elseif RoleManager.Instance.mainRoleInfo.sup_vip_type == 0 then
  1226. b = true
  1227. option_res = "ui_item_surper_vip"
  1228. modue_id = 451
  1229. module_sub = 5
  1230. module_name = "贵族"
  1231. elseif vip < 5 then
  1232. b = true
  1233. option_res = "ui_item_vip_5"
  1234. module_name = "VIP5"
  1235. sub_tab_id = 5
  1236. end
  1237. return b, option_res, modue_id, module_sub, module_name,sub_tab_id
  1238. end