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

Enforce death on save state, remove score FX (#588)

* Force death, CPU doesn't die when in hitstop

* Deal with stock aura effect
This commit is contained in:
GradualSyrup 2023-08-12 17:36:38 -05:00 committed by GitHub
parent acd6c55f48
commit eac960a547
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 80 additions and 9 deletions

View file

@ -520,6 +520,79 @@ pub unsafe fn handle_fighter_play_se(
)
}
static FOLLOW_REQ_OFFSET: usize = 0x044f860;
#[skyline::hook(offset = FOLLOW_REQ_OFFSET)] // hooked to prevent score gfx from playing when loading save states
pub unsafe fn handle_effect_follow(
module_accessor: &mut app::BattleObjectModuleAccessor,
eff_hash: Hash40,
eff_hash2: Hash40,
pos: *const Vector3f,
rot: *const Vector3f,
size: f32,
arg5: bool,
arg6: u32,
arg7: i32,
arg8: i32,
arg9: i32,
arg10: i32,
arg11: bool,
arg12: bool,
) -> u64 {
if !is_training_mode() {
return original!()(
module_accessor,
eff_hash,
eff_hash2,
pos,
rot,
size,
arg5,
arg6,
arg7,
arg8,
arg9,
arg10,
arg11,
arg12,
);
}
// Prevent the score GFX from playing on the CPU when loading save state during hitstop
if eff_hash == Hash40::new("sys_score_aura") && save_states::is_loading() {
return original!()(
module_accessor,
eff_hash,
eff_hash2,
pos,
rot,
0.0,
arg5,
arg6,
arg7,
arg8,
arg9,
arg10,
arg11,
arg12,
);
}
original!()(
module_accessor,
eff_hash,
eff_hash2,
pos,
rot,
size,
arg5,
arg6,
arg7,
arg8,
arg9,
arg10,
arg11,
arg12,
)
}
#[skyline::hook(replace = EffectModule::req)] // hooked to prevent death gfx from playing when loading save states
pub unsafe fn handle_effect(
module_accessor: &mut app::BattleObjectModuleAccessor,
@ -545,8 +618,8 @@ pub unsafe fn handle_effect(
arg9,
);
}
if save_states::is_killing() {
// Making the size 0 prevents these effects from being displayed. Fixs throw explosions, ICs squall, etc.
if save_states::is_loading() && !buff::is_buffing(module_accessor) {
// Making the size 0 prevents these effects from being displayed. Fixes throw explosions, ICs squall, etc.
return original!()(
module_accessor,
eff_hash,
@ -721,6 +794,7 @@ pub fn training_mods() {
handle_se,
// Death GFX
handle_effect,
handle_effect_follow,
// Star KO turn off
handle_star_ko,
// Clatter

View file

@ -235,6 +235,7 @@ pub unsafe fn get_param_int(
);
EffectModule::remove_common(module_accessor, Hash40::new("monad_arts_damage_buster"));
EffectModule::remove_common(module_accessor, Hash40::new("monad_arts_damage_smash"));
// TODO: We should try to remove all effects here
return Some(1);
}
if param_hash == hash40("rebirth_move_frame") {
@ -432,17 +433,13 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor)
}
// Kill the fighter and move them to camera bounds
// Note: Nana shouldn't control her state here. Popo will give a signal to have
// Nana move into NanaPosMove once he moves.
if save_state.state == KillPlayer && !fighter_is_nana {
on_ptrainer_death(module_accessor);
if !is_dead(module_accessor) {
on_death(fighter_kind, module_accessor);
StatusModule::change_status_request(module_accessor, *FIGHTER_STATUS_KIND_DEAD, false);
}
// Nana shouldn't control her state here. Popo will give a signal to have
// Nana move into NanaPosMove once he moves.
if fighter_is_nana {
return;
StatusModule::change_status_force(module_accessor, *FIGHTER_STATUS_KIND_DEAD, true);
}
save_state.state = WaitForAlive;