Rework input buffer to match HDR closer (#79)
## Summary - Preserve distinct same-action bindings in rollback input frames. - Add independent command lifetimes with tap and state-scoped hold buffering. - Detect second shield bindings and consume shield commands for air dodge. - Fix duplicate keyboard mappings being overwritten. Reviewed-on: #79 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #79.
This commit is contained in:
@@ -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,14 @@ impl FighterStateImpl for JumpSquatState {
|
||||
|
||||
fn on_enter(&mut self, state_context: &mut EnterContext) {
|
||||
state_context.play_animation(AnimKind::JumpSquat, false);
|
||||
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) {
|
||||
state_context.input.disable_hold_all();
|
||||
}
|
||||
|
||||
fn is_visually_grounded<'a>(&'a self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user