add ko event back but doing it right

This commit is contained in:
Mashy
2019-11-08 13:01:28 +10:00
parent e540128a94
commit 7b054340d4
5 changed files with 17 additions and 3 deletions
+9
View File
@@ -181,3 +181,12 @@ button {
color: @blue;
}
}
@keyframes target-ko {
0% {
opacity: 100%;
}
100% {
opacity: 20%;
}
}
+4
View File
@@ -201,6 +201,10 @@
font-size: 100%;
}
&.ko-transition {
animation: target-ko 1s ease-in-out 0s 1;
}
&.ko {
animation: none;
opacity: 0.20;
+1 -1
View File
@@ -111,7 +111,7 @@ function getText(resolution) {
function generatePostSkill() {
const [type, event] = resolution.event;
if (type === 'Ko') {
return { text: 'KO!', css: 'ko' };
return { text: 'KO!', css: 'ko-transition' };
}
if (type === 'Disable') {
+2 -1
View File
@@ -117,7 +117,8 @@ class GameConstruct extends Component {
setGameEffectInfo,
} = this.props;
const ko = construct.green_life.value === 0 ? 'ko' : '';
const koEvent = animText ? animText.text === 'KO!' && animText.constructId === construct.id : false;
const ko = construct.green_life.value === 0 && !koEvent ? 'ko' : '';
const classes = eventClasses(animating, animFocus, construct, animText);
const stats = ['RedLife', 'GreenLife', 'BlueLife'].map((s, j) => (