3电站下钱书比按调平前计算

This commit is contained in:
zhbaor 2023-08-14 13:19:06 +08:00
parent 6b725b5db3
commit 7aff131be6

View file

@ -36,12 +36,14 @@ class RIICReportAnalysis:
err_msg += "琉璃 243-153" err_msg += "琉璃 243-153"
use_tequila = False use_tequila = False
power_plants = 2
if not card: if not card:
await chain.onebot_reply(Text(err_msg)) await chain.onebot_reply(Text(err_msg))
return return
elif "153" in card or "243" in card: elif "153" in card or "243" in card:
use_tequila = True use_tequila = True
power_plants = 3
elif "252" in card: elif "252" in card:
if m := re.search(r"([1-3][1-3])贸", card): if m := re.search(r"([1-3][1-3])贸", card):
if "3" in m.group(1): if "3" in m.group(1):
@ -148,19 +150,29 @@ class RIICReportAnalysis:
output += f"贸易效率:{trading_efficiency * 100:.0f}%\n" output += f"贸易效率:{trading_efficiency * 100:.0f}%\n"
output += f"等效赤金:{gold_by_e:.0f}\n" output += f"等效赤金:{gold_by_e:.0f}\n"
output += f"经验调平:{balanced_exp_by_e:.0f}\n" output += f"经验调平:{balanced_exp_by_e:.0f}\n"
if power_plants == 2:
output += f"钱书比例:{lmb_exp_ratio_by_e:.2f}\n" output += f"钱书比例:{lmb_exp_ratio_by_e:.2f}\n"
output += f"调平总和:{total_by_e:.0f}\n\n" output += f"调平总和:{total_by_e:.0f}\n\n"
output += "-----数量算法-----\n" output += "-----数量算法-----\n"
output += f"等效赤金:{gold_by_order:.0f}\n" output += f"等效赤金:{gold_by_order:.0f}\n"
output += f"经验调平:{balanced_exp_by_order:.0f}\n" output += f"经验调平:{balanced_exp_by_order:.0f}\n"
if power_plants == 2:
output += f"钱书比例:{lmb_exp_ratio_by_order:.2f}\n" output += f"钱书比例:{lmb_exp_ratio_by_order:.2f}\n"
output += f"调平总和:{total_by_order:.0f}" 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: else:
balanced_gold = lmb_avg - external_gold balanced_gold = lmb_avg - external_gold
overflow_gold = gold_avg - balanced_gold overflow_gold = gold_avg - balanced_gold
more_exp = overflow_gold * 0.8 more_exp = overflow_gold * 0.8
balanced_exp = exp_avg + more_exp balanced_exp = exp_avg + more_exp
if power_plants == 2:
lmb_exp_ratio = (lmb_avg + 43483) / (balanced_exp + 36284) lmb_exp_ratio = (lmb_avg + 43483) / (balanced_exp + 36284)
else:
lmb_exp_ratio = (lmb_avg + 43483) / (exp_avg + 36284)
total = lmb_avg + balanced_exp total = lmb_avg + balanced_exp
output += "====计算结果====\n" output += "====计算结果====\n"