1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-10-03 09:44:26 +00:00

turn off sound effects for save states

This commit is contained in:
jugeeya 2020-08-16 18:05:45 -07:00
parent 7e1d8a054f
commit 9b0ede64b9
2 changed files with 30 additions and 2 deletions

View file

@ -207,6 +207,22 @@ pub unsafe fn handle_is_enable_transition_term(
is
}
extern "C" {
#[link_name = "\u{1}_ZN3app15sv_fighter_util15set_dead_rumbleEP9lua_State"]
pub fn set_dead_rumble(lua_state: u64) -> u64;
}
#[skyline::hook(replace = set_dead_rumble)]
pub unsafe fn handle_set_dead_rumble(
lua_state: u64) -> u64 {
if crate::common::is_training_mode() {
return 0;
}
original!()(lua_state)
}
pub fn training_mods() {
println!("[Training Modpack] Applying training mods.");
unsafe {
@ -234,6 +250,7 @@ pub fn training_mods() {
handle_get_param_float,
// Save states
handle_get_param_int,
handle_set_dead_rumble,
// Mash attack
handle_get_attack_air_kind,
// Tech options

View file

@ -101,17 +101,24 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor,
// move to camera bounds
if save_state.state == KillPlayer {
SoundModule::stop_all_sound(module_accessor);
if status == FIGHTER_STATUS_KIND_REBIRTH {
save_state.state = PosMove;
} else {
if status != FIGHTER_STATUS_KIND_DEAD && status != FIGHTER_STATUS_KIND_STANDBY {
// Try moving off-screen so we don't see effects.
let pos = Vector3f {
x: -100.0,
y: -60.0,
x: -300.0,
y: -100.0,
z: 0.0,
};
PostureModule::set_pos(module_accessor, &pos);
MotionAnimcmdModule::set_sleep(module_accessor, true);
SoundModule::pause_se_all(module_accessor, true);
ControlModule::stop_rumble(module_accessor, true);
SoundModule::stop_all_sound(module_accessor);
StatusModule::change_status_request(module_accessor, *FIGHTER_STATUS_KIND_DEAD, false);
}
}
@ -121,6 +128,10 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor,
// move to correct pos
if save_state.state == PosMove {
SoundModule::stop_all_sound(module_accessor);
MotionAnimcmdModule::set_sleep(module_accessor, false);
SoundModule::pause_se_all(module_accessor, false);
ControlModule::stop_rumble(module_accessor, false);
KineticModule::clear_speed_all(module_accessor);
let pos = Vector3f {