Merge branch 'develop' of ssh://mnml.gg:40022/~/mnml into develop

This commit is contained in:
Mashy 2019-07-23 15:05:19 +10:00
commit d03eec1423
9 changed files with 254 additions and 159 deletions

View File

@ -173,96 +173,89 @@
border-left-width: 1px; border-left-width: 1px;
} }
.construct-list .name { .construct-list {
grid-area: name; .avatar {
margin-bottom: 0.5em;
}
.construct-list .avatar {
grid-area: avatar; grid-area: avatar;
object-fit: contain; object-fit: contain;
background-size: contain; background-size: contain;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
pointer-events: none; pointer-events: none;
} }
.construct-list .name { .name {
grid-area: name;
margin-bottom: 0.5em;
text-align: center; text-align: center;
} }
.construct-list .skills { .skills {
grid-area: skills; grid-area: skills;
display: flex; padding: 0 0.5em;
border-width: 0px; margin-bottom: 0.75em;
}
.construct-list .skills button { display: grid;
flex: 1; grid-template-columns: repeat(3, 1fr);
/*border: 1px solid #222;*/ grid-gap: 0 0.5em;
border: none;
}
.construct-list .specs { button {
margin-top: 1em; height: 3em;
}
}
.specs {
grid-area: specs; grid-area: specs;
display: flex; padding: 0 0.5em;
flex: 1;
justify-content: center;
border-width: 0px;
}
.construct-list .specs figure { display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 0 0.5em;
button {
padding: 0.25em 0;
}
figure {
flex: 1; flex: 1;
border: 0;
align-items: center; align-items: center;
text-align: center; text-align: center;
} }
.construct-list .specs figcaption { figcaption {
font-size: 75%; font-size: 75%;
} line-height: initial;
}
}
.construct-list .stats { .stats {
grid-area: stats; grid-area: stats;
display: flex; display: flex;
flex-flow: row; flex-flow: row;
flex: 1; flex: 1;
border-width: 0px; border-width: 0px;
text-align: center; text-align: center;
}
.construct-list .stats figcaption { figcaption {
font-size: 75%; font-size: 75%;
} }
.stats div:nth-child(4n) { // give speed some space
div:nth-child(4n) {
margin: 0 1em; margin: 0 1em;
} }
.stats div { div {
flex: 1; flex: 1;
} }
}
.construct-list .stats .damage-label { button {
grid-area: dl; margin: 0;
display: flex;
justify-content: center;
color: #666;
}
.construct-list .stats .speed-label { &.empty {
grid-area: sl; border-style: dashed;
display: flex; }
justify-content: center; }
color: #666;
}
.construct-list .stats .life-label {
grid-area: ll;
display: flex;
justify-content: center;
color: #666;
} }
/* Equipment */ /* Equipment */
@ -294,19 +287,6 @@
flex: 1 0 100%; flex: 1 0 100%;
} }
.equip .skills {
flex: 1;
border: 2px solid #222;
}
.equip .skills button {
color: whitesmoke;
font-size: 1em;
padding: 0.2em;
border-width: 0px;
margin-bottom: 0.5em;
}
.equipping { .equipping {
position: relative; position: relative;
} }
@ -349,11 +329,6 @@
} }
} }
.equip .specs figure {
border: 0;
text-align: center;
}
.equip-spec { .equip-spec {
position: relative; position: relative;
stroke: #333; stroke: #333;
@ -372,10 +347,6 @@
opacity: 0; opacity: 0;
} }
.equip .specs figcaption {
font-size: 75%;
}
.thresholds { .thresholds {
display: flex; display: flex;
flex-flow: column; flex-flow: column;

View File

@ -15,17 +15,17 @@
.vbox-colours { .vbox-colours {
display: grid; display: grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
grid-gap: 1em 2em; grid-gap: 0.5em 1em;
align-items: center; align-items: center;
margin-bottom: 1em; margin-bottom: 0.5em;
} }
.vbox-items { .vbox-items {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
grid-gap: 1em 2em; grid-gap: 0.5em 1em;
align-items: center; align-items: center;
margin-bottom: 1em; margin-bottom: 0.5em;
button { button {
width: 100%; width: 100%;
@ -38,6 +38,8 @@
background-color: @gray; background-color: @gray;
border-width: 0; border-width: 0;
height: 3em;
:active, :hover, :focus { :active, :hover, :focus {
color: white; color: white;
} }
@ -62,9 +64,11 @@
} }
button { button {
height: 3em; height: 4em;
margin: 0; margin: 0;
// text-transform: none;
&.empty { &.empty {
border-style: dashed; border-style: dashed;
} }
@ -73,10 +77,26 @@
color: black; color: black;
background: @white; background: @white;
border: 1px solid @white; border: 1px solid @white;
ellipse.white {
stroke: black;
}
} }
} }
svg { svg {
stroke: none; stroke: none;
} }
// figures don't scale well
figure {
svg {
height: 2em;
stroke-width: 8px;
}
figcaption {
line-height: initial;
}
}
} }

View File

@ -1,6 +1,6 @@
require('./assets/styles/styles.css'); require('./assets/styles/styles.css');
require('./assets/styles/styles.mobile.css'); require('./assets/styles/styles.mobile.css');
require('./assets/styles/instance.css'); require('./assets/styles/instance.less');
require('./assets/styles/vbox.less'); require('./assets/styles/vbox.less');
require('./assets/styles/instance.mobile.css'); require('./assets/styles/instance.mobile.css');
require('./assets/styles/game.css'); require('./assets/styles/game.css');

View File

@ -124,12 +124,12 @@ function Construct(props) {
} }
// const action = skill ? '' : 'action'; // const action = skill ? '' : 'action';
const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equipping' : ''; const equipping = skillList.includes(vbox.bound[itemEquip]) && !skill;
const classes = `${equip}`; const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''}`;
return ( return (
<button <button
key={i} key={i}
disabled={!skill && itemEquip === null} disabled={!skill && !equipping}
class={classes} class={classes}
onClick={skillClick} onClick={skillClick}
onDblClick={skillDblClick} onDblClick={skillDblClick}
@ -143,12 +143,12 @@ function Construct(props) {
const s = construct.specs[i]; const s = construct.specs[i];
if (!s) { if (!s) {
const equip = specList.includes(vbox.bound[itemEquip]) ? 'equip-spec' : 'gray'; const equipping = specList.includes(vbox.bound[itemEquip]);
const classes = `${equipping ? 'equip-spec' : 'gray'} empty`;
return ( return (
<figure key={i} class={equip} > <button key={i} class={classes} disabled={!equipping} >
{shapes.diamond(equip)} {shapes.None()}
<figcaption>&nbsp;</figcaption> </button>
</figure>
); );
} }
@ -171,14 +171,13 @@ function Construct(props) {
return ( return (
<figure <button
key={i} key={i}
onClick={specClick} onClick={specClick}
onDblClick={specDblClick} onDblClick={specDblClick}
onMouseOver={e => hoverInfo(e, s)} > onMouseOver={e => hoverInfo(e, s)} >
{shapes[s]()} {shapes[s]()}
<figcaption>{s}</figcaption> </button>
</figure>
); );
}); });

View File

@ -1,15 +1,9 @@
const { connect } = require('preact-redux'); const { connect } = require('preact-redux');
const preact = require('preact'); const preact = require('preact');
const { Fragment } = require('preact');
const { postData } = require('../utils');
console.log(postData);
const actions = require('../actions'); const actions = require('../actions');
const AccountStatus = require('./account.status'); const AccountStatus = require('./account.status');
const testGame = process.env.NODE_ENV === 'development' && require('./../test.game');
const testInstance = process.env.NODE_ENV === 'development' && require('./../test.instance');
const addState = connect( const addState = connect(
function receiveState(state) { function receiveState(state) {
const { const {
@ -115,15 +109,6 @@ function Nav(args) {
return <button key={i.id} onClick={() => joinInstance(i)} >{`${phase} ${score.wins} / ${score.losses}`}</button> return <button key={i.id} onClick={() => joinInstance(i)} >{`${phase} ${score.wins} / ${score.losses}`}</button>
}); });
const haxSection = process.env.NODE_ENV === 'development'
? (
<Fragment>
<h2>Hax</h2>
<button onClick={() => setTestGame(account.id)}>Test Game</button>
<button onClick={() => setTestInstance(account.id)}>Test Instance</button>
</Fragment>)
: null;
const canJoin = team.some(c => !c); const canJoin = team.some(c => !c);
return ( return (
@ -134,7 +119,6 @@ function Nav(args) {
<button class="play-btn" disabled={canJoin} onClick={() => navTo('list')}>Play</button> <button class="play-btn" disabled={canJoin} onClick={() => navTo('list')}>Play</button>
<hr /> <hr />
{joined} {joined}
{haxSection}
</nav> </nav>
); );
} }

View File

@ -1,3 +1,5 @@
const preact = require('preact');
const circle = require('./svgs/circle'); const circle = require('./svgs/circle');
const diamond = require('./svgs/diamond'); const diamond = require('./svgs/diamond');
const hexagon = require('./svgs/hexagon'); const hexagon = require('./svgs/hexagon');
@ -20,6 +22,10 @@ module.exports = {
saw, saw,
vboxColour, vboxColour,
Red: () => vboxColour('red'),
Green: () => vboxColour('green'),
Blue: () => vboxColour('blue'),
// stats // stats
RedLife: () => square(['red']), RedLife: () => square(['red']),
GreenLife: () => square(['green']), GreenLife: () => square(['green']),
@ -29,33 +35,145 @@ module.exports = {
BluePower: () => circle(['blue']), BluePower: () => circle(['blue']),
Speed: () => triangle(['white']), Speed: () => triangle(['white']),
// specs // specs
// Base // Base
Power: () => circle(['white']),
Life: () => square(['white']), None: () =>
// Speed, <figure>
{diamond(['gray'])}
<figcaption>&nbsp;</figcaption>
</figure>,
Power: () =>
<figure>
{circle(['white'])}
<figcaption>Power</figcaption>
</figure>,
Life: () =>
<figure>
{square(['white'])}
<figcaption>Life</figcaption>
</figure>,
// Speed:
// <figure>
// {triangle(['white'])}
// <figcaption>Speed</figcaption>
// </figure>,
// Lifes Upgrades // Lifes Upgrades
LifeGG: () => square(['green']), LifeGG: () =>
LifeRR: () => square(['red']), <figure>
LifeBB: () => square(['blue']), {square(['green'])}
LifeRG: () => square(['red', 'green']), <figcaption>Life</figcaption>
LifeGB: () => square(['green', 'blue']), </figure>,
LifeRB: () => square(['red', 'blue']),
LifeRR: () =>
<figure>
{square(['green'])}
<figcaption>Life</figcaption>
</figure>,
LifeBB:() =>
<figure>
{square(['green'])}
<figcaption>Life</figcaption>
</figure>,
LifeRG: () =>
<figure>
{square(['red', 'green'])}
<figcaption>Life</figcaption>
</figure>,
LifeGB: () =>
<figure>
{square(['green', 'blue'])}
<figcaption>Life</figcaption>
</figure>,
LifeRB:() =>
<figure>
{square(['red', 'blue'])}
<figcaption>Life</figcaption>
</figure>,
// Power Upgrades // Power Upgrades
PowerGG: () => circle(['green']), PowerGG: () =>
PowerRR: () => circle(['red']), <figure>
PowerBB: () => circle(['blue']), {circle(['green'])}
PowerRG: () => circle(['red', 'green']), <figcaption>Power</figcaption>
PowerGB: () => circle(['green', 'blue']), </figure>,
PowerRB: () => circle(['red', 'blue']),
PowerRR: () =>
<figure>
{circle(['green'])}
<figcaption>Power</figcaption>
</figure>,
PowerBB:() =>
<figure>
{circle(['green'])}
<figcaption>Power</figcaption>
</figure>,
PowerRG: () =>
<figure>
{circle(['red', 'green'])}
<figcaption>Power</figcaption>
</figure>,
PowerGB: () =>
<figure>
{circle(['green', 'blue'])}
<figcaption>Power</figcaption>
</figure>,
PowerRB:() =>
<figure>
{circle(['red', 'blue'])}
<figcaption>Power</figcaption>
</figure>,
// Speed Upgrades // Speed Upgrades
SpeedGG: () => triangle(['green']), SpeedGG: () =>
SpeedRR: () => triangle(['red']), <figure>
SpeedBB: () => triangle(['blue']), {triangle(['green'])}
SpeedRG: () => triangle(['red', 'green']), <figcaption>Speed</figcaption>
SpeedGB: () => triangle(['green', 'blue']), </figure>,
SpeedRB: () => triangle(['red', 'blue']),
SpeedRR: () =>
<figure>
{triangle(['green'])}
<figcaption>Speed</figcaption>
</figure>,
SpeedBB:() =>
<figure>
{triangle(['green'])}
<figcaption>Speed</figcaption>
</figure>,
SpeedRG: () =>
<figure>
{triangle(['red', 'green'])}
<figcaption>Speed</figcaption>
</figure>,
SpeedGB: () =>
<figure>
{triangle(['green', 'blue'])}
<figcaption>Speed</figcaption>
</figure>,
SpeedRB:() =>
<figure>
{triangle(['red', 'blue'])}
<figcaption>Speed</figcaption>
</figure>,
}; };

View File

@ -124,7 +124,7 @@ function Vbox(args) {
function combinerChange(newCombiner) { function combinerChange(newCombiner) {
setCombiner(newCombiner); setCombiner(newCombiner);
if (combiner.length === 1) { if (newCombiner.length === 1) {
setItemEquip(newCombiner[0]); setItemEquip(newCombiner[0]);
} else { } else {
setItemEquip(null); setItemEquip(null);
@ -171,12 +171,12 @@ function Vbox(args) {
return setVboxSelected([group, index]); return setVboxSelected([group, index]);
} }
if (['Red', 'Green', 'Blue'].includes(v)) { if (shapes[v]) {
return ( return (
<button <button
onMouseOver={e => vboxHover(e, v)} onMouseOver={e => vboxHover(e, v)}
onClick={onClick}> onClick={onClick}>
{shapes.vboxColour(v.toLowerCase())} {shapes[v]()}
</button> </button>
); );
} }
@ -271,13 +271,13 @@ function Vbox(args) {
const highlighted = combiner.indexOf(i) > -1; const highlighted = combiner.indexOf(i) > -1;
const classes = `${highlighted ? 'highlight' : ''}`; const classes = `${highlighted ? 'highlight' : ''}`;
if (['Red', 'Green', 'Blue'].includes(v)) { if (shapes[v]) {
return ( return (
<button <button
class={classes} class={classes}
onMouseOver={e => vboxHover(e, v)} onMouseOver={e => vboxHover(e, v)}
onClick={onClick}> onClick={onClick}>
{shapes.vboxColour(v.toLowerCase())} {shapes[v]()}
</button> </button>
); );
} }

View File

@ -1,7 +1,7 @@
use rand::prelude::*; use rand::prelude::*;
use rand::{thread_rng}; use rand::{thread_rng};
const FIRSTS: [&'static str; 33] = [ const FIRSTS: [&'static str; 36] = [
"artificial", "artificial",
"ambient", "ambient",
"borean", "borean",
@ -13,6 +13,8 @@ const FIRSTS: [&'static str; 33] = [
"convex", "convex",
"distorted", "distorted",
"dub", "dub",
"emotive",
"emotionless",
"fierce", "fierce",
"inverted", "inverted",
"leafy", "leafy",
@ -31,6 +33,7 @@ const FIRSTS: [&'static str; 33] = [
"purified", "purified",
"recalcitrant", "recalcitrant",
"rogue", "rogue",
"subversive",
"subterranean", "subterranean",
"synthetic", "synthetic",
"sweet", "sweet",