item description speeds
This commit is contained in:
@@ -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,19 +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 === info);
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user