Fix ledge transitions and root motion loops (#91)
CI / build-and-test (push) Successful in 1m39s
CI / production-build (push) Successful in 12m8s

## Summary

- resolve each ledge action to the walkable segment on the stage-interior side
- preserve repeating root-motion displacement across every animation cycle
- add regression coverage for left/right ledge segments and multiple root-motion wraps
- Implement ledge intangibility

Reviewed-on: #91
Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #91.
This commit is contained in:
2026-10-12 21:38:23 +00:00
committed by EIREXE
parent 9b974d0dd6
commit f53e67d8ad
9 changed files with 93 additions and 34 deletions
+9 -2
View File
@@ -3,9 +3,9 @@ use crate::fighter::animation::AnimKind;
use crate::fighter::state::air::AirborneStateCommon;
use crate::fighter::state::fall::FallState;
use crate::fighter::state::FighterState;
use crate::fighter::FighterFacingDirection;
use crate::fighter::state::jump::JumpStateInitiator;
use crate::fighter::state::ledge_action::{LedgeActionState};
use crate::fighter::{FighterFacingDirection, FighterInvulnerabilityState};
use crate::input::FighterCommands;
use crate::math::vec::FGVec2;
use crate::stage::line::{StageLedgeSide, StageVertexID};
@@ -58,6 +58,14 @@ impl FighterStateImpl for LedgeWaitState {
fn on_enter(&mut self, state_context: &mut EnterContext) {
state_context.velocity.0 = FGVec2::ZERO;
state_context.knockback_velocity.0 = FGVec2::ZERO;
*state_context.vulnerability = FighterInvulnerabilityState::Intangible {
frames_remaining: Some(
state_context
.game_settings
.fighter_common
.ledge_grab_invulnerability_duration,
),
};
let Some(ledge) = state_context.stage_collision.find_ledge_by_vertex(self.ledge_id) else {
return;
};
@@ -127,4 +135,3 @@ fn is_ledge_drop_input(
false
}