put animation skill into state
This commit is contained in:
@@ -9,8 +9,8 @@ const shapes = require('./shapes');
|
||||
const { removeTier } = require('../utils');
|
||||
|
||||
const addState = connect(
|
||||
({ game, account, animTarget, animating, itemInfo }) =>
|
||||
({ game, account, animTarget, animating, itemInfo })
|
||||
({ game, account, animSkill, animating, itemInfo }) =>
|
||||
({ game, account, animSkill, animating, itemInfo })
|
||||
);
|
||||
|
||||
class TargetSvg extends Component {
|
||||
@@ -28,15 +28,15 @@ class TargetSvg extends Component {
|
||||
}
|
||||
|
||||
render(props, state) {
|
||||
const { game, account, animating, animTarget, itemInfo } = props;
|
||||
const { game, account, animating, animSkill, itemInfo } = props;
|
||||
const { width, height } = state;
|
||||
if (!game) return false; // game will be null when battle ends
|
||||
|
||||
// resolutions happening
|
||||
// just put skill name up
|
||||
if (animating) {
|
||||
if (!animTarget) return false;
|
||||
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(animTarget.skill));
|
||||
if (!animSkill) return false;
|
||||
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(animSkill));
|
||||
const itemSourceInfo = itemSource.length
|
||||
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
|
||||
: false;
|
||||
@@ -44,7 +44,7 @@ class TargetSvg extends Component {
|
||||
const itemSourceDescription = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]());
|
||||
return (
|
||||
<div class="resolving-skill">
|
||||
<h1>{animTarget.skill}</h1>
|
||||
<h1>{animSkill}</h1>
|
||||
<div> {itemSourceDescription} </div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user