mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 05:37:46 +00:00
refactor: 重构lib代码(无实质性功能更新,可不更新)
This commit is contained in:
parent
a7f06d404b
commit
aa3b7928ec
26 changed files with 547 additions and 483 deletions
19
lib/gacha/tool.js
Normal file
19
lib/gacha/tool.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* 欧非分析
|
||||
* @param {number} ast
|
||||
* @param {number[]} lst
|
||||
*/
|
||||
export const getLevelFromList = (ast, lst) => {
|
||||
if (ast === 0) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
let level = 0;
|
||||
for (let numIndex = 0; numIndex < lst.length; numIndex++) {
|
||||
if (ast <= lst[numIndex]) {
|
||||
level = 4 - numIndex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return level;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue