vbox demo generate random skill combos, disable part of broken curse anim
This commit is contained in:
parent
0c3cd46ce2
commit
188ae0de6a
@ -43,7 +43,7 @@ function Demo(args) {
|
||||
|
||||
if (!demo || !itemInfo.items.length || account) return false;
|
||||
|
||||
const { combiner, items, equipping, equipped, players } = demo;
|
||||
const { combiner, items, equipping, equipped, players, combo } = demo;
|
||||
|
||||
const vboxDemo = () => {
|
||||
function inventoryBtn(i, j) {
|
||||
@ -90,7 +90,7 @@ function Demo(args) {
|
||||
VBOX PHASE {shapes.Red()} {shapes.Green()} {shapes.Blue()}
|
||||
</h2>
|
||||
<p>
|
||||
Combine the colour base items with skills and specialisations to build an array of powerful variants.
|
||||
Combine colours with base skills and specialisations to build an array of powerful variants.
|
||||
</p>
|
||||
</div>
|
||||
<div> </div>
|
||||
@ -122,7 +122,7 @@ function Demo(args) {
|
||||
<ConstructAvatar construct={c} />
|
||||
<div class="skills">
|
||||
{equipped
|
||||
? <button>Strike</button>
|
||||
? <button>{combo}</button>
|
||||
: <button disabled={!equipping} class={btnClass}>SKILL</button>
|
||||
}
|
||||
<button disabled={!equipping} class={btnClass}>SKILL</button>
|
||||
|
||||
@ -234,39 +234,42 @@ function registerEvents(store) {
|
||||
|
||||
function setDemo(d) {
|
||||
|
||||
const initial = {
|
||||
const vboxDemo = {
|
||||
players: d,
|
||||
combiner: [],
|
||||
items: ['Red', 'Red', 'Attack'],
|
||||
equipped: false,
|
||||
equipping: false,
|
||||
};
|
||||
|
||||
const startDemo = () => {
|
||||
const { account } = store.getState();
|
||||
const { account, itemInfo } = store.getState();
|
||||
if (account) return false;
|
||||
store.dispatch(actions.setDemo(initial));
|
||||
if (!itemInfo || itemInfo.items.length === 0) return setTimeout(startDemo, 500);
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0] }))), 500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0, 1] }))), 1000);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0, 1, 2] }))), 1500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [], items: ['Strike', '', ''] }))), 2500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0], items: ['Strike', '', ''], equipping: true }))), 3500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [], items: ['', '', ''], equipped: true, equipping: false }))), 4250);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { items: ['', '', ''], equipped: true, equipping: false }))), 4250);
|
||||
const bases = ['Attack', 'Stun', 'Buff', 'Debuff', 'Block'];
|
||||
const combo = sample(itemInfo.combos.filter(i => bases.some(b => i.components.includes(b))));
|
||||
vboxDemo.combo = combo.item;
|
||||
vboxDemo.items = combo.components;
|
||||
store.dispatch(actions.setDemo(vboxDemo));
|
||||
|
||||
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, vboxDemo, { combiner: [0] }))), 500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, vboxDemo, { combiner: [0, 1] }))), 1000);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, vboxDemo, { combiner: [0, 1, 2] }))), 1500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, vboxDemo, { combiner: [], items: [vboxDemo.combo, '', ''] }))), 2500);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, vboxDemo, { combiner: [0], items: [vboxDemo.combo, '', ''], equipping: true }))), 3000);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, vboxDemo, { combiner: [], items: ['', '', ''], equipped: true, equipping: false }))), 4000);
|
||||
|
||||
setTimeout(() => {
|
||||
const { itemInfo } = store.getState();
|
||||
return store.dispatch(actions.setAnimTarget({
|
||||
skill: sample(itemInfo.items.filter(i => i.skill)).item,
|
||||
constructId: d[1].constructs[0].id,
|
||||
player: false,
|
||||
direction: 0,
|
||||
}));
|
||||
}, 1000);
|
||||
}, 500);
|
||||
|
||||
setTimeout(() => {
|
||||
const { itemInfo } = store.getState();
|
||||
return store.dispatch(actions.setAnimTarget({
|
||||
skill: sample(itemInfo.items.filter(i => i.skill)).item,
|
||||
constructId: d[1].constructs[1].id,
|
||||
@ -275,7 +278,7 @@ function registerEvents(store) {
|
||||
}));
|
||||
}, 3000);
|
||||
|
||||
setTimeout(startDemo, 6000);
|
||||
return setTimeout(startDemo, 5000);
|
||||
};
|
||||
|
||||
startDemo();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user