Add ledge getup, ledge intangibility limit & fix walk-off velocity (#93)
Reviewed-on: #93 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #93.
This commit is contained in:
@@ -213,7 +213,7 @@ pub fn collide_with_stage_grounded(
|
||||
state_context.surface.land(StageLineID {
|
||||
polygon: current_line_id.polygon,
|
||||
segment: segment_idx,
|
||||
});
|
||||
}, state_context.ledge_info);
|
||||
GroundedMotionResult::InGround
|
||||
}
|
||||
GroundedPositionResult::InAir => {
|
||||
@@ -246,7 +246,7 @@ pub fn collision_interrupt(ctx: &mut CollisionContext, can_walk_off: bool) -> Op
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::fighter::ecb::FighterPreviousECB;
|
||||
use crate::fighter::{FighterECB, FighterPreviousTranslation, FighterSurfaceState};
|
||||
use crate::fighter::{FighterECB, FighterLedgeInformation, FighterPreviousTranslation, FighterSurfaceState};
|
||||
use crate::math::rect::FGRect;
|
||||
use crate::stage::line::StagePolyType;
|
||||
use crate::input::FighterInput;
|
||||
@@ -371,6 +371,7 @@ use crate::stage::line::StagePolyType;
|
||||
let mut translation = FighterTranslation(FGVec2::lit("11", "0"));
|
||||
let previous_translation = FighterPreviousTranslation(translation.0);
|
||||
let mut velocity = FighterVelocity::default();
|
||||
let mut ledge_info = FighterLedgeInformation::default();
|
||||
let mut ecb = FighterECB {
|
||||
bottom: FGVec2::lit("0.0", "-0.5"),
|
||||
top: FGVec2::lit("0.0", "0.5"),
|
||||
@@ -386,6 +387,7 @@ use crate::stage::line::StagePolyType;
|
||||
velocity: &mut velocity,
|
||||
surface: &mut surface,
|
||||
ecb: &mut ecb,
|
||||
ledge_info: &mut ledge_info,
|
||||
prev_ecb: &previous_ecb,
|
||||
stage_collision: &stage_collision,
|
||||
leave_ground_ecb_lock_duration: 10,
|
||||
@@ -395,7 +397,6 @@ use crate::stage::line::StagePolyType;
|
||||
origin: FGVec2::ZERO,
|
||||
end: FGVec2::ZERO,
|
||||
},
|
||||
ledge_grab_lockout_active: false,
|
||||
};
|
||||
|
||||
assert!(matches!(
|
||||
@@ -440,6 +441,7 @@ use crate::stage::line::StagePolyType;
|
||||
};
|
||||
let previous_ecb = FighterPreviousECB::from(ecb);
|
||||
let mut presentation_snap = crate::fighter::FighterPresentationSnap::default();
|
||||
let mut ledge_info = FighterLedgeInformation::default();
|
||||
let mut context = CollisionContext {
|
||||
translation: &mut translation,
|
||||
prev_translation: &previous_translation,
|
||||
@@ -447,6 +449,7 @@ use crate::stage::line::StagePolyType;
|
||||
velocity: &mut velocity,
|
||||
surface: &mut surface,
|
||||
ecb: &mut ecb,
|
||||
ledge_info: &mut ledge_info,
|
||||
prev_ecb: &previous_ecb,
|
||||
stage_collision: &stage_collision,
|
||||
leave_ground_ecb_lock_duration: 10,
|
||||
@@ -456,7 +459,6 @@ use crate::stage::line::StagePolyType;
|
||||
origin: FGVec2::ZERO,
|
||||
end: FGVec2::ZERO,
|
||||
},
|
||||
ledge_grab_lockout_active: false,
|
||||
};
|
||||
|
||||
assert!(matches!(
|
||||
|
||||
Reference in New Issue
Block a user