|
@@ -0,0 +1,36 @@
|
|
|
|
|
+"""T3 — 任务指引→天然洞穴寻图杀怪 20(驻留洞穴, 不点任务跳转)。"""
|
|
|
|
|
+from __future__ import annotations
|
|
|
|
|
+
|
|
|
|
|
+import sys
|
|
|
|
|
+from pathlib import Path
|
|
|
|
|
+
|
|
|
|
|
+from pipeline.ctx import PipelineContext, TaskResult
|
|
|
|
|
+
|
|
|
|
|
+TASK_TITLE = "T3 天然洞穴杀怪20"
|
|
|
|
|
+
|
|
|
|
|
+KILL_TARGET = 20
|
|
|
|
|
+CAVE_MAP = "天然洞穴一层"
|
|
|
|
|
+_SCRIPTS = str(Path(__file__).resolve().parents[2] / "scripts")
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def run_task(ctx: PipelineContext) -> TaskResult:
|
|
|
|
|
+ """进洞驻留杀怪; 达标且终图在洞穴才算成功。"""
|
|
|
|
|
+ if _SCRIPTS not in sys.path:
|
|
|
|
|
+ sys.path.insert(0, _SCRIPTS)
|
|
|
|
|
+ from run_juece13_cave30_v2 import CaveStayKillBehavior
|
|
|
|
|
+
|
|
|
|
|
+ from pbot.bot.runner import run
|
|
|
|
|
+
|
|
|
|
|
+ baseline = ctx.world.kills
|
|
|
|
|
+ goal = baseline + KILL_TARGET
|
|
|
|
|
+ bh = CaveStayKillBehavior(sid=ctx.sid, kill_target=goal,
|
|
|
|
|
+ renwu_act="renwu_mov,2", allow_reroll=True)
|
|
|
|
|
+ result = run(ctx.conn, ctx.world, ctx.updater, bh,
|
|
|
|
|
+ duration_s=max(1500.0, KILL_TARGET * 75.0))
|
|
|
|
|
+ killed = ctx.world.kills - baseline
|
|
|
|
|
+ ok = killed >= KILL_TARGET and ctx.world.me.map_name == CAVE_MAP
|
|
|
|
|
+ ctx.log.info("[T3] result=%s 击杀=%d/%d map=%s", result.value, killed,
|
|
|
|
|
+ KILL_TARGET, ctx.world.me.map_name)
|
|
|
|
|
+ if ok:
|
|
|
|
|
+ return TaskResult.done(f"洞穴击杀 {killed}/{KILL_TARGET}")
|
|
|
|
|
+ return TaskResult.fail(f"{killed}/{KILL_TARGET} map={ctx.world.me.map_name}")
|