mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
feat:gacha抽卡数颜色判断
This commit is contained in:
parent
8c99081c6f
commit
e988948770
2 changed files with 24 additions and 3 deletions
25
lib/gacha.js
25
lib/gacha.js
|
|
@ -185,6 +185,13 @@ const NORMAL_LIST = [
|
|||
'啜泣摇篮',
|
||||
];
|
||||
|
||||
const FLOORS_MAP = {
|
||||
'邦布频段': [50, 70],
|
||||
'音擎频段': [50, 70],
|
||||
'独家频段': [60, 80],
|
||||
'常驻频段': [60, 80],
|
||||
};
|
||||
|
||||
function getLevelFromList(ast, lst) {
|
||||
if (ast === 0) {
|
||||
return 2;
|
||||
|
|
@ -241,17 +248,28 @@ export async function anaylizeGachaLog(uid) {
|
|||
}
|
||||
if (list.length > 0) {
|
||||
list[list.length - 1]['totalCount'] = i - preIndex;
|
||||
if (i - preIndex <= FLOORS_MAP[name][0]) {
|
||||
list[list.length - 1]['color'] = 'rgb(63, 255, 0)';
|
||||
} else if (i - preIndex >= FLOORS_MAP[name][1]) {
|
||||
list[list.length - 1]['color'] = 'rgb(255, 20, 20)';
|
||||
}
|
||||
}
|
||||
list.push({
|
||||
...item,
|
||||
rank_type_label: RANK_MAP[item.rank_type],
|
||||
isUp: isUp,
|
||||
totalCount: '-',
|
||||
color: 'white',
|
||||
});
|
||||
preIndex = i;
|
||||
}
|
||||
if (i === data.length - 1 && list.length > 0) {
|
||||
list[list.length - 1]['totalCount'] = i - preIndex + 1;
|
||||
if (i - preIndex + 1 <= FLOORS_MAP[name][0]) {
|
||||
list[list.length - 1]['color'] = 'rgb(63, 255, 0)';
|
||||
} else if (i - preIndex + 1 >= FLOORS_MAP[name][1]) {
|
||||
list[list.length - 1]['color'] = 'rgb(255, 20, 20)';
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
|
@ -279,8 +297,11 @@ export async function anaylizeGachaLog(uid) {
|
|||
level = getLevelFromList(avgUp, [51, 55, 61, 68, 70]);
|
||||
} else if ('独家频段' === name) {
|
||||
level = getLevelFromList(avgUp, [74, 87, 99, 105, 120]);
|
||||
} else if ('常驻频段' === name) {
|
||||
level = getLevelFromList(avgUp, [53, 60, 68, 73, 75]);
|
||||
}
|
||||
}
|
||||
if (avgFive !== '-') {
|
||||
if ('常驻频段' === name) {
|
||||
level = getLevelFromList(avgFive, [53, 60, 68, 73, 75]);
|
||||
}
|
||||
}
|
||||
const tag = HOMO_TAG[level];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue