proper combiner preview check, clear skill info on anim start

This commit is contained in:
Mashy 2019-10-20 12:57:56 +10:00
parent c111cfe2b8
commit 53725e1522
2 changed files with 8 additions and 1 deletions

View File

@ -344,7 +344,13 @@ function Vbox(args) {
} else { } else {
// Since theres 3 items in combiner and you can't have invalid combos we can preview it // Since theres 3 items in combiner and you can't have invalid combos we can preview it
const combinerItems = combiner.map(j => vbox.bound[j]); const combinerItems = combiner.map(j => vbox.bound[j]);
const comboItemObj = itemInfo.combos.find(combo => combinerItems.every(c => combo.components.includes(c))); const combinerCount = countBy(combinerItems, co => co);
const comboItemObj = itemInfo.combos.find(combo => combinerItems.every(c => {
if (!combo.components.includes(c)) return false;
const comboCount = countBy(combo.components, co => co);
if (combinerCount[c] > comboCount[c]) return false;
return true;
}));
comboItem = comboItemObj ? comboItemObj.item : 'refine'; comboItem = comboItemObj ? comboItemObj.item : 'refine';
text = `Combine - ${comboItem}`; text = `Combine - ${comboItem}`;
} }

View File

@ -61,6 +61,7 @@ function registerEvents(store) {
if (game && currentGame) { if (game && currentGame) {
if (game.resolved.length !== currentGame.resolved.length) { if (game.resolved.length !== currentGame.resolved.length) {
store.dispatch(actions.setAnimating(true)); store.dispatch(actions.setAnimating(true));
store.dispatch(actions.setGameSkillInfo(null));
// stop fetching the game state til animations are done // stop fetching the game state til animations are done
const newRes = game.resolved.slice(currentGame.resolved.length); const newRes = game.resolved.slice(currentGame.resolved.length);