1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-03-14 02:16:10 +00:00

change title screen; add miss tech option

This commit is contained in:
jugeeya 2019-10-04 23:56:12 -07:00
parent 6a906d1a47
commit 95a7e98332
5 changed files with 37 additions and 19 deletions

View file

@ -63,6 +63,20 @@ 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";
va_list vl;
va_start(vl,format);
int ret = vsprintf(s, format, vl);
va_end(vl);
return ret;
}
int main(int argc, char* argv[]) {
SaltySD_printf("SaltySD Plugin: alive\n");
@ -82,6 +96,8 @@ int main(int argc, char* argv[]) {
SaltySD_Memcpy(version_string, (u64) "Salty v%d%d%d", 13);
}
SaltySDCore_ReplaceImport("sprintf", (void*)sprintf_intercept);
// Add function replacements here
hitbox_vis_main();
training_mods_main();

View file

@ -46,9 +46,10 @@ int LEDGE_STATE = RANDOM_LEDGE;
#define RANDOM_TECH 1
#define TECH_IN_PLACE 2
#define TECH_ROLL 3
#define TECH_MISS 4
int TECH_STATE = RANDOM_TECH;
#define NUM_TECH_STATES 4
#define NUM_TECH_STATES 5
// Down Taunt
#define MASH_TOGGLES 0

View file

@ -102,7 +102,7 @@ if (motion_kind == hash40("appeal_lw_l") || motion_kind == hash40("appeal_lw_r")
ESCAPE_STATE == ESCAPE_TECH) {
TECH_STATE = (TECH_STATE + 1) % NUM_TECH_STATES;
const char* TECH_strings[NUM_TECH_STATES] =
{"NONE", "RANDOM", "IN PLACE", "ROLL"};
{"NONE", "RANDOM", "IN PLACE", "ROLL", "MISS TECH"};
print_string(module_accessor, TECH_strings[TECH_STATE]);
} else if (MASH_STATE == MASH_ATTACK) {

View file

@ -50,8 +50,22 @@ void get_command_flag_cat(u64 module_accessor, int category, int& flag) {
if (TECH_STATE != NONE && is_training_mode() && is_operation_cpu(module_accessor)) {
int prev_status = StatusModule::prev_status_kind(module_accessor, 0);
int status = StatusModule::status_kind(module_accessor);
if ((prev_status == FIGHTER_STATUS_KIND_PASSIVE ||
if (status == FIGHTER_STATUS_KIND_DOWN_WAIT || status == FIGHTER_STATUS_KIND_DOWN_WAIT_CONTINUE) {
const int NUM_GETUP_STATUSES = 3;
int random_statuses[NUM_GETUP_STATUSES] = {
FIGHTER_STATUS_KIND_DOWN_STAND,
FIGHTER_STATUS_KIND_DOWN_STAND_FB,
FIGHTER_STATUS_KIND_DOWN_STAND_ATTACK
};
int random_status_index = app::sv_math::rand(hash40("fighter"), NUM_GETUP_STATUSES);
StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
}
else if ((prev_status == FIGHTER_STATUS_KIND_PASSIVE ||
prev_status == FIGHTER_STATUS_KIND_PASSIVE_FB ||
prev_status == FIGHTER_STATUS_KIND_DOWN_STAND ||
prev_status == FIGHTER_STATUS_KIND_DOWN_STAND_FB ||
prev_status == FIGHTER_STATUS_KIND_DOWN_STAND_ATTACK ||
status == FIGHTER_STATUS_KIND_DOWN_STAND ||
status == FIGHTER_STATUS_KIND_DOWN_STAND_FB ||
status == FIGHTER_STATUS_KIND_DOWN_STAND_ATTACK) &&
@ -66,19 +80,6 @@ void get_command_flag_cat(u64 module_accessor, int category, int& flag) {
int random_status_index = app::sv_math::rand(hash40("fighter"), NUM_GROUND_STATUSES);
StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
}
if (WorkModule::is_enable_transition_term(module_accessor, FIGHTER_STATUS_TRANSITION_TERM_ID_DOWN_STAND) &&
status != FIGHTER_STATUS_KIND_DOWN_DAMAGE) {
const int NUM_GETUP_STATUSES = 3;
int random_statuses[NUM_GETUP_STATUSES] = {
FIGHTER_STATUS_KIND_DOWN_STAND,
FIGHTER_STATUS_KIND_DOWN_STAND_FB,
FIGHTER_STATUS_KIND_DOWN_STAND_ATTACK
};
int random_status_index = app::sv_math::rand(hash40("fighter"), NUM_GETUP_STATUSES);
StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
}
}
}
}

View file

@ -84,9 +84,9 @@ int get_command_flag_cat_replace(u64 module_accessor, int category) {
int (*get_command_flag_cat)(u64, int) = (int (*)(u64, int)) load_module_impl(control_module, 0x350);
int flag = get_command_flag_cat(control_module, category);
bool replace;
int ret = InputRecorder::get_command_flag_cat(module_accessor, category, flag, replace);
if (replace) return ret;
// bool replace;
// int ret = InputRecorder::get_command_flag_cat(module_accessor, category, flag, replace);
// if (replace) return ret;
Mash::get_command_flag_cat(module_accessor, category, flag);
Ledge::get_command_flag_cat(module_accessor, category, flag);