Thresholds for specs
This commit is contained in:
parent
34ed44cc57
commit
0840dd7dfd
@ -512,4 +512,10 @@ header {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.thresholds {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: left;
|
||||||
|
}
|
||||||
|
|||||||
@ -190,62 +190,79 @@ module.exports = {
|
|||||||
|
|
||||||
GreenDamageI: {
|
GreenDamageI: {
|
||||||
description: 'Increases green damage',
|
description: 'Increases green damage',
|
||||||
|
colours: ['green'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
RedDamageI: {
|
RedDamageI: {
|
||||||
description: 'Increased red damage',
|
description: 'Increased red damage',
|
||||||
|
colours: ['red'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
BlueDamageI: {
|
BlueDamageI: {
|
||||||
description: 'Increased blue damage',
|
description: 'Increased blue damage',
|
||||||
|
colours: ['blue'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
GRDI: {
|
GRDI: {
|
||||||
description: 'Increased green and red damage',
|
description: 'Increased green and red damage',
|
||||||
|
colours: ['green', 'red'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
GBDI: {
|
GBDI: {
|
||||||
description: 'Increased green and blue damage',
|
description: 'Increased green and blue damage',
|
||||||
|
colours: ['green', 'blue'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
RBDI: {
|
RBDI: {
|
||||||
description: 'Increased red and blue damage',
|
description: 'Increased red and blue damage',
|
||||||
|
colours: ['red', 'blue'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
Speed: {
|
|
||||||
description: 'Increases speed of cryp',
|
|
||||||
upgrades: 'combine with 2 red / blue / green',
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
Hp: {
|
Hp: {
|
||||||
description: 'Increases life',
|
description: 'Increases life',
|
||||||
upgrades: 'combine with 2 red / blue / green',
|
upgrades: 'combine with 2 red / blue / green',
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
LifeI: {
|
LifeI: {
|
||||||
description: 'Increases life',
|
description: 'Increases life',
|
||||||
|
colours: ['green'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
RedShieldI: {
|
RedShieldI: {
|
||||||
description: 'Increased red shield',
|
description: 'Increased red shield',
|
||||||
|
colours: ['red'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
BlueShieldI: {
|
BlueShieldI: {
|
||||||
description: 'Increased blue shield',
|
description: 'Increased blue shield',
|
||||||
|
colours: ['blue'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
LRSI: {
|
LRSI: {
|
||||||
description: 'Increased life and red shield',
|
description: 'Increased life and red shield',
|
||||||
|
colours: ['green', 'red'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
LBSI: {
|
LBSI: {
|
||||||
description: 'Increased life and blue shield',
|
description: 'Increased life and blue shield',
|
||||||
|
colours: ['green', 'blue'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
RBSI: {
|
RBSI: {
|
||||||
description: 'Increased red and blue shield',
|
description: 'Increased red and blue shield',
|
||||||
|
colours: ['red', 'blue'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
Speed: {
|
Speed: {
|
||||||
@ -255,26 +272,38 @@ module.exports = {
|
|||||||
|
|
||||||
RedSpeedI: {
|
RedSpeedI: {
|
||||||
description: 'Increases red speed',
|
description: 'Increases red speed',
|
||||||
|
colours: ['red'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
BlueSpeedI: {
|
BlueSpeedI: {
|
||||||
description: 'Increases blue speed',
|
description: 'Increases blue speed',
|
||||||
|
colours: ['blue'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
GreenSpeedI: {
|
GreenSpeedI: {
|
||||||
description: 'Increases green speed',
|
description: 'Increases green speed',
|
||||||
|
colours: ['green'],
|
||||||
|
thresholds: [5, 10, 20],
|
||||||
},
|
},
|
||||||
|
|
||||||
GRSpeedI: {
|
GRSpeedI: {
|
||||||
description: 'Increases green and red speed',
|
description: 'Increases green and red speed',
|
||||||
|
colours: ['green', 'red'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
GBSpeedI: {
|
GBSpeedI: {
|
||||||
description: 'Increases green and blue speed',
|
description: 'Increases green and blue speed',
|
||||||
|
colours: ['green', 'blue'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
|
|
||||||
RBSpeedI: {
|
RBSpeedI: {
|
||||||
description: 'Increases red and blue speed',
|
description: 'Increases red and blue speed',
|
||||||
|
colours: ['red', 'blue'],
|
||||||
|
thresholds: [2, 5, 10],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -5,8 +5,6 @@ const molecule = require('./molecule');
|
|||||||
|
|
||||||
const { STATS } = require('../utils');
|
const { STATS } = require('../utils');
|
||||||
|
|
||||||
console.log(STATS);
|
|
||||||
|
|
||||||
// const SKILL_HOT_KEYS = ['Q', 'W', 'E', 'R'];
|
// const SKILL_HOT_KEYS = ['Q', 'W', 'E', 'R'];
|
||||||
|
|
||||||
function GamePanel(props) {
|
function GamePanel(props) {
|
||||||
@ -142,7 +140,7 @@ function GamePanel(props) {
|
|||||||
{skills}
|
{skills}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="stats">
|
<div className="cryp-box">
|
||||||
{stats}
|
{stats}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,13 +1,21 @@
|
|||||||
const preact = require('preact');
|
const preact = require('preact');
|
||||||
const { ITEMS: { SKILLS, SPECS, COLOURS } } = require('./constants');
|
const { ITEMS: { SKILLS, SPECS, COLOURS } } = require('./constants');
|
||||||
|
const { COLOUR_ICONS } = require('../utils');
|
||||||
|
|
||||||
function Info(args) {
|
function Info(args) {
|
||||||
const {
|
const {
|
||||||
info,
|
info,
|
||||||
sendUnequip,
|
sendUnequip,
|
||||||
|
instance,
|
||||||
} = args;
|
} = args;
|
||||||
if (!info.length) return (<div className="instance-info"> </div>);
|
if (!info.length) return (<div className="instance-info"> </div>);
|
||||||
|
let red = 0; let blue = 0; let green = 0;
|
||||||
|
instance.cryps.forEach(cryp => {
|
||||||
|
red += cryp.colours.red;
|
||||||
|
blue += cryp.colours.blue;
|
||||||
|
green += cryp.colours.green;
|
||||||
|
});
|
||||||
|
const teamColours = { red, blue, green };
|
||||||
const [type, value] = info;
|
const [type, value] = info;
|
||||||
if (type === 'item') {
|
if (type === 'item') {
|
||||||
let itemDetails;
|
let itemDetails;
|
||||||
@ -17,7 +25,7 @@ function Info(args) {
|
|||||||
itemDetails = SPECS[value];
|
itemDetails = SPECS[value];
|
||||||
} else if (COLOURS[value]) {
|
} else if (COLOURS[value]) {
|
||||||
itemDetails = COLOURS[value];
|
itemDetails = COLOURS[value];
|
||||||
} console.log(itemDetails);
|
}
|
||||||
return (
|
return (
|
||||||
<div className="instance-info">
|
<div className="instance-info">
|
||||||
{value} - {itemDetails.description}
|
{value} - {itemDetails.description}
|
||||||
@ -38,12 +46,34 @@ function Info(args) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function thresholds(t, spec) {
|
||||||
|
return (
|
||||||
|
SPECS[spec].colours.map((c, i) => (
|
||||||
|
<figure key={i} alt={c.colour}>
|
||||||
|
{COLOUR_ICONS[c].svg(`stat-icon ${COLOUR_ICONS[c].colour}`)}
|
||||||
|
<figcaption>{Math.min(teamColours[c], t)} / {t}</figcaption>
|
||||||
|
</figure>
|
||||||
|
))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (type === 'spec') {
|
if (type === 'spec') {
|
||||||
|
const breaks = SPECS[value.spec].thresholds ? SPECS[value.spec].thresholds.map((t, i) => {
|
||||||
|
const threshold = thresholds(t, value.spec);
|
||||||
|
return (
|
||||||
|
<div className="thresholds" key={i} alt={t}>
|
||||||
|
{threshold}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}) : null;
|
||||||
return (
|
return (
|
||||||
<div className="instance-info">
|
<div className="instance-info">
|
||||||
<div>
|
<div>
|
||||||
<div> {value.spec} </div>
|
<div> {value.spec} </div>
|
||||||
<div> {SPECS[value.spec].description} </div>
|
<div> {SPECS[value.spec].description} </div>
|
||||||
|
{breaks}
|
||||||
</div>
|
</div>
|
||||||
<button onClick={() => sendUnequip(value.cryp.id, value.spec)}>
|
<button onClick={() => sendUnequip(value.cryp.id, value.spec)}>
|
||||||
unequip
|
unequip
|
||||||
|
|||||||
@ -11,7 +11,7 @@ const addState = connect(
|
|||||||
return ws.sendVboxUnequip(instance.instance, crypId, item);
|
return ws.sendVboxUnequip(instance.instance, crypId, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { info, sendUnequip };
|
return { info, sendUnequip, instance };
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
function receiveDispatch(dispatch) {
|
function receiveDispatch(dispatch) {
|
||||||
|
|||||||
@ -91,6 +91,12 @@ const SPECS = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const COLOUR_ICONS = {
|
||||||
|
red: { colour: 'red', caption: 'red', svg: shapes.circle },
|
||||||
|
blue: { colour: 'blue', caption: 'blue', svg: shapes.circle },
|
||||||
|
green: { colour: 'green', caption: 'green', svg: shapes.circle },
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
stringSort,
|
stringSort,
|
||||||
numSort,
|
numSort,
|
||||||
@ -99,4 +105,5 @@ module.exports = {
|
|||||||
NULL_UUID,
|
NULL_UUID,
|
||||||
STATS,
|
STATS,
|
||||||
SPECS,
|
SPECS,
|
||||||
|
COLOUR_ICONS,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user