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

This commit is contained in:
ntr
2019-09-12 16:19:28 +10:00
10 changed files with 121 additions and 42 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ class Slay extends Component {
});
anime.set('#slay', {
translateY: (window.screen.height) * 0.35 * this.props.direction.y,
translateY: -1 * (window.screen.height) * 0.35,
translateX: 0,
});
anime.set('#explosion feDisplacementMap', {
+1 -1
View File
@@ -56,7 +56,7 @@ function Collection(args) {
teamSelect[insert] = id;
return setTeam(teamSelect);
}
console.log(constructs.length);
const dispConstructs = constructs.length >= ((teamPage + 1) * 6)
? constructs.slice(teamPage * 6, (teamPage + 1) * 6)
: constructs.slice(teamPage * 6, constructs.length);
+20 -2
View File
@@ -3,7 +3,7 @@ const range = require('lodash/range');
const reactStringReplace = require('react-string-replace');
const { INFO } = require('./../constants');
const { convertItem } = require('../utils');
const { convertItem, removeTier, itemSpeed } = require('../utils');
const shapes = require('./shapes');
function InfoComponent(args) {
@@ -40,12 +40,23 @@ function InfoComponent(args) {
if (isSkill) {
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/;
const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(info));
const itemSourceInfo = itemSource.length
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
: false;
const itemRegEx = /(Red|Blue|Green)/;
const itemSourceDescription = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]());
const calcSpeed = itemSource.length
? (24 + (itemSpeed(itemSource[0].components[0]) + itemSpeed(itemSource[0].components[1])) * itemSpeed(itemSource[0].components[2])) * 4
: (24 + itemSpeed(info)) * 4;
const speed = <div> Speed {shapes.SpeedStat()} multiplier {calcSpeed}% </div>;
return (
<div class="info-skill">
<h2>{fullInfo.item}</h2>
<h3>SKILL</h3>
{itemSourceDescription}
<div>{infoDescription}</div>
{speed}
</div>
);
}
@@ -135,11 +146,18 @@ function InfoComponent(args) {
});
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/;
const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
const itemSource = itemInfo.combos.filter(c => c.item === info);
const itemSourceInfo = itemSource.length
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
: false;
const itemRegEx = /(Red|Blue|Green)/;
const itemSourceDescription = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]());
return (
<div class="info-spec">
<h2>{info}</h2>
<h3>SPEC</h3>
{itemSourceDescription}
<div>{infoDescription}</div>
<div class="thresholds">
{thresholds}
+1 -1
View File
@@ -12,7 +12,7 @@ const Bottom = require('./main.bottom');
const addState = connect(
state => {
const { game, instance, account, nav } = state;
return { game, instance, account, nav };
return { game, instance, account, nav };
}
);
+59 -32
View File
@@ -1,4 +1,5 @@
const preact = require('preact');
const { Component } = require('preact')
const { connect } = require('preact-redux');
const addState = connect(
@@ -8,48 +9,74 @@ const addState = connect(
}
);
function Scoreboard(args) {
const {
abandon,
animating,
isPlayer,
player,
isGame,
clear,
} = args;
const scoreText = () => {
if (player.score === 'Zero') return '▫▫▫▫';
if (player.score === 'One') return '■▫▫▫';
if (player.score === 'Two') return '■■▫▫';
if (player.score === 'Three') return '■■■▫';
if (player.score === 'Adv') return '■■■+';
if (player.score === 'Win') return '■■■■';
return '';
};
class Scoreboard extends Component {
constructor(props) {
super(props);
this.state = {
abandonState: false,
};
}
if (!isPlayer) {
render(args, state) {
const {
abandon,
animating,
isPlayer,
player,
isGame,
clear,
} = args;
const { abandonState } = state;
const scoreText = () => {
if (player.score === 'Zero') return '▫▫▫▫';
if (player.score === 'One') return '■▫▫▫';
if (player.score === 'Two') return '■■▫▫';
if (player.score === 'Three') return '■■■▫';
if (player.score === 'Adv') return '■■■+';
if (player.score === 'Win') return '■■■■';
return '';
};
const divClick = e => {
e.stopPropagation();
return this.setState({ abandonState: false });
};
const abandonStateTrue = e => {
e.stopPropagation();
this.setState({ abandonState: true });
};
if (!isPlayer) {
return (
<div class={`player-box top ${player.ready ? 'ready' : ''}`}>
<div class="ctrl">&nbsp;</div>
<div class="score">{scoreText()}</div>
<div class="img">
<div>{player.name}</div>
</div>
</div>
);
}
const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`;
const abandonAction = abandonState ? abandon : abandonStateTrue;
return (
<div class={`player-box top ${player.ready ? 'ready' : ''}`}>
<div class="ctrl">&nbsp;</div>
<div onClick={divClick} class={`player-box bottom ${player.ready ? 'ready' : ''}`}>
<div class="score">{scoreText()}</div>
<div class="img">
<div>{player.name}</div>
</div>
<div>
{(isPlayer && isGame) ? <button disabled={animating} onClick={clear}>Clear</button> : null}
</div>
<div>
{(abandon) ? <button class={abandonClasses} disabled={animating} onClick={abandonAction}>Abandon</button> : null}
</div>
</div>
);
}
return (
<div class={`player-box bottom ${player.ready ? 'ready' : ''}`}>
<div class="score">{scoreText()}</div>
<div class="img">
<div>{player.name}</div>
</div>
{(isPlayer && isGame) ? <button disabled={animating} onClick={clear}>Clear</button> : null}
{(abandon) ? <button disabled={animating} onClick={abandon}>Abandon</button> : null}
</div>
);
}
module.exports = addState(Scoreboard);