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

View File

@ -181,3 +181,12 @@ button {
color: @blue;
}
}
@keyframes target-ko {
0% {
opacity: 100%;
}
100% {
opacity: 20%;
}
}

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;

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') {

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) => (

View File

@ -353,8 +353,8 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
};
if target.is_ko() {
// resolutions.push(Resolution::new(&source, &target).event(Event::Ko()).stages(EventStages::PostOnly));
target.effects.clear();
resolutions.push(Resolution::new(&source, &target).event(Event::Ko()).stages(EventStages::PostOnly));
}
game.update_construct(&mut source);