improve check
This commit is contained in:
parent
ea5d908893
commit
245cb603fc
@ -177,12 +177,13 @@ function Vbox(args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const combinerItems = combiner.map(j => vbox.bound[j]);
|
const combinerItems = combiner.map(j => vbox.bound[j]);
|
||||||
|
const combinerCount = countBy(combinerItems, co => co);
|
||||||
|
|
||||||
const comboHighlight = combinerItems.length > 0 && itemInfo.combos.some(combo => {
|
const comboHighlight = combinerItems.length > 0 && itemInfo.combos.some(combo => {
|
||||||
if (combo.components.includes(v)) {
|
if (combo.components.includes(v)) {
|
||||||
return combinerItems.every(c => {
|
return combinerItems.every(c => {
|
||||||
if (!combo.components.includes(c)) return false;
|
if (!combo.components.includes(c)) return false;
|
||||||
const comboCount = countBy(combo.components, co => co);
|
const comboCount = countBy(combo.components, co => co);
|
||||||
const combinerCount = countBy(combinerItems, co => co);
|
|
||||||
if (combinerCount[c] > comboCount[c]) return false;
|
if (combinerCount[c] > comboCount[c]) return false;
|
||||||
if (c === v && combinerCount[c] + 1 > comboCount[c]) return false;
|
if (c === v && combinerCount[c] + 1 > comboCount[c]) return false;
|
||||||
return true;
|
return true;
|
||||||
@ -264,12 +265,13 @@ function Vbox(args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const combinerItems = combiner.map(j => vbox.bound[j]);
|
const combinerItems = combiner.map(j => vbox.bound[j]);
|
||||||
|
const combinerCount = countBy(combinerItems, co => co);
|
||||||
|
|
||||||
const comboHighlight = combinerItems.length > 0 && itemInfo.combos.some(combo => {
|
const comboHighlight = combinerItems.length > 0 && itemInfo.combos.some(combo => {
|
||||||
if (combo.components.includes(v)) {
|
if (combo.components.includes(v)) {
|
||||||
return combinerItems.every(c => {
|
return combinerItems.every(c => {
|
||||||
if (!combo.components.includes(c)) return false;
|
if (!combo.components.includes(c)) return false;
|
||||||
const comboCount = countBy(combo.components, co => co);
|
const comboCount = countBy(combo.components, co => co);
|
||||||
const combinerCount = countBy(combinerItems, co => co);
|
|
||||||
if (combinerCount[c] > comboCount[c]) return false;
|
if (combinerCount[c] > comboCount[c]) return false;
|
||||||
if (c === v && combinerCount[c] + 1 > comboCount[c]) return false;
|
if (c === v && combinerCount[c] + 1 > comboCount[c]) return false;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user