|
|
@@ -125,7 +125,10 @@ class MineEnterBehavior(KillBehavior):
|
|
|
|
|
|
def _tick_tp_goto_slip(self, conn: GatewayConnection,
|
|
|
world: WorldMirror) -> TickResult:
|
|
|
- """1 格步进走向传送员(342,338); 撞墙顺/逆 45° 滑行; 到达转 tp_dialog。"""
|
|
|
+ """跑步(2格/0.7s)走向传送员(342,338); 撞墙滑行; 到达转 tp_dialog.
|
|
|
+
|
|
|
+ 距目标 >4 格用 3013 跑; ≤4 格降回 3011 走(防冲过判定圈)。
|
|
|
+ """
|
|
|
from pbot.bot.wander import DIRS as WDIRS
|
|
|
from pbot.bot.kill import TELEPORTER_POS, TELEPORTER_AID
|
|
|
me = world.me
|
|
|
@@ -141,7 +144,10 @@ class MineEnterBehavior(KillBehavior):
|
|
|
if now - self._pending_rej_t < 0.9:
|
|
|
return TickResult.RUNNING
|
|
|
self._pending_rej = False
|
|
|
- if now - self._last_step_t < 0.9:
|
|
|
+ dist = max(abs(tx - me.x), abs(ty - me.y))
|
|
|
+ use_run = dist > 4
|
|
|
+ step_t = 0.7 if use_run else 0.9
|
|
|
+ if now - self._last_step_t < step_t:
|
|
|
return TickResult.RUNNING
|
|
|
# 事件消费: SC1 确认清滑行锁; 仅 pull_back=真弹回才触发滑行
|
|
|
# (anchor_echo 是锚点申报回显=位置确认, 非拒绝)
|
|
|
@@ -164,15 +170,18 @@ class MineEnterBehavior(KillBehavior):
|
|
|
_LOG.info("[盟重·滑行] want=%d blocked → dir=%d", want, d)
|
|
|
self._slip_blocked = False
|
|
|
dx, dy = WDIRS[d]
|
|
|
- fx, fy = me.x + dx, me.y + dy
|
|
|
+ stride = 2 if use_run else 1
|
|
|
+ fx, fy = me.x + dx * stride, me.y + dy * stride
|
|
|
from pbot.game.messages import protocol_map_name
|
|
|
mn = protocol_map_name(me.map_id, me.map_name)
|
|
|
- _ = conn.send_frame(3011, 0, d, (me.y << 16) | me.x, self._sid,
|
|
|
+ _ = conn.send_frame(3013 if use_run else 3011, 0, d,
|
|
|
+ (me.y << 16) | me.x, self._sid,
|
|
|
mn.encode(), pre=(fy << 16) | fx)
|
|
|
self._last_step_t = time.time()
|
|
|
self._pending_rej = True
|
|
|
self._pending_rej_t = self._last_step_t
|
|
|
- _LOG.info("[盟重·走] (%d,%d) dir=%d → (%d,%d)", me.x, me.y, d, fx, fy)
|
|
|
+ _LOG.info("[盟重·%s] (%d,%d) dir=%d → (%d,%d)",
|
|
|
+ "跑" if use_run else "走", me.x, me.y, d, fx, fy)
|
|
|
return TickResult.RUNNING
|
|
|
|
|
|
def _dir8(self, x: int, y: int, tx: int, ty: int) -> int:
|