mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-01-31 22:47:25 +00:00
ledge option defensive options fix, change_motion version detector
This commit is contained in:
parent
8839eed65a
commit
671ceebef1
5 changed files with 21 additions and 5 deletions
|
@ -66,8 +66,15 @@ void __attribute__((weak)) NORETURN __libnx_exit(int rc) {
|
|||
extern int sprintf(char* s, const char* format, ...) LINKABLE;
|
||||
|
||||
int sprintf_intercept(char* s, const char* format, ...) {
|
||||
if (strcmp(format, "Ver. %d.%d.%d") == 0 || strcmp(format, "Salty v%d%d%d") == 0)
|
||||
format = "Training Mods v1.4";
|
||||
if (strcmp(format, "Ver. %d.%d.%d") == 0 || strcmp(format, "Salty v%d%d%d") == 0) {
|
||||
va_list vl;
|
||||
va_start(vl, format);
|
||||
major = va_arg(vl, int);
|
||||
minor = va_arg(vl, int);
|
||||
patch = va_arg(vl, int);
|
||||
va_end(vl);
|
||||
return vsprintf(s, "Training Mods v1.5", vl);
|
||||
}
|
||||
va_list vl;
|
||||
va_start(vl,format);
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
using namespace app::lua_bind;
|
||||
|
||||
int major, minor, patch;
|
||||
|
||||
u64 fighter_manager_addr;
|
||||
u64 is_training_mode(void) asm("_ZN3app9smashball16is_training_modeEv") LINKABLE;
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ void force_option(u64 module_accessor) {
|
|||
|
||||
void defensive_option(u64 module_accessor, int category, int& flag) {
|
||||
int status = StatusModule::status_kind(module_accessor);
|
||||
int prev_status = StatusModule::prev_status_kind(module_accessor, 0);
|
||||
if (status == FIGHTER_STATUS_KIND_CLIFF_JUMP3 ||
|
||||
status == FIGHTER_STATUS_KIND_CLIFF_JUMP2 ||
|
||||
status == FIGHTER_STATUS_KIND_CLIFF_JUMP1) {
|
||||
|
@ -46,7 +47,9 @@ void defensive_option(u64 module_accessor, int category, int& flag) {
|
|||
if ((status == FIGHTER_STATUS_KIND_CLIFF_CLIMB ||
|
||||
status == FIGHTER_STATUS_KIND_CLIFF_ATTACK ||
|
||||
status == FIGHTER_STATUS_KIND_CLIFF_ESCAPE ||
|
||||
StatusModule::prev_status_kind(module_accessor, 0) == FIGHTER_STATUS_KIND_CLIFF_CLIMB) &&
|
||||
prev_status == FIGHTER_STATUS_KIND_CLIFF_CLIMB ||
|
||||
prev_status == FIGHTER_STATUS_KIND_CLIFF_ATTACK ||
|
||||
prev_status == FIGHTER_STATUS_KIND_CLIFF_ESCAPE) &&
|
||||
(WorkModule::is_enable_transition_term(module_accessor, FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE) ||
|
||||
CancelModule::is_enable_cancel(module_accessor))) {
|
||||
perform_defensive_option(module_accessor);
|
||||
|
|
|
@ -39,7 +39,7 @@ void get_command_flag_cat(u64 module_accessor, int category, int& flag) {
|
|||
if (category == FIGHTER_PAD_COMMAND_CATEGORY1)
|
||||
flag |= FIGHTER_PAD_CMD_CAT1_FLAG_AIR_ESCAPE;
|
||||
|
||||
if (menu.MASH_STATE == MASH_JUMP)
|
||||
if (menu.MASH_STATE == MASH_JUMP && !is_in_landing(module_accessor))
|
||||
if (category == FIGHTER_PAD_COMMAND_CATEGORY1)
|
||||
flag |= FIGHTER_PAD_CMD_CAT1_FLAG_JUMP_BUTTON;
|
||||
|
||||
|
|
|
@ -178,8 +178,12 @@ u64 change_motion_replace(u64 module_accessor, u64 motion_kind, float unk1, floa
|
|||
}
|
||||
|
||||
u64 motion_module = load_module(module_accessor, 0x88);
|
||||
u64 change_motion_offset = 0;
|
||||
if (major < 4) change_motion_offset = 0xD8;
|
||||
else change_motion_offset = 0xE0;
|
||||
|
||||
u64 (*change_motion)(u64,u64,float,float,bool,float,bool,bool) =
|
||||
(u64 (*)(u64,u64,float,float,bool,float,bool,bool)) load_module_impl(motion_module, 0xE0);
|
||||
(u64 (*)(u64,u64,float,float,bool,float,bool,bool)) load_module_impl(motion_module, change_motion_offset);
|
||||
|
||||
return change_motion(motion_module, motion_kind, unk1, unk2, unk3, unk4, unk5, unk6);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue