Animations should use the state from the previous strike

This commit is contained in:
Sam 2022-05-10 11:31:52 -04:00
parent 0c054837f9
commit c4987c3c48

View File

@ -33,11 +33,14 @@ impl Animation for ComboAnimation {
*rate = 1.0;
let mut next = (*skeleton).clone();
let (move1, move2, move3, _move2h) = match stage_section {
for i in 0..=strike {
let (move1, move2, move3, _move2h) = if i == strike { match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time.powi(2), 0.0, anim_time.powf(0.25)),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 1.0),
_ => (0.0, 0.0, 0.0, 0.0),
}} else {
(1.0, 1.0, 1.0, 1.0)
};
let pullback = 1.0 - move3;
let move2 = move2 * pullback;
@ -52,7 +55,6 @@ impl Animation for ComboAnimation {
},
_ => {},
}
next
},
_ => {
match strike {
@ -750,9 +752,9 @@ impl Animation for ComboAnimation {
},
_ => {},
}
next
},
}
}
next
}
}