From a5897b9c892352a47763a438b47cd86514751253 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Fri, 30 Jul 2021 16:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=A4=9A=E4=B8=AA=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E6=80=AA=E7=89=A9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/enemys.js | 12 ++++++++++-- libs/events.js | 1 - libs/ui.js | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libs/enemys.js b/libs/enemys.js index 39d9b5b9..46a1d93f 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -383,6 +383,15 @@ enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId, enemys, used, x x = null; y = null; } else { + // 检查enemys里面是否使用了存在的内容 + for (var i = 0; i < enemys.length; ++i) { + var one = enemys[i]; + if (id == one.id && one.locs != null && + locEnemyInfo.atk == one.atk && locEnemyInfo.def == one.def && locEnemyInfo.hp == one.hp) { + one.locs.push([x, y]); + return; + } + } enemyInfo = locEnemyInfo; } var id = enemy.id + ":" + x + ":" + y; @@ -400,8 +409,7 @@ enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId, enemys, used, x e[v] = enemyInfo[v]; } if (x != null && y != null) { - e.x = x; - e.y = y; + e.locs = [[x, y]]; } ["name", "money", "exp", "point"].forEach(function (one) { e[one] = core.getEnemyValue(enemy, one, x, y, floorId); diff --git a/libs/events.js b/libs/events.js index 9f1a9be6..298215a2 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1488,7 +1488,6 @@ events.prototype._action_setViewport = function (data, x, y, prefix) { } else { data.loc = this.__action_getLoc(data.loc, x, y, prefix); } - console.log(data.loc); this.__action_doAsyncFunc(data.async, core.moveViewport, data.loc[0], data.loc[1], data.moveMode, data.time); } diff --git a/libs/ui.js b/libs/ui.js index 804342a1..6e386e6e 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -2289,8 +2289,8 @@ ui.prototype._drawBookDetail_origin = function (enemy, texts) { // 怪物数值和原始值不一样时,在详细信息页显示原始数值 var originEnemy = core.enemys._getCurrentEnemys_getEnemy(enemy.id); var content = []; - if (enemy.x != null && enemy.y != null) { - texts.push("\r[#FF6A6A]\\d怪物坐标:\\d\r[][" + enemy.x + ", " + enemy.y + ']'); + if (enemy.locs != null && enemy.locs.length >= 0) { + texts.push("\r[#FF6A6A]\\d怪物坐标:\\d\r[]" + JSON.stringify(enemy.locs)); } ["hp", "atk", "def", "point", "money", "exp"].forEach(function (one) { if (enemy[one] == null || originEnemy[one] == null) return;