You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

script-skill-parser.js 70 kB

5 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974
  1. //带标签的模板字符串
  2. function tp(strings, ...keys) {
  3. return (function(...values) {
  4. let dict = values[values.length - 1] || {};
  5. let fragment = document.createDocumentFragment();
  6. fragment.appendChild(document.createTextNode(strings[0]));
  7. //let result = [strings[0]];
  8. keys.forEach(function(key, i, arr) {
  9. let value = Number.isInteger(key) ? values[key] : dict[key];
  10. if (value == undefined)
  11. {
  12. console.log("模板字符串中 %s 未找到输入数据",key);
  13. }else
  14. {
  15. if (!(value instanceof Node))
  16. {
  17. value = document.createTextNode(value);
  18. }
  19. try{
  20. fragment.appendChild(arr.lastIndexOf(key) == i ? value : value.cloneNode(true));
  21. }catch(e)
  22. {
  23. console.log(value, e);
  24. console.log(keys, values);
  25. }
  26. }
  27. fragment.appendChild(document.createTextNode(strings[i + 1]));
  28. });
  29. return fragment;
  30. });
  31. }
  32. const Attributes = {
  33. /*0: "Fire",
  34. 1: "Water",
  35. 2: "Wood",
  36. 3: "Light",
  37. 4: "Dark",
  38. 5: "Heart",
  39. 6: "Jammer",
  40. 7: "Poison",
  41. 8: "MPoison",
  42. 9: "Bomb",*/
  43. Fire: 0,
  44. Water: 1,
  45. Wood: 2,
  46. Light: 3,
  47. Dark: 4,
  48. Heart: 5,
  49. Jammer: 6,
  50. Poison: 7,
  51. MPoison: 8,
  52. Bomb: 9,
  53. }
  54. for (let name in Attributes)
  55. {
  56. Attributes[Attributes[name]] = name;
  57. }
  58. Attributes.all = function () {
  59. return [
  60. this.Fire,
  61. this.Water,
  62. this.Wood,
  63. this.Light,
  64. this.Dark
  65. ];
  66. }
  67. Attributes.orbs = function () {
  68. return [
  69. this.Fire,
  70. this.Water,
  71. this.Wood,
  72. this.Light,
  73. this.Dark,
  74. this.Heart,
  75. this.Jammer,
  76. this.Poison,
  77. this.MPoison,
  78. this.Bomb,
  79. ];
  80. }
  81. //代码来自于 https://www.jianshu.com/p/3644833bca33
  82. function isEqual(obj1,obj2) {
  83. //判断是否是对象或数组
  84. function isObject(obj) {
  85. return typeof obj === 'object' && obj !== null;
  86. }
  87. // 两个数据有任何一个不是对象或数组
  88. if (!isObject(obj1) || !isObject(obj2)) {
  89. // 值类型(注意:参与equal的一般不会是函数)
  90. return obj1 === obj2;
  91. }
  92. // 如果传的两个参数都是同一个对象或数组
  93. if (obj1 === obj2) {
  94. return true;
  95. }
  96. // 两个都是对象或数组,而且不相等
  97. // 1.先比较obj1和obj2的key的个数,是否一样
  98. const obj1Keys = Object.keys(obj1);
  99. const obj2Keys = Object.keys(obj2);
  100. if (obj1Keys.length !== obj2Keys.length) {
  101. return false;
  102. }
  103. // 如果key的个数相等,就是第二步
  104. // 2.以obj1为基准,和obj2依次递归比较
  105. for (let key in obj1) {
  106. // 比较当前key的value --- 递归
  107. const res = isEqual(obj1[key], obj2[key]);
  108. if (!res) {
  109. return false;
  110. }
  111. }
  112. // 3.全相等
  113. return true
  114. }
  115. class Board
  116. {
  117. #rowCount = 6;
  118. #columnCount = 7;
  119. #data = [];
  120. constructor(def = null)
  121. {
  122. for (let ri=0;ri<this.#rowCount;ri++)
  123. {
  124. this.#data.push(new Array(this.#columnCount).fill(Array.isArray(def) ? null : def));
  125. }
  126. if (Array.isArray(def))
  127. {
  128. this.randomFill(def);
  129. }
  130. }
  131. //填充序列
  132. sequenceFill(sequence)
  133. {
  134. const o = sequence.entries();
  135. //65版部分
  136. for (let ri=0;ri<this.#data.length;ri++)
  137. {
  138. if (ri == 2) ri++;
  139. const row = this.#data[ri];
  140. for (let ci=0;ci<row.length;ci++)
  141. {
  142. if (ci == 3) ci++;
  143. //从数组中随机取出一个
  144. row[ci] = o.next().value?.[1] ?? row[ci];
  145. }
  146. }
  147. //填充剩下的部分
  148. for (let ri=0;ri<this.#data.length;ri++)
  149. {
  150. if (ri == 2) ri++;
  151. const row = this.#data[ri];
  152. row[3] = o.next().value?.[1] ?? row[3] ;
  153. }
  154. const row = this.#data[2];
  155. for (let ci=0;ci<row.length;ci++)
  156. {
  157. row[ci] = o.next().value?.[1] ?? row[ci] ;
  158. }
  159. }
  160. //将有序数组转为随机的数组
  161. sequenceToRandom(valueArray)
  162. {
  163. const randomData = [];
  164. //将65版之后的的提出来
  165. let secondaryData = valueArray.splice((this.#rowCount - 1) * (this.#columnCount - 1));
  166. while(valueArray.length > 0)
  167. {
  168. randomData.push(valueArray.randomShift());
  169. }
  170. while(secondaryData.length > 0)
  171. {
  172. randomData.push(secondaryData.randomShift());
  173. }
  174. return randomData;
  175. }
  176. //洗版的填充
  177. randomFill(attrs)
  178. {
  179. let valueArray = new Uint8Array(this.#rowCount * this.#columnCount);
  180. crypto.getRandomValues(valueArray); //获取符合密码学要求的安全的随机值
  181. valueArray = Array.from(valueArray.map(x => attrs[x % attrs.length])); //用所有宝珠随机填充
  182. //之后用每种颜色填充前3个
  183. attrs.forEach((attr,idx)=>{
  184. valueArray.fill(attr, idx * 3, (idx + 1) * 3);
  185. });
  186. //将上方数据重新乱序排列
  187. const randomData = this.sequenceToRandom(valueArray);
  188. this.sequenceFill(randomData);
  189. }
  190. //生成珠子的填充
  191. generateOrbs(attrs, count)
  192. {
  193. let valueArray = new Array(this.#rowCount * this.#columnCount);
  194. attrs.forEach((attr,idx)=>{
  195. valueArray.fill(attr, idx * count, (idx + 1) * count);
  196. });
  197. //将上方数据重新乱序排列
  198. const randomData = this.sequenceToRandom(valueArray);
  199. this.sequenceFill(randomData);
  200. }
  201. //设定横行
  202. setRow(rows, attr = 0)
  203. {
  204. for (let row of rows)
  205. {
  206. if (row >= 2) row++;
  207. const rowData = this.#data[row];
  208. for (let ri=0;ri<rowData.length;ri++)
  209. {
  210. rowData[ri] = attr;
  211. }
  212. }
  213. }
  214. //设定竖列
  215. setColumn(cols, attr = 0)
  216. {
  217. for (let col of cols)
  218. {
  219. if (col >= 3) col++;
  220. for (let row of this.#data)
  221. {
  222. row[col] = attr;
  223. }
  224. }
  225. }
  226. //设定形状
  227. setShape(matrix, attr = 0)
  228. {
  229. function fillRow(rowData, inputRow, attr)
  230. {
  231. for (let col of inputRow)
  232. {
  233. if (col == 3) rowData[col] = attr;
  234. if (col >= 3) col++;
  235. rowData[col] = attr;
  236. }
  237. }
  238. for (let ri=0;ri<matrix.length;ri++)
  239. {
  240. if (ri == 2)
  241. {
  242. fillRow(this.#data[ri], matrix[ri], attr);
  243. }
  244. fillRow(this.#data[ri >= 2 ? ri+1 : ri], matrix[ri], attr);
  245. }
  246. }
  247. //面板叠加
  248. overlayBoard(board)
  249. {
  250. for (let ri=0;ri<board.length;ri++)
  251. {
  252. const rowNew = board[ri];
  253. const rowOld = this.#data[ri];
  254. for (let ci=0;ci<rowNew.length;ci++)
  255. {
  256. rowOld[ci] = rowNew[ci] ?? rowOld[ci];
  257. }
  258. }
  259. }
  260. //导出数组
  261. valueOf()
  262. {
  263. return this.#data;
  264. }
  265. //输出表格
  266. toTable()
  267. {
  268. const table = document.createElement("table");
  269. table.className = "board";
  270. this.#data.forEach((rowData, ri, rArr) => {
  271. const row = table.insertRow();
  272. if (ri == 2 && rArr.length > 5) row.classList.add("board-row4");
  273. rowData.forEach((orbType, ci, cArr) => {
  274. const cell = row.insertCell();
  275. const orb = cell.appendChild(document.createElement('icon'));
  276. orb.className = "orb";
  277. if (orbType != null) orb.setAttribute("data-orb-icon", orbType);
  278. if (ci == 3 && cArr.length > 6) cell.classList.add("board-cell5");
  279. });
  280. });
  281. if (this.#data.length > 5)
  282. {
  283. table.onclick = function() {
  284. this.classList.toggle("board-76");
  285. };
  286. }
  287. return table;
  288. }
  289. }
  290. const SkillValue = {
  291. isLess: function (value) {
  292. if (value.kind === SkillValueKind.Percent) return value.value < 1;
  293. if (value.kind === SkillValueKind.Constant) return value.value < 0;
  294. return false;
  295. }
  296. };
  297. const SkillValueKind = {
  298. Percent: 'mul',
  299. Constant: 'const',
  300. ConstantTo: 'const-to',
  301. xMaxHP: 'mul-maxhp',
  302. xHP: 'mul-hp',
  303. xATK: 'mul-atk',
  304. xRCV: 'mul-rcv',
  305. RandomATK: 'random-atk',
  306. HPScale: 'hp-scale',
  307. xTeamHP: 'mul-team-hp',
  308. xTeamATK: 'mul-team-atk',
  309. xTeamRCV: 'mul-team-rcv',
  310. xAwakenings: 'mul-awakenings',
  311. };
  312. const SkillPowerUpKind = {
  313. Multiplier: 'mul',
  314. ScaleAttributes: 'scale-attrs',
  315. ScaleCombos: 'scale-combos',
  316. ScaleMatchLength: 'scale-match-len',
  317. ScaleMatchAttrs: 'scale-match-attrs',
  318. ScaleCross: 'scale-cross',
  319. ScaleAwakenings: 'scale-awakenings',
  320. };
  321. const SkillKinds = {
  322. Unknown: "unknown",
  323. ActiveTurns: "active-turns",
  324. DamageEnemy: "damage-enemy",
  325. Vampire: "vampire",
  326. ReduceDamage: "reduce-damage",
  327. SelfHarm: "self-harm",
  328. Heal: "heal",
  329. AutoHealBuff: "auto-heal-buff",
  330. ChangeOrbs: "change-orbs",
  331. GenerateOrbs: "generate-orbs",
  332. FixedOrbs: "fixed-orbs",
  333. PowerUp: "power-up",
  334. CounterAttack: "counter-attack",
  335. SetOrbState: "set-orb-state",
  336. RateMultiply: "rate-mul",
  337. OrbDropIncrease: "orb-drop-incr",
  338. Resolve: "resolve",
  339. Delay: "delay",
  340. DefenseBreak: "def-break",
  341. MassAttack: "mass-attack",
  342. BoardChange: "board-change",
  343. Unbind: "unbind",
  344. RandomSkills: "random-skills",
  345. ChangeAttribute: "change-attr",
  346. SkillBoost: "skill-boost",
  347. AddCombo: "add-combo",
  348. VoidEnemyBuff: "void-enemy-buff",
  349. Poison: "poison",
  350. CTW: "ctw",
  351. Gravity: "gravity",
  352. FollowAttack: "follow-attack",
  353. AutoHeal: "auto-heal",
  354. TimeExtend: "time-extend",
  355. DropRefresh: "drop-refresh",
  356. LeaderChange: "leader-change",
  357. MinMatchLength: "min-match-len",
  358. FixedTime: "fixed-time",
  359. Drum: "drum",
  360. Board7x6: "7x6-board",
  361. NoSkyfall: "no-skyfall",
  362. Henshin: "henshin",
  363. }
  364. function skillParser(skillId)
  365. {
  366. /*function merge(skills)
  367. {
  368. //解封部分的合并
  369. let unbinds = skills.filter(skill=>skill.kind == SkillKinds.Unbind);
  370. if (unbinds.length>1)
  371. { //把后面的全都合并到第一个
  372. unbinds.reduce((pre,cur)=>{
  373. pre.normal = pre.normal || cur.normal;
  374. pre.awakenings = pre.awakenings || cur.awakenings;
  375. pre.matches = pre.matches || cur.matches;
  376. return pre
  377. });
  378. unbinds.shift(); //去除第一个
  379. unbinds.forEach(skill=>skills.splice(skills.indexOf(skill),1)); //去掉所有后面的
  380. }
  381. let fixedDamages = skills.filter(skill=>skill.kind == SkillKinds.DamageEnemy && skill.attr === 'fixed').filter((skill,idx,arr)=>skill.id==arr[0].id);
  382. if (fixedDamages.length>1)
  383. { //把后面的全都合并到第一个
  384. fixedDamages[0].times = 5;
  385. fixedDamages.shift(); //去除第一个
  386. fixedDamages.forEach(skill=>skills.splice(skills.indexOf(skill),1)); //去掉所有后面的
  387. }
  388. }*/
  389. const skill = Skills[skillId];
  390. if (!skill) return [];
  391. if (!parsers[skill.type]) {
  392. return [{ kind: SkillKinds.Unknown }];
  393. }
  394. //此处用apply将这个parser传递到后面解析函数的this里,用于递归解析
  395. const result = parsers[skill.type].apply({ parser: skillParser }, skill.params);
  396. const skills = (Array.isArray(result) ? result : [result])
  397. .filter(s => Boolean(s))
  398. .map(s => ({ id: skillId, type: skill.type, params: skill.params, ...s }));
  399. //merge(skills);
  400. return skills;
  401. }
  402. //返回flag里值为true的数组,如[1,4,7]
  403. function flags(num){
  404. /*
  405. return Array.from(new Array(32),(i,n)=>n).filter(n => num & (1 << n)); //性能太差
  406. return new Array(32).fill(null).map((i,n)=>n).filter(n => num & (1 << n)); //性能比上者好,但还是不够快
  407. */
  408. const arr = [];
  409. for (let i = 0; i<32;i++)
  410. {
  411. if (num & (1<<i))
  412. {
  413. arr.push(i);
  414. }
  415. }
  416. return arr;
  417. }
  418. const v = {
  419. percent: function(value) {
  420. return { kind: SkillValueKind.Percent, value: (value / 100) || 1 };
  421. },
  422. constant: function(value) {
  423. return { kind: SkillValueKind.Constant, value: value ?? 0 };
  424. },
  425. constantTo: function(value) {
  426. return { kind: SkillValueKind.ConstantTo, value: value || 1 };
  427. },
  428. xMaxHP: function(value) {
  429. return { kind: SkillValueKind.xMaxHP, value: (value / 100) || 1 };
  430. },
  431. xHP: function(value) {
  432. return { kind: SkillValueKind.xHP, value: (value / 100) || 1 };
  433. },
  434. xATK: function(value) {
  435. return { kind: SkillValueKind.xATK, value: (value / 100) || 1 };
  436. },
  437. xRCV: function(value) {
  438. return { kind: SkillValueKind.xRCV, value: (value / 100) || 1 };
  439. },
  440. randomATK: function(min, max) {
  441. return { kind: SkillValueKind.RandomATK, min: (min / 100) || 1, max: (max / 100) || 1, scale: 1 };
  442. },
  443. hpScale: function(min, max, scale) {
  444. return { kind: SkillValueKind.HPScale, min: (min / 100) || 1, max: (max / 100) || 1, scale: (scale / 100) || 1 };
  445. },
  446. xTeamHP: function(value) {
  447. return { kind: SkillValueKind.xTeamHP, value: (value / 100) || 1 };
  448. },
  449. xTeamATK: function(attrs, value) {
  450. return { kind: SkillValueKind.xTeamATK, attrs: attrs, value: (value / 100) || 1 };
  451. },
  452. xTeamRCV: function(value) {
  453. return { kind: SkillValueKind.xTeamRCV, value: (value / 100) || 1 };
  454. },
  455. percentAwakenings: function(awakenings, value) {
  456. return { kind: SkillValueKind.xAwakenings, awakenings: awakenings, value: value / 100 };
  457. },
  458. };
  459. const c = {
  460. hp: function (min, max) {
  461. return { hp: { min: min / 100, max: max / 100 } };
  462. },
  463. exact: function (type, value, attrs) {
  464. if (attrs === void 0) { attrs = Attributes.all(); }
  465. return { exact: { type: type, value: value, attrs: attrs } };
  466. },
  467. compo: function (type, ids) {
  468. return { compo: { type: type, ids: ids } };
  469. },
  470. remainOrbs: function (count) { return { remainOrbs: { count: count } }; },
  471. useSkill: function () { return { useSkill: true }; },
  472. multiplayer: function () { return { multiplayer: true }; },
  473. prob: function (percent) { return { prob: percent }; },
  474. }
  475. const p = {
  476. mul: function (values) {
  477. if (Array.isArray(values)) {
  478. return {
  479. kind: SkillPowerUpKind.Multiplier,
  480. hp: 1,
  481. atk: values[0] / 100,
  482. rcv: values[1] / 100
  483. };
  484. }
  485. else {
  486. return {
  487. kind: SkillPowerUpKind.Multiplier,
  488. hp: (values.hp || 100) / 100,
  489. atk: (values.atk || 100) / 100,
  490. rcv: (values.rcv || 100) / 100
  491. };
  492. }
  493. },
  494. stats: function (value) {
  495. let statTypes = Array.from(arguments).slice(1);
  496. return [
  497. statTypes.indexOf(1) >= 0 ? value : 100,
  498. statTypes.indexOf(2) >= 0 ? value : 100
  499. ];
  500. },
  501. scale: function (min, max, baseMul, bonusMul) {
  502. return {
  503. min: min,
  504. max: max || min,
  505. baseAtk: (baseMul[0] / 100) || 1,
  506. baseRcv: (baseMul[1] / 100) || 1,
  507. bonusAtk: (bonusMul[0] / 100) ?? 0,
  508. bonusRcv: (bonusMul[1] / 100) ?? 0
  509. };
  510. },
  511. scaleAttrs: function (attrs, min, max, baseMul, bonusMul) {
  512. return { kind: SkillPowerUpKind.ScaleAttributes, attrs: attrs ,...this.scale(min, max, baseMul, bonusMul) };
  513. },
  514. scaleCombos: function (min, max, baseMul, bonusMul) {
  515. return { kind: SkillPowerUpKind.ScaleCombos ,...this.scale(min, max, baseMul, bonusMul) };
  516. },
  517. scaleMatchLength: function (attrs, min, max, baseMul, bonusMul) {
  518. return { kind: SkillPowerUpKind.ScaleMatchLength, attrs: attrs ,...this.scale(min, max, baseMul, bonusMul) };
  519. },
  520. scaleMatchAttrs: function (matches, min, max, baseMul, bonusMul) {
  521. return { kind: SkillPowerUpKind.ScaleMatchAttrs, matches: matches ,...this.scale(min, max, baseMul, bonusMul) };
  522. },
  523. scaleCross: function (crosses) {
  524. return { kind: SkillPowerUpKind.ScaleCross, crosses: crosses.map(cross => ({ ...cross, atk: (cross.atk / 100) || 1, rcv: (cross.rcv / 100) || 1 })) };
  525. },
  526. scaleAwakenings: function (awakenings, value) {
  527. return { kind: SkillPowerUpKind.ScaleAwakenings, awakenings: awakenings, value: value / 100 };
  528. },
  529. }
  530. function activeTurns(turns, skill) {
  531. return skill ? { kind: SkillKinds.ActiveTurns, turns: turns, skill: skill } : null;
  532. }
  533. function damageEnemy(target, attr, damage) {
  534. return { kind: SkillKinds.DamageEnemy, target: target, attr: attr, damage: damage };
  535. }
  536. function vampire(attr, damageValue, healValue) {
  537. return { kind: SkillKinds.Vampire, attr: attr, damage: damageValue, heal: healValue };
  538. }
  539. function reduceDamage(attrs, percent, condition) {
  540. return { kind: SkillKinds.ReduceDamage, attrs: attrs, percent: percent, condition: condition };
  541. }
  542. function selfHarm(value) {
  543. return { kind: SkillKinds.SelfHarm, value: value };
  544. }
  545. function heal(value) {
  546. return { kind: SkillKinds.Heal, value: value };
  547. }
  548. function autoHealBuff(value) {
  549. return { kind: SkillKinds.AutoHealBuff, value: value };
  550. }
  551. function fromTo(from, to) {
  552. return { from: from, to: to };
  553. }
  554. function changeOrbs() {
  555. return { kind: SkillKinds.ChangeOrbs, changes: Array.from(arguments) };
  556. }
  557. function generateOrbs(orbs, exclude, count) {
  558. return { kind: SkillKinds.GenerateOrbs, orbs: orbs, exclude: exclude, count: count };
  559. }
  560. function fixedOrbs() {
  561. return { kind: SkillKinds.FixedOrbs, generates: Array.from(arguments) };
  562. }
  563. function powerUp(attrs, types, value, condition, reduceDamageValue) {
  564. if (value.kind === SkillPowerUpKind.Multiplier) {
  565. let hp = value.hp, atk = value.atk, rcv = value.rcv;
  566. if (hp === 1 && atk === 1 && rcv === 1 && !reduceDamage)
  567. return null;
  568. }
  569. return { kind: SkillKinds.PowerUp, attrs: attrs, types: types, condition: condition, value: value, reduceDamage: reduceDamageValue };
  570. }
  571. function counterAttack(attr, prob, value) {
  572. return { kind: SkillKinds.CounterAttack, attr: attr, prob: prob, value: value };
  573. }
  574. function setOrbState(orbs, state, arg) {
  575. return { kind: SkillKinds.SetOrbState, orbs: orbs, state: state, arg: arg};
  576. }
  577. function rateMultiply(value, rate) {
  578. return { kind: SkillKinds.RateMultiply, value: value, rate: rate };
  579. }
  580. function orbDropIncrease(value, attrs) {
  581. return { kind: SkillKinds.OrbDropIncrease, value: value, attrs: attrs };
  582. }
  583. function resolve(min, prob) {
  584. return { kind: SkillKinds.Resolve, min: min, max: 1, prob: prob };
  585. }
  586. function unbind(normal, awakenings, matches) {
  587. return { kind: SkillKinds.Unbind, normal: normal, awakenings: awakenings , matches: matches};
  588. }
  589. function boardChange(attrs) {
  590. return { kind: SkillKinds.BoardChange, attrs: attrs };
  591. }
  592. function randomSkills(skills) {
  593. return { kind: SkillKinds.RandomSkills, skills: skills };
  594. }
  595. function changeAttr(target, attr) {
  596. return { kind: SkillKinds.ChangeAttribute, target: target, attr: attr ?? 0 };
  597. }
  598. function gravity(value) {
  599. return { kind: SkillKinds.Gravity, value: value };
  600. }
  601. function voidEnemyBuff(buffs) {
  602. return { kind: SkillKinds.VoidEnemyBuff, buffs: buffs };
  603. }
  604. function skillBoost(value) { return { kind: SkillKinds.SkillBoost, value: value }; }
  605. function minMatch(value) { return { kind: SkillKinds.MinMatchLength, value: value }; }
  606. function fixedTime(value) { return { kind: SkillKinds.FixedTime, value: v.constant(value) }; }
  607. function addCombo(value) { return { kind: SkillKinds.AddCombo, value: value }; }
  608. function defBreak(value) { return { kind: SkillKinds.DefenseBreak, value: value }; }
  609. function poison(value) { return { kind: SkillKinds.Poison, value: value }; }
  610. function CTW(value) { return { kind: SkillKinds.CTW, value: value }; }
  611. function followAttack(value) { return { kind: SkillKinds.FollowAttack, value: value }; }
  612. function autoHeal(value) { return { kind: SkillKinds.AutoHeal, value: value }; }
  613. function timeExtend(value) { return { kind: SkillKinds.TimeExtend, value: value }; }
  614. function delay() { return { kind: SkillKinds.Delay }; }
  615. function massAttack() { return { kind: SkillKinds.MassAttack }; }
  616. function dropRefresh() { return { kind: SkillKinds.DropRefresh }; }
  617. function drum() { return { kind: SkillKinds.Drum }; }
  618. function leaderChange(type = 0) { return { kind: SkillKinds.LeaderChange, type: type }; }
  619. function board7x6() { return { kind: SkillKinds.Board7x6 }; }
  620. function noSkyfall() { return { kind: SkillKinds.NoSkyfall }; }
  621. function henshin(id) { return { kind: SkillKinds.Henshin, id: id }; }
  622. const parsers = {
  623. parser: (() => []), //这个用来解决代码提示的报错问题,不起实际作用
  624. [0](attr, mul) { return damageEnemy('all', attr, v.xATK(mul)); },
  625. [1](attr, value) { return damageEnemy('all', attr, v.constant(value)); },
  626. [2](mul) { return damageEnemy('single', 'self', v.xATK(mul)); },
  627. [3](turns, percent) { return activeTurns(turns, reduceDamage('all', v.percent(percent))); },
  628. [4](mul) { return poison(v.xATK(mul)); },
  629. [5](time) { return CTW(v.constant(time)); },
  630. [6](percent) { return gravity(v.xHP(percent)); },
  631. [7](mul) { return heal(v.xRCV(mul)); },
  632. [8](value) { return heal(v.constant(value)); },
  633. [9](from, to) { return changeOrbs(fromTo([from ?? 0], [to ?? 0])); },
  634. [10]() { return dropRefresh(); },
  635. [11](attr, mul) { return powerUp([attr], null, p.mul({ atk: mul })); },
  636. [12](mul) { return followAttack(v.xATK(mul)); },
  637. [13](mul) { return autoHeal(v.xRCV(mul)); },
  638. [14](min, prob) { return resolve(v.percent(min), v.percent(prob)); },
  639. [15](time) { return timeExtend(v.constant(time / 100)); },
  640. [16](percent) { return reduceDamage('all', v.percent(percent)); },
  641. [17](attr, percent) { return reduceDamage([attr], v.percent(percent)); },
  642. [18](turns) { return activeTurns(turns, delay()); },
  643. [19](turns, percent) { return activeTurns(turns, defBreak(v.percent(percent))); },
  644. [20](from1, to1, from2, to2) {
  645. if ((to1 ?? 0) == (to2 ?? 0))
  646. return changeOrbs(fromTo([from1 ?? 0, from2 ?? 0], [to1 ?? 0]));
  647. else
  648. return changeOrbs(
  649. fromTo([from1 ?? 0], [to1 ?? 0]),
  650. fromTo([from2 ?? 0], [to2 ?? 0])
  651. );
  652. },
  653. [21](turns, attr, percent) { return activeTurns(turns, reduceDamage([attr], v.percent(percent))); },
  654. [22](type, mul) { return powerUp(null, [type], p.mul({ atk: mul })); },
  655. [23](type, mul) { return powerUp(null, [type], p.mul({ hp: mul })); },
  656. [24](type, mul) { return powerUp(null, [type], p.mul({ rcv: mul })); },
  657. [26](mul) { return powerUp(null, null, p.mul({ atk: mul })); },
  658. [28](attr, mul) { return powerUp([attr], null, p.mul({ atk: mul, rcv: mul })); },
  659. [29](attr, mul) { return powerUp([attr], null, p.mul({ hp: mul, atk: mul, rcv: mul })); },
  660. [30](type1, type2, mul) { return powerUp(null, [type1, type2], p.mul({ hp: mul })); },
  661. [31](type1, type2, mul) { return powerUp(null, [type1, type2], p.mul({ atk: mul })); },
  662. [33]() { return drum(); },
  663. [35](mul, percent) { return vampire('self', v.xATK(mul), v.percent(percent)); },
  664. [36](attr1, attr2, percent) { return reduceDamage([attr1, attr2], v.percent(percent)); },
  665. [37](attr, mul) { return damageEnemy('single', attr, v.xATK(mul)); },
  666. [38](max, _, percent) { return reduceDamage('all', v.percent(percent), max === 100 ? c.hp(max, max) : c.hp(0, max)); },
  667. [39](percent, stats1, stats2, mul) { return powerUp(null, null, p.mul(p.stats(mul, stats1, stats2)), c.hp(0, percent)); },
  668. [40](attr1, attr2, mul) { return powerUp([attr1, attr2], null, p.mul({ atk: mul })); },
  669. [41](prob, mul, attr) { return counterAttack(attr ?? 0, v.percent(prob), v.percent(mul)); },
  670. [42](targetAttr, dmgAttr, value) { return damageEnemy(targetAttr, dmgAttr, v.constant(value)); },
  671. [43](min, max, percent) { return reduceDamage('all', v.percent(percent), c.hp(min, max)); },
  672. [44](percent, stats1, stats2, mul) { return powerUp(null, null, p.mul(p.stats(mul, stats1, stats2)), c.hp(percent, 100)); },
  673. [45](attr, mul) { return powerUp([attr], null, p.mul({ hp: mul, atk: mul })); },
  674. [46](attr1, attr2, mul) { return powerUp([attr1, attr2], null, p.mul({ hp: mul })); },
  675. [48](attr, mul) { return powerUp([attr], null, p.mul({ hp: mul })); },
  676. [49](attr, mul) { return powerUp([attr], null, p.mul({ rcv: mul })); },
  677. [50](turns, attr, mul) { return activeTurns(turns, powerUp([attr], null, p.mul({ atk: mul }))); },
  678. [51](turns) { return activeTurns(turns, massAttack()); },
  679. [52](attr, mul) { return setOrbState([attr], 'enhanced', {enhance: v.percent(mul)}); },
  680. [53](mul) { return rateMultiply(v.percent(mul), 'drop'); },
  681. [54](mul) { return rateMultiply(v.percent(mul), 'coin'); },
  682. [55](value) { return damageEnemy('single', 'fixed', v.constant(value)); },
  683. [56](value) { return damageEnemy('all', 'fixed', v.constant(value)); },
  684. [58](attr, min, max) { return damageEnemy('all', attr, v.randomATK(min, max)); },
  685. [59](attr, min, max) { return damageEnemy('single', attr, v.randomATK(min, max)); },
  686. [60](turns, mul, attr) { return activeTurns(turns, counterAttack(attr, v.percent(100), v.percent(mul))); },
  687. [61](attrs, min, base, bonus, incr) { return powerUp(null, null, p.scaleAttrs(flags(attrs), min, min + (incr ?? 0), [base, 100], [bonus, 0])); },
  688. [62](type, mul) { return powerUp(null, [type], p.mul({ hp: mul, atk: mul })); },
  689. [63](type, mul) { return powerUp(null, [type], p.mul({ hp: mul, rcv: mul })); },
  690. [64](type, mul) { return powerUp(null, [type], p.mul({ atk: mul, rcv: mul })); },
  691. [65](type, mul) { return powerUp(null, [type], p.mul({ hp: mul, atk: mul, rcv: mul })); },
  692. [66](combo, mul) { return powerUp(null, null, p.scaleCombos(combo, combo, [mul, 100], [0, 0])); },
  693. [67](attr, mul) { return powerUp([attr], null, p.mul({ hp: mul, rcv: mul })); },
  694. [69](attr, type, mul) { return powerUp([attr], [type], p.mul({ atk: mul })); },
  695. [71](...attrs) { return boardChange(attrs.filter(attr => attr >= 0)); },
  696. [73](attr, type, mul) { return powerUp([attr], [type], p.mul({ hp: mul, atk: mul })); },
  697. [75](attr, type, mul) { return powerUp([attr], [type], p.mul({ atk: mul, rcv: mul })); },
  698. [76](attr, type, mul) { return powerUp([attr], [type], p.mul({ hp: mul, atk: mul, rcv: mul })); },
  699. [77](type1, type2, mul) { return powerUp(null, [type1, type2], p.mul({ hp: mul, atk: mul })); },
  700. [79](type1, type2, mul) { return powerUp(null, [type1, type2], p.mul({ atk: mul, rcv: mul })); },
  701. [84](attr, min, max, percent) {
  702. return [
  703. selfHarm(percent ? v.xHP(100 - percent) : v.constantTo(1)),
  704. damageEnemy('single', attr, v.randomATK(min, max))
  705. ];
  706. },
  707. [85](attr, min, max, percent) {
  708. return [
  709. selfHarm(percent ? v.xHP(100 - percent) : v.constantTo(1)),
  710. damageEnemy('all', attr, v.randomATK(min, max))
  711. ];
  712. },
  713. [86](attr, value, _, percent) {
  714. return [
  715. selfHarm(percent ? v.xHP(100 - percent) : v.constantTo(1)),
  716. damageEnemy('single', attr, v.constant(value))
  717. ];
  718. },
  719. [87](attr, value, _, percent) {
  720. return [
  721. selfHarm(percent ? v.xHP(100 - percent) : v.constantTo(1)),
  722. damageEnemy('all', attr, v.constant(value))
  723. ];
  724. },
  725. [88](turns, type, mul) { return activeTurns(turns, powerUp(null, [type], p.mul({ atk: mul }))); },
  726. [90](turns, attr1, attr2, mul) { return activeTurns(turns, powerUp([attr1, attr2], null, p.mul({ atk: mul }))); },
  727. [91](attr1, attr2, mul) { return setOrbState([attr1, attr2], 'enhanced', {enhance: v.percent(mul)}); },
  728. [92](turns, type1, type2, mul) { return activeTurns(turns, powerUp(null, [type1, type2], p.mul({ atk: mul }))); },
  729. [93]() { return leaderChange(); },
  730. [94](percent, attr, stats1, stats2, mul) { return powerUp([attr], null, p.mul(p.stats(mul, stats1, stats2)), c.hp(0, percent)); },
  731. [95](percent, type, stats1, stats2, mul) { return powerUp(null, [type], p.mul(p.stats(mul, stats1, stats2)), c.hp(0, percent)); },
  732. [96](percent, attr, stats1, stats2, mul) { return powerUp([attr], null, p.mul(p.stats(mul, stats1, stats2)), c.hp(percent, 100)); },
  733. [97](percent, type, stats1, stats2, mul) { return powerUp(null, [type], p.mul(p.stats(mul, stats1, stats2)), c.hp(percent, 100)); },
  734. [98](min, base, bonus, max) { return powerUp(null, null, p.scaleCombos(min, max, [base, 100], [bonus, 0])); },
  735. [100](stats1, stats2, mul) { return powerUp(null, null, p.mul(p.stats(mul, stats1, stats2)), c.useSkill()); },
  736. [101](combo, mul) { return powerUp(null, null, p.mul({ atk: mul }), c.exact('combo', combo)); },
  737. [103](combo, stats1, stats2, mul) { return powerUp(null, null, p.scaleCombos(combo, combo, p.stats(mul, stats1, stats2), [0, 0])); },
  738. [104](combo, attrs, stats1, stats2, mul) { return powerUp(flags(attrs), null, p.scaleCombos(combo, combo, p.stats(mul, stats1, stats2), [0, 0])); },
  739. [105](rcv, atk) { return powerUp(null, null, p.mul({ rcv, atk })); },
  740. [106](hp, atk) { return powerUp(null, null, p.mul({ hp, atk })); },
  741. [107](hp) { return powerUp(null, null, p.mul({ hp })); },
  742. [108](hp, type, atk) { return [powerUp(null, null, p.mul({ hp })), powerUp(null, [type], p.mul({ atk }))]; },
  743. [109](attrs, len, mul) { return powerUp(null, null, p.scaleMatchLength(flags(attrs), len, len, [mul, 100], [0, 0])); },
  744. [110](single, attr, min, max, scale) { return damageEnemy(single ? 'single' : 'all', attr, v.hpScale(min, max, scale)); },
  745. [111](attr1, attr2, mul) { return powerUp([attr1, attr2], null, p.mul({ hp: mul, atk: mul })); },
  746. [114](attr1, attr2, mul) { return powerUp([attr1, attr2], null, p.mul({ hp: mul, atk: mul, rcv: mul })); },
  747. [115](attr, mul, percent) { return vampire(attr, v.xATK(mul), v.percent(percent)); },
  748. [116](...ids) { return ids.flatMap(id => this.parser(id)); },
  749. [117](bind, rcv, constant, hp, awokenBind) {
  750. return [
  751. rcv ? heal(v.xRCV(rcv)) : hp ? heal(v.xMaxHP(hp)) : constant ? heal(v.constant(constant)) : null,
  752. (bind || awokenBind) ? unbind(bind ?? 0, awokenBind ?? 0) : null,
  753. ].filter(Boolean);
  754. },
  755. [118](...ids) { return randomSkills(ids.map(id => this.parser(id))); },
  756. [119](attrs, min, base, bonus, max) { return powerUp(null, null, p.scaleMatchLength(flags(attrs), min, max, [base, 100], [bonus, 0])); },
  757. [121](attrs, types, hp, atk, rcv) { return powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv })); },
  758. [122](percent, attrs, types, atk, rcv) { return powerUp(flags(attrs), flags(types), p.mul({ atk, rcv }), c.hp(0, percent)); },
  759. [123](percent, attrs, types, atk, rcv) { return powerUp(flags(attrs), flags(types), p.mul({ atk, rcv }), c.hp(percent, 100)); },
  760. [124](attrs1, attrs2, attrs3, attrs4, attrs5, min, mul, bonus) {
  761. const attrs = [attrs1, attrs2, attrs3, attrs4, attrs5].filter(Boolean);
  762. return powerUp(null, null, p.scaleMatchAttrs(attrs.map(flags), min, bonus ? attrs.length : min, [mul, 100], [bonus, 0]));
  763. },
  764. [125](mon1, mon2, mon3, mon4, mon5, hp, atk, rcv) { return powerUp(null, null, p.mul({ hp, atk, rcv }), c.compo('card', [mon1, mon2, mon3, mon4, mon5].filter(Boolean))); },
  765. [126](attrs, turns, turns2, percent) { return activeTurns(turns === turns2 ? turns : [turns, turns2], orbDropIncrease(v.percent(percent), flags(attrs))); },
  766. [127](cols1, attrs1, cols2, attrs2) {
  767. return fixedOrbs(
  768. { orbs: flags(attrs1), type: 'col', positions: flags(cols1) },
  769. { orbs: flags(attrs2), type: 'col', positions: flags(cols2) }
  770. );
  771. },
  772. [128](rows1, attrs1, rows2, attrs2) {
  773. return fixedOrbs(
  774. { orbs: flags(attrs1), type: 'row', positions: flags(rows1) },
  775. { orbs: flags(attrs2), type: 'row', positions: flags(rows2) }
  776. );
  777. },
  778. [129](attrs, types, hp, atk, rcv, rAttrs, rPercent) {
  779. return [
  780. powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv })),
  781. rPercent && reduceDamage(flags(rAttrs), v.percent(rPercent)) || null
  782. ];
  783. },
  784. [130](percent, attrs, types, atk, rcv, rAttrs, rPercent) {
  785. return [
  786. powerUp(flags(attrs), flags(types), p.mul({ atk, rcv }), c.hp(0, percent)),
  787. rPercent && reduceDamage(flags(rAttrs), v.percent(rPercent), c.hp(0, percent)) || null
  788. ];
  789. },
  790. [131](percent, attrs, types, atk, rcv, rAttrs, rPercent) {
  791. return [
  792. powerUp(flags(attrs), flags(types), p.mul({ atk, rcv }), c.hp(percent, 100)),
  793. rPercent && reduceDamage(flags(rAttrs), v.percent(rPercent), c.hp(percent, 100)) || null
  794. ];
  795. },
  796. [132](turns, time, percent) { return activeTurns(turns, timeExtend(time ? v.constant(time / 10) : v.percent(percent))); },
  797. [133](attrs, types, atk, rcv) { return powerUp(flags(attrs), flags(types), p.mul({ atk, rcv }), c.useSkill()); },
  798. [136](attrs1, hp1, atk1, rcv1, attrs2, hp2, atk2, rcv2) {
  799. return [
  800. powerUp(flags(attrs1), null, p.mul({ hp: hp1, atk: atk1, rcv: rcv1 })),
  801. powerUp(flags(attrs2), null, p.mul({ hp: hp2, atk: atk2, rcv: rcv2 })),
  802. ];
  803. },
  804. [137](types1, hp1, atk1, rcv1, types2, hp2, atk2, rcv2) {
  805. return [
  806. powerUp(null, flags(types1), p.mul({ hp: hp1, atk: atk1, rcv: rcv1 })),
  807. powerUp(null, flags(types2), p.mul({ hp: hp2, atk: atk2, rcv: rcv2 })),
  808. ];
  809. },
  810. [138](...ids) { return ids.flatMap(id => this.parser(id)); },
  811. [139](attrs, types, percent1, less1, mul1, percent2, less2, mul2) {
  812. return [
  813. powerUp(flags(attrs), flags(types), p.mul({ atk: mul1 }), less1 ? c.hp(0, percent1) : c.hp(percent1, 100)),
  814. powerUp(flags(attrs), flags(types), p.mul({ atk: mul2 }), less1 ?
  815. (less2 ? c.hp(percent1, percent2) : c.hp(percent2, 100)) :
  816. (less2 ? c.hp(0, percent2) : c.hp(percent2, percent1))
  817. ),
  818. ];
  819. },
  820. [140](attrs, mul) { return setOrbState(flags(attrs), 'enhanced', {enhance: v.percent(mul)}); },
  821. [141](count, to, exclude) { return generateOrbs(flags(to), flags(exclude), count); },
  822. [142](turns, attr) { return activeTurns(turns, changeAttr('self', attr)); },
  823. [143](mul, dmgAttr) { return damageEnemy('all', dmgAttr ?? 0, v.xTeamHP(mul)); },
  824. [144](teamAttrs, mul, single, dmgAttr) { return damageEnemy(single ? 'single' : 'all', dmgAttr, v.xTeamATK(flags(teamAttrs), mul)); },
  825. [145](mul) { return heal(v.xTeamRCV(mul)); },
  826. [146](turns) { return skillBoost(v.constant(turns)); },
  827. [148](percent) { return rateMultiply(v.percent(percent), 'exp'); },
  828. [149](mul) { return powerUp(null, null, p.mul({ rcv: mul }), c.exact('match-length', 4, [Attributes.Heart])); },
  829. [150](_, mul) { return powerUp(null, null, p.mul({ atk: mul }), c.exact('match-length', 5, 'enhanced')); },
  830. [151](mul1, mul2, percent) {
  831. return [
  832. powerUp(null, null, p.scaleCross([{ single: true, attr: Attributes.Heart, atk: mul1, rcv: mul2 }]), undefined, v.percent(percent)),
  833. ];
  834. },
  835. [152](attrs, count) { return setOrbState(flags(attrs), 'locked', {count: v.constant(count)}); },
  836. [153](attr) { return changeAttr('opponent', attr); },
  837. [154](from, to) { return changeOrbs(fromTo(flags(from), flags(to))); },
  838. [155](attrs, types, hp, atk, rcv) { return powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv }), c.multiplayer()); },
  839. [156](turns, awoken1, awoken2, awoken3, type, mul) {
  840. return activeTurns(turns, type === 2 ?
  841. powerUp(null, null, p.scaleAwakenings([awoken1, awoken2, awoken3].filter(Boolean), mul)) :
  842. reduceDamage('all', v.percentAwakenings([awoken1, awoken2, awoken3].filter(Boolean), mul))
  843. );
  844. },
  845. [157](attr1, mul1, attr2, mul2, attr3, mul3) {
  846. return powerUp(null, null, p.scaleCross([
  847. { single: false, attr: attr1, mul: mul1 },
  848. { single: false, attr: attr2, mul: mul2 },
  849. { single: false, attr: attr3, mul: mul3 }
  850. ].filter(cross => cross.mul)));
  851. },
  852. [158](len, attrs, types, atk, hp, rcv) {
  853. return [
  854. minMatch(len),
  855. powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv }))
  856. ];
  857. },
  858. [159](attrs, min, base, bonus, max) { return powerUp(null, null, p.scaleMatchLength(flags(attrs), min, max, [base, 100], [bonus, 0])); },
  859. [160](turns, combo) { return activeTurns(turns, addCombo(combo)); },
  860. [161](percent) { return gravity(v.xMaxHP(percent)); },
  861. [162]() { return board7x6(); },
  862. [163](attrs, types, hp, atk, rcv, rAttrs, rPercent) {
  863. return [
  864. noSkyfall(),
  865. powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv })),
  866. rPercent && reduceDamage(flags(rAttrs), v.percent(rPercent)) || null,
  867. ];
  868. },
  869. [164](attrs1, attrs2, attrs3, attrs4, min, atk, rcv, bonus) {
  870. const attrs = [attrs1, attrs2, attrs3, attrs4].filter(Boolean);
  871. return powerUp(null, null, p.scaleMatchAttrs(attrs.map(flags), min, attrs.length, [atk, rcv], [bonus, bonus]));
  872. },
  873. [165](attrs, min, baseAtk, baseRcv, bonusAtk, bonusRcv, incr) { return powerUp(null, null, p.scaleAttrs(flags(attrs), min, min + (incr ?? 0), [baseAtk, baseRcv], [bonusAtk, bonusRcv])); },
  874. [166](min, baseAtk, baseRcv, bonusAtk, bonusRcv, max) { return powerUp(null, null, p.scaleCombos(min, max, [baseAtk, baseRcv], [bonusAtk, bonusRcv])); },
  875. [167](attrs, min, baseAtk, baseRcv, bonusAtk, bonusRcv, max) { return powerUp(null, null, p.scaleMatchLength(flags(attrs), min, max, [baseAtk, baseRcv], [bonusAtk, bonusRcv])); },
  876. [169](combo, mul, percent) { return powerUp(null, null, p.scaleCombos(combo, combo, [mul, 100], [0, 0]), undefined, v.percent(percent)); },
  877. [170](attrs, min, mul, percent) { return powerUp(null, null, p.scaleAttrs(flags(attrs), min, min, [mul, 100], [0, 0]), undefined, v.percent(percent)); },
  878. [171](attrs1, attrs2, attrs3, attrs4, min, mul, percent) {
  879. const attrs = [attrs1, attrs2, attrs3, attrs4].filter(Boolean);
  880. return powerUp(null, null, p.scaleMatchAttrs(attrs.map(flags), min, min, [mul, 0], [0, 0]), undefined, v.percent(percent));
  881. },
  882. [172]() { return setOrbState(null, 'unlocked'); },
  883. [173](turns, attrAbsorb, comboAbsorb, damageAbsorb) {
  884. return activeTurns(turns, voidEnemyBuff(
  885. [
  886. attrAbsorb && 'attr-absorb',
  887. comboAbsorb && 'combo-absorb',
  888. damageAbsorb && 'damage-absorb'
  889. ].filter((buff) => typeof buff === 'string')
  890. ));
  891. },
  892. [175](series1, series2, series3, hp, atk, rcv) { return powerUp(null, null, p.mul({ hp, atk, rcv }), c.compo('series', [series1, series2, series3].filter(Boolean))); },
  893. [176](row1, row2, row3, row4, row5, attrs) {
  894. return fixedOrbs(
  895. { orbs: [attrs ?? 0], type: 'shape', positions: [row1, row2, row3, row4, row5].map(row=>flags(row)) }
  896. );
  897. },
  898. [177](_0, _1, _2, _3, _4, remains, mul) {
  899. return [
  900. noSkyfall(),
  901. powerUp(null, null, p.mul({ atk: mul }), c.remainOrbs(remains))
  902. ];
  903. },
  904. [178](time, attrs, types, hp, atk, rcv) {
  905. return [
  906. fixedTime(time),
  907. powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv }))
  908. ];
  909. },
  910. [179](turns, value, percent, bind, awokenBind) {
  911. return [
  912. (bind || awokenBind) ? unbind(bind ?? 0, awokenBind ?? 0) : null,
  913. activeTurns(turns, autoHealBuff(value ? v.constant(value) : v.xMaxHP(percent)))
  914. ].filter(Boolean);
  915. },
  916. [180](turns, percent) { return activeTurns(turns, orbDropIncrease(v.percent(percent), 'enhanced')); },
  917. [182](attrs, len, mul, percent) { return powerUp(null, null, p.scaleMatchLength(flags(attrs), len, len, [mul, 100], [0, 0]), undefined, v.percent(percent)); },
  918. [183](attrs, types, percent1, atk1, rcv1, percent2, atk2, rcv2) {
  919. return [
  920. powerUp(flags(attrs), flags(types), p.mul({ atk: atk1, rcv: rcv1 }), c.hp(percent1, 100)),
  921. powerUp(flags(attrs), flags(types), p.mul({ atk: atk2, rcv: rcv2 }), c.hp(0, percent2 || percent1)),
  922. ];
  923. },
  924. [184](turns) { return activeTurns(turns, noSkyfall()); },
  925. [185](time, attrs, types, hp, atk, rcv) {
  926. return [
  927. timeExtend(v.constant(time / 100)),
  928. powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv })),
  929. ];
  930. },
  931. [186](attrs, types, hp, atk, rcv) {
  932. return [
  933. board7x6(),
  934. powerUp(flags(attrs), flags(types), p.mul({ hp, atk, rcv })),
  935. ];
  936. },
  937. [188](value) {
  938. return damageEnemy('single', 'fixed', v.constant(value));
  939. },
  940. [191](turns) {
  941. return activeTurns(turns, voidEnemyBuff(['damage-void']));
  942. },
  943. [195](percent) {
  944. return selfHarm(percent ? v.xHP(percent) : v.constantTo(1));
  945. },
  946. [196](matches) {
  947. return unbind(0,0,matches);
  948. },
  949. [202](id) {
  950. return henshin(id);
  951. },
  952. [203](evotype, hp, atk, rcv) { return powerUp(null, null, p.mul({ hp, atk, rcv }), c.compo('evolution', [evotype])); },
  953. [215](turns, attrs) { return activeTurns(turns, setOrbState(flags(attrs), 'bound')); },
  954. [218](turns) { return skillBoost(v.constant(-turns)); },
  955. [224](turns, attr) { return activeTurns(turns, changeAttr('opponent', attr)); },
  956. [227]() { return leaderChange(1); },
  957. };
  958. //将内容添加到代码片段
  959. DocumentFragment.prototype.ap = function(arg)
  960. {
  961. if (Array.isArray(arg)) //数组,递归自身
  962. {
  963. arg.forEach(element=>this.ap(element));
  964. }
  965. else if (arg instanceof Node) //属于Node的直接添加
  966. {
  967. this.appendChild(arg);
  968. }
  969. else //其他内容的转换为文字添加
  970. {
  971. this.appendChild(document.createTextNode(arg));
  972. }
  973. return this;
  974. }
  975. //将数组和分隔符添加到一个代码片段,类似join
  976. Array.prototype.nodeJoin = function(separator)
  977. {
  978. const frg = document.createDocumentFragment();
  979. this.forEach((item, idx, arr)=>{
  980. frg.ap(item);
  981. if (idx < (arr.length - 1) && separator != null)
  982. frg.ap(separator instanceof Node ? separator.cloneNode(true) : separator);
  983. });
  984. return frg;
  985. }
  986. //按住Ctrl点击技能在控制台输出技能的对象
  987. function showParsedSkill(event) {
  988. if (event.ctrlKey) {
  989. console.log(this.skill);
  990. }
  991. }
  992. function renderSkillEntry(skills)
  993. {
  994. const ul = document.createElement("ul");
  995. ul.className = "card-skill-list";
  996. skills.forEach(skill=>{
  997. const li = ul.appendChild(document.createElement("li"));
  998. li.className = skill.kind;
  999. li.appendChild(renderSkill(skill));
  1000. li.skill = skill;
  1001. li.addEventListener("click", showParsedSkill);
  1002. });
  1003. return ul;
  1004. }
  1005. function renderSkill(skill, option = {})
  1006. {
  1007. const frg = document.createDocumentFragment();
  1008. if (typeof localTranslating == "undefined") return frg;
  1009. const tsp = localTranslating.skill_parse;
  1010. function createIcon(iconType, className){
  1011. const idoc = document.createElement("icon");
  1012. idoc.className = `icon-skill${className ? ` ${className}` : ''}`;
  1013. idoc.setAttribute("data-icon-type", iconType);
  1014. return idoc;
  1015. }
  1016. if (Array.isArray(skill))
  1017. {
  1018. frg.ap(skill.map(_skill=>renderSkill(_skill)));
  1019. return frg;
  1020. }
  1021. switch (skill.kind) {
  1022. case SkillKinds.Unknown: {
  1023. let dict = {
  1024. type: skill.kind
  1025. };
  1026. frg.ap(tsp.skill.unknown(dict));
  1027. break;
  1028. }
  1029. case SkillKinds.ActiveTurns: { //有回合的行动
  1030. let turns = skill.turns, actionSkill = skill.skill;
  1031. let dict = {
  1032. turns: Array.isArray(turns) ? turns.join(tsp.word.range_hyphen().textContent) : turns,
  1033. actionSkill: renderSkill(actionSkill),
  1034. };
  1035. frg.ap(tsp.skill.active_turns(dict));
  1036. break;
  1037. }
  1038. case SkillKinds.RandomSkills: { //随机技能
  1039. let skills = skill.skills;
  1040. const ul = document.createElement("ul");
  1041. ul.className = "random-active-skill";
  1042. skills.forEach(subSkills=>{
  1043. const li = ul.appendChild(document.createElement("li"));
  1044. li.appendChild(renderSkillEntry(subSkills));
  1045. });
  1046. let dict = {
  1047. skills: ul,
  1048. };
  1049. frg.ap(tsp.skill.random_skills(dict));
  1050. break;
  1051. }
  1052. case SkillKinds.Delay: { //威吓
  1053. let dict = {
  1054. icon: createIcon(skill.kind),
  1055. };
  1056. frg.ap(tsp.skill.delay(dict));
  1057. break;
  1058. }
  1059. case SkillKinds.MassAttack: { //全体攻击
  1060. let dict = {
  1061. icon: createIcon(skill.kind),
  1062. };
  1063. frg.ap(tsp.skill.mass_attack(dict));
  1064. break;
  1065. }
  1066. case SkillKinds.LeaderChange: { //切换队长
  1067. let type = skill.type;
  1068. let dict = {
  1069. icon: createIcon(skill.kind),
  1070. target: type ? tsp.target.team_last() : tsp.target.self(),
  1071. };
  1072. frg.ap(tsp.skill.leader_change(dict));
  1073. break;
  1074. }
  1075. case SkillKinds.NoSkyfall: { //无天降
  1076. let dict = {
  1077. icon: createIcon(skill.kind),
  1078. };
  1079. frg.ap(tsp.skill.no_skyfall(dict));
  1080. break;
  1081. }
  1082. case SkillKinds.SelfHarm: { //主动自残
  1083. let value = skill.value;
  1084. let dict = {
  1085. icon: createIcon("heal", "hp-decr"),
  1086. value: renderValue(value, {percent: true}),
  1087. stats: tsp.stats.hp(),
  1088. };
  1089. frg.ap(tsp.skill.self_harm(dict));
  1090. break;
  1091. }
  1092. case SkillKinds.Heal: { //主动回血buff
  1093. let value = skill.value;
  1094. let dict = {
  1095. icon: createIcon("heal", "hp-incr"),
  1096. //icon: createIcon("auto-heal"),
  1097. value: renderValue(value, {unit: tsp.unit.point, percent: value.kind == SkillValueKind.xRCV ? false : true}),
  1098. stats: tsp.stats.hp(),
  1099. };
  1100. frg.ap(tsp.skill.heal(dict));
  1101. break;
  1102. }
  1103. case SkillKinds.AutoHealBuff: { //自动回血buff
  1104. let dict = {
  1105. icon: createIcon("auto-heal"),
  1106. value: renderValue(skill.value, {unit: tsp.unit.point, percent: true}),
  1107. stats: tsp.stats.hp(),
  1108. };
  1109. frg.ap(tsp.skill.auto_heal_buff(dict));
  1110. break;
  1111. }
  1112. case SkillKinds.DefenseBreak: { //破防
  1113. let dict = {
  1114. icon: createIcon(skill.kind),
  1115. value: renderValue(skill.value, {percent: true}),
  1116. };
  1117. frg.ap(tsp.skill.defense_break(dict));
  1118. break;
  1119. }
  1120. case SkillKinds.Poison: { //毒
  1121. let dict = {
  1122. icon: createIcon(skill.kind),
  1123. belong_to: tsp.target.self(),
  1124. target: tsp.target.enemy(),
  1125. stats: tsp.stats.hp(),
  1126. value: renderValue(skill.value),
  1127. };
  1128. frg.ap(tsp.skill.poison(dict));
  1129. break;
  1130. }
  1131. case SkillKinds.TimeExtend: { //时间变化buff
  1132. let value = skill.value;
  1133. let dict = {
  1134. icon: createIcon("status-time", SkillValue.isLess(value) ? "time-decr" : "time-incr"),
  1135. value: renderValue(value, { unit:tsp.unit.seconds, plusSign: value.kind != SkillValueKind.Percent, percent: SkillValue.isLess(value) }),
  1136. };
  1137. frg.ap(tsp.skill.time_extend(dict));
  1138. break;
  1139. }
  1140. case SkillKinds.FollowAttack: { //队长技追打
  1141. let dict = {
  1142. //icon: createIcon("follow_attack"),
  1143. belong_to: tsp.target.self(),
  1144. target: tsp.target.enemy(),
  1145. value: renderValue(skill.value),
  1146. };
  1147. frg.ap(tsp.skill.follow_attack(dict));
  1148. break;
  1149. }
  1150. case SkillKinds.AutoHeal: { //队长技自动回血
  1151. let dict = {
  1152. icon: createIcon(skill.kind),
  1153. belong_to: tsp.target.self(),
  1154. value: renderValue(skill.value),
  1155. stats: tsp.stats.hp(),
  1156. };
  1157. frg.ap(tsp.skill.auto_heal(dict));
  1158. break;
  1159. }
  1160. case SkillKinds.CTW: { //时间暂停
  1161. let dict = {
  1162. icon: createIcon(skill.kind),
  1163. value: renderValue(skill.value, { unit: tsp.unit.seconds }),
  1164. };
  1165. frg.ap(tsp.skill.ctw(dict));
  1166. break;
  1167. }
  1168. case SkillKinds.Gravity: { //重力
  1169. let dict = {
  1170. icon: createIcon(skill.kind),
  1171. target: tsp.target.enemy(),
  1172. value: renderValue(skill.value, { percent:true }),
  1173. };
  1174. frg.ap(tsp.skill.gravity(dict));
  1175. break;
  1176. }
  1177. case SkillKinds.Resolve: { //根性
  1178. let prob = skill.prob;
  1179. let dict = {
  1180. icon: createIcon(skill.kind),
  1181. stats: renderStat('hp'),
  1182. value: renderValue(skill.min, { percent:true }),
  1183. prob: prob.value < 1 ? tsp.value.prob({value: renderValue(prob, { percent:true })}) : null,
  1184. };
  1185. frg.ap(tsp.skill.resolve(dict));
  1186. break;
  1187. }
  1188. case SkillKinds.DamageEnemy: { //大炮和固伤
  1189. let attr = skill.attr, target = skill.target, damage = skill.damage;
  1190. if (attr == null) break; //没有属性时,编号为0的空技能
  1191. dict = {
  1192. target: target === 'all' ? tsp.target.enemy_all() : target === 'single' ? tsp.target.enemy_one() : tsp.target.enemy_attr({attr: renderAttrs(target, {affix: true})}),
  1193. damage: renderValue(damage, {unit: tsp.unit.point}),
  1194. attr: renderAttrs(attr, {affix: (attr === 'self' || attr === 'fixed') ? false : true})
  1195. };
  1196. frg.ap(tsp.skill.damage_enemy(dict));
  1197. break;
  1198. }
  1199. case SkillKinds.Unbind: { //解封
  1200. let normal = skill.normal, awakenings = skill.awakenings, matches = skill.matches;
  1201. let effects = [];
  1202. if (normal)
  1203. effects.push(tsp.skill.unbind_normal({icon: createIcon("unbind-normal"), turns: normal}));
  1204. if (awakenings)
  1205. effects.push(tsp.skill.unbind_awakenings({icon: createIcon("unbind-awakenings"), turns: awakenings}));
  1206. if (matches)
  1207. effects.push(tsp.skill.unbind_matches({icon: createIcon("unbind-matches"), turns: matches}));
  1208. frg.ap(effects.nodeJoin(tsp.word.comma()));
  1209. break;
  1210. }
  1211. case SkillKinds.BoardChange: { //洗版
  1212. const attrs = skill.attrs;
  1213. dict = {
  1214. orbs: renderOrbs(attrs),
  1215. };
  1216. let board = new Board(attrs);
  1217. frg.ap(tsp.skill.board_change(dict));
  1218. frg.ap(board.toTable());
  1219. break;
  1220. }
  1221. case SkillKinds.SkillBoost: { //溜
  1222. const value = skill.value;
  1223. let dict = {
  1224. icon: createIcon(skill.kind, SkillValue.isLess(skill.value) ? "boost-decr" : "boost-incr"),
  1225. turns: renderValue(value, { unit:tsp.unit.turns, plusSign:true }),
  1226. };
  1227. frg.ap(tsp.skill.skill_boost(dict));
  1228. break;
  1229. }
  1230. case SkillKinds.AddCombo: { //+C
  1231. const value = skill.value;
  1232. let icon = createIcon(skill.kind);
  1233. icon.setAttribute("data-add-combo", value);
  1234. let dict = {
  1235. icon: icon,
  1236. value: value,
  1237. };
  1238. frg.ap(tsp.skill.add_combo(dict));
  1239. break;
  1240. }
  1241. case SkillKinds.FixedTime: { //固定手指
  1242. const value = skill.value;
  1243. let dict = {
  1244. icon: createIcon(skill.kind),
  1245. value: renderValue(value, { unit: tsp.unit.seconds }),
  1246. };
  1247. frg.ap(tsp.skill.fixed_time(dict));
  1248. break;
  1249. }
  1250. case SkillKinds.MinMatchLength: { //最低匹配长度
  1251. const value = skill.value;
  1252. let dict = {
  1253. icon: createIcon(skill.kind),
  1254. value: value,
  1255. };
  1256. frg.ap(tsp.skill.min_match_length(dict));
  1257. break;
  1258. }
  1259. case SkillKinds.DropRefresh: { //刷版
  1260. let dict = {
  1261. icon: createIcon(skill.kind),
  1262. };
  1263. frg.ap(tsp.skill.drop_refresh(dict));
  1264. break;
  1265. }
  1266. case SkillKinds.Drum: { //太鼓达人音效
  1267. let dict = {
  1268. //icon: createIcon(skill.kind),
  1269. };
  1270. frg.ap(tsp.skill.drum(dict));
  1271. break;
  1272. }
  1273. case SkillKinds.Board7x6: { //76版
  1274. let dict = {
  1275. icon: createIcon(skill.kind),
  1276. };
  1277. frg.ap(tsp.skill.board7x6(dict));
  1278. break;
  1279. }
  1280. case SkillKinds.Vampire: { //吸血
  1281. let attr = skill.attr, damage = skill.damage, heal = skill.heal;
  1282. dict = {
  1283. icon: createIcon("heal", "hp-incr"),
  1284. target: tsp.target.enemy_one(),
  1285. damage: renderValue(damage),
  1286. attr: renderAttrs(attr, {affix: (attr === 'self' || attr === 'fixed') ? false : true}),
  1287. heal: renderValue(heal, {percent: true}),
  1288. };
  1289. frg.ap(tsp.skill.vampire(dict));
  1290. break;
  1291. }
  1292. case SkillKinds.CounterAttack: { //反击
  1293. let attr = skill.attr, prob = skill.prob, value = skill.value;
  1294. dict = {
  1295. icon: createIcon(skill.kind),
  1296. target: tsp.target.enemy(),
  1297. prob: prob.value < 1 ? tsp.value.prob({value: renderValue(prob, { percent:true })}) : null,
  1298. value: renderValue(value),
  1299. attr: renderAttrs(attr, {affix: true}),
  1300. };
  1301. frg.ap(tsp.skill.counter_attack(dict));
  1302. break;
  1303. }
  1304. case SkillKinds.ChangeOrbs: { //珠子变换
  1305. let changes = skill.changes;
  1306. let subDocument = [];
  1307. for (const change of changes)
  1308. {
  1309. dict = {
  1310. from: renderOrbs(change.from),
  1311. to: renderOrbs(change.to),
  1312. };
  1313. subDocument.push(tsp.skill.change_orbs(dict));
  1314. }
  1315. frg.ap(subDocument.nodeJoin(tsp.word.comma()));
  1316. break;
  1317. }
  1318. case SkillKinds.GenerateOrbs: { //产生珠子
  1319. let orbs = skill.orbs, exclude = skill.exclude, count = skill.count;
  1320. dict = {
  1321. exclude: exclude.length ? tsp.word.affix_exclude({cotent: renderOrbs(exclude)}) : void 0,
  1322. orbs: renderOrbs(orbs),
  1323. value: count,
  1324. };
  1325. let board = new Board();
  1326. board.generateOrbs(orbs, count);
  1327. frg.ap(tsp.skill.generate_orbs(dict));
  1328. frg.ap(board.toTable());
  1329. break;
  1330. }
  1331. case SkillKinds.FixedOrbs: { //固定位置产生珠子
  1332. let generates = skill.generates;
  1333. let slight_pause = tsp.word.slight_pause().textContent;
  1334. let subDocument = [];
  1335. //let board = new Array(5).fill(null).map(i=>new Array(6).fill(null));
  1336. let board = new Board();
  1337. function posSplit(pos, max)
  1338. {
  1339. return {sequence: pos.filter(n=>n<=2).map(n=>n+1), reverse: pos.filter(n=>n>=3).reverse().map(n=>max-n)};
  1340. }
  1341. for (const generate of generates)
  1342. {
  1343. let orb = generate.orbs?.[0];
  1344. dict = {
  1345. orbs: renderOrbs(orb),
  1346. };
  1347. if (generate.type == 'shape')
  1348. {
  1349. dict.position = tsp.position.shape();
  1350. board.setShape(generate.positions, orb);
  1351. }else
  1352. {
  1353. let posFrgs = [];
  1354. if (generate.positions.length == 0) continue;
  1355. if (generate.type == 'row')
  1356. {
  1357. const pos = posSplit(generate.positions, 5);
  1358. if (pos.sequence.length) posFrgs.push(tsp.position.top({pos: pos.sequence.join(slight_pause)}));
  1359. if (pos.reverse.length) posFrgs.push(tsp.position.bottom({pos: pos.reverse.join(slight_pause)}));
  1360. board.setRow(generate.positions, orb);
  1361. }else
  1362. {
  1363. const pos = posSplit(generate.positions, 6);
  1364. if (pos.sequence.length) posFrgs.push(tsp.position.left({pos: pos.sequence.join(slight_pause)}));
  1365. if (pos.reverse.length) posFrgs.push(tsp.position.right({pos: pos.reverse.join(slight_pause)}));
  1366. board.setColumn(generate.positions, orb);
  1367. }
  1368. dict.position = posFrgs.nodeJoin(tsp.word.slight_pause());
  1369. }
  1370. subDocument.push(tsp.skill.fixed_orbs(dict));
  1371. }
  1372. frg.ap(subDocument.nodeJoin(tsp.word.comma()));
  1373. frg.ap(board.toTable());
  1374. break;
  1375. }
  1376. case SkillKinds.OrbDropIncrease: { //增加天降
  1377. let attrs = skill.attrs, value = skill.value;
  1378. dict = {
  1379. icon: createIcon(skill.kind),
  1380. orbs: renderOrbs(attrs, {className: "drop", affix: true}),
  1381. value: renderValue(value, {percent: true}),
  1382. };
  1383. frg.ap(tsp.skill.orb_drop_increase(dict));
  1384. break;
  1385. }
  1386. case SkillKinds.VoidEnemyBuff: {
  1387. let buffs = skill.buffs;
  1388. let subDocument = [];
  1389. for (let buff of buffs)
  1390. {
  1391. let dict = {
  1392. icon: createIcon(buff),
  1393. };
  1394. subDocument.push(tsp.skill[buff.replace(/\-/g,'_')](dict));
  1395. }
  1396. let dict = {
  1397. buff: subDocument.nodeJoin(tsp.word.slight_pause()),
  1398. };
  1399. frg.ap(tsp.skill.void_enemy_buff(dict));
  1400. break;
  1401. }
  1402. case SkillKinds.ChangeAttribute: {
  1403. let attrs = skill.attrs, target = skill.target;
  1404. dict = {
  1405. attrs: renderAttrs(attrs, {affix: true}),
  1406. target: target === 'opponent' ? tsp.target.enemy_all() : tsp.target.self(),
  1407. };
  1408. frg.ap(tsp.skill.change_attribute(dict));
  1409. break;
  1410. }
  1411. case SkillKinds.SetOrbState: {
  1412. let orbs = skill.orbs, state = skill.state, arg = skill.arg;
  1413. dict = {
  1414. orbs: renderOrbs(orbs, {className: state, affix: true}),
  1415. };
  1416. switch (state)
  1417. {
  1418. case "enhanced":{
  1419. dict.value = renderValue(arg.enhance, {percent: true});
  1420. frg.ap(tsp.skill.set_orb_state_enhanced(dict));
  1421. break;
  1422. }
  1423. case "locked":{
  1424. if (arg.count.value < 42)
  1425. dict.value = renderValue(arg.count, {unit: tsp.unit.unit});
  1426. frg.ap(tsp.skill.set_orb_state_locked(dict));
  1427. break;
  1428. }
  1429. case "unlocked":{
  1430. dict.icon = createIcon('orb-unlocked'),
  1431. frg.ap(tsp.skill.set_orb_state_unlocked(dict));
  1432. break;
  1433. }
  1434. case "bound":{
  1435. frg.ap(tsp.skill.set_orb_state_bound(dict));
  1436. break;
  1437. }
  1438. }
  1439. break;
  1440. }
  1441. case SkillKinds.RateMultiply: {
  1442. let rate = skill.rate, value = skill.value;
  1443. dict = {
  1444. rate: tsp.skill["rate_multiply_" + rate]({icon: createIcon(skill.kind + "-" + rate)}),
  1445. value: renderValue(value),
  1446. };
  1447. frg.ap(tsp.skill.rate_multiply(dict));
  1448. break;
  1449. }
  1450. case SkillKinds.ReduceDamage: {
  1451. let attrs = skill.attrs, percent = skill.percent, condition = skill.condition;
  1452. dict = {
  1453. icon: createIcon(skill.kind),
  1454. attrs: renderAttrs(attrs, {affix: true}),
  1455. value: renderValue(percent, {percent: true}),
  1456. };
  1457. if (condition) dict.condition = renderCondition(condition);
  1458. frg.ap(tsp.skill.reduce_damage(dict));
  1459. break;
  1460. }
  1461. /*
  1462. case SkillKinds.ReduceDamage: {
  1463. const { attrs, percent, condition } = skill as Skill.ReduceDamage;
  1464. return (
  1465. <span className="CardSkill-skill">
  1466. {!!condition && <>{renderCondition(condition)} &rArr; </>}
  1467. <Asset assetId="status-def" className="CardSkill-icon" />
  1468. {(Array.isArray(attrs) && !isEqual(attrs, Attributes.all())) && renderAttrs(attrs)}
  1469. {renderValue(percent)}
  1470. </span>
  1471. );
  1472. }
  1473. case SkillKinds.PowerUp: {
  1474. const { attrs, types, condition, value, reduceDamage } = skill as Skill.PowerUp;
  1475. const targets: React.ReactNode[] = [];
  1476. if (attrs && !isEqual(attrs, Attributes.all())) targets.push(...renderAttrs(attrs || []));
  1477. if (types) targets.push(...renderTypes(types || []));
  1478. return (
  1479. <span className="CardSkill-skill">
  1480. {condition && <>{renderCondition(condition)} &rArr; </>}
  1481. {targets.length > 0 && <>{targets}</>}
  1482. {!!value && renderPowerUp(value)}
  1483. {!!reduceDamage && <>
  1484. <Asset assetId="status-def" className="CardSkill-icon" />
  1485. {renderValue(reduceDamage)}
  1486. </>}
  1487. </span>
  1488. );
  1489. }
  1490. */
  1491. default: {
  1492. console.log("未处理的技能类型",skill.kind, skill);
  1493. frg.ap(skill.kind);
  1494. }
  1495. }
  1496. return frg;
  1497. };
  1498. function renderStat(stat, option) {
  1499. const frg = document.createDocumentFragment();
  1500. if (typeof localTranslating == "undefined") return frg;
  1501. const tspt = localTranslating.skill_parse.stats;
  1502. if (tspt[stat])
  1503. frg.ap(tspt[stat](option));
  1504. else
  1505. {
  1506. console.log("未知状态类型",stat);
  1507. frg.ap(tspt.unknown({ type: stat }));
  1508. }
  1509. return frg;
  1510. }
  1511. function renderAttrs(attrs, option = {}) {
  1512. if (!Array.isArray(attrs))
  1513. attrs = [attrs ?? 0];
  1514. const frg = document.createDocumentFragment();
  1515. if (typeof localTranslating == "undefined") return frg;
  1516. const tsp = localTranslating.skill_parse;
  1517. let contentFrg;
  1518. if (isEqual(attrs, Attributes.all()))
  1519. {
  1520. contentFrg = option.any ? tsp.attrs.any() : tsp.attrs.all();
  1521. }
  1522. else
  1523. {
  1524. contentFrg = attrs.map(attr => {
  1525. const icon = document.createElement("icon");
  1526. icon.className = "attr";
  1527. icon.setAttribute("data-attr-icon",attr);
  1528. return tsp.attrs[attr]({icon: icon});
  1529. })
  1530. .nodeJoin(tsp.word.slight_pause());
  1531. }
  1532. frg.ap(option.affix ? tsp.word.affix_attr({cotent: contentFrg}) : contentFrg);
  1533. return frg;
  1534. }
  1535. function renderOrbs(attrs, option = {}) {
  1536. if (!Array.isArray(attrs))
  1537. attrs = [attrs ?? 0];
  1538. const frg = document.createDocumentFragment();
  1539. if (typeof localTranslating == "undefined") return frg;
  1540. const tsp = localTranslating.skill_parse;
  1541. let contentFrg;
  1542. if (isEqual(attrs, Attributes.orbs()))
  1543. {
  1544. contentFrg = option.any ? tsp.orbs.any() : tsp.orbs.all();
  1545. }
  1546. else
  1547. {
  1548. contentFrg = attrs.map(attr => {
  1549. const icon = document.createElement("icon");
  1550. icon.className = "orb";
  1551. if (option.className) icon.className += " " + option.className;
  1552. icon.setAttribute("data-orb-icon",attr);
  1553. return tsp.orbs[attr]({icon: icon});
  1554. })
  1555. .nodeJoin(tsp.word.slight_pause());
  1556. }
  1557. frg.ap(option.affix ? tsp.word.affix_orb({cotent: contentFrg}) : contentFrg);
  1558. return frg;
  1559. }
  1560. function renderTypes(types, option = {}) {
  1561. if (!Array.isArray(types))
  1562. types = [types ?? 0];
  1563. const frg = document.createDocumentFragment();
  1564. if (typeof localTranslating == "undefined") return frg;
  1565. const tsp = localTranslating.skill_parse;
  1566. const contentFrg = types.map(attr => {
  1567. const icon = document.createElement("icon");
  1568. icon.className = "type";
  1569. icon.setAttribute("data-type-icon",attr);
  1570. return tsp.types[attr]({icon: icon});
  1571. })
  1572. .nodeJoin(tsp.word.slight_pause());
  1573. frg.ap(option.affix ? tsp.word.affix_type({cotent: contentFrg}) : contentFrg);
  1574. return frg;
  1575. }
  1576. function renderCondition(cond) {
  1577. const frg = document.createDocumentFragment();
  1578. const tsp = localTranslating.skill_parse;
  1579. if (cond.hp) {
  1580. let dict = {
  1581. hp: renderStat('hp'),
  1582. min: renderValue(v.percent(cond.hp.min * 100), {percent: true}),
  1583. max: renderValue(v.percent(cond.hp.max * 100), {percent: true}),
  1584. };
  1585. if (cond.hp.min === cond.hp.max)
  1586. frg.ap(tsp.cond.hp_equal(dict));
  1587. else if (cond.hp.min === 0)
  1588. frg.ap(tsp.cond.hp_less_or_equal(dict));
  1589. else if (cond.hp.max === 1)
  1590. frg.ap(tsp.cond.hp_greater_or_equal(dict));
  1591. else
  1592. frg.ap(tsp.cond.hp_belong_to_range(dict));
  1593. } else if (cond.useSkill) {
  1594. frg.ap(tsp.cond.use_skill());
  1595. } else if (cond.multiplayer) {
  1596. frg.ap(tsp.cond.multi_player());
  1597. } else if (cond.remainOrbs) {
  1598. let dict = {
  1599. count: renderValue(v.constant(cond.remainOrbs.count), {unit: tsp.unit.unit}),
  1600. };
  1601. frg.ap(tsp.cond.remain_orbs(dict));
  1602. } else if (cond.exact) {
  1603. if (cond.exact.type === 'combo') {
  1604. let dict = {value: cond.exact.value};
  1605. frg.ap(tsp.cond.exact_combo(dict));
  1606. } else if (cond.exact.type === 'match-length') {
  1607. let dict = {
  1608. value: cond.exact.value,
  1609. orbs: cond.exact.attrs === 'enhanced' ? tsp.cond.exact_match_enhanced() : renderOrbs(cond.exact.attrs)
  1610. };
  1611. frg.ap(tsp.cond.exact_match_length(dict));
  1612. } else if (cond.exact.type === 'match-count') {
  1613. }
  1614. } else if (cond.compo) {
  1615. let dict = {};
  1616. switch (cond.compo.type)
  1617. {
  1618. case 'card':{
  1619. dict.ids = cond.compo.ids.join();
  1620. frg.ap(tsp.cond.compo_type_card(dict));
  1621. break;
  1622. }
  1623. case 'series':{
  1624. dict.ids = cond.compo.ids.join();
  1625. frg.ap(tsp.cond.compo_type_series(dict));
  1626. break;
  1627. }
  1628. case 'evolution':{
  1629. dict.ids = cond.compo.ids.join();
  1630. frg.ap(tsp.cond.compo_type_evolution(dict));
  1631. break;
  1632. }
  1633. }
  1634. } else {
  1635. frg.ap(tsp.cond.unknown());
  1636. }
  1637. return frg;
  1638. }
  1639. /*
  1640. function renderCondition(cond: SkillCondition) {
  1641. if (cond.hp) {
  1642. if (cond.hp.min === cond.hp.max)
  1643. return <>{renderStat('hp')} = {formatNumber(cond.hp.min * 100)}%</>;
  1644. else if (cond.hp.min === 0)
  1645. return <>{renderStat('hp')} &le; {formatNumber(cond.hp.max * 100)}%</>;
  1646. else if (cond.hp.max === 1)
  1647. return <>{renderStat('hp')} &ge; {formatNumber(cond.hp.min * 100)}%</>;
  1648. else
  1649. return <>{renderStat('hp')} &in; [{formatNumber(cond.hp.min * 100)}%, {formatNumber(cond.hp.max * 100)}%]</>;
  1650. } else if (cond.useSkill) {
  1651. return <>use skill</>;
  1652. } else if (cond.multiplayer) {
  1653. return <>in multiplayer</>;
  1654. } else if (cond.remainOrbs) {
  1655. return <>&le; {cond.remainOrbs.count} orbs remain</>;
  1656. } else if (cond.exact) {
  1657. if (cond.exact.type === 'combo') {
  1658. return <>= {cond.exact.value} combos</>;
  1659. } else if (cond.exact.type === 'match-length') {
  1660. return <>= {cond.exact.value} {cond.exact.attrs === 'enhanced' ? 'Enhanced' : renderAttrs(cond.exact.attrs)} orbs</>;
  1661. }
  1662. } else if (cond.compo) {
  1663. return <>{cond.compo.type} [{cond.compo.ids.join()}] in team</>;
  1664. }
  1665. return <>[ unknown condition ]</>;
  1666. }
  1667. function renderPowerUp(powerUp: SkillPowerUp) {
  1668. function renderStats(hp: number, atk: number, rcv: number, mul = true) {
  1669. const operator = mul ? <>&times;</> : <>+</>;
  1670. let list: Array<['hp' | 'atk' | 'rcv', number]> = [['hp', hp], ['atk', atk], ['rcv', rcv]];
  1671. list = list.filter(([, value]) => value !== (mul ? 1 : 0));
  1672. if (list.length === 0) return null;
  1673. if (list.every(([, value]) => value === list[0][1])) {
  1674. return <>
  1675. {list.map(([name], i) => <React.Fragment key={name}>{i !== 0 && ', '}{renderStat(name)}</React.Fragment>)}
  1676. &nbsp;{operator} {formatNumber(list[0][1])}
  1677. </>;
  1678. } else {
  1679. return <>
  1680. {list.map(([name, value], i) => (
  1681. <React.Fragment key={name}>
  1682. {i !== 0 ? '; ' : ''}
  1683. {renderStat(name)}
  1684. &nbsp;{operator} {formatNumber(value)}
  1685. </React.Fragment>
  1686. ))}
  1687. </>;
  1688. }
  1689. }
  1690. switch (powerUp.kind) {
  1691. case SkillPowerUpKind.Multiplier: {
  1692. const { hp, atk, rcv } = powerUp as SkillPowerUp.Mul;
  1693. return renderStats(hp, atk, rcv);
  1694. }
  1695. case SkillPowerUpKind.ScaleAttributes: {
  1696. const { attrs, min, max, baseAtk, baseRcv, bonusAtk, bonusRcv } = powerUp as SkillPowerUp.ScaleAttrs;
  1697. return <>
  1698. &ge; {min} of [{renderAttrs(attrs)}] &rArr; {renderStats(1, baseAtk, baseRcv)}
  1699. {max !== min && <> for each &le; {max} attributes: {renderStats(0, bonusAtk, bonusRcv, false)}</>}
  1700. </>;
  1701. }
  1702. case SkillPowerUpKind.ScaleCombos: {
  1703. const { min, max, baseAtk, baseRcv, bonusAtk, bonusRcv } = powerUp as SkillPowerUp.Scale;
  1704. return <>
  1705. &ge; {min} combos &rArr; {renderStats(1, baseAtk, baseRcv)}
  1706. {max !== min && <> for each &le; {max} combos: {renderStats(0, bonusAtk, bonusRcv, false)}</>}
  1707. </>;
  1708. }
  1709. case SkillPowerUpKind.ScaleMatchAttrs: {
  1710. const { matches, min, max, baseAtk, baseRcv, bonusAtk, bonusRcv } = powerUp as SkillPowerUp.ScaleMultiAttrs;
  1711. return <>
  1712. &ge; {min} matches of [{matches.map((attrs, i) =>
  1713. <React.Fragment key={i}>{i !== 0 && ', '}{renderAttrs(attrs)}</React.Fragment>
  1714. )}] &rArr; {renderStats(1, baseAtk, baseRcv)}
  1715. {max !== min && <> for each &le; {max} matches: {renderStats(0, bonusAtk, bonusRcv, false)}</>}
  1716. </>;
  1717. }
  1718. case SkillPowerUpKind.ScaleMatchLength: {
  1719. const { attrs, min, max, baseAtk, baseRcv, bonusAtk, bonusRcv } = powerUp as SkillPowerUp.ScaleAttrs;
  1720. return <>
  1721. &ge; {min} &times; {renderAttrs(attrs)} &rArr; {renderStats(1, baseAtk, baseRcv)}
  1722. {max !== min && <> for each &le; {max} orbs: {renderStats(0, bonusAtk, bonusRcv, false)}</>}
  1723. </>;
  1724. }
  1725. case SkillPowerUpKind.ScaleCross: {
  1726. const { crosses } = powerUp as SkillPowerUp.ScaleCross;
  1727. return crosses.map(({ single, attr, mul }, i) => <React.Fragment key={i}>
  1728. {i !== 0 && ', '}
  1729. {mul !== 1 && <>{renderStat('atk')} &times; {formatNumber(mul)} </>}
  1730. {single ? 'when' : 'for each'} cross of {renderAttrs(attr)}
  1731. </React.Fragment>);
  1732. }
  1733. case SkillPowerUpKind.ScaleAwakenings: {
  1734. const { awakenings, value } = powerUp as SkillPowerUp.ScaleAwakenings;
  1735. return <>
  1736. {renderStat('atk')} &times; {formatNumber(value - 1)} for each {awakenings.map(id =>
  1737. <Asset assetId={`awakening-${id}`} className="CardSkill-icon" key={id} />
  1738. )}
  1739. </>;
  1740. }
  1741. default:
  1742. return <>[ unknown power up ]</>;
  1743. }
  1744. }
  1745. */
  1746. function renderValue(_value, option = {}) {
  1747. const frg = document.createDocumentFragment();
  1748. if (typeof localTranslating == "undefined") return frg;
  1749. const tsp = localTranslating.skill_parse
  1750. const tspv = tsp.value;
  1751. const od = option.decimalDigits, os = option.plusSign;
  1752. let dict;
  1753. switch (_value.kind) {
  1754. case SkillValueKind.Percent: {
  1755. dict = {
  1756. value: option.percent ? (_value.value * 100).keepCounts(od,os) : _value.value.keepCounts(od,os),
  1757. };
  1758. frg.ap(
  1759. option.percent ?
  1760. tspv.mul_percent(dict) :
  1761. tspv.mul_times(dict)
  1762. );
  1763. break;
  1764. }
  1765. case SkillValueKind.Constant: {
  1766. dict = {
  1767. value: _value.value.keepCounts(od,os),
  1768. unit: option.unit ? option.unit() : undefined,
  1769. };
  1770. frg.ap(tspv.const(dict));
  1771. break;
  1772. }
  1773. case SkillValueKind.ConstantTo: {
  1774. dict = {
  1775. value: _value.value.keepCounts(od,os)
  1776. };
  1777. frg.ap(tspv.const_to(dict));
  1778. break;
  1779. }
  1780. case SkillValueKind.xMaxHP: {
  1781. dict = {
  1782. value: option.percent ? (_value.value * 100).keepCounts(od,os) : _value.value.keepCounts(od,os),
  1783. stats: renderStat('maxhp'),
  1784. };
  1785. frg.ap(
  1786. option.percent ?
  1787. tspv.mul_of_percent(dict) :
  1788. tspv.mul_of_times(dict)
  1789. );
  1790. break;
  1791. }
  1792. case SkillValueKind.xHP: {
  1793. dict = {
  1794. value: option.percent ? (_value.value * 100).keepCounts(od,os) : _value.value.keepCounts(od,os),
  1795. stats: renderStat('hp'),
  1796. };
  1797. frg.ap(
  1798. option.percent ?
  1799. tspv.mul_of_percent(dict) :
  1800. tspv.mul_of_times(dict)
  1801. );
  1802. break;
  1803. }
  1804. case SkillValueKind.xATK: {
  1805. dict = {
  1806. value: option.percent ? (_value.value * 100).keepCounts(od,os) : _value.value.keepCounts(od,os),
  1807. stats: renderStat('atk'),
  1808. };
  1809. frg.ap(
  1810. option.percent ?
  1811. tspv.mul_of_percent(dict) :
  1812. tspv.mul_of_times(dict)
  1813. );
  1814. break;
  1815. }
  1816. case SkillValueKind.xRCV: {
  1817. dict = {
  1818. value: option.percent ? (_value.value * 100).keepCounts(od,os) : _value.value.keepCounts(od,os),
  1819. stats: renderStat('rcv'),
  1820. };
  1821. frg.ap(
  1822. option.percent ?
  1823. tspv.mul_of_percent(dict) :
  1824. tspv.mul_of_times(dict)
  1825. );
  1826. break;
  1827. }
  1828. case SkillValueKind.xTeamHP: {
  1829. let value = _value.value;
  1830. dict = {
  1831. value: option.percent ? (value * 100).keepCounts(od,os) : value.keepCounts(od,os),
  1832. stats: renderStat('teamhp'),
  1833. };
  1834. frg.ap(
  1835. option.percent ?
  1836. tspv.mul_of_percent(dict) :
  1837. tspv.mul_of_times(dict)
  1838. );
  1839. break;
  1840. }
  1841. case SkillValueKind.xTeamRCV: {
  1842. dict = {
  1843. value: option.percent ? (_value.value * 100).keepCounts(od,os) : _value.value.keepCounts(od,os),
  1844. stats: renderStat('teamrcv'),
  1845. };
  1846. frg.ap(
  1847. option.percent ?
  1848. tspv.mul_of_percent(dict) :
  1849. tspv.mul_of_times(dict)
  1850. );
  1851. break;
  1852. }
  1853. case SkillValueKind.xTeamATK: {
  1854. let attrs = _value.attrs, value = _value.value;
  1855. dict = {
  1856. value: option.percent ? (value * 100).keepCounts(od,os) : value.keepCounts(od,os),
  1857. stats: renderStat('teamatk', {attrs: renderAttrs(attrs, {affix: true})}),
  1858. };
  1859. frg.ap(
  1860. option.percent ?
  1861. tspv.mul_of_percent(dict) :
  1862. tspv.mul_of_times(dict)
  1863. );
  1864. break;
  1865. }
  1866. case SkillValueKind.HPScale: {
  1867. let min = _value.min, max = _value.max;
  1868. dict = {
  1869. min: tspv.mul_of_times({value: min.keepCounts(od,os), stats:renderStat('atk')}),
  1870. max: tspv.mul_of_times({value: max.keepCounts(od,os), stats:renderStat('atk')}),
  1871. hp: renderStat('hp'),
  1872. };
  1873. frg.ap(tspv.hp_scale(dict));
  1874. break;
  1875. }
  1876. case SkillValueKind.RandomATK: {
  1877. let min = _value.min, max = _value.max;
  1878. dict = {
  1879. min: min.keepCounts(od,os),
  1880. atk: renderStat('atk'),
  1881. };
  1882. if (max != min)
  1883. {
  1884. dict.max = tsp.word.range_hyphen().ap(max.keepCounts(od,os));
  1885. }
  1886. frg.ap(tspv.random_atk(dict));
  1887. break;
  1888. }
  1889. /*
  1890. case SkillValueKind.xAwakenings: {
  1891. const { value, awakenings } = _value as SkillValue.WithAwakenings;
  1892. return <span>{formatNumber(value * 100)}% &times; each of {awakenings.map(id =>
  1893. <Asset assetId={`awakening-${id}`} className="CardSkill-icon" key={id} />
  1894. )}</span>;
  1895. }
  1896. */
  1897. default: {
  1898. console.log("未知数值类型",_value.kind, _value);
  1899. frg.ap(tspv.unknown({ type: _value.kind }));
  1900. }
  1901. }
  1902. return frg;
  1903. }

智龙迷城队伍图制作工具