diff --git a/apps/starrail_gacha.ts b/apps/starrail_gacha.ts index 1f68083..fc228d6 100644 --- a/apps/starrail_gacha.ts +++ b/apps/starrail_gacha.ts @@ -39,7 +39,7 @@ export class SRGachaPlugin extends Plugin { fnc: 'single' }, { - reg: '^#星铁抽卡排名.*$', + reg: '^#星铁抽卡(排名|排行).*$', fnc: 'showrank' } ] @@ -164,8 +164,10 @@ export class SRGachaPlugin extends Plugin { } getUpPercentage(rankData: RankData): number { - if (rankData.star5 == 0) return 0; - return rankData.up / rankData.star5; + if (rankData.up == 0) return 0; + const wai = rankData.star5 - rankData.up; + const buwai = rankData.up - wai; + return buwai / rankData.up; } getAverageUpCount(rankData: RankData): number { @@ -181,7 +183,7 @@ export class SRGachaPlugin extends Plugin { msg.push(""); msg.push("排行榜 (小保底不歪): "); let top1 = Object.values(rank) - .filter(r => r.star5 > 0).sort((a, b) => this.getUpPercentage(b) - this.getUpPercentage(a)); + .filter(r => r.up > 0).sort((a, b) => this.getUpPercentage(b) - this.getUpPercentage(a)); let top2 = Object.values(rank) .filter(r => r.star5 > 0).sort((a, b) => this.getAverageUpCount(a) - this.getAverageUpCount(b));