1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-01-31 22:47:25 +00:00

fix normal ledge option, add defensive options

This commit is contained in:
jugeeya 2019-10-30 19:08:46 -07:00
parent 590e82fe85
commit cd8ffd61e1
4 changed files with 30 additions and 19 deletions

View file

@ -55,6 +55,13 @@ const char* mash_items[] = { "None", "Airdodge", "Jump", "Attack", "Random" };
#define SHIELD_HOLD 2
const char* shield_items[] = { "None", "Infinite", "Hold" };
// Defensive States
#define RANDOM_DEFENSIVE 1
#define DEFENSIVE_SHIELD 2
#define DEFENSIVE_SPOTDODGE 3
#define DEFENSIVE_JAB 4
const char* defensive_items[] = { "None", "Random", "Flash Shield", "Spotdodge", "Jab" };
struct TrainingModpackMenu {
bool HITBOX_VIS = 1;
int DI_STATE = NONE;
@ -63,6 +70,7 @@ struct TrainingModpackMenu {
int TECH_STATE = RANDOM_TECH;
int MASH_STATE = NONE;
int SHIELD_STATE = NONE;
int DEFENSIVE_STATE = RANDOM_DEFENSIVE;
char print_buffer[256];
u64 print_buffer_len = 0;
} menu;

View file

@ -32,4 +32,23 @@ bool is_in_landing(u64 module_accessor) {
int status_kind = StatusModule::status_kind(module_accessor);
return status_kind >= FIGHTER_STATUS_KIND_LANDING &&
status_kind <= FIGHTER_STATUS_KIND_LANDING_DAMAGE_LIGHT;
}
void perform_defensive_option(u64 module_accessor) {
if (menu.DEFENSIVE_STATE == RANDOM_DEFENSIVE) {
const int NUM_GROUND_STATUSES = 3;
int random_statuses[NUM_GROUND_STATUSES] = {
FIGHTER_STATUS_KIND_ESCAPE,
FIGHTER_STATUS_KIND_ATTACK,
FIGHTER_STATUS_KIND_GUARD_ON
};
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);
} else if (menu.DEFENSIVE_STATE == DEFENSIVE_SHIELD)
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_GUARD_ON, 1);
else if (menu.DEFENSIVE_STATE == DEFENSIVE_SPOTDODGE)
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_ESCAPE, 1);
else if (menu.DEFENSIVE_STATE == DEFENSIVE_JAB)
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_ATTACK, 1);
}

View file

@ -13,7 +13,7 @@ void force_option(u64 module_accessor) {
if (frame == random_frame || frame > 30.0) {
int status = 0;
int ledge_case = menu.LEDGE_STATE - 1;
int ledge_case = menu.LEDGE_STATE;
if (menu.LEDGE_STATE == RANDOM_LEDGE)
ledge_case = app::sv_math::rand(hash40("fighter"), 4) + 1;
@ -47,15 +47,7 @@ void defensive_option(u64 module_accessor, int category, int& flag) {
status == FIGHTER_STATUS_KIND_CLIFF_ATTACK ||
status == FIGHTER_STATUS_KIND_CLIFF_ESCAPE) &&
WorkModule::is_enable_transition_term(module_accessor, FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE)) {
const int NUM_GROUND_STATUSES = 3;
int random_statuses[NUM_GROUND_STATUSES] = {
FIGHTER_STATUS_KIND_ESCAPE,
FIGHTER_STATUS_KIND_ATTACK,
FIGHTER_STATUS_KIND_GUARD_ON
};
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);
perform_defensive_option(module_accessor);
}
}

View file

@ -70,15 +70,7 @@ void get_command_flag_cat(u64 module_accessor, int category, int& flag) {
status == FIGHTER_STATUS_KIND_DOWN_STAND_FB ||
status == FIGHTER_STATUS_KIND_DOWN_STAND_ATTACK) &&
WorkModule::is_enable_transition_term(module_accessor, FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_GUARD_ON)) {
const int NUM_GROUND_STATUSES = 3;
int random_statuses[NUM_GROUND_STATUSES] = {
FIGHTER_STATUS_KIND_ESCAPE,
FIGHTER_STATUS_KIND_ATTACK,
FIGHTER_STATUS_KIND_GUARD_ON
};
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);
perform_defensive_option(module_accessor);
}
}
}