diff --git a/CHANGELOG.md b/CHANGELOG.md index 807de0fb..9a6107c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.6.6] - 2019-10-27 +# Added +- Offering of draws + - Neither player receives a point if they agree to a draw + - Bots automatically agree to draws + +## [1.6.5] - 2019-10-25 +# Fixed +- Stripe being blocked no longer causes unrecoverable error +- Automatic ready up is now throttled after abandons +- Player width styling + +# Changed +- Improved wiggle animation +- Intercept is now considered defensive by bots +- Password restrictions relaxed + ## [1.6.4] - 2019-10-24 ### Changed - Animations processing on client side reduced. diff --git a/VERSION b/VERSION index 49ebdd60..83d1a5eb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.5 \ No newline at end of file +1.6.6 \ No newline at end of file diff --git a/acp/package.json b/acp/package.json index 2591fabe..a1935bb7 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.5", + "version": "1.6.6", "description": "", "main": "index.js", "scripts": { diff --git a/client/assets/styles/colours.less b/client/assets/styles/colours.less index 79088b7c..13da2d0e 100644 --- a/client/assets/styles/colours.less +++ b/client/assets/styles/colours.less @@ -150,4 +150,22 @@ button { &.green { border-color: @green; } -} \ No newline at end of file +} + +@keyframes rgb { + 0% { + color: @red; + } + 25% { + color: @white; + } + 50% { + color: @blue; + } + 75% { + color: @white; + } + 100% { + color: @green; + } +} diff --git a/client/assets/styles/controls.less b/client/assets/styles/controls.less index 2ff3ee04..54bcb375 100644 --- a/client/assets/styles/controls.less +++ b/client/assets/styles/controls.less @@ -144,7 +144,15 @@ aside { &:active, &.confirming { background: @red; color: black; - border: 2px solid black; + border: 2px solid @red; + } +} + +.draw:not([disabled]) { + &:active, &.confirming { + background: @gray-hover; + color: black; + border: 2px solid @gray-hover; } } diff --git a/client/assets/styles/game.less b/client/assets/styles/game.less index f85ca3cf..65ad6b25 100644 --- a/client/assets/styles/game.less +++ b/client/assets/styles/game.less @@ -437,11 +437,12 @@ #targeting, .resolving-skill { width: calc(100% - 1em); } + + .player { + width: calc(100% - 1em); + bottom: 3em; + height: calc(50% - 3em); + } } - .player { - width: calc(100% - 1em); - bottom: 3em; - height: calc(50% - 3em); - } } diff --git a/client/assets/styles/menu.less b/client/assets/styles/menu.less index 0fbb7f90..672e928e 100644 --- a/client/assets/styles/menu.less +++ b/client/assets/styles/menu.less @@ -90,6 +90,11 @@ .login { display: flex; flex-flow: column; + + .terms { + display: inline; + margin: 0 1em; + } } } diff --git a/client/assets/styles/player.less b/client/assets/styles/player.less index 616ba46f..cadd02fe 100644 --- a/client/assets/styles/player.less +++ b/client/assets/styles/player.less @@ -51,6 +51,11 @@ color: @yellow; font-weight: bold; } + + .name.subscriber { + // animation: rgb 4s cubic-bezier(0.5, 0, 0.5, 1) 0s infinite alternate; + // font-weight: bold; + } } .chat { diff --git a/client/assets/styles/styles.less b/client/assets/styles/styles.less index e8188302..86ea5d38 100644 --- a/client/assets/styles/styles.less +++ b/client/assets/styles/styles.less @@ -143,7 +143,7 @@ button, input { a { color: whitesmoke; - text-decoration: none; + // text-decoration: none; &:hover { color: whitesmoke; diff --git a/client/package.json b/client/package.json index 6c6d56fe..b6b1c359 100644 --- a/client/package.json +++ b/client/package.json @@ -1,12 +1,12 @@ { "name": "mnml-client", - "version": "1.6.5", + "version": "1.6.6", "description": "", "main": "index.js", "scripts": { "start": "parcel watch index.html --out-dir /var/lib/mnml/public/current", "anims": "parcel watch animations.html --no-hmr --out-dir /var/lib/mnml/public/current", - "build": "parcel build index.html", + "build": "parcel build index.html --no-source-maps", "scss": "node-sass --watch assets/scss -o assets/styles", "lint": "eslint --fix --ext .jsx src/", "test": "echo \"Error: no test specified\" && exit 1" diff --git a/client/src/app.jsx b/client/src/app.jsx index cfc877b7..0d668980 100644 --- a/client/src/app.jsx +++ b/client/src/app.jsx @@ -15,10 +15,6 @@ const registerEvents = require('./events'); const Mnml = require('./components/mnml'); -if (process.env.NODE_ENV !== 'development') { - LogRocket.init('yh0dy3/mnml'); -} - function stripeKey() { if (window.location.host === 'mnml.gg') return 'pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq'; return 'pk_test_Cb49tTqTXpzk7nEmlGzRrNJg00AU0aNZDj'; @@ -40,9 +36,12 @@ events.setWs(ws); const App = () => ( - - - + {window.Stripe + ? + + + : + } ); diff --git a/client/src/components/account.box.jsx b/client/src/components/account.box.jsx index c6383c55..0ff61b8f 100644 --- a/client/src/components/account.box.jsx +++ b/client/src/components/account.box.jsx @@ -101,11 +101,13 @@ function AccountBox(args) { // ); // } + const nameClass = `name ${account.subscribed ? 'subscriber' : ''}`; + return (
 
-
{account.name}
+
{account.name}
 
); diff --git a/client/src/components/anims/wiggle.jsx b/client/src/components/anims/wiggle.jsx index a9615181..5886a47d 100644 --- a/client/src/components/anims/wiggle.jsx +++ b/client/src/components/anims/wiggle.jsx @@ -1,22 +1,24 @@ const anime = require('animejs').default; function wiggle(id, idle) { + if (!idle) return true; const duration = 300; const target = document.getElementById(id); const x = window.innerWidth * 0.01 * (Math.round(Math.random()) ? Math.random() : -Math.random()); const y = window.innerHeight * 0.01 * (Math.round(Math.random()) ? Math.random() : -Math.random()); - + + const originalX = parseFloat(idle.animations[0].currentValue); + const originalY = parseFloat(idle.animations[1].currentValue); // console.log(x, y); return anime({ targets: target, - rotate: 0, - translateX: [x, -x, 0], - translateY: [y, -y, 0], + translateX: [originalX + x, originalX - x, originalX], + translateY: [originalY + y, originalY - y, originalY], duration, easing: 'easeInOutSine', // direction: 'alternate', begin: idle.pause, - complete: idle.restart, + complete: idle.play, }); } diff --git a/client/src/components/game.ctrl.btns.jsx b/client/src/components/game.ctrl.btns.jsx index 671e9d62..3918b5ca 100644 --- a/client/src/components/game.ctrl.btns.jsx +++ b/client/src/components/game.ctrl.btns.jsx @@ -75,7 +75,7 @@ function GameCtrlBtns(args) { } = args; if (!game) return false; - const finished = game.phase === 'Finish'; + const finished = game.phase === 'Finished'; function quitClick() { getInstanceState(); diff --git a/client/src/components/game.ctrl.btns.top.jsx b/client/src/components/game.ctrl.btns.top.jsx index 4ab0d543..8e09718c 100644 --- a/client/src/components/game.ctrl.btns.top.jsx +++ b/client/src/components/game.ctrl.btns.top.jsx @@ -8,16 +8,23 @@ const addState = connect( const { ws, game, + account, } = state; function sendAbandon() { return ws.sendInstanceAbandon(game.instance); } + function sendDraw() { + return ws.sendGameOfferDraw(game.id); + } + return { game, + account, sendAbandon, + sendDraw, }; }, function receiveDispatch(dispatch) { @@ -34,13 +41,18 @@ const addState = connect( function GameCtrlTopBtns(args) { const { game, + account, leave, sendAbandon, + sendDraw, } = args; const finished = game && game.phase === 'Finished'; - const { abandonState } = this.state; + const { abandonState, drawState } = this.state; + + const player = game.players.find(p => p.id === account.id); + const drawOffered = player && player.draw_offered; const abandonStateTrue = e => { e.stopPropagation(); @@ -48,16 +60,29 @@ function GameCtrlTopBtns(args) { setTimeout(() => this.setState({ abandonState: false }), 2000); }; + const drawStateTrue = e => { + e.stopPropagation(); + this.setState({ drawState: true }); + setTimeout(() => this.setState({ drawState: false }), 2000); + }; + const abandonClasses = `abandon ${abandonState ? 'confirming' : ''}`; const abandonText = abandonState ? 'Confirm' : 'Abandon'; const abandonAction = abandonState ? sendAbandon : abandonStateTrue; const abandonBtn = ; - const leaveBtn = ; + + const drawClasses = `draw ${drawState || drawOffered ? 'confirming' : ''}`; + const drawText = drawOffered + ? 'Offered' + : drawState ? 'Draw' : 'Offer'; + const drawAction = drawState ? sendDraw : drawStateTrue; + const drawBtn = ; return (
- {finished ? leaveBtn : abandonBtn} + {abandonBtn} + {drawBtn}
); } diff --git a/client/src/components/game.footer.jsx b/client/src/components/game.footer.jsx index 101318a4..4a1589b0 100644 --- a/client/src/components/game.footer.jsx +++ b/client/src/components/game.footer.jsx @@ -82,7 +82,7 @@ function GameFooter(props) { const now = Date.now(); const end = Date.parse(game.phase_end); const timerPct = ((now - zero) / (end - zero) * 100); - const displayPct = game.phase === 'Finish' || !game.phase_end + const displayPct = game.phase === 'Finished' || !game.phase_end ? 0 : Math.min(timerPct, 100); @@ -108,7 +108,7 @@ function GameFooter(props) { return ( ); diff --git a/client/src/components/play.footer.jsx b/client/src/components/play.footer.jsx index f8a8479a..1f059064 100644 --- a/client/src/components/play.footer.jsx +++ b/client/src/components/play.footer.jsx @@ -3,8 +3,6 @@ const { connect } = require('preact-redux'); const { errorToast, infoToast } = require('../utils'); -const AccountBox = require('./account.box'); - const addState = connect( function receiveState(state) { const { diff --git a/client/src/components/play.jsx b/client/src/components/play.jsx index 25906879..40f5b657 100644 --- a/client/src/components/play.jsx +++ b/client/src/components/play.jsx @@ -203,6 +203,7 @@ function Play(args) {
Join our Discord server to find opponents and talk to the devs.
Message @ntr or @mashy for some credits to get started.
+ Tutorial Playthrough on YouTube

diff --git a/client/src/components/player.box.jsx b/client/src/components/player.box.jsx index 29ee6532..6cace8a4 100644 --- a/client/src/components/player.box.jsx +++ b/client/src/components/player.box.jsx @@ -68,24 +68,33 @@ function Scoreboard(args) { }; const winner = player.score === 'Win'; + const chatText = chat + ? chat + : player.draw_offered + ? 'draw' + : '\u00A0'; if (!isPlayer) { + const nameClass = `name ${player.img ? 'subscriber' : ''}`; return (
{scoreText()}
-
{player.name}
+
{player.name}
-
{chat || '\u00A0'}
+
{chatText}
); } + const boxClass = `player-box bottom ${winner ? 'winner': player.ready ? 'ready' : ''}`; + const nameClass = `name ${player.img ? 'subscriber' : ''}`; + return ( -
-
{chat || '\u00A0'}
+
+
{chatText}
{scoreText()}
-
{player.name}
+
{player.name}
); diff --git a/client/src/components/shop.jsx b/client/src/components/shop.jsx index 08a79fad..7e23bc60 100644 --- a/client/src/components/shop.jsx +++ b/client/src/components/shop.jsx @@ -48,9 +48,12 @@ function Shop(args) {

ยค {account.balance}

- - - + {window.Stripe + ? + + + :
Please unblock Stripe to use the store
+ }
); diff --git a/client/src/components/welcome.jsx b/client/src/components/welcome.jsx index 790fe3ae..558e5719 100644 --- a/client/src/components/welcome.jsx +++ b/client/src/components/welcome.jsx @@ -53,7 +53,7 @@ function Welcome() {

Welcome to mnml.

-

Turn-based 1v1 strategy game in an abstract setting.

+

MNML is a turn-based 1v1 strategy game in an abstract setting.

Build a unique team of 3 constructs from a range of skills and specialisations.
Outplay your opponent in multiple rounds by adapting to an always shifting meta.
@@ -62,6 +62,7 @@ function Welcome() {

Free to play, no pay to win. Register to start playing.

+ Tutorial Playthrough on YouTube
{pageEl()} diff --git a/client/src/components/welcome.register.jsx b/client/src/components/welcome.register.jsx index 99f8baed..68b6fedb 100644 --- a/client/src/components/welcome.register.jsx +++ b/client/src/components/welcome.register.jsx @@ -58,7 +58,7 @@ function Register(args) { value={this.state.name} onInput={linkState(this, 'name')} /> - + -   Confirm agreement to terms of service   +