From 7aff131be603f7addb04c886a7fbc3f42f626790 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Mon, 14 Aug 2023 13:19:06 +0800 Subject: [PATCH] =?UTF-8?q?3=E7=94=B5=E7=AB=99=E4=B8=8B=E9=92=B1=E4=B9=A6?= =?UTF-8?q?=E6=AF=94=E6=8C=89=E8=B0=83=E5=B9=B3=E5=89=8D=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/riic_report_analysis.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/riic_report_analysis.py b/apps/riic_report_analysis.py index 9487202..119e856 100644 --- a/apps/riic_report_analysis.py +++ b/apps/riic_report_analysis.py @@ -36,12 +36,14 @@ class RIICReportAnalysis: err_msg += "琉璃 243-153" use_tequila = False + power_plants = 2 if not card: await chain.onebot_reply(Text(err_msg)) return elif "153" in card or "243" in card: use_tequila = True + power_plants = 3 elif "252" in card: if m := re.search(r"([1-3][1-3])贸", card): if "3" in m.group(1): @@ -148,19 +150,29 @@ class RIICReportAnalysis: output += f"贸易效率:{trading_efficiency * 100:.0f}%\n" output += f"等效赤金:{gold_by_e:.0f}\n" output += f"经验调平:{balanced_exp_by_e:.0f}\n" - output += f"钱书比例:{lmb_exp_ratio_by_e:.2f}\n" + if power_plants == 2: + output += f"钱书比例:{lmb_exp_ratio_by_e:.2f}\n" output += f"调平总和:{total_by_e:.0f}\n\n" output += "-----数量算法-----\n" output += f"等效赤金:{gold_by_order:.0f}\n" output += f"经验调平:{balanced_exp_by_order:.0f}\n" - output += f"钱书比例:{lmb_exp_ratio_by_order:.2f}\n" - output += f"调平总和:{total_by_order:.0f}" + if power_plants == 2: + output += f"钱书比例:{lmb_exp_ratio_by_order:.2f}\n" + output += f"调平总和:{total_by_order:.0f}\n\n" + if power_plants == 3: + if exp_avg != 0: + output += f"钱书比例:{lmb_avg / exp_avg:.0f}" + else: + output += f"钱书比例:正无穷" else: balanced_gold = lmb_avg - external_gold overflow_gold = gold_avg - balanced_gold more_exp = overflow_gold * 0.8 balanced_exp = exp_avg + more_exp - lmb_exp_ratio = (lmb_avg + 43483) / (balanced_exp + 36284) + if power_plants == 2: + lmb_exp_ratio = (lmb_avg + 43483) / (balanced_exp + 36284) + else: + lmb_exp_ratio = (lmb_avg + 43483) / (exp_avg + 36284) total = lmb_avg + balanced_exp output += "====计算结果====\n"