greatly simplify recipes
This commit is contained in:
parent
fe04c0d2db
commit
c22c09a87b
@ -162,30 +162,11 @@ function InfoComponent(args) {
|
||||
|
||||
function Combos() {
|
||||
if (!player) return false;
|
||||
|
||||
// show recipe for what's in combiner
|
||||
if (combiner.some(u => u !== null)) {
|
||||
const filteredCombos = itemInfo.combos
|
||||
.filter(combo => combiner.every(u => u === null
|
||||
|| combo.components.includes(player.vbox.bound[u])));
|
||||
if (filteredCombos.length > 6) return false;
|
||||
return (
|
||||
<table>
|
||||
<tbody>
|
||||
{filteredCombos.map((c, i) =>
|
||||
<tr key={i} >
|
||||
<td class="highlight" >{convertItem(c.item)}</td>
|
||||
{c.components.map((u, j) => <td key={j}>{convertItem(u)}</td>)}
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
if (!info) return false;
|
||||
|
||||
const vboxCombos = itemInfo.combos.filter(c => c.components.includes(info));
|
||||
if (vboxCombos.length > 6) return false;
|
||||
|
||||
return (
|
||||
<table class="combos">
|
||||
<tbody>
|
||||
|
||||
@ -14,7 +14,6 @@ const addState = connect(
|
||||
player,
|
||||
combiner,
|
||||
reclaiming,
|
||||
vboxHighlight,
|
||||
vboxSelected,
|
||||
itemInfo,
|
||||
itemUnequip,
|
||||
@ -49,7 +48,6 @@ const addState = connect(
|
||||
sendVboxCombine,
|
||||
sendVboxDiscard,
|
||||
sendVboxReclaim,
|
||||
vboxHighlight,
|
||||
vboxSelected,
|
||||
itemInfo,
|
||||
itemUnequip,
|
||||
@ -70,10 +68,6 @@ const addState = connect(
|
||||
return dispatch(actions.setInfo(item));
|
||||
}
|
||||
|
||||
function setVboxHighlight(v) {
|
||||
return dispatch(actions.setVboxHighlight(v));
|
||||
}
|
||||
|
||||
function setVboxSelected(v) {
|
||||
return dispatch(actions.setVboxSelected(v));
|
||||
}
|
||||
@ -86,7 +80,6 @@ const addState = connect(
|
||||
setCombiner,
|
||||
setReclaiming,
|
||||
setInfo,
|
||||
setVboxHighlight,
|
||||
setVboxSelected,
|
||||
setItemEquip,
|
||||
};
|
||||
@ -105,7 +98,6 @@ function Vbox(args) {
|
||||
sendVboxCombine,
|
||||
sendVboxDiscard,
|
||||
sendVboxReclaim,
|
||||
// vboxHighlight,
|
||||
|
||||
setCombiner,
|
||||
setInfo,
|
||||
@ -118,19 +110,12 @@ function Vbox(args) {
|
||||
sendItemUnequip,
|
||||
|
||||
setReclaiming,
|
||||
setVboxHighlight,
|
||||
} = args;
|
||||
|
||||
if (!player) return false;
|
||||
const { vbox } = player;
|
||||
const vboxSelecting = vboxSelected.length;
|
||||
|
||||
// function setHighlight(type) {
|
||||
// if (type === 'skill') return setVboxHighlight(itemInfo.items.filter(v => v.skill).map(v => v.item));
|
||||
// if (type === 'spec') return setVboxHighlight(itemInfo.items.filter(v => v.spec).map(v => v.item));
|
||||
// return false;
|
||||
// }
|
||||
|
||||
function combinerChange(newCombiner) {
|
||||
setCombiner(newCombiner);
|
||||
|
||||
@ -140,20 +125,7 @@ function Vbox(args) {
|
||||
setItemEquip(null);
|
||||
}
|
||||
|
||||
if (newCombiner.every(c => c === null)) return setVboxHighlight([]);
|
||||
|
||||
const combinerValues = newCombiner.map(cv => player.vbox.bound[cv]).filter(cv => cv);
|
||||
|
||||
const filteredCombos = itemInfo.combos
|
||||
.filter(combo => combinerValues.every(u => combo.components.includes(u)));
|
||||
|
||||
const comboValues = itemInfo.items.filter(v => {
|
||||
if (!filteredCombos.some(c => c.components.includes(v.item))) return false;
|
||||
if (!['Red', 'Green', 'Blue'].includes(v.item) && combinerValues.includes(v.item)) return false;
|
||||
return true;
|
||||
});
|
||||
|
||||
return setVboxHighlight(comboValues.map(v => v.item));
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@ -50,7 +50,6 @@ module.exports = {
|
||||
teamPage: createReducer(0, 'SET_TEAM_PAGE'),
|
||||
teamSelect: createReducer([null, null, null], 'SET_TEAM_SELECT'),
|
||||
|
||||
vboxHighlight: createReducer([], 'SET_VBOX_HIGHLIGHT'),
|
||||
vboxSelected: createReducer([], 'SET_VBOX_SELECTED'),
|
||||
|
||||
ws: createReducer(null, 'SET_WS'),
|
||||
|
||||
@ -1765,9 +1765,11 @@ fn purge(source: &mut Construct, target: &mut Construct, mut results: Resolution
|
||||
}
|
||||
}
|
||||
|
||||
if turns > 1 {
|
||||
let mut effect = skill.effect()[0];
|
||||
effect.duration = effect.duration * turns;
|
||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, effect)).stages(EventStages::PostOnly));
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user