Просмотр исходного кода

style: ruff ANN001 类型注解

wuzilong 1 месяц назад
Родитель
Сommit
decd6dcd05
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      pipeline_bot/pipeline/tasks/t02_biqi_kill20.py

+ 7 - 4
pipeline_bot/pipeline/tasks/t02_biqi_kill20.py

@@ -13,6 +13,8 @@ from typing import TYPE_CHECKING
 
 if TYPE_CHECKING:
     from pbot.world.actor import Npc
+    from pbot.world.mirror import WorldMirror
+    from run_juece13_wugong_autofight import AutoFightBehavior
 
 import json
 import re
@@ -32,7 +34,7 @@ _SPAWN_GAP_S = 8.0
 _SPAWN_TALK_DIST = 3
 
 
-def _find_spawn_npc(world) -> Npc | None:
+def _find_spawn_npc(world: "WorldMirror") -> "Npc | None":
     """视野内名字含'刷怪'的 NPC(KillBehavior._find_spawn_npc 同源)。"""
     for npc in world.npcs.values():
         if "刷怪" in npc.name:
@@ -40,7 +42,8 @@ def _find_spawn_npc(world) -> Npc | None:
     return None
 
 
-def _try_spawn(ctx: PipelineContext, af, last: dict) -> bool:
+def _try_spawn(ctx: PipelineContext, af: "AutoFightBehavior",
+               last: dict) -> bool:
     """无怪时点【点我刷怪】: True=已处理(本轮不必再漫游)。
 
     链路: 走到 NPC 旁 → CS1010 开对话 → 下一 tick 收到 SC643 后点确认
@@ -100,8 +103,8 @@ def _try_spawn(ctx: PipelineContext, af, last: dict) -> bool:
     return True
 
 
-def _spawn_on_land(ctx: PipelineContext, af, last: dict,
-                   tag: str = "") -> None:
+def _spawn_on_land(ctx: PipelineContext, af: "AutoFightBehavior",
+                   last: dict, tag: str = "") -> None:
     """落地即点一次【点我刷怪】: 走到 NPC → 开对话 → 点确认 → 立即返回。
 
     不论服务器报"已有怪物"还是其他错误都无碍 — 点完即继续正常杀怪