Implement hitstun and knockback.
This commit is contained in:
@@ -14,7 +14,7 @@ use crate::fighter::{
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
pub enum LandingType {
|
||||
Normal,
|
||||
Special
|
||||
Special,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
@@ -25,7 +25,10 @@ pub struct LandingState {
|
||||
|
||||
impl LandingState {
|
||||
pub fn create(grounded_common: GroundedStateCommon, landing_type: LandingType) -> Self {
|
||||
Self { grounded_common, landing_type }
|
||||
Self {
|
||||
grounded_common,
|
||||
landing_type,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +39,8 @@ impl FighterStateImpl for LandingState {
|
||||
if state_context.is_current_animation_finished() {
|
||||
grounded_movement_standstill_common_interrupts(state_context, &self.grounded_common)
|
||||
} else if state_context.get_current_animation_frame()
|
||||
>= state_context.fighter_manifest.attributes.landing_iasa && let LandingType::Normal = self.landing_type
|
||||
>= state_context.fighter_manifest.attributes.landing_iasa
|
||||
&& let LandingType::Normal = self.landing_type
|
||||
{
|
||||
dash::check_input(state_context, &self.grounded_common).or_else(|| {
|
||||
ground::grounded_movement_common_interrupts(state_context, &self.grounded_common)
|
||||
@@ -88,10 +92,10 @@ impl FighterStateImpl for LandingState {
|
||||
match self.landing_type {
|
||||
LandingType::Normal => {
|
||||
state_context.play_animation(AnimKind::Landing, false);
|
||||
},
|
||||
}
|
||||
LandingType::Special => {
|
||||
state_context.play_animation(AnimKind::LandingSpecial, false);
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user