const { connect } = require('preact-redux'); const preact = require('preact'); const actions = require('../actions'); const shapes = require('./shapes'); const { ConstructAvatar } = require('./construct'); const { ConstructAnimation } = require('./animations'); const addState = connect( function receiveState(state) { const { account, itemInfo, demo, } = state; return { account, itemInfo, demo, }; }, function receiveDispatch(dispatch) { function setAnimTarget(anim) { dispatch(actions.setAnimTarget(anim)); } return { setAnimTarget }; } ); function Demo(args) { const { demo, itemInfo, account, setAnimTarget, } = args; if (!demo || !itemInfo.items.length || account) return false; const { combiner, items, equipping, equipped, players } = demo; const vboxDemo = () => { function inventoryBtn(i, j) { if (!i) return ; const highlighted = combiner.indexOf(j) > -1; const classes = `${highlighted ? 'highlight' : ''}`; if (shapes[i]) { return ; } return ; } function combinerBtn() { let text = ''; if (combiner.length < 3) { for (let i = 0; i < 3; i++) { if (combiner.length > i) { text += '■ '; } else { text += '▫ '; } } } else { text = 'combine'; } return ( ); } function inventoryElement() { return (

VBOX PHASE {shapes.Red()} {shapes.Green()} {shapes.Blue()}

Combine the colour base items with an array of skills and specialisations to build powerful variants.

 
{items.map((i, j) => inventoryBtn(i, j))}
{combinerBtn()}
); } return (
{inventoryElement()}
); }; const vboxConstructs = () => { const btnClass = equipping ? 'equipping empty gray' : 'empty gray'; return (
{players[0].constructs.map((c, i) => (

{c.name}

{i === 0 && equipped ? : }
))}
); }; const gameDemo = () => { return (

COMBAT PHASE

Battle your opponent using dynamic team builds from the VBOX phase.

Crafted skills can be used to damage the opponent or support your team.

Turn based combat, each team picks targets for their skills during this phase.

The damage dealt by skills, cast order and construct life depend on your decisions in the VBOX phase.

); }; return (
{vboxDemo()} {vboxConstructs()} {gameDemo()}
); } module.exports = addState(Demo);