mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-18 12:26:11 +00:00
Fix Tech Followup (#123)
* Add Dash Attack * Extract Method try_change_status * Code Formatting * Fix Tech Followups Fixed resetting after teching * Update Mash Restore mash after footstool
This commit is contained in:
parent
8c03361b8e
commit
658c0fe63c
2 changed files with 64 additions and 6 deletions
|
@ -70,15 +70,28 @@ pub unsafe fn is_airborne(module_accessor: &mut app::BattleObjectModuleAccessor)
|
||||||
situation_kind == SITUATION_KIND_AIR
|
situation_kind == SITUATION_KIND_AIR
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn is_idle(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
pub fn is_idle(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||||
let status_kind = StatusModule::status_kind(module_accessor);
|
let status_kind;
|
||||||
|
unsafe {
|
||||||
|
status_kind = StatusModule::status_kind(module_accessor);
|
||||||
|
}
|
||||||
status_kind == FIGHTER_STATUS_KIND_WAIT
|
status_kind == FIGHTER_STATUS_KIND_WAIT
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn is_in_hitstun(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
pub fn is_in_hitstun(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||||
let status_kind = StatusModule::status_kind(module_accessor);
|
let status_kind;
|
||||||
|
unsafe {
|
||||||
|
status_kind = StatusModule::status_kind(module_accessor);
|
||||||
|
}
|
||||||
(*FIGHTER_STATUS_KIND_DAMAGE..=*FIGHTER_STATUS_KIND_DAMAGE_FALL).contains(&status_kind)
|
(*FIGHTER_STATUS_KIND_DAMAGE..=*FIGHTER_STATUS_KIND_DAMAGE_FALL).contains(&status_kind)
|
||||||
}
|
}
|
||||||
|
pub fn is_in_footstool(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||||
|
let status_kind;
|
||||||
|
unsafe {
|
||||||
|
status_kind = StatusModule::status_kind(module_accessor);
|
||||||
|
}
|
||||||
|
(*FIGHTER_STATUS_KIND_TREAD_DAMAGE..=*FIGHTER_STATUS_KIND_TREAD_FALL).contains(&status_kind)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn is_shielding(module_accessor: *mut app::BattleObjectModuleAccessor) -> bool {
|
pub fn is_shielding(module_accessor: *mut app::BattleObjectModuleAccessor) -> bool {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -116,20 +116,65 @@ unsafe fn check_buffer(module_accessor: &mut app::BattleObjectModuleAccessor) {
|
||||||
Reset when CPU is idle to prevent deadlocks
|
Reset when CPU is idle to prevent deadlocks
|
||||||
and to reset when using the training mode reset
|
and to reset when using the training mode reset
|
||||||
*/
|
*/
|
||||||
if is_idle(module_accessor) {
|
if should_reset(module_accessor) {
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !is_in_hitstun(module_accessor) && MENU.mash_in_neutral != OnOff::On {
|
if !should_buffer(module_accessor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_menu_mash(module_accessor);
|
buffer_menu_mash(module_accessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn should_reset(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||||
|
if !is_idle(module_accessor) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let prev_status;
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
prev_status = StatusModule::prev_status_kind(module_accessor, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't reset after teching
|
||||||
|
if prev_status == *FIGHTER_STATUS_KIND_DOWN {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if prev_status == *FIGHTER_STATUS_KIND_PASSIVE {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if prev_status == *FIGHTER_STATUS_KIND_PASSIVE_FB {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn should_buffer(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
|
||||||
|
unsafe{
|
||||||
|
if MENU.mash_in_neutral == OnOff::On {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if is_in_hitstun(module_accessor) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if is_in_footstool(module_accessor) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Temp Translation
|
// Temp Translation
|
||||||
pub fn buffer_menu_mash(module_accessor: &mut app::BattleObjectModuleAccessor) -> Action {
|
pub fn buffer_menu_mash(module_accessor: &mut app::BattleObjectModuleAccessor) -> Action {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
Loading…
Add table
Reference in a new issue