@@ -291,6 +291,7 @@ pub struct Chaining {
291291impl Chaining {
292292 pub const PRIORITY : i32 = 30 ;
293293 pub const ANIMATION : & ' static str = "chaining" ;
294+ pub const FOLLOWUP_ANIMATION : & ' static str = "followup" ;
294295 pub const LENGTH : u32 = 2 ;
295296}
296297
@@ -923,33 +924,35 @@ fn chaining(
923924 if let Some ( attack) = available_attacks
924925 . attacks
925926 . iter ( )
926- . filter ( |a| a. name == "chain" . to_string ( ) )
927+ . filter ( |a| a. name == * "chain" )
927928 . last ( )
928929 {
929930 if let Some ( fighter) = fighter_assets. get ( meta_handle) {
930931 //if we havent started the chain yet or if we have input during chain window
931932 if !chaining. has_started || chaining. continue_chain && chaining. can_extend {
932- chaining. has_started = true ;
933- chaining. can_extend = false ;
933+ if !chaining. has_started {
934+ chaining. has_started = true ;
935+ animation. play ( Chaining :: ANIMATION , false ) ;
936+ }
934937 // Start the attack from the beginning
935938
936- animation. play ( Chaining :: ANIMATION , false ) ;
937939 //if we are on chain followup, skip the first frame of the animation
938940 if chaining. continue_chain {
941+ animation. play ( Chaining :: FOLLOWUP_ANIMATION , false ) ;
939942 animation. current_frame = 2 ;
940943 chaining. continue_chain = false ;
941944 chaining. link += 1 ;
942945 if chaining. link >= Chaining :: LENGTH {
943946 chaining. transition_to_final = true ;
944947 }
945948 }
949+ chaining. can_extend = false ;
946950
947951 let mut offset = attack. hitbox . offset ;
948952 if facing. is_left ( ) {
949953 offset. x *= -1.0
950954 }
951955 offset. y += fighter. collision_offset ;
952- // let attack_frames = attack.frames;
953956 // Spawn the attack entity
954957 let attack_entity = commands
955958 . spawn_bundle ( TransformBundle :: from_transform (
@@ -990,8 +993,7 @@ fn chaining(
990993 // Reset velocity
991994 * * velocity = Vec2 :: ZERO ;
992995
993- // Do a forward jump thing
994- //TODO: Fix hacky way to get a forward jump
996+ //move forward a bit during active frames
995997 if animation. current_frame > attack. frames . startup
996998 && animation. current_frame < attack. frames . recovery
997999 {
0 commit comments