Implement animation root motion deltas (#84)
CI / build-and-test (push) Successful in 1m33s
CI / production-build (push) Successful in 12m5s

Implements root motion and adds a dash attack.

Reviewed-on: #84
Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #84.
This commit is contained in:
2026-10-05 20:04:35 +00:00
committed by EIREXE
parent 5c277a00f0
commit 7a9adbd6a4
13 changed files with 459 additions and 23 deletions
+18
View File
@@ -17,6 +17,7 @@ struct MoveCompiler {
iasa_frame: Option<u32>,
landing_duration: Option<u32>,
cursor: u32,
use_root_motion: bool,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
@@ -114,6 +115,10 @@ impl MoveCompiler {
self.iasa_frame = Some(iasa_frame);
}
fn enable_root_motion(&mut self) {
self.use_root_motion = true;
}
fn into_attack_script(mut self) -> Result<FighterAttackScript, String> {
self.remove_all_hitboxes().map_err(|err| err.to_string())?;
let mut hitboxes = self.hitboxes;
@@ -124,6 +129,7 @@ impl MoveCompiler {
iasa_frame: self.iasa_frame,
wont_autocancel_window: self.wont_autocancel_window,
landing_duration: self.landing_duration,
use_root_motion: self.use_root_motion,
})
}
}
@@ -232,6 +238,18 @@ pub fn compile_script(text: &str) -> Result<FighterAttackScript, String> {
);
}
{
let mc = mc.clone();
engine.register_fn(
"enable_root_motion",
move || -> Result<(), Box<EvalAltResult>> {
let mut b = mc.borrow_mut();
b.enable_root_motion();
Ok(())
},
);
}
{
let mc = mc.clone();
engine.register_fn(