commit
e490529baf
@ -373,14 +373,18 @@ enemys.prototype._getCurrentEnemys_sort = function (enemys) {
|
||||
|
||||
enemys.prototype.hasEnemyLeft = function (enemyId, floorId) {
|
||||
if (floorId == null) floorId = core.status.floorId;
|
||||
if (floorId instanceof Array) {
|
||||
for (var i = 0; i < floorId.length; ++i) {
|
||||
if (core.hasEnemyLeft(enemyId, floorId[i]))
|
||||
return true;
|
||||
if (!(floorId instanceof Array)) floorId = [floorId];
|
||||
var enemyMap = {};
|
||||
if (enemyId instanceof Array) enemyId.forEach(function(v) { enemyMap[v] = true;});
|
||||
else if (enemyId) enemyMap[enemyId] = true;
|
||||
else enemyMap = null;
|
||||
for (var i = 0; i < floorId.length; i++) {
|
||||
var mapBlocks = core.status.maps[floorId[i]].blocks;
|
||||
for (var b = 0; b < mapBlocks.length; b++) {
|
||||
if (!mapBlocks[b].disable && mapBlocks[b].event.cls.indexOf('enemy') === 0) {
|
||||
if (enemyMap === null || enemyMap[mapBlocks[b].event.id]) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return core.getCurrentEnemys(floorId).filter(function (enemy) {
|
||||
return enemyId == null || enemy.id == enemyId;
|
||||
}).length > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user