fix: 数据统计适配itemEffectEvent
This commit is contained in:
parent
177d9c8407
commit
83a266ee83
21
libs/ui.js
21
libs/ui.js
@ -3306,6 +3306,27 @@ ui.prototype._drawStatistics_items = function (floorId, floor, id, obj) {
|
||||
core.setFlag("__statistics__", true);
|
||||
var ratio = core.status.thisMap.ratio;
|
||||
core.status.thisMap.ratio = core.clone(core.status.maps[floorId].ratio);
|
||||
const itemInfo = core.material.items[id];
|
||||
if (itemInfo.hasOwnProperty('itemEffectEvent') && itemInfo.itemEffectEvent.hasOwnProperty('value')) {
|
||||
const values = itemInfo.itemEffectEvent.value;
|
||||
for (let statusName in values) {
|
||||
const getStatusValue = values[statusName];
|
||||
let needRatio, statusValue;
|
||||
if (statusName.endsWith(':o')) {
|
||||
needRatio = true;
|
||||
statusName = statusName.slice(0, -2);
|
||||
}
|
||||
if (core.status.hero.hasOwnProperty(statusName)) {
|
||||
try {
|
||||
statusValue = eval(getStatusValue);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
if (needRatio) statusValue *= ratio;
|
||||
core.addStatus(statusName, statusValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
try { eval(core.material.items[id].itemEffect); }
|
||||
catch (e) { }
|
||||
core.status.thisMap.ratio = ratio;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user