diff --git a/dynamic/src/ext.rs b/dynamic/src/ext.rs index 973a3110f4..ae813219c5 100644 --- a/dynamic/src/ext.rs +++ b/dynamic/src/ext.rs @@ -319,7 +319,7 @@ bitflags! { const Parry = 0x100000; const CStickOverride = 0x200000; const RivalsWallJump = 0x400000; - const ParryManual = 0x800000; + const TreadJump = 0x800000; const SpecialAll = 0x20802; const AttackAll = 0x201; diff --git a/fighters/common/src/function_hooks/controls.rs b/fighters/common/src/function_hooks/controls.rs index 6e2b4f1ae7..511b0889ce 100644 --- a/fighters/common/src/function_hooks/controls.rs +++ b/fighters/common/src/function_hooks/controls.rs @@ -119,30 +119,37 @@ unsafe fn map_controls_hook( let mappings = mappings.add(player_idx as usize); let parry_map = if (*out).buttons.intersects(Buttons::Guard) { Buttons::Parry | Buttons::GuardHold } else { Buttons::Parry | Buttons::Guard }; + // Map the Footstool input to any combination of two distinct jump buttons + let shorthop_map = if (*out).buttons.intersects(Buttons::Jump) { Buttons::TreadJump | Buttons::JumpMini | Buttons::Jump } else { Buttons::JumpMini | Buttons::Jump }; + // If shorthop button is pressed before we mapped shorthop_map, then we know two buttons are pressed + if (*out).buttons.intersects(Buttons::JumpMini) { + (*out).buttons |= Buttons::TreadJump; + } + if controller.style == ControllerStyle::GCController { (*out).buttons |= apply_button_mappings!( controller, mappings, - (l, gc_l, JumpMini, Buttons::JumpMini | Buttons::Jump)( + (l, gc_l, JumpMini, shorthop_map)( r, gc_r, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(zl, gc_z, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(zl, gc_z, JumpMini, shorthop_map)( zr, gc_z, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(a, gc_a, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(a, gc_a, JumpMini, shorthop_map)( b, gc_b, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(x, gc_x, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(x, gc_x, JumpMini, shorthop_map)( y, gc_y, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map ) ); (*out).buttons |= apply_button_mappings!( @@ -241,6 +248,16 @@ unsafe fn map_controls_hook( gc_y, Parry, parry_map + )(dpad_up, gc_dup, Parry, parry_map)( + dpad_down, + gc_ddown, + Parry, + parry_map + )(dpad_left, gc_dlr, Parry, parry_map)( + dpad_right, + gc_dlr, + Parry, + parry_map ) ); if (*mappings).gc_absmash & 1 != 0 { @@ -263,36 +280,36 @@ unsafe fn map_controls_hook( (*out).buttons |= apply_button_mappings!( controller, mappings, - (l, joy_shoulder, JumpMini, Buttons::JumpMini | Buttons::Jump)( + (l, joy_shoulder, JumpMini, shorthop_map)( r, joy_shoulder, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( zl, joy_zshoulder, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( zr, joy_zshoulder, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(left_sl, joy_sl, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(left_sl, joy_sl, JumpMini, shorthop_map)( left_sr, joy_sr, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( right_sl, joy_sl, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( right_sr, joy_sr, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map ) ); (*out).buttons |= apply_button_mappings!( @@ -434,22 +451,22 @@ unsafe fn map_controls_hook( dpad_left, joy_down, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( dpad_right, joy_up, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( dpad_up, joy_left, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map )( dpad_down, joy_right, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map ) ); (*out).buttons |= apply_button_mappings!( @@ -511,16 +528,16 @@ unsafe fn map_controls_hook( (*out).buttons |= apply_button_mappings!( controller, mappings, - (a, joy_down, JumpMini, Buttons::JumpMini | Buttons::Jump)( + (a, joy_down, JumpMini, shorthop_map)( y, joy_up, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(b, joy_left, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(b, joy_left, JumpMini, shorthop_map)( x, joy_right, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map ) ); (*out).buttons |= apply_button_mappings!( @@ -617,26 +634,26 @@ unsafe fn map_controls_hook( (*out).buttons |= apply_button_mappings!( controller, mappings, - (l, pro_l, JumpMini, Buttons::JumpMini | Buttons::Jump)( + (l, pro_l, JumpMini, shorthop_map)( r, pro_r, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(zl, pro_zl, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(zl, pro_zl, JumpMini, shorthop_map)( zr, pro_zr, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(a, pro_a, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(a, pro_a, JumpMini, shorthop_map)( b, pro_b, JumpMini, - Buttons::JumpMini | Buttons::Jump - )(x, pro_x, JumpMini, Buttons::JumpMini | Buttons::Jump)( + shorthop_map + )(x, pro_x, JumpMini, shorthop_map)( y, pro_y, JumpMini, - Buttons::JumpMini | Buttons::Jump + shorthop_map ) ); (*out).buttons |= apply_button_mappings!( @@ -758,6 +775,16 @@ unsafe fn map_controls_hook( pro_y, Parry, parry_map + )(dpad_up, pro_dup, Parry, parry_map)( + dpad_down, + pro_ddown, + Parry, + parry_map + )(dpad_left, pro_dlr, Parry, parry_map)( + dpad_right, + pro_dlr, + Parry, + parry_map ) ); @@ -875,7 +902,7 @@ unsafe fn map_controls_hook( }; if (*out).buttons.intersects(parry_manual) { - (*out).buttons |= Buttons::ParryManual; + (*out).buttons |= Buttons::Parry; } if (*out).buttons.intersects(Buttons::Guard) diff --git a/fighters/common/src/general_statuses/shield/guard_damage/main.rs b/fighters/common/src/general_statuses/shield/guard_damage/main.rs index 51e64bc213..bb722e1ace 100644 --- a/fighters/common/src/general_statuses/shield/guard_damage/main.rs +++ b/fighters/common/src/general_statuses/shield/guard_damage/main.rs @@ -181,7 +181,7 @@ unsafe fn status_guard_damage_main_common(fighter: &mut L2CFighterCommon) -> L2C if fighter.is_flag(*FIGHTER_STATUS_GUARD_ON_WORK_FLAG_JUST_SHIELD) { // parry, force instant transition even during hitstop for chained parries - if (fighter.is_button_trigger(Buttons::Parry) || fighter.is_button_trigger(Buttons::ParryManual)) + if fighter.is_button_trigger(Buttons::Parry) && fighter.is_cat_flag(CatHdr::Parry) { VarModule::on_flag(fighter.object(), vars::common::instance::IS_PARRY_FOR_GUARD_OFF); StopModule::cancel_hit_stop(fighter.module_accessor); diff --git a/fighters/ken/src/status/special_s.rs b/fighters/ken/src/status/special_s.rs index 0bdf969401..7b76bf81ab 100644 --- a/fighters/ken/src/status/special_s.rs +++ b/fighters/ken/src/status/special_s.rs @@ -211,13 +211,13 @@ unsafe extern "C" fn special_s_loop_main(fighter: &mut L2CFighterCommon) -> L2CV }; MotionModule::change_motion(fighter.module_accessor, Hash40::new(special_s_mot_name), 0.0, 1.0, false, 0.0, false, false); - let ryu_tatsumaki_wind = if !MotionModule::is_flip(fighter.module_accessor) { - hash40("ryu_tatsumaki_wind_r") + let ken_tatsumaki_wind = if !MotionModule::is_flip(fighter.module_accessor) { + hash40("ken_tatsumaki_wind_r") } else { - hash40("ryu_tatsumaki_wind_l") + hash40("ken_tatsumaki_wind_l") }; fighter.clear_lua_stack(); - lua_args!(fighter, MA_MSC_EFFECT_REQUEST_FOLLOW, ryu_tatsumaki_wind, hash40("rot"), 0.0, 1.5, 0.0, 0.0, 0.0, 0.0, 1.0, false, *EFFECT_SUB_ATTRIBUTE_SYNC_STOP, 0, -1); + lua_args!(fighter, MA_MSC_EFFECT_REQUEST_FOLLOW, ken_tatsumaki_wind, hash40("rot"), 0.0, 1.5, 0.0, 0.0, 0.0, 0.0, 1.0, false, *EFFECT_SUB_ATTRIBUTE_SYNC_STOP, 0, -1); sv_module_access::effect(fighter.lua_state_agent); let spineffect = fighter.pop_lua_stack(1).get_u32(); diff --git a/fighters/rockman/src/acmd/tilts.rs b/fighters/rockman/src/acmd/tilts.rs index 71e1025f9c..a1233bbceb 100644 --- a/fighters/rockman/src/acmd/tilts.rs +++ b/fighters/rockman/src/acmd/tilts.rs @@ -5,14 +5,16 @@ unsafe extern "C" fn game_attacks3melee(agent: &mut L2CAgentBase) { let boma = agent.boma(); frame(lua_state, 14.0); if is_excute(agent) { - ATTACK(agent, 0, 0, Hash40::new("arml"), 10.0, 65, 94, 0, 54, 4.0, 0.0, 0.0, 0.0, Some(0.0), Some(0.0), Some(0.0), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 14, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_G, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); - ATTACK(agent, 1, 0, Hash40::new("arml"), 10.0, 65, 94, 0, 54, 4.0, 0.0, 0.0, 0.0, Some(0.0), Some(0.0), Some(0.0), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 14, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_A, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); + ATTACK(agent, 0, 0, Hash40::new("arml"), 10.0, 65, 94, 0, 54, 4.0, 0.0, 0.0, 0.0, Some(0.0), Some(0.0), Some(0.0), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 12, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_G, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); + ATTACK(agent, 1, 0, Hash40::new("arml"), 10.0, 65, 94, 0, 54, 4.0, 0.0, 0.0, 0.0, Some(0.0), Some(0.0), Some(0.0), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 12, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_A, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); } frame(lua_state, 15.0); FT_MOTION_RATE(agent, 0.5); if is_excute(agent) { - ATTACK(agent, 0, 0, Hash40::new("handl"), 14.0, 270, 10, 0, 70, 5.0, 0.0, 0.0, 0.0, None, None, None, 1.1, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 36, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_G, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); - ATTACK(agent, 1, 0, Hash40::new("handl"), 10.0, 65, 94, 0, 54, 5.0, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 36, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_A, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); + ATTACK(agent, 0, 0, Hash40::new("handl"), 14.0, 270, 10, 0, 70, 5.0, 0.0, 0.0, 0.0, None, None, None, 1.1, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 24, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_G, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); + ATTACK(agent, 1, 0, Hash40::new("handl"), 10.0, 65, 94, 0, 54, 5.0, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 24, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_A, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH); + ATK_SET_SHIELD_SETOFF_MUL(agent, 0, 1.75); + ATK_SET_SHIELD_SETOFF_MUL(agent, 1, 1.75); } frame(lua_state, 21.0); FT_MOTION_RATE_RANGE(agent, 21.0, 53.0, 26.0); diff --git a/fighters/trail/src/acmd/tilts.rs b/fighters/trail/src/acmd/tilts.rs index c594a19cd4..45598e4872 100644 --- a/fighters/trail/src/acmd/tilts.rs +++ b/fighters/trail/src/acmd/tilts.rs @@ -209,14 +209,12 @@ unsafe extern "C" fn game_attackhi3(agent: &mut L2CAgentBase) { unsafe extern "C" fn effect_attackhi3(agent: &mut L2CAgentBase) { let lua_state = agent.lua_state_agent; let boma = agent.boma(); - let mut handle = 0; frame(lua_state, 11.0); if is_excute(agent) { FOOT_EFFECT(agent, Hash40::new("null"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 1.3, 0, 0, 0, 0, 0, 0, false); } frame(lua_state, 12.0); if is_excute(agent) { - handle = EffectModule::req_follow(boma, Hash40::new_raw(0x12542f686b), Hash40::new("top"), &Vector3f::new(0.0, 22.0, 0.0), &Vector3f::new(-70.0, -90.0, 0.0), 1.05, true, 0, 0, 0, 0, 0, false, false); EFFECT_FOLLOW(agent, Hash40::new("trail_keyblade_flare"), Hash40::new("haver"), 0, 0, 0, 0, 0, 0, 1, true); } frame(lua_state, 14.0); diff --git a/src/controls/submenu.rs b/src/controls/submenu.rs index 773818391b..57ecddd6e4 100644 --- a/src/controls/submenu.rs +++ b/src/controls/submenu.rs @@ -108,7 +108,7 @@ impl TagSubMenu for ButtonSelector Self::GRAB => b"Grab", Self::PARRY => b"Parry", Self::TAUNT => b"Taunt/Footstool", - Self::SHORT_HOP => b"ShortHop/Footstool", + Self::SHORT_HOP => b"ShortHop", Self::TILT_ATTACK => b"Tilt", Self::SMASH_ATTACK => b"Smash", _ => return None, diff --git a/utils/src/modules/input.rs b/utils/src/modules/input.rs index e231d46dbc..06c0b5b8c1 100644 --- a/utils/src/modules/input.rs +++ b/utils/src/modules/input.rs @@ -616,7 +616,7 @@ fn exec_internal(input_module: &mut InputModule, control_module: u64, call_origi // Parry cat flag let parry_input = unsafe { ControlModule::check_button_on((*input_module.owner).module_accessor, 0x3) // CONTROL_PAD_BUTTON_GUARD - && (triggered_buttons.intersects(Buttons::Parry) || triggered_buttons.intersects(Buttons::ParryManual)) + && triggered_buttons.intersects(Buttons::Parry) }; let parry_offset = CatHdr::Parry.bits().trailing_zeros() as usize; @@ -632,7 +632,7 @@ fn exec_internal(input_module: &mut InputModule, control_module: u64, call_origi // Footstool cat flag let footstool_input = unsafe { (*input_module.owner).is_situation(*SITUATION_KIND_AIR) - && triggered_buttons.intersects(Buttons::JumpMini | Buttons::AppealAll) + && triggered_buttons.intersects(Buttons::TreadJump) }; let footstool_offset = CatHdr::TreadJump.bits().trailing_zeros() as usize;