Fix ledge transitions and root motion loops (#91)
## 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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user