1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-20 00:46:34 +00:00

Ledge Trump Fix (#317)

* initial fix with frame 19 override, need to remove debug and fix delay

* trump avoidance working, debug still present

* Cleanup
This commit is contained in:
GradualSyrup 2022-03-17 08:26:58 -05:00 committed by GitHub
parent 01a0d51548
commit 5422cf5e1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,24 +58,33 @@ fn roll_ledge_case() {
}
pub unsafe fn force_option(module_accessor: &mut app::BattleObjectModuleAccessor) {
if StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CLIFF_WAIT {
if StatusModule::situation_kind(module_accessor) as i32 != *SITUATION_KIND_CLIFF {
// No longer on ledge, so re-roll the ledge case and reset the delay counter for next time
reset_ledge_case();
reset_ledge_delay();
return;
}
// Need to roll ledge delay so we know if getup needs to be buffered
roll_ledge_delay();
roll_ledge_case();
// This flag is false when needing to buffer, and true when getting up
let flag_cliff = WorkModule::is_flag(module_accessor,*FIGHTER_INSTANCE_WORK_ID_FLAG_CATCH_CLIFF);
let current_frame = MotionModule::frame(module_accessor) as i32;
let should_buffer = (LEDGE_DELAY == 0) && (current_frame == 19) && (!flag_cliff);
if !WorkModule::is_enable_transition_term(
module_accessor,
*FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_CLIFF_ATTACK,
) {
// Not able to take any action yet
return;
// This check isn't reliable for buffered options in time, so don't return if we need to buffer an option this frame
if !should_buffer {
return;
}
}
roll_ledge_delay();
roll_ledge_case();
if LEDGE_CASE == LedgeOption::WAIT {
// Do nothing, but don't reset the ledge case.
return;
@ -87,6 +96,9 @@ pub unsafe fn force_option(module_accessor: &mut app::BattleObjectModuleAccessor
}
let status = LEDGE_CASE.into_status().unwrap_or(0);
StatusModule::change_status_request_from_script(module_accessor, status, true);
match LEDGE_CASE {
LedgeOption::JUMP => {
mash::buffer_menu_mash();
@ -94,7 +106,6 @@ pub unsafe fn force_option(module_accessor: &mut app::BattleObjectModuleAccessor
_ => mash::perform_defensive_option(),
}
StatusModule::change_status_request_from_script(module_accessor, status, true);
}
pub unsafe fn is_enable_transition_term(