CBG Helper 2024.12 修复版

修复 CBG Helper 无法使用的问题,原项目为 https://gf.qytechs.cn/zh-CN/scripts/406264-cbg-helper, 有问题找 LingErEd (https://space.bilibili.com/103021226)

目前为 2024-12-08 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name CBG Helper 2024.12 修复版
  3. // @namespace https://yys.zhebu.work/
  4. // @version 0.1.7.b
  5. // @description 修复 CBG Helper 无法使用的问题,原项目为 https://gf.qytechs.cn/zh-CN/scripts/406264-cbg-helper, 有问题找 LingErEd (https://space.bilibili.com/103021226)
  6. // @author Jie Chu (原作者) & LingErEd (修复)
  7. // @match https://yys.cbg.163.com/*
  8. // @grant none
  9. // @run-at document-start
  10. // @require https://update.gf.qytechs.cn/scripts/465643/1421695/ajaxHookerLatest.js
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. let panel_class_name = 'content-overview';
  15. let acct_info = {
  16. ready: false
  17. };
  18. let FRAC_N = 5;
  19. let url_get_equip_detail = "/cgi/api/get_equip_detail";
  20. let url_get_equip_desc = "/cgi/api/get_equip_desc"; // added by LingErEd
  21. let suit_imp = ["散件", "招财猫", "火灵", "蚌精", "共潜", '遗念火']; // 重要套装,可自行添加
  22. let suit_by_props = {
  23. '暴击伤害': ["无刀取"],
  24. '暴击': ["针女", "三味", "网切", "伤魂鸟", "破势", "镇墓兽", "青女房", "海月火玉"],
  25. '攻击加成': ["蝠翼", "轮入道", "狰", "鸣屋", "心眼", "阴摩罗", "狂骨", "兵主部", "贝吹坊"],
  26. '防御加成': ["珍珠", "魅妖", "雪幽魂", "招财猫", "反枕", "日女巳时", "木魅", "出世螺", "奉海图"],
  27. '生命加成': ["地藏像", "涅槃之火", "被服", "镜姬", "钟灵", "薙魂", "树妖", "涂佛", "恶楼"],
  28. '效果抵抗': ["骰子鬼", "返魂香", "魍魉之匣", "幽谷响", "共潜"],
  29. '效果命中': ["蚌精", "火灵", "飞缘魔", "遗念火"],
  30. '首领御魂': ["土蜘蛛", "胧车", "荒骷髅", "地震鲶", "蜃气楼", "鬼灵歌伎", "夜荒魂"]
  31. }
  32. // eslint-disable-next-line no-undef
  33. ajaxHooker.hook(request => {
  34. let originalResponse = request.response;
  35. if (request.url.startsWith(url_get_equip_detail)) {
  36. console.log('ajaxHooker url_get_equip_detail');
  37. request.response = res => {
  38. if (res.status == 200) {
  39. // console.log(res.responseText);
  40. const data = JSON.parse(res.responseText)
  41. floatify(data, 'url_get_equip_detail')
  42. }
  43. if(originalResponse) try {originalResponse.apply(this, [res]);} catch (error) {}
  44. };
  45. }
  46. if (request.url.startsWith(url_get_equip_desc)) {
  47. console.log('ajaxHooker url_get_equip_desc');
  48. request.response = res => {
  49. if (res.status == 200) {
  50. // const data = JSON.parse(res.responseText)
  51. floatify({
  52. equip: res.json
  53. }, 'url_get_equip_desc')
  54. }
  55. if(originalResponse) try {originalResponse.apply(this, [res]);} catch (error) {}
  56. }
  57. }
  58. })
  59.  
  60. function nowrapText(textLabel) {
  61. return `<span class="cbghelper_nowrap">${textLabel}</span>`
  62. }
  63.  
  64. function addExtendedHighlight() {
  65. if (document.getElementById('cbghelper_exthighlight') || !acct_info.hasOwnProperty("summary")) {
  66. return;
  67. }
  68. let {
  69. fastest,
  70. heads,
  71. feet,
  72. hero_info
  73. } = acct_info.summary;
  74. let itms = [];
  75. let build_item = function(label, id) {
  76. let li = document.createElement('li');
  77. li.innerText = label;
  78. return li
  79. };
  80. //collection of heros
  81. let total = hero_info['ssr']['all'] + hero_info['sp']['all'];
  82. let got_total = hero_info['ssr']['got'] + hero_info['sp']['got'];
  83. if (total === got_total) {
  84. itms.push(build_item('SSR/SP全收集'));
  85. } else if (hero_info['ssr']['all'] === hero_info['ssr']['got']) {
  86. itms.push(build_item('SSR全收集'));
  87. }
  88. if (hero_info['x']['all'] === hero_info['x']['got']) {
  89. itms.push(build_item('联动全收集'));
  90. }
  91. //number of heads and feet
  92. if (heads.length > 0 || feet.length > 0) {
  93. let x = heads.length > 0 ? heads.length : '无';
  94. let y = feet.length > 0 ? feet.length : '无';
  95. let label = `${x}头${y}脚`;
  96. itms.push(build_item(label))
  97. }
  98. //fastest speed
  99. let fastest_spd_label = `最快一速${[1, 2, 3, 4, 5, 6].reduce((total, p) => total + fastest[p]['散件'], 0).toFixed(2)}`;
  100. let fastest_spd = build_item(fastest_spd_label)
  101. fastest_spd.id = 'cbghelper_exthighlight';
  102. itms.push(fastest_spd);
  103. //fastest zhaocai speed
  104. let zc_spd_val = [1, 2, 3, 4, 5, 6].reduce((total, p) => total + fastest[p]['招财猫'], 0);
  105. let spd_inc = [1, 2, 3, 4, 5, 6].map(p => fastest[p]['散件'] - fastest[p]['招财猫'], 0);
  106. spd_inc.sort((a, b) => b - a);
  107. zc_spd_val += spd_inc[0] + spd_inc[1];
  108. let zc_spd_label = `招财一速${zc_spd_val.toFixed(2)}`;
  109. itms.push(build_item(zc_spd_label));
  110.  
  111. let highlight = document.getElementsByClassName('highlight')[0];
  112. for (let li of itms) {
  113. highlight.appendChild(li);
  114. }
  115. }
  116.  
  117. function summaryPage() {
  118. let wrapper = document.createElement('div');
  119. wrapper.classList.add('module');
  120. if (!acct_info.hasOwnProperty('summary')) {
  121. wrapper.appendChild(document.createTextNode("数据加载出错,请尝试刷新页面"))
  122. return wrapper;
  123. }
  124. let decimal = 2;
  125. let {
  126. fastest,
  127. heads,
  128. feet,
  129. fullspd_cnt
  130. } = acct_info.summary;
  131. let fullspd_suit = Object.fromEntries(suit_imp.map(name => [name, 0]));
  132. fastest = JSON.parse(JSON.stringify(fastest)); // make a deep copy
  133. let suit_stats = {};
  134. for (let p of [1, 2, 3, 4, 5, 6]) {
  135. for (let name in fullspd_cnt[p]) {
  136. if (fullspd_suit[name] === 0) {
  137. continue;
  138. }
  139. if (name in suit_stats) {
  140. suit_stats[name].push(p);
  141. } else {
  142. suit_stats[name] = [p];
  143. }
  144. }
  145. }
  146. for (let name in suit_stats) {
  147. if (suit_stats[name].length >= 4) {
  148. if (name in fullspd_suit) {
  149. continue;
  150. } else {
  151. fullspd_suit[name] = 0;
  152. }
  153. }
  154. }
  155. let fast_suit_speed = function(name) {
  156. let suit_fastest = Object.fromEntries([1, 2, 3, 4, 5, 6].map(p => [p, name in fastest[p] ? fastest[p][name] : 0]));
  157. let suit_spd_val = [1, 2, 3, 4, 5, 6].reduce((total, p) => total + suit_fastest[p], 0);
  158. let spd_inc = [1, 2, 3, 4, 5, 6].map(p => fastest[p]['散件'] - suit_fastest[p]);
  159. spd_inc.sort((a, b) => b - a);
  160. suit_spd_val += spd_inc[0] + spd_inc[1];
  161. return suit_spd_val;
  162. }
  163. Object.keys(fullspd_suit).forEach(name => {
  164. fullspd_suit[name] = fast_suit_speed(name);
  165. })
  166.  
  167. let sortByValue = function(a, b) {
  168. return b.value - a.value
  169. }
  170. let headStr = heads.length > 0 ? heads.sort(sortByValue).map(itm => `<span class="data-value">${itm.name}: ${(itm.value).toFixed(decimal)}</span>`.trim()).join(", ") : "无";
  171. let feetStr = feet.length > 0 ? feet.sort(sortByValue).map(itm => `<span class="data-value">${itm.name}: ${(itm.value).toFixed(decimal)}</span>`.trim()).join(", ") : "无";
  172. let td_val = function(pos, name) {
  173. let fullspd = fullspd_cnt[pos][name] > 0;
  174. let spd = name in fastest[pos] ? fastest[pos][name].toFixed(decimal) : 0;
  175. let res = `<span${fullspd? "":" class=disabled"}>${spd}</span> `
  176. if (fullspd) {
  177. res += nowrapText(`(${fullspd_cnt[pos][name]})`)
  178. }
  179. return res;
  180. }
  181. Object.keys(fastest[2]).forEach(k => fastest[2][k] = fastest[2][k] - 57 > 0 ? fastest[2][k] - 57 : 0)
  182. let speed_summary = function(name) {
  183. return `<tr> <td>${name}</td> ${[1, 2, 3, 4, 5, 6, 7].map(i => `<td>${td_val(i, name)}</td>`)} </tr>`;
  184. }
  185. let fastest_tbl = `<table width="100%">
  186. <tr> <th>位置</th> ${[1, 2, 3, 4, 5, 6].map(i => `<th>${i}</th>`)} <th>4${nowrapText("(命中)")}</th> </tr>
  187. ${ Object.keys(fullspd_suit).map(name => speed_summary(name)).join(" ") }
  188. </table>`;
  189. let suit_table = `<table width="100%">
  190. <tr> <th>御魂名称</th> <th>套装一速</th></tr>
  191. ${ Object.keys(fullspd_suit).map(name => `<tr> <th>${name}</th> <td>${fullspd_suit[name].toFixed(5)}</td></tr>\n`).join("") }
  192. </table>`;
  193.  
  194. let title = document.createElement('div')
  195. title.classList.add('title');
  196. title.innerText = "御魂亮点"
  197. let spd = document.createElement('section')
  198. spd.innerHTML = `<div><span class="data-name">头:</span> ${headStr} </div>
  199. <div><span class="data-name">脚:</span> ${feetStr} </div>`;
  200. let title2 = document.createElement('div');
  201. title2.innerText = "套装一速(非独立)";
  202. title2.classList.add('title');
  203. let suit = document.createElement('section');
  204. suit.innerHTML = suit_table;
  205.  
  206. let title3 = document.createElement('div');
  207. title3.innerText = "各位置一速(满速个数)";
  208. title3.classList.add('title');
  209.  
  210. let fastest_sec = document.createElement('section');
  211. fastest_sec.innerHTML = fastest_tbl;
  212. if (fastest_sec.firstChild.nodeType === Node.TEXT_NODE) {
  213. fastest_sec.firstChild.textContent = '';
  214. }
  215.  
  216. wrapper.appendChild(title);
  217. wrapper.appendChild(spd);
  218. wrapper.appendChild(title2);
  219. wrapper.appendChild(suit);
  220. wrapper.appendChild(title3);
  221. wrapper.appendChild(fastest_sec);
  222. return wrapper;
  223. }
  224.  
  225. function addHighlightView() {
  226. if (document.getElementById('cbghelper_highlight')) {
  227. return;
  228. }
  229. let div = document.createElement('div');
  230. div.id = 'cbghelper_highlight';
  231. div.class = 'module';
  232. div.appendChild(summaryPage());
  233. let wrapper = document.getElementsByClassName(panel_class_name)[0];
  234. wrapper.appendChild(div)
  235. }
  236.  
  237. function addDownloadBtn() {
  238. if (document.getElementById('cbghelper_download')) {
  239. return;
  240. }
  241. let b = document.createElement('a');
  242. b.innerText = "(💾保存为JSON)";
  243. b.onclick = function() {
  244. console.log("To save data!");
  245. saveToJsonHelper();
  246. }
  247. b.id = "cbghelper_download"
  248. b.style.cursor = "pointer";
  249. let yuhun_list = document.getElementsByClassName('content-top-left')[0];
  250. yuhun_list.getElementsByTagName('h3')[1].appendChild(b);
  251. }
  252.  
  253. function addDownloadBtnWrapper() {
  254. if (document.getElementsByClassName('yuhun-list').length) {
  255. addDownloadBtn();
  256. }
  257. }
  258.  
  259. function addExtHighlightWrapper() {
  260. if (document.getElementsByClassName('highlight').length) {
  261. addExtendedHighlight();
  262. }
  263. }
  264.  
  265. function addHighlightViewWrapper() {
  266. if (document.getElementsByClassName(panel_class_name).length && acct_info.ready) {
  267. addHighlightView();
  268. }
  269. }
  270.  
  271. function init() {
  272. let checkfn_list = {
  273. 'cbghelper_download': addDownloadBtnWrapper,
  274. 'cbghelper_exthighlight': addExtHighlightWrapper,
  275. 'cbghelper_highlight': addHighlightViewWrapper
  276. };
  277. let handlers = {};
  278.  
  279. let checkExist = setInterval(function() {
  280. if (!document.URL.startsWith("https://yys.cbg.163.com/cgi/mweb/equip")) {
  281. return;
  282. }
  283. for (let eid of Object.keys(checkfn_list)) {
  284. if (document.getElementById(eid) && eid in handlers) {
  285. clearInterval(handlers[eid]);
  286. delete handlers[eid];
  287. } else if (document.getElementById(eid) || eid in handlers) {
  288. continue;
  289. } else {
  290. handlers[eid] = setInterval(checkfn_list[eid], 200);
  291. }
  292. }
  293. }, 100);
  294. };
  295.  
  296. init();
  297. const floatify = function(data, type) {
  298. console.log('floatify', data);
  299. let equip = data['equip'];
  300. // 如果没有 equip_desc 则返回
  301. if (!equip.hasOwnProperty('equip_desc')) {
  302. console.log('No equip_desc, from', type);
  303. return data;
  304. }
  305. let acct_detail = JSON.parse(equip['equip_desc']);
  306. let mitama_list = acct_detail['inventory'];
  307. let hero_list = acct_detail['heroes'];
  308. let hero_info = acct_detail['hero_history'];
  309.  
  310. try {
  311. var message = {
  312. name: equip.seller_name,
  313. roleid: equip.seller_roleid,
  314. ordersn: equip.game_ordersn,
  315. mitama_list
  316. };
  317. var event = new CustomEvent("SaveLastAccount", {
  318. detail: message
  319. });
  320. window.dispatchEvent(event);
  321. acct_info.latest = message;
  322. } catch (error) {}
  323.  
  324. Object.entries(mitama_list).forEach(([key, value]) => {
  325. mitama_list[key] = floatify_mitama(value);
  326. });
  327. Object.entries(hero_list).forEach(([key, value]) => {
  328. hero_list[key] = floatify_hero(value, mitama_list);
  329. });
  330. acct_detail['inventory'] = mitama_list;
  331. equip['equip_desc'] = JSON.stringify(acct_detail);
  332. data['equip'] = equip;
  333.  
  334. acctHighlight(mitama_list, hero_info);
  335.  
  336. return data;
  337. }
  338.  
  339. function getPropValue(mitama_set, mitama_list, propName) {
  340. let res = 0;
  341. for (let mitama_id of mitama_set) {
  342. var {
  343. attrs,
  344. single_attr = []
  345. } = mitama_list[mitama_id];
  346. for (let [p, v] of attrs) {
  347. if (p === propName) {
  348. res += parseFloat(v);
  349. }
  350. }
  351. if (single_attr.length > 0 && single_attr[0] === propName) {
  352. res += parseFloat(single_attr[1]);
  353. }
  354. }
  355. return res
  356. }
  357.  
  358. function floatify_hero(hero_data, mitama_list) {
  359. var {
  360. attrs,
  361. equips
  362. } = hero_data
  363. Object.keys(attrs).forEach(propName => {
  364. if (propName === '速度' && parseFloat(attrs[propName].add_val) > 0) {
  365. if (hero_data.heroId === 255 && hero_data.awake === 1) { //觉醒阎魔+10速度
  366. attrs[propName].add_val = 10.0
  367. } else {
  368. attrs[propName].add_val = 0.0
  369. }
  370. attrs[propName].add_val += getPropValue(equips, mitama_list, propName);
  371. attrs[propName].add_val = attrs[propName].add_val.toFixed(FRAC_N)
  372. }
  373. if (propName === '暴击' && parseFloat(attrs[propName].add_val) > 0) {
  374. let suit_cp = suit_by_props['暴击'];
  375. attrs[propName].add_val = getPropValue(equips, mitama_list, propName);
  376. let suit_names = equips.map(x => mitama_list[x].name);
  377. let suit_count = {};
  378. for (let n of suit_names) {
  379. if (n in suit_count) {
  380. suit_count[n] += 1;
  381. } else {
  382. suit_count[n] = 1;
  383. }
  384. }
  385. Object.keys(suit_count).forEach(n => {
  386. if (suit_count[n] >= 2 && suit_cp.includes(n)) {
  387. attrs[propName].add_val += suit_count[n] === 6 ? 30 : 15;
  388. }
  389. })
  390. attrs[propName].add_val = attrs[propName].add_val.toFixed(2) + "%";
  391. }
  392. })
  393.  
  394. return hero_data;
  395. }
  396.  
  397. function floatify_mitama(mitama) {
  398. var {
  399. rattr,
  400. attrs
  401. } = mitama;
  402. mitama["attrs"] = [attrs[0], ...calAttrs(rattr)];
  403. return mitama;
  404. }
  405.  
  406. function calAttrs(rattrs, format = true) {
  407. var enAttrNames = ['attackAdditionRate',
  408. 'attackAdditionVal',
  409. 'critPowerAdditionVal',
  410. 'critRateAdditionVal',
  411. 'debuffEnhance',
  412. 'debuffResist',
  413. 'defenseAdditionRate',
  414. 'defenseAdditionVal',
  415. 'maxHpAdditionRate',
  416. 'maxHpAdditionVal',
  417. 'speedAdditionVal'
  418. ]
  419.  
  420. var cnAttrNames = ['攻击加成', '攻击', '暴击伤害', '暴击',
  421. '效果命中', '效果抵抗', '防御加成',
  422. '防御', '生命加成', '生命', '速度'
  423. ]
  424.  
  425. var basePropValue = {
  426. '攻击加成': 3,
  427. '攻击': 27,
  428. '暴击伤害': 4,
  429. '暴击': 3,
  430. '效果抵抗': 4,
  431. '效果命中': 4,
  432. '防御加成': 3,
  433. '防御': 5,
  434. '生命加成': 3,
  435. '生命': 114,
  436. '速度': 3
  437. }
  438.  
  439. var percentProp = {
  440. '攻击加成': true,
  441. '攻击': false,
  442. '暴击伤害': true,
  443. '暴击': true,
  444. '效果抵抗': true,
  445. '效果命中': true,
  446. '防御加成': true,
  447. '防御': false,
  448. '生命加成': true,
  449. '生命': false,
  450. '速度': false
  451. }
  452.  
  453. var e2cNameMap = Object.assign({}, ...enAttrNames.map((n, index) => ({
  454. [n]: cnAttrNames[index]
  455. })));
  456. var res = Object();
  457. for (let rattr of rattrs) {
  458. var [prop, v] = rattr;
  459. prop = e2cNameMap[prop];
  460. if (prop in res) {
  461. res[prop] += v;
  462. } else {
  463. res[prop] = v;
  464. }
  465. }
  466.  
  467. return Object.keys(res).sort().map(p => {
  468. var v = res[p] * basePropValue[p]
  469. if (format) {
  470. v = v.toFixed(FRAC_N);
  471. if (percentProp[p]) {
  472. v += "%";
  473. }
  474. }
  475.  
  476. return [p, v];
  477. })
  478. }
  479.  
  480. function soulToJson(soulItem) {
  481. const {
  482. attrs,
  483. level,
  484. qua,
  485. rattr,
  486. uuid,
  487. name,
  488. pos,
  489. single_attr = []
  490. } = soulItem;
  491. var born = parseInt(uuid.substring(0, 8), 16);
  492. let soulDict = {
  493. '固有属性': single_attr.length ? single_attr[0] : null,
  494. '生成时间': born,
  495. '御魂等级': level,
  496. '御魂星级': qua,
  497. '御魂ID': uuid,
  498. '御魂类型': name,
  499. '位置': pos
  500. };
  501. let PROPNAMES = ['攻击', '攻击加成', '防御',
  502. '防御加成', '暴击', '暴击伤害', '生命', '生命加成', '效果命中',
  503. '效果抵抗', '速度'
  504. ];
  505. PROPNAMES.map(function(e, i) {
  506. soulDict[e] = 0;
  507. });
  508.  
  509. let percent = ['攻击加成', '防御加成', '暴击', '暴击伤害', '生命加成', '效果命中', '效果抵抗'];
  510. for (let [p, v] of [attrs[0], ...calAttrs(rattr, false)]) {
  511. v = parseFloat(v)
  512. if (percent.includes(p)) {
  513. v = v / 100;
  514. }
  515. soulDict[p] += v;
  516. }
  517. if (single_attr.length) {
  518. const [p, v] = single_attr;
  519. soulDict[p] += parseFloat(v) / 100;
  520. }
  521.  
  522. return soulDict;
  523. }
  524.  
  525. function saveToJson(soulLists) {
  526. var fileContent = 'data:text/json;charset=utf-8,'
  527. let soulListJson = Object.values(soulLists).map(soulToJson);
  528. soulListJson.unshift('yuhun_ocr2.0');
  529. fileContent += JSON.stringify(soulListJson);
  530.  
  531. var encodedUri = encodeURI(fileContent);
  532. var link = document.createElement('a');
  533. link.setAttribute('href', encodedUri);
  534. link.setAttribute('download', 'yuhun.json');
  535. link.innerHTML = 'Click Here to download your data';
  536. document.body.appendChild(link); // Required for FF
  537.  
  538. link.click();
  539. link.parentNode.removeChild(link);
  540. }
  541.  
  542. function acctHighlight(mitama_list, hero_info) {
  543. let fastest = {};
  544. let fullspd_cnt = {}
  545. let heads = [];
  546. let feet = [];
  547. let all_pos = [1, 2, 3, 4, 5, 6];
  548. for (let p of [1, 2, 3, 4, 5, 6, 7]) { //7 for 命中@4
  549. fastest[p] = {};
  550. fullspd_cnt[p] = {};
  551. for (let name of suit_imp) {
  552. fastest[p][name] = 0;
  553. fullspd_cnt[p][name] = 0;
  554. }
  555. }
  556.  
  557. Object.entries(mitama_list).forEach(([key, m]) => {
  558. let {
  559. attrs,
  560. pos,
  561. name,
  562. qua,
  563. rattr
  564. } = m;
  565. let spd = 0,
  566. spdpt = 0;
  567. for (let [p, v] of attrs) {
  568. if (p === '速度') {
  569. spd += parseFloat(v);
  570. }
  571. }
  572. for (let rattr_entry of rattr) {
  573. var [prop, v] = rattr_entry;
  574. if (prop === 'speedAdditionVal') {
  575. spdpt += 1
  576. }
  577. }
  578. if (spdpt < 1 || (pos === 2 && spd < 57)) {
  579. return;
  580. }
  581. if (spdpt === 6 && (pos !== 2 || spd > 70)) {
  582. fullspd_cnt[pos]['散件'] += 1
  583. if (name in fullspd_cnt[pos]) {
  584. fullspd_cnt[pos][name] += 1;
  585. } else {
  586. fullspd_cnt[pos][name] = 1;
  587. }
  588. if (pos === 2) {
  589. heads.push({
  590. pos,
  591. name,
  592. value: spd - 57
  593. });
  594. } else if (pos === 4 && attrs[0][0] === '效果命中') {
  595. fullspd_cnt[7]['散件'] += 1;
  596. if (name in fullspd_cnt[pos]) {
  597. fullspd_cnt[7][name] += 1;
  598. } else {
  599. fullspd_cnt[7][name] = 1;
  600. }
  601. feet.push({
  602. pos,
  603. name,
  604. value: spd
  605. });
  606. }
  607. }
  608. if (name in fastest[pos]) {
  609. fastest[pos][name] = fastest[pos][name] > spd ? fastest[pos][name] : spd;
  610. } else {
  611. fastest[pos][name] = spd;
  612. }
  613. fastest[pos]['散件'] = fastest[pos]['散件'] > spd ? fastest[pos]['散件'] : spd;
  614. if (pos === 4 && attrs[0][0] === '效果命中') {
  615. pos = 7;
  616. if (name in fastest[pos]) {
  617. fastest[pos][name] = fastest[pos][name] > spd ? fastest[pos][name] : spd;
  618. } else {
  619. fastest[pos][name] = spd;
  620. }
  621. fastest[pos]['散件'] = fastest[pos]['散件'] > spd ? fastest[pos]['散件'] : spd;
  622. }
  623. });
  624. acct_info.summary = {
  625. heads,
  626. feet,
  627. fastest,
  628. fullspd_cnt,
  629. hero_info
  630. }
  631. acct_info.ready = true;
  632. }
  633.  
  634. function saveToJsonHelper() {
  635. // var event = new CustomEvent("LoadLastAccount", {});
  636. // window.dispatchEvent(event);
  637. // console.log("Account data requested!");
  638. saveToJson(acct_info.latest.mitama_list);
  639. }
  640. // function needed that is not included from chrome extension
  641. var cssRules = `
  642. .cbghelper_nowrap {
  643. white-space: nowrap;
  644. }
  645. `
  646.  
  647. function injectCSS() {
  648. var style = document.createElement('style');
  649. style.innerHTML = cssRules;
  650. document.getElementsByTagName('head')[0].appendChild(style);
  651. }
  652.  
  653. injectCSS();
  654. })()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址