fix:clone

This commit is contained in:
ShakeFlower 2026-09-06 18:38:42 +08:00
parent 0a6d22b5d7
commit 84c9db94c0

View File

@ -197,15 +197,19 @@ enemys.prototype.getEnemyValue = function (enemy, name, x, y, floorId) {
enemy = core.material.enemys[enemy];
if (enemy == null) return null;
}
enemy = clone(enemy);
if (!core.isset(name)) { // 仅name不填时返回该enemy的完整数据,有x,y将用该点信息覆盖core.material.enemys相应属性
enemy = clone(enemy);
for (let status in pointInfo) {
if (pointInfo.hasOwnProperty(status)) enemy[status] = pointInfo[status];
}
return enemy;
}
else return enemy[name];
const value = enemy[name];
if (typeof value === "number" || typeof value === "string" ||
typeof value === "boolean"
) return value;
return clone(value);
}
////// 能否获胜 //////