From 6a0d03c49d3c3ddb57f7280cf69543ac8079c4ec Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 21 Oct 2019 17:03:53 +1100 Subject: [PATCH 01/38] 'fix' play ctrl styles --- client/src/components/play.ctrl.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/components/play.ctrl.jsx b/client/src/components/play.ctrl.jsx index b5ab1c39..36ca50c5 100644 --- a/client/src/components/play.ctrl.jsx +++ b/client/src/components/play.ctrl.jsx @@ -66,9 +66,8 @@ function JoinButtons(args) {
{discordBtn} -
-
 
-
+
+
From 8e6048b912579b15cfef7fd463b8ed480660009b Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 21 Oct 2019 19:40:19 +1000 Subject: [PATCH 02/38] fix tick speed bug with new application --- WORKLOG.md | 10 ---------- server/src/game.rs | 8 +++++--- server/src/skill.rs | 31 ++++++++++++++++++++++++++----- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/WORKLOG.md b/WORKLOG.md index ee4b4714..150a20d0 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -10,13 +10,6 @@ * clear active mtx after joining game -* Check results stack for whether a construct has ticked a dot already. Current issue E.g. - Construct 1 with slow speed applies siphon round 1 on Enemy Construct 1 - Construct 2 with fast speed applies siphon round 2 on Enemy Construct 2 - Siphon tick won't proc at all that turn - It assumes the dot has triggered already from existing dot from pre_resolve - Instead of checking a dot already exists instead search for a matching dot tick event in results - * mobile styles * mobile info page @@ -25,9 +18,6 @@ * can't reset password without knowing password =\ * Invert recharge - * serde serialize privatise - * chat - * Convert spec 'Plus' -> '+' when it appears as combo text in combiner and in info text ## SOON diff --git a/server/src/game.rs b/server/src/game.rs index af4746ed..0421ab65 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -377,9 +377,11 @@ impl Game { let mut sorted = self.stack.clone(); sorted.iter_mut() .for_each(|s| { - let caster = self.construct_by_id(s.source_construct_id).unwrap(); - let speed = caster.skill_speed(s.skill); - s.speed = speed; + if !s.skill.is_tick() { + let caster = self.construct_by_id(s.source_construct_id).unwrap(); + let speed = caster.skill_speed(s.skill); + s.speed = speed; + } }); sorted.sort_unstable_by_key(|s| s.speed); diff --git a/server/src/skill.rs b/server/src/skill.rs index 6431d39d..d4685c2a 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -384,7 +384,7 @@ impl Cast { source_player_id: source.account, target_construct_id: target.id, skill, - speed: 0, + speed: source.skill_speed(skill), } } @@ -1499,7 +1499,13 @@ fn heal(source: &mut Construct, target: &mut Construct, mut results: Resolutions } fn triage(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { - let skip_tick = target.effects.iter().any(|e| e.effect == Effect::Triage); + let skip_tick = target.effects.iter().any(|e| { + match e.effect { + Effect::Triage => source.skill_speed(skill) <= e.tick.unwrap().speed, + _ => false, + } + }); + let ConstructEffect { effect, duration, meta, tick: _ } = skill.effect()[0]; let tick_skill = match meta { Some(EffectMeta::Skill(s)) => s, @@ -1565,7 +1571,12 @@ fn decay(source: &mut Construct, target: &mut Construct, mut results: Resolution let wither = skill.effect()[0]; results.push(Resolution::new(source, target).event(target.add_effect(skill, wither))); - let skip_tick = target.effects.iter().any(|e| e.effect == Effect::Decay); + let skip_tick = target.effects.iter().any(|e| { + match e.effect { + Effect::Decay => source.skill_speed(skill) <= e.tick.unwrap().speed, + _ => false, + } + }); let ConstructEffect { effect, duration, meta, tick: _ } = skill.effect()[1]; let tick_skill = match meta { Some(EffectMeta::Skill(s)) => s, @@ -1619,7 +1630,12 @@ fn electrocute(source: &mut Construct, target: &mut Construct, mut results: Reso _ => panic!("no electrocute tick skill"), }; - let skip_tick = target.effects.iter().any(|e| e.effect == Effect::Electrocute); + let skip_tick = target.effects.iter().any(|e| { + match e.effect { + Effect::Electrocute => source.skill_speed(skill) <= e.tick.unwrap().speed, + _ => false, + } + }); let electrocute = ConstructEffect::new(effect, duration).set_tick(Cast::new_tick(source, target, tick_skill)); results.push(Resolution::new(source, target) .event(target.add_effect(skill, electrocute)) @@ -1716,7 +1732,12 @@ fn recharge(source: &mut Construct, target: &mut Construct, mut results: Resolut fn siphon(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { - let skip_tick = target.effects.iter().any(|e| e.effect == Effect::Siphon); + let skip_tick = target.effects.iter().any(|e| { + match e.effect { + Effect::Siphon => source.skill_speed(skill) <= e.tick.unwrap().speed, + _ => false, + } + }); let ConstructEffect { effect, duration, meta, tick: _ } = skill.effect()[0]; let tick_skill = match meta { Some(EffectMeta::Skill(s)) => s, From 0c9c4a769256c00d3c651158ae412017a77e3ec8 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 09:52:24 +1000 Subject: [PATCH 03/38] add reshape tab, remove mtx from play page --- CHANGELOG.md | 4 + client/src/components/header.jsx | 5 ++ client/src/components/main.top.jsx | 2 + client/src/components/play.jsx | 128 ++++------------------------ client/src/components/reshape.jsx | 131 +++++++++++++++++++++++++++++ client/src/events.jsx | 3 +- 6 files changed, 161 insertions(+), 112 deletions(-) create mode 100644 client/src/components/reshape.jsx diff --git a/CHANGELOG.md b/CHANGELOG.md index fab461ad..c97e3d50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.6.3] - 2019-10-XX +### Fixed +- Fixed bug where dots / hots would not trigger when reapplied by a skill caster at higher speed + ## [1.6.2] - 2019-10-20 ### Fixed - Combiner bug where it would preview items for different combinations diff --git a/client/src/components/header.jsx b/client/src/components/header.jsx index 9bb8d9e0..8810ecb3 100644 --- a/client/src/components/header.jsx +++ b/client/src/components/header.jsx @@ -83,6 +83,11 @@ function Header(args) { class={`login-btn ${nav === 'play' ? 'highlight' : ''}`}> Play + - - ); - }; - - const availableMtx = (item, i) => ( -
-
Enable {item.variant}
- -
- ); - - const subscription = account.subscribed - ? - : ; - +function Play() { return (

v{VERSION}

-

Use the buttons on the right to join an instance.

- Select PVP to play against other players.
- Select INVITE then click COPY LINK to generate an instance invitation for a friend.
- Click LEARN to practice the game without time controls. + Join our discord server to find opponents and talk to the devs.
+ Message @ntr or @mashy on discord. Invite link on the right control panel.
+ We will also give you some credits to try the mtx.

-

Join our Discord server to find opponents, message @ntr or @mashy for some credits to get started.

- If you enjoy the game please support its development by subscribing or purchasing credits.
+ If you enjoy the game you can support the development: +

    +
  • Invite people to play pvp games and grow the community.
  • +
  • Subscribe or purchase credits.
  • +
glhf

-

¤ {account.balance}

-
- {subscription} - -
-
-
- {shop.owned.map(useMtx)} -
-
- {shop.available.map(availableMtx)} -
+

The buttons on the right are the controls to play the game.

+

+ Click LEARN to practice the game without time controls.
+ Select INVITE then click COPY LINK to create a game invitation for a friend.
+ Select PVP to queue for a game against other players.
+

+

If you can't find a match through pvp queue, ask around on discord.

); } -module.exports = addState(Play); +module.exports = Play; diff --git a/client/src/components/reshape.jsx b/client/src/components/reshape.jsx new file mode 100644 index 00000000..30e56aa7 --- /dev/null +++ b/client/src/components/reshape.jsx @@ -0,0 +1,131 @@ +// const { connect } = require('preact-redux'); +const preact = require('preact'); +const { connect } = require('preact-redux'); + +const actions = require('./../actions'); + +const VERSION = process.env.npm_package_version; + +const addState = connect( + function receiveState(state) { + const { + ws, + account, + shop, + } = state; + + function mtxBuy(mtx) { + return ws.sendMtxBuy(mtx.variant); + } + + return { + account, + shop, + mtxBuy, + }; + }, + + function receiveDispatch(dispatch) { + function setMtxActive(mtx) { + dispatch(actions.setConstructRename(null)); + dispatch(actions.setMtxActive(mtx)); + return true; + } + + function setNav(place) { + return dispatch(actions.setNav(place)); + } + + return { + setMtxActive, + setNav, + }; + } +); + +function Reshape(args) { + const { + account, + shop, + mtxBuy, + + setMtxActive, + setNav, + } = args; + + if (!shop) return false; + + const useMtx = (item, i) => { + const price = item === 'Rename' ? 5 : 1; + return ( +
{ + e.stopPropagation(); + setMtxActive(item); + }}> +
{item}
+ +
+ ); + }; + + const availableMtx = (item, i) => ( +
+
Enable {item.variant}
+ +
+ ); + + const subscription = account.subscribed + ? + : ; + + return ( +
setMtxActive(null)}> +
+

Use credits to modify your construct names and appearance.

+
    + +
  • Purchase image sets to unlock different types of avatars.
  • +
  • You can reroll any avatar to a new avatar from owned sets.
  • +
  • Reroll avatars by clicking the owned set and then the construct you wish to reroll.
  • +
  • Press escape to clear any active mtx.
  • +
+ +

+ You can switch out your active constructs in the account settings.
+ Accounts start with 4 constructs by default.
+

+
+
+

¤ {account.balance}

+
+ {subscription} + +
+
+
+ {shop.owned.map(useMtx)} +
+
+ {shop.available.map(availableMtx)} +
+
+
+ ); +} + +module.exports = addState(Reshape); diff --git a/client/src/events.jsx b/client/src/events.jsx index faf2b0ee..b89d739f 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -28,7 +28,8 @@ function registerEvents(store) { function setTeam(team) { store.dispatch(actions.setTeam(team)); - setNav('play'); + const { nav } = store.getState(); + if (nav !== 'reshape') setNav('play'); } function setSubscription(sub) { From a304f003d0c42b73603daf942cc3c8f8d356ce4c Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 10:28:28 +1000 Subject: [PATCH 04/38] added sub back to home, controls on reshape menu --- client/src/components/controls.jsx | 2 +- client/src/components/play.jsx | 69 ++++++++++++++++++++++++++++-- client/src/components/reshape.jsx | 2 - 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/client/src/components/controls.jsx b/client/src/components/controls.jsx index 8df3d524..e7b4e639 100644 --- a/client/src/components/controls.jsx +++ b/client/src/components/controls.jsx @@ -38,7 +38,7 @@ function Controls(args) { if (game) return ; if (instance) return ; - if (nav === 'play' || nav === 'shop' || !nav) return + if (nav === 'play' || nav === 'shop' || nav === 'reshape' || !nav) return if (nav === 'team' || nav === 'account') return return false; diff --git a/client/src/components/play.jsx b/client/src/components/play.jsx index ec1dd4c1..6d846016 100644 --- a/client/src/components/play.jsx +++ b/client/src/components/play.jsx @@ -1,9 +1,61 @@ // const { connect } = require('preact-redux'); const preact = require('preact'); +const { connect } = require('preact-redux'); + +const actions = require('./../actions'); const VERSION = process.env.npm_package_version; -function Play() { +const addState = connect( + function receiveState(state) { + const { + ws, + account, + } = state; + + return { + account, + }; + }, + + function receiveDispatch(dispatch) { + function setMtxActive(mtx) { + dispatch(actions.setConstructRename(null)); + dispatch(actions.setMtxActive(mtx)); + return true; + } + + function setNav(place) { + return dispatch(actions.setNav(place)); + } + + return { + setMtxActive, + setNav, + }; + } +); + + +function Play(args) { + const { + account, + setNav, + } = args; + + const subscription = account.subscribed + ? + : ; + return (
@@ -23,7 +75,18 @@ function Play() {

-

The buttons on the right are the controls to play the game.

+

¤ {account.balance}

+
+ {subscription} + +
+
+

Click LEARN to practice the game without time controls.
Select INVITE then click COPY LINK to create a game invitation for a friend.
@@ -35,4 +98,4 @@ function Play() { ); } -module.exports = Play; +module.exports = addState(Play); diff --git a/client/src/components/reshape.jsx b/client/src/components/reshape.jsx index 30e56aa7..d45bd4d4 100644 --- a/client/src/components/reshape.jsx +++ b/client/src/components/reshape.jsx @@ -4,8 +4,6 @@ const { connect } = require('preact-redux'); const actions = require('./../actions'); -const VERSION = process.env.npm_package_version; - const addState = connect( function receiveState(state) { const { From e3f906ef195cb84ec1f3a89fe30f5fef041ef583 Mon Sep 17 00:00:00 2001 From: ntr Date: Tue, 22 Oct 2019 11:46:14 +1100 Subject: [PATCH 05/38] fix siphon anim --- client/assets/styles/game.less | 6 ++++++ client/assets/styles/styles.less | 4 ++-- client/src/components/play.ctrl.jsx | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/assets/styles/game.less b/client/assets/styles/game.less index ef445028..f85ca3cf 100644 --- a/client/assets/styles/game.less +++ b/client/assets/styles/game.less @@ -235,6 +235,9 @@ width: 100%; height: 100%; position: absolute; + overflow: hidden; + max-height: 100%; + max-width: 100%; } .combat-anim svg { @@ -339,6 +342,9 @@ .skill-animation { opacity: 0; stroke-width: 5px; + overflow: hidden; + max-height: 100%; + max-width: 100%; // height: 5em; } diff --git a/client/assets/styles/styles.less b/client/assets/styles/styles.less index 1cb6f712..7150057e 100644 --- a/client/assets/styles/styles.less +++ b/client/assets/styles/styles.less @@ -14,7 +14,7 @@ html body { -ms-user-select: none; overflow-x: hidden; - overflow-y: hidden; + // overflow-y: hidden; } #mnml { @@ -26,7 +26,7 @@ html body { /* stops inspector going skitz*/ overflow-x: hidden; - overflow-y: hidden; + // overflow-y: hidden; } // @media (min-width: 1921px) { diff --git a/client/src/components/play.ctrl.jsx b/client/src/components/play.ctrl.jsx index 36ca50c5..8bdeab21 100644 --- a/client/src/components/play.ctrl.jsx +++ b/client/src/components/play.ctrl.jsx @@ -70,7 +70,7 @@ function JoinButtons(args) {

- + - +
diff --git a/client/src/events.jsx b/client/src/events.jsx index b89d739f..3db2ce7b 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -180,6 +180,7 @@ function registerEvents(store) { } function setAccountInstances(v) { + store.dispatch(actions.setMtxActive(null)); return store.dispatch(actions.setInstances(v)); } From c05ad8637fabcad7f4068a4e87588a04c561abce Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 11:58:00 +1000 Subject: [PATCH 07/38] stop idle construct movement causing overflow --- client/assets/styles/menu.less | 1 + client/assets/styles/player.less | 1 + 2 files changed, 2 insertions(+) diff --git a/client/assets/styles/menu.less b/client/assets/styles/menu.less index 4d0dd7ca..cbe04a86 100644 --- a/client/assets/styles/menu.less +++ b/client/assets/styles/menu.less @@ -35,6 +35,7 @@ .construct { flex: 1 1 33%; + overflow: hidden; display: flex; flex-flow: column; diff --git a/client/assets/styles/player.less b/client/assets/styles/player.less index 4eb448d9..6bcf804b 100644 --- a/client/assets/styles/player.less +++ b/client/assets/styles/player.less @@ -2,6 +2,7 @@ .player-box { display: grid; + overflow: hidden; grid-template-areas: "msg" "img" From c522180366cbe9c3faa038d9431b3c3e46a793c4 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 13:15:57 +1000 Subject: [PATCH 08/38] faceoff text for start, win, lose --- WORKLOG.md | 6 +---- client/assets/styles/instance.less | 10 ++++++++- client/src/components/faceoff.jsx | 35 ++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/WORKLOG.md b/WORKLOG.md index e61cdcd9..2f72978e 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -3,13 +3,9 @@ *PRODUCTION* -* rename vbox to shop (just for display) -* give the shop and inventory distinct delineation -* proper victory / lose page instead of just face off (you are the winner or something) +* give the vbox and inventory distinct delineation * vbox phase skill list navigator (overlay maybe?) -* clear active mtx after joining game - * mobile styles * mobile info page diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 05952fc7..60ba9412 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -413,9 +413,10 @@ text-align: center; overflow: hidden; display: grid; - grid-template-rows: 1fr 1.5fr; + grid-template-rows: 1fr 0.25fr 1.5fr; grid-template-areas: "opponent" + "text" "player"; h1 { @@ -445,6 +446,13 @@ } } +.faceoff-text { + grid-area: text; + text-align: center; + align-self: center; + height: auto; +} + /* Mobile Nav*/ .instance-nav { display: none; } diff --git a/client/src/components/faceoff.jsx b/client/src/components/faceoff.jsx index 68de5481..41a95e86 100644 --- a/client/src/components/faceoff.jsx +++ b/client/src/components/faceoff.jsx @@ -66,6 +66,7 @@ function Faceoff(props) { ); } + function OpponentTeam(team) { const constructs = team.constructs.map((c, i) => ); @@ -78,10 +79,44 @@ function Faceoff(props) {
); } + function faceoffText() { + if (!instance.winner) { + const zero = Date.parse(instance.phase_start); + const now = Date.now(); + const end = Date.parse(instance.phase_end); + const timerPct = instance.phase_end + ? ((now - zero) / (end - zero) * 100) + : 100; + const fight = timerPct > 10 ?

FIGHT

: null; + return ( +
+

{otherTeam.name}

+

vs

+

{playerTeam.name}

+ {fight} +
+ ); + } + + if (instance.winner === playerTeam.id) { + return ( +
+

You are the champion

+
+ ) + } + + return ( +
+

You lose

+
+ ) + } return (
{OpponentTeam(otherTeam)} + {faceoffText()} {PlayerTeam(playerTeam)}
); From 21d55e27b092efdd038dc512b68cdad3cf201394 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 14:11:01 +1000 Subject: [PATCH 09/38] add back overflow to body --- client/assets/styles/instance.less | 2 +- client/assets/styles/styles.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 60ba9412..30e26403 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -413,7 +413,7 @@ text-align: center; overflow: hidden; display: grid; - grid-template-rows: 1fr 0.25fr 1.5fr; + grid-template-rows: 1fr 0.5fr 1.5fr; grid-template-areas: "opponent" "text" diff --git a/client/assets/styles/styles.less b/client/assets/styles/styles.less index 7150057e..2d3af757 100644 --- a/client/assets/styles/styles.less +++ b/client/assets/styles/styles.less @@ -14,7 +14,7 @@ html body { -ms-user-select: none; overflow-x: hidden; - // overflow-y: hidden; + overflow-y: hidden; } #mnml { From 4edeb6d315ee3bd509aad5a327e26b94647bb320 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 14:24:30 +1000 Subject: [PATCH 10/38] change win text --- client/src/components/faceoff.jsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/client/src/components/faceoff.jsx b/client/src/components/faceoff.jsx index 41a95e86..c589a60c 100644 --- a/client/src/components/faceoff.jsx +++ b/client/src/components/faceoff.jsx @@ -97,20 +97,13 @@ function Faceoff(props) {
); } - - if (instance.winner === playerTeam.id) { - return ( -
-

You are the champion

-
- ) - } - + const winner = instance.winner === playerTeam.id ? playerTeam.name : otherTeam.name; return (
-

You lose

+

{winner} wins

) + } return ( From ec3a2a0ce5a356c2c7a4ec32fc311d618f03588d Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 22 Oct 2019 20:07:33 +1000 Subject: [PATCH 11/38] highlight colours for noobs --- client/src/components/vbox.component.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 7e56bafb..ed39b212 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -97,7 +97,7 @@ function Vbox(args) { const { combiner, navInstance, - // instance, + instance, itemInfo, player, reclaiming, @@ -161,6 +161,14 @@ function Vbox(args) { function availableBtn(v, group, index) { if (!v) return ; + const tutorial = instance.time_control === 'Practice' + && instance.rounds.length === 1 + && group === 0 + && combiner.length === 0 + && vboxSelected.length === 0 + && vbox.bits > 10 + && vbox.free[0].filter(c => c).length > 4 + ? 'combo-border' : null; const selected = vboxSelected[0] === group && vboxSelected[1] === index; @@ -194,7 +202,7 @@ function Vbox(args) { } return false; }) ? 'combo-border' : ''; - const classes = `${v.toLowerCase()} ${selected ? 'highlight' : ''} ${comboHighlight}`; + const classes = `${v.toLowerCase()} ${selected ? 'highlight' : ''} ${comboHighlight} ${tutorial}`; if (shapes[v]) { return ( From 1ec43cd6b03355de9ad0f8b31dffa0c21111a364 Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 23 Oct 2019 08:26:15 +1000 Subject: [PATCH 12/38] add inventory tutorial step --- client/assets/styles/instance.less | 12 +----------- client/src/components/vbox.component.jsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 30e26403..44857870 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -97,8 +97,7 @@ grid-template-columns: 1fr min-content 1fr; grid-template-areas: "vbox varrow inventory" - "vbox . carrow" - "vbox . combiner"; + "vbox varrow combiner"; } .vbox-inventory { @@ -112,15 +111,6 @@ justify-content: flex-end; } -.vbox-combiner-arrow { - color: @gray-hint; - grid-area: carrow; - display: block; - text-align: center; - font-size: 2em; - vertical-align: center; -} - .vbox-arrow, .vbox-arrow-mobile { display: flex; justify-content:center; diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index ed39b212..16bdab66 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -275,6 +275,16 @@ function Vbox(args) { return ; } + const tutorial = instance.time_control === 'Practice' + && instance.rounds.length === 1 + && i === 0 + && combiner.length === 0 + && vboxSelected.length === 0 + && vbox.bits === 16 + && vbox.bound.length === 5 + && vbox.free[0].filter(c => c).length === 4 + ? 'combo-border' : null; + const combinerItems = combiner.map(j => vbox.bound[j]); const combinerCount = countBy(combinerItems, co => co); @@ -314,7 +324,7 @@ function Vbox(args) { const highlighted = combiner.indexOf(i) > -1; const border = buttons[removeTier(v)] ? buttons[removeTier(v)]() : ''; - const classes = `${highlighted ? 'highlight' : border} ${comboHighlight}`; + const classes = `${highlighted ? 'highlight' : border} ${comboHighlight} ${tutorial}`; if (shapes[v]) { return ( - ); - - if (instances.length) { - return ( - - ); - } - - const inviteBtn = () => { - if (!invite) { - return ( - - ); - } - - function copyClick(e) { - const link = `${document.location.origin}#join=${invite}`; - const textArea = document.createElement('textarea', { id: '#clipboard' }); - textArea.value = link; - document.body.appendChild(textArea); - textArea.focus(); - textArea.select(); - - try { - document.execCommand('copy'); - infoToast('Invite link copied to clipboard.'); - } catch (err) { - console.error('link copy error', err); - errorToast('Invite link copy error.'); - } - - document.body.removeChild(textArea); - return true; - } - - return ( - - ); - }; - return ( ); } -module.exports = addState(JoinButtons); +module.exports = JoinButtons; diff --git a/client/src/components/play.jsx b/client/src/components/play.jsx index 6d846016..dc7a1720 100644 --- a/client/src/components/play.jsx +++ b/client/src/components/play.jsx @@ -2,6 +2,7 @@ const preact = require('preact'); const { connect } = require('preact-redux'); +const { errorToast, infoToast } = require('../utils'); const actions = require('./../actions'); const VERSION = process.env.npm_package_version; @@ -11,10 +12,35 @@ const addState = connect( const { ws, account, + instances, + invite, } = state; + function sendInstanceState(id) { + ws.sendInstanceState(id); + } + + function sendInstancePractice() { + ws.sendInstancePractice(); + } + + function sendInstanceQueue() { + ws.sendInstanceQueue(); + } + + function sendInstanceInvite() { + ws.sendInstanceInvite(); + } + return { account, + instances, + invite, + + sendInstanceState, + sendInstanceQueue, + sendInstancePractice, + sendInstanceInvite, }; }, @@ -36,13 +62,69 @@ const addState = connect( } ); - function Play(args) { const { account, + instances, + invite, + + sendInstanceState, + sendInstanceQueue, + sendInstancePractice, + sendInstanceInvite, + setNav, } = args; - + + const inviteBtn = () => { + if (!invite) { + return ( +
+ +
Invite a Friend
+
+ + ); + } + + function copyClick(e) { + const link = `${document.location.origin}#join=${invite}`; + const textArea = document.createElement('textarea', { id: '#clipboard' }); + textArea.value = link; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + try { + document.execCommand('copy'); + infoToast('Invite link copied to clipboard.'); + } catch (err) { + console.error('link copy error', err); + errorToast('Invite link copy error.'); + } + + document.body.removeChild(textArea); + return true; + } + + return ( +
+ +
Invite Generated
+
+ ); + }; + const subscription = account.subscribed ? +
Matchmaking
+ + {inviteBtn()} +
+ +
Practice MNML
+
+
+ +
Join the Community
+
+
+ ); + + return ( +
+
+ +
Resume playing
+
+
+ ); + } + return (
-

v{VERSION}

-

- Join our discord server to find opponents and talk to the devs.
- Message @ntr or @mashy on discord. Invite link on the right control panel.
- We will also give you some credits to try the mtx.
-

-

- If you enjoy the game you can support the development: -

    -
  • Invite people to play pvp games and grow the community.
  • -
  • Subscribe or purchase credits.
  • -
- glhf -

+

v{VERSION}

+ {list()}

¤ {account.balance}

@@ -84,15 +199,19 @@ function Play(args) { role="link"> Get Credits -
+
+
+ Join our Discord server to find opponents and talk to the devs.
+ Message @ntr or @mashy for some credits to get started.

-

- Click LEARN to practice the game without time controls.
- Select INVITE then click COPY LINK to create a game invitation for a friend.
- Select PVP to queue for a game against other players.
-

-

If you can't find a match through pvp queue, ask around on discord.

+
+ If you enjoy the game you can support the development: +
    +
  • Invite people to play pvp games and grow the community.
  • +
  • Subscribe or purchase credits.
  • +
+
); diff --git a/client/src/components/shop.jsx b/client/src/components/shop.jsx index 16883b22..08a79fad 100644 --- a/client/src/components/shop.jsx +++ b/client/src/components/shop.jsx @@ -41,7 +41,7 @@ function Shop(args) { Subscriptions grant extra benefits:

diff --git a/client/src/socket.jsx b/client/src/socket.jsx index 5fed2f29..adad1a66 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -259,7 +259,7 @@ function createSocket(events) { QueueRequested: () => events.notify('pvp queue request received'), QueueJoined: () => events.notify('you have joined the pvp queue'), - InviteRequested: () => events.notify('pvp queue request received'), + InviteRequested: () => events.notify('pvp invite request received'), Invite: code => events.setInvite(code), InstanceChat: chat => events.setInstanceChat(chat), ChatWheel: wheel => events.setChatWheel(wheel), From eb161f7d78864644035547964401ae201ab45db0 Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 23 Oct 2019 16:26:34 +1100 Subject: [PATCH 21/38] shorten faceoff time --- server/src/instance.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/instance.rs b/server/src/instance.rs index 4f4ae29e..8c92a821 100644 --- a/server/src/instance.rs +++ b/server/src/instance.rs @@ -81,7 +81,7 @@ impl TimeControl { pub fn lobby_timeout(&self) -> DateTime { Utc::now() - .checked_add_signed(Duration::seconds(30)) + .checked_add_signed(Duration::seconds(15)) .expect("could not set phase end") } From 84672f91a92e448f4a9c33b4569a5a4af2d54dfc Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 23 Oct 2019 16:27:16 +1100 Subject: [PATCH 22/38] v1.6.3 --- VERSION | 2 +- acp/package.json | 2 +- client/package.json | 2 +- ops/package.json | 2 +- server/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 308b6faa..f5d2a585 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.2 \ No newline at end of file +1.6.3 \ No newline at end of file diff --git a/acp/package.json b/acp/package.json index 50e3dad7..b0f4f97b 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.2", + "version": "1.6.3", "description": "", "main": "index.js", "scripts": { diff --git a/client/package.json b/client/package.json index c3f92b8c..c2b00a0b 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.2", + "version": "1.6.3", "description": "", "main": "index.js", "scripts": { diff --git a/ops/package.json b/ops/package.json index 164423a5..07c68e1e 100755 --- a/ops/package.json +++ b/ops/package.json @@ -1,6 +1,6 @@ { "name": "mnml-ops", - "version": "1.6.2", + "version": "1.6.3", "description": "", "main": "index.js", "scripts": { diff --git a/server/Cargo.toml b/server/Cargo.toml index 90c16448..80e33093 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mnml" -version = "1.6.2" +version = "1.6.3" authors = ["ntr "] [dependencies] From 157db74b7b46227be351f7bcba6958a030951761 Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 23 Oct 2019 16:46:05 +1100 Subject: [PATCH 23/38] changelog --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7507c689..9be80477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,17 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [1.6.3] - 2019-10-XX +## [1.6.3] - 2019-10-23 + +### Added +- MNNI: the MNML guide + - Delivers the message of the day + ### Fixed - Fixed issue where dots / hots would not trigger when reapplied at a higher speed - Changed layout of home page. UI elements for rerolling construct avatars moved to a separate tab. - Added highlighting to first round of a game against the bots to guide new users -- Fixed UI issues related to scroll bars +- Fixed UI issues related to scrolling - Improved the invite link ## [1.6.2] - 2019-10-20 From 14cb0751616a508848eb649276cf0c6d1641144d Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 23 Oct 2019 15:49:46 +1000 Subject: [PATCH 24/38] fix animCb logic from stalling --- client/src/animations.utils.jsx | 15 +++++++++++---- client/src/events.jsx | 8 ++++---- client/src/utils.jsx | 1 + server/src/skill.rs | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/client/src/animations.utils.jsx b/client/src/animations.utils.jsx index 95389eeb..2e525c86 100644 --- a/client/src/animations.utils.jsx +++ b/client/src/animations.utils.jsx @@ -1,4 +1,5 @@ const { TIMES } = require('./constants'); +const { removeTier } = require('./utils'); function none() { return { @@ -200,14 +201,20 @@ function getText(resolution, sequence) { }; } +function isCbAnim(skill) { + return ['Attack', 'Blast', 'Siphon', 'SiphonTick', 'Strike', 'Chaos', 'Slay', 'Heal', + 'Buff', 'Amplify', 'Haste', 'Triage', 'TriageTick', 'Link', 'Hybrid', 'Intercept', + 'Debuff', 'Curse', 'Decay', 'DecayTick', 'Purge', 'Silence', 'Restrict', + 'Stun', 'Bash', 'Absorb', 'Sleep', 'Break', 'Ruin', + 'Block', 'Sustain', 'Electrify', 'Electrocute', 'ElectrocuteTick', + 'Counter', 'CounterAttack', 'Purify', 'Recharge', 'Reflect'].includes(removeTier(skill)); +} + module.exports = { getFocusTargets, getObjects, getTime, getSequence, getText, + isCbAnim, }; - - - // if (!(resolution.target.id === construct.id) - // && !(resolution.event[0] === 'AoeSkill' && targetTeam.includes(construct.id))) return false; diff --git a/client/src/events.jsx b/client/src/events.jsx index 945c2b59..b70d2221 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -7,7 +7,7 @@ const sample = require('lodash/sample'); const actions = require('./actions'); const { TIMES } = require('./constants'); const animations = require('./animations.utils'); -const { infoToast, errorToast, removeTier } = require('./utils'); +const { infoToast, errorToast } = require('./utils'); function registerEvents(store) { function notify(msg) { @@ -79,7 +79,7 @@ function registerEvents(store) { if (sequence.includes('START_SKILL') && anims.animSource) store.dispatch(actions.setAnimSource(anims.animSource)); if (sequence.includes('END_SKILL') && anims.animTarget) { store.dispatch(actions.setAnimTarget(anims.animTarget)); - if (!['Banish', 'Invert'].includes(removeTier(anims.animTarget.skill))) store.dispatch(actions.setAnimCb(cb)); + if (animations.isCbAnim(anims.animSkill)) store.dispatch(actions.setAnimCb(cb)); } if (sequence.includes('POST_SKILL') && text) { // timeout to prevent text classes from being added too soon @@ -98,8 +98,8 @@ function registerEvents(store) { store.dispatch(actions.setAnimTarget(null)); store.dispatch(actions.setAnimText(null)); store.dispatch(actions.setAnimFocus([])); - if (!sequence.includes('END_SKILL') || (anims.animSkill && ['Banish', 'Invert'].includes(anims.animSkill))) return cb(); - return true; + if (sequence.includes('END_SKILL') && animations.isCbAnim(anims.animSkill)) return true; + return cb(); }, timeout); }, err => { if (err) return console.error(err); diff --git a/client/src/utils.jsx b/client/src/utils.jsx index ca66fd54..88719c34 100644 --- a/client/src/utils.jsx +++ b/client/src/utils.jsx @@ -142,6 +142,7 @@ function randomPoints(numPoints, radius, dimensions) { } const removeTier = skill => { + if (!skill) return skill; if (skill.includes('SiphonTick')) return 'SiphonTick'; if (skill.includes('TriageTick')) return 'TriageTick'; if (skill.includes('DecayTick')) return 'DecayTick'; diff --git a/server/src/skill.rs b/server/src/skill.rs index f7254101..998cb178 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -69,12 +69,12 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) - pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut resolutions: Vec) -> Resolutions { if let Some(disable) = source.disabled(skill) { - resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill })); + resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill }).stages(EventStages::PostOnly)); return resolutions; } if target.is_ko() { - resolutions.push(Resolution::new(source, target).event(Event::TargetKo { skill })); + resolutions.push(Resolution::new(source, target).event(Event::TargetKo { skill }).stages(EventStages::PostOnly)); return resolutions; } From c203727d2508fbe059bdb956ebe149a8e0c7924a Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 23 Oct 2019 16:03:33 +1000 Subject: [PATCH 25/38] fix animation stages --- server/src/skill.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/src/skill.rs b/server/src/skill.rs index 998cb178..ed594c4d 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -16,7 +16,7 @@ pub fn dev_resolve(a_id: Uuid, b_id: Uuid, skill: Skill) -> Resolutions { let mut b = Construct::new(); b.id = b_id; if skill.aoe() { // Send an aoe skill event for anims - resolutions.push(Resolution::new(&a, &b).event(Event::AoeSkill { skill })); + resolutions.push(Resolution::new(&a, &b).event(Event::AoeSkill { skill }).stages(EventStages::StartEnd)); } return resolve(skill, &mut a, &mut b, resolutions); } @@ -36,7 +36,7 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) - if skill.aoe() { // Send an aoe skill event for anims resolutions.push(Resolution::new(&source, - &game.construct_by_id(cast.target_construct_id).unwrap().clone()).event(Event::AoeSkill { skill })); + &game.construct_by_id(cast.target_construct_id).unwrap().clone()).event(Event::AoeSkill { skill }).stages(EventStages::StartEnd)); } for target_id in targets { @@ -68,13 +68,13 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) - } pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut resolutions: Vec) -> Resolutions { - if let Some(disable) = source.disabled(skill) { - resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill }).stages(EventStages::PostOnly)); + if let Some(_disable) = source.disabled(skill) { + // resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill }).stages(EventStages::PostOnly)); return resolutions; } if target.is_ko() { - resolutions.push(Resolution::new(source, target).event(Event::TargetKo { skill }).stages(EventStages::PostOnly)); + // resolutions.push(Resolution::new(source, target).event(Event::TargetKo { skill }).stages(EventStages::PostOnly)); return resolutions; } @@ -1811,7 +1811,7 @@ fn silence(source: &mut Construct, target: &mut Construct, mut results: Resoluti } fn purge(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { - results.push(Resolution::new(source, target).event(Event::Skill { skill })); + results.push(Resolution::new(source, target).event(Event::Skill { skill }).stages(EventStages::StartEnd)); while let Some(i) = target.effects .iter() .position(|ce| { @@ -1845,7 +1845,7 @@ fn purge(source: &mut Construct, target: &mut Construct, mut results: Resolution } fn purify(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { - results.push(Resolution::new(source, target).event(Event::Skill { skill })); + results.push(Resolution::new(source, target).event(Event::Skill { skill }).stages(EventStages::StartEnd)); let amount = source.green_power().pct(skill.multiplier()); while let Some(i) = target.effects .iter() @@ -1869,7 +1869,7 @@ fn purify(source: &mut Construct, target: &mut Construct, mut results: Resolutio } fn banish(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { - results.push(Resolution::new(source, target).event(Event::Skill { skill })); + results.push(Resolution::new(source, target).event(Event::Skill { skill }).stages(EventStages::StartEnd)); let red_damage = target.red_life().pct(skill.multiplier()); let blue_damage = target.blue_life().pct(skill.multiplier()); From e6e7713539e5c18fb6899231503b5441978a9142 Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 23 Oct 2019 19:17:57 +1000 Subject: [PATCH 26/38] remove inversion event --- client/src/animations.utils.jsx | 2 -- server/src/construct.rs | 6 +++--- server/src/skill.rs | 8 ++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/client/src/animations.utils.jsx b/client/src/animations.utils.jsx index 2e525c86..09cf7fa8 100644 --- a/client/src/animations.utils.jsx +++ b/client/src/animations.utils.jsx @@ -75,8 +75,6 @@ function getObjects(resolution, stages, game, account) { function getSequence(resolution) { if (!resolution.event) return []; - if (resolution.event[0] === 'Inversion') return []; - switch (resolution.stages) { case 'AllStages': return ['START_SKILL', 'END_SKILL', 'POST_SKILL']; case 'StartEnd': return ['START_SKILL', 'END_SKILL']; diff --git a/server/src/construct.rs b/server/src/construct.rs index d1f5eab9..325e6d5e 100644 --- a/server/src/construct.rs +++ b/server/src/construct.rs @@ -606,7 +606,7 @@ impl Construct { }); }, true => { - events.push(Event::Inversion { skill }); + // events.push(Event::Inversion { skill }); // there is no green shield (yet) let current_green_life = self.green_life(); @@ -669,7 +669,7 @@ impl Construct { }); }, true => { - events.push(Event::Inversion { skill }); + // events.push(Event::Inversion { skill }); let current_green_life = self.green_life(); self.green_life.increase(modified_power); @@ -738,7 +738,7 @@ impl Construct { }); }, true => { - events.push(Event::Inversion { skill }); + // events.push(Event::Inversion { skill }); let current_green_life = self.green_life(); self.green_life.increase(modified_power); diff --git a/server/src/skill.rs b/server/src/skill.rs index ed594c4d..3aab4aa8 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -2004,10 +2004,10 @@ mod tests { // attack should heal and recharge red shield let mut results = attack(&mut x, &mut y, vec![], Skill::Attack); - match results.remove(0).event { - Event::Inversion { skill } => assert_eq!(skill, Skill::Attack), - _ => panic!("not inversion"), - }; + // match results.remove(0).event { + // Event::Inversion { skill } => assert_eq!(skill, Skill::Attack), + // _ => panic!("not inversion"), + //}; match results.remove(0).event { Event::Healing { skill: _, overhealing: _, amount } => assert!(amount > 0), From d9563f8a9a0596f791b2c4bc5efe134975d5c057 Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 24 Oct 2019 08:50:24 +1000 Subject: [PATCH 27/38] convert server enum into anims keywords --- client/src/animations.utils.jsx | 8 ++++---- client/src/events.jsx | 22 ++++++++++++---------- server/src/skill.rs | 8 ++++++++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/client/src/animations.utils.jsx b/client/src/animations.utils.jsx index 09cf7fa8..05ca0e8a 100644 --- a/client/src/animations.utils.jsx +++ b/client/src/animations.utils.jsx @@ -8,7 +8,7 @@ function none() { }; } -function getObjects(resolution, stages, game, account) { +function getObjects(resolution, game, account) { if (!resolution) return none(); if (!resolution.target) return none(); @@ -53,7 +53,7 @@ function getObjects(resolution, stages, game, account) { }; }; - const skipSource = !stages.includes('START_SKILL') + const skipSource = !resolution.stages.includes('START_SKILL') || resolution.source.id === resolution.target.id; const animSource = skipSource @@ -118,10 +118,10 @@ function getFocusTargets(resolution, game) { return [target]; } -function getText(resolution, sequence) { +function getText(resolution) { const nullText = { text: null, constructId: null, life: null }; if (!resolution) return nullText; - if (!sequence.includes('POST_SKILL')) return nullText; + if (!resolution.stages.includes('POST_SKILL')) return nullText; function generatePostSkill() { const [type, event] = resolution.event; diff --git a/client/src/events.jsx b/client/src/events.jsx index b70d2221..972ea9d0 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -67,21 +67,22 @@ function registerEvents(store) { // stop fetching the game state til animations are done const newRes = game.resolved.slice(currentGame.resolved.length); return eachSeries(newRes, (r, cb) => { - // convert server enum into anims keywords - // todo make serersideonly - const sequence = animations.getSequence(r); - const timeout = animations.getTime(sequence); - const anims = animations.getObjects(r, sequence, game, account); - const text = animations.getText(r, sequence); + const timeout = animations.getTime(r.stages); + const anims = animations.getObjects(r, game, account); + const text = animations.getText(r); store.dispatch(actions.setAnimFocus(animations.getFocusTargets(r, game))); if (anims.animSkill) store.dispatch(actions.setAnimSkill(anims.animSkill)); - if (sequence.includes('START_SKILL') && anims.animSource) store.dispatch(actions.setAnimSource(anims.animSource)); - if (sequence.includes('END_SKILL') && anims.animTarget) { + if (r.stages.includes('START_SKILL') && anims.animSource) { + store.dispatch(actions.setAnimSource(anims.animSource)); + } + + if (r.stages.includes('END_SKILL') && anims.animTarget) { store.dispatch(actions.setAnimTarget(anims.animTarget)); if (animations.isCbAnim(anims.animSkill)) store.dispatch(actions.setAnimCb(cb)); } - if (sequence.includes('POST_SKILL') && text) { + + if (r.stages.includes('POST_SKILL') && text) { // timeout to prevent text classes from being added too soon if (timeout === TIMES.POST_SKILL_DURATION_MS) { store.dispatch(actions.setAnimText(text)); @@ -92,13 +93,14 @@ function registerEvents(store) { ); } } + return setTimeout(() => { store.dispatch(actions.setAnimSkill(null)); store.dispatch(actions.setAnimSource(null)); store.dispatch(actions.setAnimTarget(null)); store.dispatch(actions.setAnimText(null)); store.dispatch(actions.setAnimFocus([])); - if (sequence.includes('END_SKILL') && animations.isCbAnim(anims.animSkill)) return true; + if (r.stages.includes('END_SKILL') && animations.isCbAnim(anims.animSkill)) return true; return cb(); }, timeout); }, err => { diff --git a/server/src/skill.rs b/server/src/skill.rs index 3aab4aa8..75a6094d 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -408,13 +408,21 @@ pub struct EventConstruct { #[derive(Debug,Clone,PartialEq,Serialize,Deserialize)] pub enum EventStages { + #[serde(rename = "START_SKILL END_SKILL POST_SKILL")] AllStages, // Anim Anim Anim + #[serde(rename = "START_SKILL END_SKILL")] StartEnd, // Anim Anim Skip + #[serde(rename = "START_SKILL POST_SKILL")] StartPost, // Anim Skip Anim + #[serde(rename = "START_SKILL")] StartOnly, // Anim Skip Skip + #[serde(rename = "END_SKILL POST_SKILL")] EndPost, // Skip Anim Anim + #[serde(rename = "END_SKILL")] EndOnly, // Skip Anim Skip + #[serde(rename = "POST_SKILL")] PostOnly, // Skip Skip Anim + #[serde(rename = "")] NoStages, // Skip Skip Skip } From e0cae50cc65d6642d7628eb171f810ccec90f955 Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 24 Oct 2019 08:53:04 +1000 Subject: [PATCH 28/38] anim cleanup --- client/src/animations.utils.jsx | 16 ---------------- client/src/events.jsx | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/client/src/animations.utils.jsx b/client/src/animations.utils.jsx index 05ca0e8a..8e2818c7 100644 --- a/client/src/animations.utils.jsx +++ b/client/src/animations.utils.jsx @@ -73,21 +73,6 @@ function getObjects(resolution, game, account) { }; } -function getSequence(resolution) { - if (!resolution.event) return []; - switch (resolution.stages) { - case 'AllStages': return ['START_SKILL', 'END_SKILL', 'POST_SKILL']; - case 'StartEnd': return ['START_SKILL', 'END_SKILL']; - case 'StartPost': return ['START_SKILL', 'POST_SKILL']; - case 'StartOnly': return ['START_SKILL']; - case 'EndPost': return ['END_SKILL', 'POST_SKILL']; - case 'EndOnly': return ['END_SKILL']; - case 'PostOnly': return ['POST_SKILL']; - case 'NoStages': return []; - default: return ['START_SKILL', 'END_SKILL', 'POST_SKILL']; - } -} - function getTime(stages) { let time = 0; if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) { @@ -212,7 +197,6 @@ module.exports = { getFocusTargets, getObjects, getTime, - getSequence, getText, isCbAnim, }; diff --git a/client/src/events.jsx b/client/src/events.jsx index 972ea9d0..b09cb57c 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -63,10 +63,10 @@ function registerEvents(store) { if (game.resolved.length !== currentGame.resolved.length) { store.dispatch(actions.setAnimating(true)); store.dispatch(actions.setGameSkillInfo(null)); - // stop fetching the game state til animations are done const newRes = game.resolved.slice(currentGame.resolved.length); return eachSeries(newRes, (r, cb) => { + if (!r.event) return cb; const timeout = animations.getTime(r.stages); const anims = animations.getObjects(r, game, account); const text = animations.getText(r); From a388a3427020717a6fe356076690c0102b05971b Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 24 Oct 2019 09:01:40 +1000 Subject: [PATCH 29/38] bailout for no stages --- client/src/events.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/events.jsx b/client/src/events.jsx index b09cb57c..66832af9 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -66,7 +66,7 @@ function registerEvents(store) { // stop fetching the game state til animations are done const newRes = game.resolved.slice(currentGame.resolved.length); return eachSeries(newRes, (r, cb) => { - if (!r.event) return cb; + if (!r.event || r.stages === '') return cb; const timeout = animations.getTime(r.stages); const anims = animations.getObjects(r, game, account); const text = animations.getText(r); From 657d0950f64631034d9219333885cc92624f83b1 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 24 Oct 2019 11:09:43 +1100 Subject: [PATCH 30/38] v1.6.4 --- VERSION | 2 +- acp/package.json | 2 +- client/package.json | 2 +- ops/package.json | 2 +- server/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index f5d2a585..6463e95e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3 \ No newline at end of file +1.6.4 \ No newline at end of file diff --git a/acp/package.json b/acp/package.json index b0f4f97b..58c51770 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.3", + "version": "1.6.4", "description": "", "main": "index.js", "scripts": { diff --git a/client/package.json b/client/package.json index c2b00a0b..79c60238 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.3", + "version": "1.6.4", "description": "", "main": "index.js", "scripts": { diff --git a/ops/package.json b/ops/package.json index 07c68e1e..32dfed42 100755 --- a/ops/package.json +++ b/ops/package.json @@ -1,6 +1,6 @@ { "name": "mnml-ops", - "version": "1.6.3", + "version": "1.6.4", "description": "", "main": "index.js", "scripts": { diff --git a/server/Cargo.toml b/server/Cargo.toml index 80e33093..07d3812c 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mnml" -version = "1.6.3" +version = "1.6.4" authors = ["ntr "] [dependencies] From dc62b45a33a101aa6dd4a8222feacaeca2c50692 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 24 Oct 2019 18:03:58 +1100 Subject: [PATCH 31/38] changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9be80477..807de0fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [1.6.3] - 2019-10-23 +## [1.6.4] - 2019-10-24 +### Changed +- Animations processing on client side reduced. +## [1.6.3] - 2019-10-23 ### Added - MNNI: the MNML guide - Delivers the message of the day From 6948fce6e06e23b2b35571c632b6badaa641d57a Mon Sep 17 00:00:00 2001 From: Mashy Date: Fri, 25 Oct 2019 13:10:03 +1000 Subject: [PATCH 32/38] early return fix --- client/src/events.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/events.jsx b/client/src/events.jsx index 66832af9..6f42c894 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -66,7 +66,7 @@ function registerEvents(store) { // stop fetching the game state til animations are done const newRes = game.resolved.slice(currentGame.resolved.length); return eachSeries(newRes, (r, cb) => { - if (!r.event || r.stages === '') return cb; + if (!r.event || r.stages === '') return cb(); const timeout = animations.getTime(r.stages); const anims = animations.getObjects(r, game, account); const text = animations.getText(r); From ec6db16396f9fbbf2bf6fe3f0c3f75da672324df Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 14:23:34 +1100 Subject: [PATCH 33/38] flex btn --- client/assets/mnni.svg | 26 +++++++++++++------------- client/assets/styles/controls.less | 4 ++++ client/src/components/play.ctrl.jsx | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/client/assets/mnni.svg b/client/assets/mnni.svg index 3b4b744b..2977381b 100644 --- a/client/assets/mnni.svg +++ b/client/assets/mnni.svg @@ -11,8 +11,8 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="2100mm" - height="1100mm" - viewBox="0 0 2100 1100" + height="2100mm" + viewBox="0 0 2100 2100" version="1.1" id="svg16" inkscape:version="0.92.1 r15371" @@ -2008,15 +2008,15 @@ id="g4989"> @@ -2459,9 +2459,9 @@ inkscape:pageshadow="2" inkscape:zoom="0.079573438" inkscape:cx="3528.1874" - inkscape:cy="583.63933" + inkscape:cy="3097.0409" inkscape:document-units="mm" - inkscape:current-layer="layer2" + inkscape:current-layer="layer1" showgrid="true" inkscape:snap-grids="true" inkscape:window-width="1920" @@ -2515,7 +2515,7 @@ id="layer2" inkscape:label="boxes" style="display:none" - transform="translate(0,100)"> + transform="translate(0,1100)"> diff --git a/client/assets/styles/controls.less b/client/assets/styles/controls.less index b465938d..6349f182 100644 --- a/client/assets/styles/controls.less +++ b/client/assets/styles/controls.less @@ -117,6 +117,10 @@ aside { font-size: 200%; animation: co 0.75s cubic-bezier(0, 0, 1, 1) 0s infinite alternate; } + + .flex { + flex: 1; + } } .abandon:not([disabled]) { diff --git a/client/src/components/play.ctrl.jsx b/client/src/components/play.ctrl.jsx index 39f11fc0..d267b670 100644 --- a/client/src/components/play.ctrl.jsx +++ b/client/src/components/play.ctrl.jsx @@ -16,7 +16,7 @@ function JoinButtons(args) {
- +
From 15ef79f2a102909869dad2cc42e6d362ab3f2129 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 14:24:06 +1100 Subject: [PATCH 34/38] v1.6.5 --- VERSION | 2 +- acp/package.json | 2 +- client/package.json | 2 +- ops/package.json | 2 +- server/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 6463e95e..49ebdd60 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.4 \ No newline at end of file +1.6.5 \ No newline at end of file diff --git a/acp/package.json b/acp/package.json index 58c51770..2591fabe 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.4", + "version": "1.6.5", "description": "", "main": "index.js", "scripts": { diff --git a/client/package.json b/client/package.json index 79c60238..6c6d56fe 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.4", + "version": "1.6.5", "description": "", "main": "index.js", "scripts": { diff --git a/ops/package.json b/ops/package.json index 32dfed42..40211410 100755 --- a/ops/package.json +++ b/ops/package.json @@ -1,6 +1,6 @@ { "name": "mnml-ops", - "version": "1.6.4", + "version": "1.6.5", "description": "", "main": "index.js", "scripts": { diff --git a/server/Cargo.toml b/server/Cargo.toml index 07d3812c..4df35fa1 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mnml" -version = "1.6.4" +version = "1.6.5" authors = ["ntr "] [dependencies] From f87db71ac144b63d2226c0cc77b9eb8c22d247c7 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 14:41:41 +1100 Subject: [PATCH 35/38] enabled button css fix --- client/assets/styles/controls.less | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/assets/styles/controls.less b/client/assets/styles/controls.less index 6349f182..2ff3ee04 100644 --- a/client/assets/styles/controls.less +++ b/client/assets/styles/controls.less @@ -85,6 +85,17 @@ aside { transition-property: color, background; transition-duration: 0.25s; transition-timing-function: ease; + + &:enabled { + color: forestgreen; + border-color: forestgreen; + + &:hover { + background: forestgreen; + color: black; + border-color: forestgreen; + } + } } .team-page-ctrl { From 753e5c9b12f0b16f73a3f10b20ee82d8269b12c5 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 15:14:23 +1100 Subject: [PATCH 36/38] default register --- client/src/components/welcome.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/welcome.jsx b/client/src/components/welcome.jsx index 6146b7a0..790fe3ae 100644 --- a/client/src/components/welcome.jsx +++ b/client/src/components/welcome.jsx @@ -8,7 +8,7 @@ const Help = require('./welcome.help'); const Demo = require('./demo'); function Welcome() { - const page = this.state.page || 'login'; + const page = this.state.page || 'register'; const navRegister = () => this.setState({ page: 'register' }); const pageEl = () => { From 41e74710e99a47491b33b0aabf70faa3a507aa7b Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 15:21:19 +1100 Subject: [PATCH 37/38] click to copy --- client/src/components/play.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/play.jsx b/client/src/components/play.jsx index dc7a1720..25906879 100644 --- a/client/src/components/play.jsx +++ b/client/src/components/play.jsx @@ -120,7 +120,7 @@ function Play(args) { type="submit"> Copy 🔗 -
Invite Generated
+
Click to Copy
); }; From 8d553403aab8cd296098b796515c81243b40f6da Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 15:32:42 +1100 Subject: [PATCH 38/38] MNML index --- client/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/index.html b/client/index.html index 57f8602d..760d2f1e 100644 --- a/client/index.html +++ b/client/index.html @@ -9,7 +9,7 @@ - mnml - abstract strategy + MNML - abstract strategy @@ -19,7 +19,7 @@