fix:血瓶宝石显示更改
This commit is contained in:
parent
d4400325ff
commit
2ebec941ea
@ -32,11 +32,8 @@ items.prototype.getItemEffectValue = function (itemId, ratio) {
|
|||||||
const itemEffectEvent = core.material.items[itemId].itemEffectEvent;
|
const itemEffectEvent = core.material.items[itemId].itemEffectEvent;
|
||||||
if (!itemEffectEvent) return effectObj;
|
if (!itemEffectEvent) return effectObj;
|
||||||
const value = itemEffectEvent.value;
|
const value = itemEffectEvent.value;
|
||||||
if (!ratio && ratio !== 0) {
|
if (ratio == null) {
|
||||||
ratio = core.status.thisMap.ratio;
|
ratio = (core.status.thisMap?.ratio) ?? 1;
|
||||||
if (!ratio && ratio !== 0) {
|
|
||||||
ratio = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (let statusName in value) {
|
for (let statusName in value) {
|
||||||
let statusValue, needRatio;
|
let statusValue, needRatio;
|
||||||
|
|||||||
@ -1793,30 +1793,37 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
diff = {};
|
diff = {};
|
||||||
const id = block.event.id;
|
const id = block.event.id;
|
||||||
const item = core.material.items[id];
|
const item = core.material.items[id];
|
||||||
if (item.cls === 'items' && item.hasOwnProperty('itemEffectEvent') && item.itemEffectEvent.hasOwnProperty('value')) {
|
if (item.cls === 'items'){
|
||||||
const values = item.itemEffectEvent.value;
|
const ratio = getRatio();
|
||||||
for (let statusName in values) {
|
const effectObj = core.getItemEffectValue(item.id, ratio);
|
||||||
const getStatusValue = values[statusName];
|
for (let statusName in effectObj) {
|
||||||
let ratio, needRatio, statusValue;
|
diff[statusName] = statusValue || 0;
|
||||||
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' && 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') {
|
if (item.cls === 'equips') {
|
||||||
// 装备也显示
|
// 装备也显示
|
||||||
const diff = item.equip.value ?? {};
|
const diff = item.equip.value ?? {};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user