mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 13:47:44 +00:00
feat: 挑战定时提醒
This commit is contained in:
parent
607b85c922
commit
534ef0765e
6 changed files with 340 additions and 0 deletions
|
|
@ -369,4 +369,42 @@ export class ZZZChallenge {
|
|||
'0'
|
||||
)}`;
|
||||
}
|
||||
getSRankCountUpTo(maxLevel) {
|
||||
let s_rank_count = 0;
|
||||
const min_level = Math.min(
|
||||
...this.all_floor_detail.map(f => f.layer_index)
|
||||
);
|
||||
for (let level = 1; level <= maxLevel; level++) {
|
||||
const floor = this.all_floor_detail.find(f => f.layer_index === level);
|
||||
if (floor) {
|
||||
if (floor.rating === 'S') {
|
||||
s_rank_count++;
|
||||
}
|
||||
} else {
|
||||
if (level < min_level) {
|
||||
s_rank_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return s_rank_count;
|
||||
}
|
||||
|
||||
areAllSUpTo(maxLevel) {
|
||||
const min_level = Math.min(
|
||||
...this.all_floor_detail.map(f => f.layer_index)
|
||||
);
|
||||
for (let level = 1; level <= maxLevel; level++) {
|
||||
const floor = this.all_floor_detail.find(f => f.layer_index === level);
|
||||
if (floor) {
|
||||
if (floor.rating !== 'S') {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (level >= min_level) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue