Deduplicate fighter state lifecycle policies (#36)
CI / build-and-test (push) Failing after 10m51s
CI / build-and-test (push) Failing after 10m51s
Fixes #22 Extracts shared grounded collision/friction and airborne movement/landing policies while preserving state-specific behavior. Running fighters now pass `can_walk_off = true` so they can run off platform edges. Includes grounded and airborne hitstun call sites. Reviewed-on: #36 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #36.
This commit is contained in:
@@ -5,8 +5,7 @@ use super::{
|
||||
use crate::fighter::FighterFacingDirection;
|
||||
use crate::fighter::animation::AnimKind;
|
||||
use crate::fighter::state::FighterState;
|
||||
use crate::fighter::state::fall::FallState;
|
||||
use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon};
|
||||
use crate::fighter::state::ground::GroundedStateCommon;
|
||||
use crate::input::FighterCommands::{SmashMoveLeft, SmashMoveRight};
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
@@ -107,13 +106,7 @@ impl FighterStateImpl for DashState {
|
||||
&mut self,
|
||||
state_context: &mut CollisionContext,
|
||||
) -> Option<FighterState> {
|
||||
if let GroundedMotionResult::InAir =
|
||||
ground::collide_with_stage_grounded(state_context, &mut self.ground_common, true)
|
||||
{
|
||||
Some(FighterState::Fall(FallState))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
ground::collision_interrupt(state_context, &mut self.ground_common, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user