1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-28 04:44:06 +00:00

fix footstool/trump hitstun options

This commit is contained in:
jugeeya 2020-05-16 17:55:59 -07:00
parent c43da06180
commit bcd0ca5a28
4 changed files with 14 additions and 21 deletions

View file

@ -49,29 +49,29 @@ pub unsafe fn is_operation_cpu(module_accessor: &mut app::BattleObjectModuleAcce
}
pub unsafe fn is_in_hitstun(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
let status_kind = StatusModule::status_kind(module_accessor) as i32;
let status_kind = StatusModule::status_kind(module_accessor);
(*FIGHTER_STATUS_KIND_DAMAGE..=*FIGHTER_STATUS_KIND_DAMAGE_FALL).contains(&status_kind)
}
pub unsafe fn is_in_shieldstun(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
let status_kind = StatusModule::status_kind(module_accessor) as i32;
let prev_status = StatusModule::prev_status_kind(module_accessor, 0) as i32;
let status_kind = StatusModule::status_kind(module_accessor);
let prev_status = StatusModule::prev_status_kind(module_accessor, 0);
// If we are taking shield damage or we are droping shield from taking shield damage we are in hitstun
if status_kind == FIGHTER_STATUS_KIND_GUARD_DAMAGE
status_kind == FIGHTER_STATUS_KIND_GUARD_DAMAGE
|| (prev_status == FIGHTER_STATUS_KIND_GUARD_DAMAGE
&& status_kind == FIGHTER_STATUS_KIND_GUARD_OFF)
{
return true;
}
false
}
pub unsafe fn is_in_landing(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
let status_kind = StatusModule::status_kind(module_accessor) as i32;
let status_kind = StatusModule::status_kind(module_accessor);
(*FIGHTER_STATUS_KIND_LANDING..=*FIGHTER_STATUS_KIND_LANDING_DAMAGE_LIGHT).contains(&status_kind)
}
pub unsafe fn is_in_footstool(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
let status_kind = StatusModule::status_kind(module_accessor);
(*FIGHTER_STATUS_KIND_TREAD_DAMAGE..=*FIGHTER_STATUS_KIND_TREAD_FALL).contains(&status_kind)
}
pub unsafe fn perform_defensive_option(
_module_accessor: &mut app::BattleObjectModuleAccessor,
flag: &mut i32,

View file

@ -61,15 +61,6 @@ pub unsafe fn defensive_option(
) {
let status = StatusModule::status_kind(module_accessor) as i32;
let prev_status = StatusModule::prev_status_kind(module_accessor, 0) as i32;
// if [
// *FIGHTER_STATUS_KIND_CLIFF_JUMP3,
// *FIGHTER_STATUS_KIND_CLIFF_JUMP2,
// *FIGHTER_STATUS_KIND_CLIFF_JUMP1,
// ]
// .contains(&status)
// {
// *flag |= *FIGHTER_PAD_CMD_CAT1_FLAG_AIR_ESCAPE;
// }
if should_perform_defensive_option(module_accessor, prev_status, status) {
perform_defensive_option(module_accessor, flag);

View file

@ -29,6 +29,8 @@ pub unsafe fn get_command_flag_cat(
if is_in_hitstun(module_accessor)
|| is_in_landing(module_accessor)
|| is_in_shieldstun(module_accessor)
|| is_in_footstool(module_accessor)
|| StatusModule::status_kind(module_accessor) == FIGHTER_STATUS_KIND_CLIFF_ROBBED
{
match MENU.mash_state {
Mash::Airdodge => {
@ -134,7 +136,7 @@ pub unsafe fn check_button_on(
if [*CONTROL_PAD_BUTTON_GUARD_HOLD, *CONTROL_PAD_BUTTON_GUARD].contains(&button) {
if is_training_mode() && is_operation_cpu(module_accessor) {
if MENU.mash_state == Mash::Airdodge
&& (is_in_hitstun(module_accessor) || is_in_landing(module_accessor))
&& (is_in_hitstun(module_accessor) || is_in_landing(module_accessor) || is_in_footstool(module_accessor))
{
return Some(true);
}

View file

@ -125,7 +125,7 @@ pub unsafe fn handle_init_settings(
unk6: i32,
unk7: i32,
) {
let status_kind = StatusModule::status_kind(module_accessor) as i32;
let status_kind = StatusModule::status_kind(module_accessor);
tech::init_settings(module_accessor, status_kind).unwrap_or_else(|| {
original!()(
module_accessor,