mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-14 02:16:10 +00:00
Fix Airdodge (#117)
* Update mash.rs Use StatusModule::change_status_request_from_script * Extract Method * Fix Air Dodge
This commit is contained in:
parent
a959a24edc
commit
e4850705fe
2 changed files with 21 additions and 9 deletions
|
@ -40,7 +40,7 @@ unsafe fn get_angle(module_accessor: &mut app::BattleObjectModuleAccessor) -> f6
|
|||
}
|
||||
|
||||
// Currently used for air dodge//Drift only
|
||||
if !(is_airborne(module_accessor) && is_in_hitstun(module_accessor)) {
|
||||
if !is_correct_status(module_accessor) {
|
||||
return ANGLE_NONE;
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,18 @@ unsafe fn get_angle(module_accessor: &mut app::BattleObjectModuleAccessor) -> f6
|
|||
angle
|
||||
}
|
||||
|
||||
fn is_correct_status(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||
let air_dodge_condition;
|
||||
unsafe {
|
||||
air_dodge_condition = is_airborne(module_accessor) && is_in_hitstun(module_accessor);
|
||||
}
|
||||
if air_dodge_condition {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
unsafe fn pick_angle(direction: Direction) -> f64 {
|
||||
if direction == Direction::Random {
|
||||
let rand_direction = get_random_direction();
|
||||
|
|
|
@ -192,18 +192,18 @@ unsafe fn perform_action(module_accessor: &mut app::BattleObjectModuleAccessor)
|
|||
|
||||
match action {
|
||||
Airdodge => {
|
||||
let expected_status;
|
||||
let transition_flag;
|
||||
// Shield if grounded instead
|
||||
if is_grounded(module_accessor) {
|
||||
reset();
|
||||
buffer_action(Shield);
|
||||
return 0;
|
||||
expected_status = *FIGHTER_STATUS_KIND_GUARD_ON;
|
||||
transition_flag = *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE;
|
||||
} else {
|
||||
expected_status = *FIGHTER_STATUS_KIND_ESCAPE_AIR;
|
||||
transition_flag = *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_AIR;
|
||||
}
|
||||
|
||||
return get_flag(
|
||||
module_accessor,
|
||||
*FIGHTER_STATUS_KIND_ESCAPE_AIR,
|
||||
*FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_AIR,
|
||||
);
|
||||
return get_flag(module_accessor, expected_status, transition_flag);
|
||||
}
|
||||
Jump => {
|
||||
return update_jump_flag(module_accessor);
|
||||
|
|
Loading…
Add table
Reference in a new issue