From a0faa129520d0b8917439bdfe535b5333caa4684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C4=93lla=20Caerulea?= <69615283+StellaCaerulea@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:49:06 +0800 Subject: [PATCH] :bug: Change the calculation for up-average pulls Co-authored-by: xtaodada --- modules/gacha_log/log.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/gacha_log/log.py b/modules/gacha_log/log.py index f682fda..ec900f8 100644 --- a/modules/gacha_log/log.py +++ b/modules/gacha_log/log.py @@ -387,7 +387,11 @@ class GachaLog: # 五星常驻 five_star_const = five_star - five_star_up # UP 平均 - up_avg = round((total - no_five_star) / five_star_up, 2) if five_star_up != 0 else 0 + up_avg = ( + round((total - no_five_star - (all_five[0].count if not all_five[0].isUp else 0)) / five_star_up, 2) + if five_star_up != 0 + else 0 + ) # UP 花费原石 up_cost = sum(i.count * 160 for i in all_five if i.isUp) up_cost = f"{round(up_cost / 10000, 2)}w" if up_cost >= 10000 else up_cost