Skip unsupported commission offers and explain acceptance blockers
This commit is contained in:
@@ -854,7 +854,7 @@ class ProgressionPlanner:
|
||||
return False, "整份委托提交魔物不足或受保留保护"
|
||||
return (True, "可接取") if info.get("steps") else (False, "委托没有有效步骤")
|
||||
|
||||
def commission_plan(self, snapshot, quest_policy, ranch_policy, *, battle_policy=None):
|
||||
def commission_plan(self, snapshot, quest_policy, ranch_policy, *, battle_policy=None, accept_supported=None):
|
||||
"""Plan full type-4 progression using the existing commission policy.
|
||||
|
||||
The engine must call this INSTEAD OF TaskPlanner.plan for commissions.
|
||||
@@ -902,6 +902,12 @@ class ProgressionPlanner:
|
||||
continue
|
||||
if not self._commission_offer_ready(snapshot, quest_policy, policy, ranch_policy, info)[0]:
|
||||
continue
|
||||
if accept_supported is not None and not accept_supported(key):
|
||||
blocked.append(self._intent(scope, {"id": 0, "typeId": key}, 0, info.get("startStep") or {},
|
||||
"progression_loop_accept", "暂不接取:" + info.get("name", key), policy,
|
||||
path="taskService/taskLoopReceive", payload={"taskTypeId": key, "city": city}, phase=str(today),
|
||||
block_reason="委托后续战斗或条件当前无法自动完成"))
|
||||
continue
|
||||
action = self._intent(scope, {"id": 0, "typeId": key}, 0, info.get("startStep") or {},
|
||||
"progression_loop_accept", "接取城市委托:" + info.get("name", key), policy,
|
||||
path="taskService/taskLoopReceive", payload={"taskTypeId": key, "city": city}, phase=str(today))
|
||||
|
||||
Reference in New Issue
Block a user