fix:血瓶宝石显示更改

This commit is contained in:
lizhuoyuan 2025-04-18 15:57:40 +08:00
parent d4400325ff
commit 2ebec941ea
2 changed files with 31 additions and 27 deletions

View File

@ -32,11 +32,8 @@ items.prototype.getItemEffectValue = function (itemId, ratio) {
const itemEffectEvent = core.material.items[itemId].itemEffectEvent;
if (!itemEffectEvent) return effectObj;
const value = itemEffectEvent.value;
if (!ratio && ratio !== 0) {
ratio = core.status.thisMap.ratio;
if (!ratio && ratio !== 0) {
ratio = 1;
}
if (ratio == null) {
ratio = (core.status.thisMap?.ratio) ?? 1;
}
for (let statusName in value) {
let statusValue, needRatio;

View File

@ -1793,30 +1793,37 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
diff = {};
const id = block.event.id;
const item = core.material.items[id];
if (item.cls === 'items' && item.hasOwnProperty('itemEffectEvent') && item.itemEffectEvent.hasOwnProperty('value')) {
const values = item.itemEffectEvent.value;
for (let statusName in values) {
const getStatusValue = values[statusName];
let ratio, needRatio, statusValue;
if (statusName.endsWith(':o')) {
needRatio = true;
statusName = statusName.slice(0, -2);
}
ratio = getRatio();
if (core.status.hero.hasOwnProperty(statusName)) {
if (!diff.hasOwnProperty(statusName)) {
diff[statusName] = 0;
}
try {
statusValue = eval(getStatusValue);
} catch (error) {
console.log(error);
}
if (needRatio) statusValue *= ratio;
diff[statusName] += statusValue || 0;
}
if (item.cls === 'items'){
const ratio = getRatio();
const effectObj = core.getItemEffectValue(item.id, ratio);
for (let statusName in effectObj) {
diff[statusName] = statusValue || 0;
}
}
// if (item.cls === 'items' && item.hasOwnProperty('itemEffectEvent') && item.itemEffectEvent.hasOwnProperty('value')) {
// const values = item.itemEffectEvent.value;
// for (let statusName in values) {
// const getStatusValue = values[statusName];
// let ratio, needRatio, statusValue;
// if (statusName.endsWith(':o')) {
// needRatio = true;
// statusName = statusName.slice(0, -2);
// }
// ratio = getRatio();
// if (core.status.hero.hasOwnProperty(statusName)) {
// if (!diff.hasOwnProperty(statusName)) {
// diff[statusName] = 0;
// }
// try {
// statusValue = eval(getStatusValue);
// } catch (error) {
// console.log(error);
// }
// if (needRatio) statusValue *= ratio;
// diff[statusName] += statusValue || 0;
// }
// }
// }
if (item.cls === 'equips') {
// 装备也显示
const diff = item.equip.value ?? {};