fix action bugs

This commit is contained in:
bridge
2025-10-04 21:36:23 +08:00
parent 9b0be5b4c2
commit 34234c10a8
3 changed files with 6 additions and 3 deletions

View File

@@ -3,6 +3,9 @@ from __future__ import annotations
import json
from src.classes.action.registry import ActionRegistry
# 确保在收集注册表前加载所有动作模块(含 mutual actions
import src.classes.action # noqa: F401
import src.classes.mutual_action # noqa: F401
ALL_ACTION_CLASSES = list(ActionRegistry.all())
@@ -16,7 +19,7 @@ ACTION_INFOS = {
"doable_requirements": getattr(action, "DOABLES_REQUIREMENTS", ""),
"params": getattr(action, "PARAMS", {}),
}
for action in ALL_ACTUAL_ACTION_CLASSES
for action in ALL_ACTION_CLASSES
}
ACTION_INFOS_STR = json.dumps(ACTION_INFOS, ensure_ascii=False)

View File

@@ -145,7 +145,7 @@ class MutualAction(DefineAction, LLMAction, TargetingMixin):
if target is None:
return False
distance = get_avatar_distance(self.avatar, target)
return distance <= 2
return distance <= 3
def start(self, target_avatar: "Avatar|str") -> Event:
"""