anims nearly back
This commit is contained in:
@@ -17,7 +17,7 @@ class AnimText extends preact.Component {
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const { animText, construct } = this.props;
|
||||
if (animText && animText !== prevProps.animText && animText.variant[1].target === construct.id) {
|
||||
if (animText && animText !== prevProps.animText && animText.event[1].construct === construct.id) {
|
||||
anime({
|
||||
targets: '.combat-text',
|
||||
top: '40%',
|
||||
@@ -29,7 +29,7 @@ class AnimText extends preact.Component {
|
||||
|
||||
render() {
|
||||
const { construct, animText, itemInfo } = this.props;
|
||||
if (animText && animText.variant[1].target === construct.id) {
|
||||
if (animText && animText.event[1].construct === construct.id) {
|
||||
const itemSourceDescription = () => {
|
||||
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(animText.cast.skill));
|
||||
const itemSourceInfo = itemSource.length
|
||||
@@ -40,7 +40,7 @@ class AnimText extends preact.Component {
|
||||
};
|
||||
|
||||
const generateAnimText = () => {
|
||||
const [type, event] = animText.variant;
|
||||
const [type, event] = animText.event;
|
||||
if (type === 'Ko') return <h1><span>KO!</span></h1>;
|
||||
if (type === 'Disable') {
|
||||
const { disable } = event;
|
||||
|
||||
@@ -22,7 +22,7 @@ const addState = connect(
|
||||
class GameConstructEffects extends preact.Component {
|
||||
shouldComponentUpdate(newProps) {
|
||||
if (newProps.animText && newProps.animText !== this.props.animText) {
|
||||
const [type, info] = newProps.animText.variant;
|
||||
const [type, info] = newProps.animText.event;
|
||||
if (info.target === this.props.construct.id
|
||||
&& (type === 'Effect' || type === 'Removal')) return true;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class GameConstructEffects extends preact.Component {
|
||||
</div>);
|
||||
}
|
||||
|
||||
const effects = animText ? animText.variant[1].display.effects : construct.effects;
|
||||
const effects = animText ? animText.event[1].display.effects : construct.effects;
|
||||
|
||||
const renderEffects = effects.length
|
||||
? effects.map(c =>
|
||||
|
||||
@@ -8,7 +8,7 @@ const addState = connect(({ animText }) => ({ animText }));
|
||||
class GameConstructLife extends preact.Component {
|
||||
shouldComponentUpdate(newProps) {
|
||||
if (newProps.animText && newProps.animText !== this.props.animText) {
|
||||
const [type, info] = newProps.animText.variant;
|
||||
const [type, info] = newProps.animText.event;
|
||||
if (info.target === this.props.construct.id
|
||||
&& (type === 'Damage' || type === 'Healing' || type === 'Recharge')) return true;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class GameConstructLife extends preact.Component {
|
||||
};
|
||||
|
||||
if (animText) {
|
||||
const { red, blue, green } = animText.variant[1].display;
|
||||
const { red, blue, green } = animText.event[1].display;
|
||||
return lifeBars(red, green, blue);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user