Merge branch 'develop' into msg-pane
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mnml-client",
|
||||
"version": "1.4.6",
|
||||
"version": "1.4.8",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -34,7 +34,7 @@ class ConstructAvatar extends Component {
|
||||
<div
|
||||
class="avatar"
|
||||
id={construct.id}
|
||||
onClick={this.onClick.bind(this)}
|
||||
onMouseDown={this.onClick.bind(this)}
|
||||
style={{ 'background-image': `url(/imgs/${construct.img}.svg)` }}>
|
||||
<ConstructAnimation construct={construct} />
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ const range = require('lodash/range');
|
||||
const reactStringReplace = require('react-string-replace');
|
||||
|
||||
const { INFO } = require('./../constants');
|
||||
const { convertItem, removeTier, itemSpeed } = require('../utils');
|
||||
const { convertItem, removeTier } = require('../utils');
|
||||
const shapes = require('./shapes');
|
||||
|
||||
function InfoComponent(args) {
|
||||
@@ -46,15 +46,14 @@ function InfoComponent(args) {
|
||||
: 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>;
|
||||
const speed = <div> Speed {shapes.SpeedStat()} multiplier {fullInfo.speed * 4}% </div>;
|
||||
const cooldown = fullInfo.cooldown ? `${fullInfo.cooldown} Turn delay` : null;
|
||||
return (
|
||||
<div class="info-skill">
|
||||
<h2>{fullInfo.item}</h2>
|
||||
<h3>SKILL</h3>
|
||||
<h2>{fullInfo.item} - {fullInfo.cost}b</h2>
|
||||
<h3> SKILL </h3>
|
||||
{itemSourceDescription}
|
||||
<div> {cooldown} </div>
|
||||
<div>{infoDescription}</div>
|
||||
{speed}
|
||||
</div>
|
||||
@@ -133,7 +132,6 @@ function InfoComponent(args) {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
console.log(info);
|
||||
const bonusObj = info.includes('Life')
|
||||
? <div class={`${reqClass} bonus`} > + {bonus.bonus}</div>
|
||||
: <div class={`${reqClass} bonus`} > + {bonus.bonus}%</div>;
|
||||
@@ -157,7 +155,7 @@ function InfoComponent(args) {
|
||||
|
||||
return (
|
||||
<div class="info-spec">
|
||||
<h2>{info}</h2>
|
||||
<h2>{info} - {fullInfo.cost}b</h2>
|
||||
<h3>SPEC</h3>
|
||||
{itemSourceDescription}
|
||||
<div>{infoDescription}</div>
|
||||
@@ -167,10 +165,10 @@ function InfoComponent(args) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const cost = fullInfo.cost ? `- ${fullInfo.cost}b` : false;
|
||||
return (
|
||||
<div class="info-item">
|
||||
<h2>{fullInfo.item}</h2>
|
||||
<h2>{fullInfo.item} {cost}</h2>
|
||||
<div>{fullInfo.description}</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -87,12 +87,12 @@ function registerEvents(store) {
|
||||
);
|
||||
}
|
||||
return setTimeout(() => {
|
||||
const animSkill = anims.animTarget ? removeTier(anims.animTarget.skill) : false;
|
||||
store.dispatch(actions.setAnimSource(null));
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
store.dispatch(actions.setAnimText(null));
|
||||
store.dispatch(actions.setAnimFocus([]));
|
||||
if (!sequence.includes('END_SKILL')
|
||||
|| ['Banish', 'Invert'].includes(removeTier(anims.animTarget.skill))) return cb();
|
||||
if (!sequence.includes('END_SKILL') || (animSkill && ['Banish', 'Invert'].includes(animSkill))) return cb();
|
||||
return true;
|
||||
}, timeout);
|
||||
}, err => {
|
||||
@@ -206,6 +206,7 @@ function registerEvents(store) {
|
||||
}
|
||||
|
||||
function setDemo(d) {
|
||||
|
||||
const initial = {
|
||||
players: d,
|
||||
combiner: [],
|
||||
@@ -215,7 +216,8 @@ function registerEvents(store) {
|
||||
};
|
||||
|
||||
const startDemo = () => {
|
||||
console.log(initial);
|
||||
const { account } = store.getState();
|
||||
if (account) return false;
|
||||
store.dispatch(actions.setDemo(initial));
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0] }))), 2000);
|
||||
|
||||
@@ -187,20 +187,6 @@ const removeTier = skill => {
|
||||
return skill;
|
||||
};
|
||||
|
||||
function itemSpeed(item) {
|
||||
switch (item) {
|
||||
case 'Attack': return 1;
|
||||
case 'Stun': return 2;
|
||||
case 'Block': return 3;
|
||||
case 'Buff': return 4;
|
||||
case 'Debuff': return 4;
|
||||
case 'Red': return 3;
|
||||
case 'Green': return 2;
|
||||
case 'Blue': return 1;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function postData(url = '/', data = {}) {
|
||||
// Default options are marked with *
|
||||
return fetch(`/api${url}`, {
|
||||
@@ -264,6 +250,5 @@ module.exports = {
|
||||
TARGET_COLOURS,
|
||||
randomPoints,
|
||||
removeTier,
|
||||
itemSpeed,
|
||||
match,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user