diff --git a/WORKLOG.md b/WORKLOG.md index 39803600..d254b298 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -30,7 +30,6 @@ Hexagon Set - Increase intensity for each visit _mashy_ -* add back combo preview * floating combat text combat (start opposite hp and float towards it) to speed up animations * represent construct colours during game phase (try %bar or dots) * buy from preview if you have the required bases in vbox / inventory diff --git a/client/src/animations.utils.jsx b/client/src/animations.utils.jsx index 1e0dd81b..461abe84 100644 --- a/client/src/animations.utils.jsx +++ b/client/src/animations.utils.jsx @@ -160,9 +160,9 @@ function getText(resolution) { if (type === 'Recharge') { const { red, blue } = event; - if (red > 0 && blue > 0) return { text: [`+${red}R +${blue}B`, ''], css: 'rb' }; - if (red > 0) return { text: [`+${red}R`, ''], css: 'red' }; - if (blue > 0) return { text: [`+${blue}B`, ''], css: 'blue' }; + if (red > 0 && blue > 0) return { text: `+${red}R +${blue}B`, css: 'rb' }; + if (red > 0) return { text: `+${red}R`, css: 'red' }; + if (blue > 0) return { text: `+${blue}B`, css: 'blue' }; return nullText; } diff --git a/client/src/components/game.construct.jsx b/client/src/components/game.construct.jsx index 58579c6a..2f1c0617 100644 --- a/client/src/components/game.construct.jsx +++ b/client/src/components/game.construct.jsx @@ -23,22 +23,39 @@ class combatText extends preact.Component { render(props) { const { construct, animText, itemInfo } = props; if (animText && animText.constructId === construct.id) { - const itemSource = itemInfo.combos.filter(c => c.item === removeTier(animText.skill)); - 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 itemSourceDescription = () => { + const itemSource = itemInfo.combos.filter(c => c.item === removeTier(animText.skill)); + const itemSourceInfo = itemSource.length + ? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}` + : false; + const itemRegEx = /(Red|Blue|Green)/; + return reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]()); + }; - return ( -