Add Ultimate-style input binding buffers
CI / build-and-test (pull_request) Successful in 2m19s
CI / production-build (pull_request) Successful in 11m44s

This commit is contained in:
2026-09-29 19:59:50 +02:00
parent adf83ba03f
commit 6bab92fe25
9 changed files with 549 additions and 166 deletions
+22 -3
View File
@@ -11,7 +11,7 @@ use crate::{
ground,
},
},
input::FighterCommands,
input::{DigitalAction, FighterCommands},
math::{int::FGi32, vec::FGVec2},
};
#[derive(Debug, Hash, Clone, Copy)]
@@ -68,8 +68,18 @@ impl FighterStateImpl for JumpSquatState {
direction: wavedash_dir.normalize_or_zero(),
}))
} else if self.duration_counter >= state_context.fighter_attributes.jumpsquat_duration {
info!("Jump {}", state_context.input.get_last_frame().jump);
let jump_type = if state_context.input.get_last_frame().jump {
info!(
"Jump {}",
state_context
.input
.get_last_frame()
.is_held(DigitalAction::Jump)
);
let jump_type = if state_context
.input
.get_last_frame()
.is_held(DigitalAction::Jump)
{
JumpType::LongJump
} else {
JumpType::ShortHop
@@ -97,9 +107,18 @@ impl FighterStateImpl for JumpSquatState {
fn on_enter(&mut self, state_context: &mut EnterContext) {
state_context.play_animation(AnimKind::JumpSquat, false);
// Preserve buffered inputs while jump squat makes the transition
// temporarily unavailable, matching Ultimate/HDR-style hold input.
state_context.input.enable_hold_all(10);
state_context.input.clear_command(FighterCommands::Jump);
}
fn on_exit(&mut self, state_context: &mut crate::fighter::state::ExitContext) {
// The hold policy is state-scoped and must never leak into the next
// state. Command lifetime itself remains independent of this policy.
state_context.input.disable_hold_all();
}
fn is_visually_grounded<'a>(&'a self) -> bool {
true
}