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

Smooth save state (#298)

* Initial Test

* clean up
This commit is contained in:
GradualSyrup 2022-01-03 01:41:23 -06:00 committed by GitHub
parent e0645a071c
commit ff6569b93b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -281,6 +281,17 @@ pub unsafe fn handle_set_dead_rumble(lua_state: u64) -> u64 {
original!()(lua_state)
}
#[skyline::hook(replace = CameraModule::req_quake)]
pub unsafe fn handle_req_quake(module_accessor: &mut app::BattleObjectModuleAccessor, my_int: i32) -> u64 {
if !is_training_mode() {
return original!()(module_accessor,my_int);
}
if save_states::is_killing() {
return original!()(module_accessor, *CAMERA_QUAKE_KIND_NONE);
}
original!()(module_accessor,my_int)
}
pub static mut COMMON_PARAMS: *mut CommonParams = 0 as *mut _;
fn params_main(params_info: &ParamsInfo<'_>) {
@ -335,6 +346,7 @@ pub fn training_mods() {
// Save states
handle_get_param_int,
handle_set_dead_rumble,
handle_req_quake,
// Mash attack
handle_get_attack_air_kind,
// Attack angle

View file

@ -50,6 +50,13 @@ static mut MIRROR_STATE: f32 = 1.0;
// MIRROR_STATE == 1 -> Do not mirror
// MIRROR_STATE == -1 -> Do Mirror
pub unsafe fn is_killing() -> bool {
if SAVE_STATE_PLAYER.state == KillPlayer || SAVE_STATE_CPU.state == KillPlayer {
return true;
}
return false;
}
pub unsafe fn should_mirror() -> f32 {
match MENU.save_state_mirroring {
SaveStateMirroring::None => 1.0,