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