Default egg restocking to ten draws and add single-draw opt-in

This commit is contained in:
AttilaNet
2026-11-09 07:44:41 +08:00
parent d7ca68b5f9
commit df0259febf
7 changed files with 79 additions and 16 deletions
+7 -4
View File
@@ -291,6 +291,7 @@ class Policy:
egg_stock: int = 12
buy_batch: int = 5
buy_ten: bool = True
allow_single_draw: bool = False
keep_money: int = 1000
daily_buy_money: int = 5000
manual_eggs: bool = False
@@ -472,11 +473,13 @@ class Planner:
money = int(snapshot.raw["master"].get("money", 0))
left = min(max(0, policy.daily_buy_money), daily_left) if daily_left is not None else max(0, policy.daily_buy_money)
affordable = min(int(market.get("max") or 1), max(0, money - policy.keep_money) // price, left // price)
if policy.buy_ten and policy.egg_stock >= 10 and missing >= 10 and affordable >= 10:
if not policy.allow_single_draw:
count = min(missing, max(10, policy.buy_batch), affordable) // 10 * 10
if count < 10:
self.notes.append(f"十连等待:单抽已关闭,补货缺口 {missing};十连需 {price * 10} 可用金币,保留 {policy.keep_money},额度剩余 {left};补货目标至少设为10")
return []
elif policy.buy_ten and missing >= 10 and affordable >= 10:
count = min(missing, max(10, policy.buy_batch), affordable) // 10 * 10
elif policy.buy_ten and policy.egg_stock >= 10 and stock > 0:
self.notes.append(f"十连等待:可孵蛋库存 {stock},补货缺口 {missing};十连需 {price * 10} 可用金币,保留 {policy.keep_money},额度剩余 {left}")
return []
else:
count = min(missing, max(0, policy.buy_batch), affordable)
if count <= 0: