From e548c68b97e49f4bb624cc28890a6cd9b5d14e95 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Tue, 20 Jul 2021 15:29:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=86=8C=E5=8D=95=E5=88=97=E6=9F=90?= =?UTF-8?q?=E4=B8=AA=E7=82=B9=E7=9A=84=E6=80=AA=E7=89=A9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/enemys.js | 35 ++++++++++++++++++++++++++--------- libs/ui.js | 13 ++++++++----- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/libs/enemys.js b/libs/enemys.js index 19c1d0e1..44d7983a 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -355,7 +355,7 @@ enemys.prototype.getCurrentEnemys = function (floorId) { core.extractBlocks(floorId); core.status.maps[floorId].blocks.forEach(function (block) { if (!block.disable && block.event.cls.indexOf('enemy') == 0) { - this._getCurrentEnemys_addEnemy(block.event.id, enemys, used, floorId); + this._getCurrentEnemys_addEnemy(block.event.id, enemys, used, block.x, block.y, floorId); } }, this); return this._getCurrentEnemys_sort(enemys); @@ -369,29 +369,46 @@ enemys.prototype._getCurrentEnemys_getEnemy = function (enemyId) { return core.material.enemys[enemy.displayIdInBook] || enemy; } -enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId, enemys, used, floorId) { +enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId, enemys, used, x, y, floorId) { var enemy = this._getCurrentEnemys_getEnemy(enemyId); - if (enemy == null || used[enemy.id]) return; + if (enemy == null) return; + + var id = enemy.id; var enemyInfo = this.getEnemyInfo(enemy, null, null, null, floorId); + var locEnemyInfo = this.getEnemyInfo(enemy, null, x, y, floorId); + + if (locEnemyInfo.atk == enemyInfo.atk && locEnemyInfo.def == enemyInfo.def && locEnemyInfo.hp == enemyInfo.hp) { + x = null; + y = null; + } else { + enemyInfo = locEnemyInfo; + } + var id = enemy.id + ":" + x + ":" + y; + if (used[id]) return; + used[id] = true; + var specialText = core.enemys.getSpecialText(enemy); var specialColor = core.enemys.getSpecialColor(enemy); - var critical = this.nextCriticals(enemy, 1, null, null, floorId); + var critical = this.nextCriticals(enemy, 1, x, y, floorId); if (critical.length > 0) critical = critical[0]; var e = core.clone(enemy); - for (var x in enemyInfo) { - e[x] = enemyInfo[x]; + for (var v in enemyInfo) { + e[v] = enemyInfo[v]; + } + if (x != null && y != null) { + e.x = x; + e.y = y; } e.specialText = specialText; e.specialColor = specialColor; - e.damage = this.getDamage(enemy, null, null, floorId); + e.damage = this.getDamage(enemy, x, y, floorId); e.critical = critical[0]; e.criticalDamage = critical[1]; - e.defDamage = this.getDefDamage(enemy, 1, null, null, floorId); + e.defDamage = this.getDefDamage(enemy, 1, x, y, floorId); enemys.push(e); - used[enemy.id] = true; } enemys.prototype._getCurrentEnemys_sort = function (enemys) { diff --git a/libs/ui.js b/libs/ui.js index 29eeca32..8f3db199 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -2250,7 +2250,7 @@ ui.prototype._drawBookDetail_getTexts = function (enemy, floorId, texts) { // --- 模仿临界计算器 this._drawBookDetail_mofang(enemy, texts); // --- 吸血怪最低生命值 - this._drawBookDetail_vampire(enemy, texts); + this._drawBookDetail_vampire(enemy, floorId, texts); // --- 仇恨伤害 this._drawBookDetail_hatred(enemy, texts); // --- 战斗回合数,临界表 @@ -2261,6 +2261,9 @@ 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 + ']'); + } ["hp", "atk", "def", "point", "money", "exp"].forEach(function (one) { if (enemy[one] == null || originEnemy[one] == null) return; if (enemy[one] != originEnemy[one]) { @@ -2314,7 +2317,7 @@ ui.prototype._drawBookDetail_mofang_getArray = function (hp) { return arr; } -ui.prototype._drawBookDetail_vampire = function (enemy, texts) { +ui.prototype._drawBookDetail_vampire = function (enemy, floorId, texts) { if (core.enemys.hasSpecial(enemy.special, 11)) { var damage = core.getDamage(enemy.id); if (damage != null) { @@ -2324,7 +2327,7 @@ ui.prototype._drawBookDetail_vampire = function (enemy, texts) { while (start