From b2fcc0572357285954e59460caaad994d8ae52f7 Mon Sep 17 00:00:00 2001 From: ShakeFlower Date: Fri, 14 Feb 2025 09:41:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=87=AA=E5=8A=A8=E6=8B=BE=E5=8F=96?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=A9=BF=E8=BF=87=E6=BB=91=E5=86=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/maps.js | 2 +- project/floors/MT0.js | 18 +++++++++++++----- project/plugins.js | 12 ++++++++---- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/libs/maps.js b/libs/maps.js index 0544557c..bb329df6 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -675,7 +675,7 @@ maps.prototype.getFgMapArray = function (floorId) { maps.prototype._getBgFgNumber = function (name, x, y, floorId) { if (x == null) x = core.getHeroLoc('x'); if (y == null) y = core.getHeroLoc('y'); - return this._getBgFgMapArray(name, floorId)[x][y]; + return this._getBgFgMapArray(name, floorId)[y][x]; } maps.prototype.getBgNumber = function (x, y, floorId) { diff --git a/project/floors/MT0.js b/project/floors/MT0.js index 3296b8cb..13584027 100644 --- a/project/floors/MT0.js +++ b/project/floors/MT0.js @@ -14,11 +14,11 @@ main.floors.MT0= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0,201, 0, 0,201, 0, 0, 0], + [ 0, 0, 1, 0, 0, 0,201, 0, 0,201, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0,203, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0], + [ 0, 1, 0, 0, 0, 0, 0, 0,203, 0, 0, 0, 0], + [ 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0,201,202, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -48,6 +48,14 @@ main.floors.MT0= "type": "comment", "text": "unlockControl" } + ], + "3,8": [ + { + "type": "moveHero", + "steps": [ + "up:8" + ] + } ] }, "changeFloor": {}, @@ -61,8 +69,8 @@ main.floors.MT0= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [167,167,167,167,167,167,167,167,167,167,167,167,167], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0, 0,167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0, 0,167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], diff --git a/project/plugins.js b/project/plugins.js index af1123fe..aeb45c9f 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -2002,7 +2002,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = const changeFloor = floor.changeFloor[loc]; const isEnemy = autoBattle && cls.startsWith('enemy'), isItem = autoGet && cls === 'items'; - if (core.onSki(core.getBgNumber(x, y))) return false; + if (has(changeFloor)) { if (!core.noPass(tx, ty, floorId) && !core.canMoveHero(nx, ny, dir)) { return false; @@ -2078,6 +2078,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = const ambush = checkblockInfo.ambush[loc]; const repulse = checkblockInfo.repulse[loc]; const chase = checkblockInfo.chase[loc]; + return (has(damage) && damage > 0) || has(ambush) || has(repulse) || has(chase); } @@ -2088,6 +2089,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = function bfs(floorId, deep = Infinity) { core.extractBlocks(floorId); const objs = core.getMapBlocksObj(floorId); + const bgMap = core.getBgMapArray(floorId); const { x, y } = core.status.hero.loc; /** @type {[direction, number, number][]} */ const dir = Object.entries(core.utils.scan).map(v => [v[0], v[1].x, v[1].y]); @@ -2112,6 +2114,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } const loc = `${tx},${ty}`; if (mapped[loc]) return; + if (core.onSki(bgMap[ty][tx])) return; // 寻路不允许穿过滑冰 const block = objs[loc]; mapped[loc] = true; const type = judge(block, nx, ny, tx, ty, v[0], floorId, autoBattle, autoGet); @@ -2166,16 +2169,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } function auto() { + if (!core.status.floorId || !core.status.checkBlock.damage) return; // 这两个条件不知道什么情形下会出现 + if (core.status.event.id == 'action' || core.events.onSki() || core.status.lockControl) return; // 在冰上不允许触发自动清怪 const before = flags.__forbidSave__; - // 如果勇士当前点有地图伤害,只清周围,如果有事件,直接不清了 const { x, y } = core.status.hero.loc; const floor = core.floors[core.status.floorId]; const loc = `${x},${y}`; const hasEvent = has(floor.events[loc]); - if (hasEvent) return; + if (hasEvent) return; // 如果有事件,直接不清了 let deep = Infinity; if (hasBlockDamage(loc)) { - deep = core.flags.enableGentleClick ? 1 : 0; // 有地图伤害允许轻点附近1格 + deep = core.flags.enableGentleClick ? 1 : 0; // 角色站的位置有地图伤害时,仍然允许轻点附近1格 } flags.__forbidSave__ = true; flags.__statistics__ = true;