1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-01-20 09:20:13 +00:00

add choosable ledge options

This commit is contained in:
jugeeya 2019-06-19 11:39:20 -07:00
parent 8ccd0a0a5b
commit 00f1381788
3 changed files with 56 additions and 34 deletions

View file

@ -82,6 +82,18 @@ u64 appeal_s_replace(L2CAgent* l2c_agent, void* variadic) {
acmd.frame(1); acmd.frame(1);
if (acmd.is_excute()) { if (acmd.is_excute()) {
if (is_training_mode()) { if (is_training_mode()) {
if (TOGGLE_STATE == LEDGE_OPTION) {
LEDGE_STATE = (LEDGE_STATE + 1) % NUM_LEDGE_STATES;
const char* LEDGE_strings[NUM_LEDGE_STATES] = {
"RANDOM",
"NORMAL",
"ROLL",
"JUMP",
"ATTACK"
};
print_string(acmd.module_accessor, LEDGE_strings[LEDGE_STATE]);
} else {
DI_STATE = (DI_STATE + 1) % NUM_DI_STATES; DI_STATE = (DI_STATE + 1) % NUM_DI_STATES;
const char* DI_strings[NUM_DI_STATES] = { const char* DI_strings[NUM_DI_STATES] = {
"NONE", "NONE",
@ -99,6 +111,7 @@ u64 appeal_s_replace(L2CAgent* l2c_agent, void* variadic) {
print_string(acmd.module_accessor, DI_strings[DI_STATE]); print_string(acmd.module_accessor, DI_strings[DI_STATE]);
} }
} }
}
return 0; return 0;
} }

View file

@ -3,17 +3,29 @@
#define NONE 0 #define NONE 0
// Up Taunt /* Up Taunt */
bool HITBOX_VIS = 1; bool HITBOX_VIS = 1;
// Side Taunt /* Side Taunt
// 0, 0.785398, 1.570796, 2.356194, -3.14159, -2.356194, -1.570796, -0.785398 0, 0.785398, 1.570796, 2.356194, -3.14159, -2.356194, -1.570796, -0.785398
// 0, pi/4, pi/2, 3pi/4, pi, 5pi/4, 3pi/2, 7pi/4 0, pi/4, pi/2, 3pi/4, pi, 5pi/4, 3pi/2, 7pi/4
*/
int DI_STATE = 0; /* DI */
int DI_STATE = NONE;
#define DI_RANDOM_IN_AWAY 9 #define DI_RANDOM_IN_AWAY 9
#define NUM_DI_STATES 10 #define NUM_DI_STATES 10
/* Ledge Option */
#define RANDOM_LEDGE 0
#define NEUTRAL_LEDGE 1
#define ROLL_LEDGE 2
#define JUMP_LEDGE 3
#define ATTACK_LEDGE 4
int LEDGE_STATE = RANDOM_LEDGE;
#define NUM_LEDGE_STATES 5
// Down Taunt // Down Taunt
#define MASH_AIRDODGE 1 #define MASH_AIRDODGE 1
#define MASH_JUMP 2 #define MASH_JUMP 2
@ -21,7 +33,7 @@ int DI_STATE = 0;
#define HOLD_SHIELD 4 #define HOLD_SHIELD 4
#define LEDGE_OPTION 5 #define LEDGE_OPTION 5
int TOGGLE_STATE = 0; int TOGGLE_STATE = NONE;
#define NUM_TOGGLE_STATES 6 #define NUM_TOGGLE_STATES 6
#endif // TAUNT_TOGGLES_H #endif // TAUNT_TOGGLES_H

View file

@ -89,22 +89,26 @@ namespace app::lua_bind {
return get_param_float(work_module, param_type, param_hash); return get_param_float(work_module, param_type, param_hash);
} }
// Force option out of hitstun // Force ledge option
u64 enable_transition_term_replace(u64 module_accessor, int transition_id) { u64 enable_transition_term_replace(u64 module_accessor, int transition_id) {
if (TOGGLE_STATE == LEDGE_OPTION && is_training_mode() && is_operation_cpu(module_accessor)) { if (TOGGLE_STATE == LEDGE_OPTION && is_training_mode() && is_operation_cpu(module_accessor)) {
if (StatusModule::status_kind(module_accessor) == FIGHTER_STATUS_KIND_CLIFF_WAIT) { if (StatusModule::status_kind(module_accessor) == FIGHTER_STATUS_KIND_CLIFF_WAIT) {
if (transition_id == FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_CLIFF_CLIMB) { if (transition_id == FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_CLIFF_CLIMB) {
int status = 0; int status = 0;
int ledge_case = LEDGE_OPTION;
switch (app::sv_math::rand(hash40("fighter"), 4)) { if (LEDGE_OPTION == RANDOM_LEDGE)
case 0: ledge_case = app::sv_math::rand(hash40("fighter"), 4) + 1;
switch (ledge_case) {
case NEUTRAL_LEDGE:
status = FIGHTER_STATUS_KIND_CLIFF_CLIMB; break; status = FIGHTER_STATUS_KIND_CLIFF_CLIMB; break;
case 1: case ROLL_LEDGE:
status = FIGHTER_STATUS_KIND_CLIFF_ATTACK; break;
case 2:
status = FIGHTER_STATUS_KIND_CLIFF_ESCAPE; break; status = FIGHTER_STATUS_KIND_CLIFF_ESCAPE; break;
case 3: case JUMP_LEDGE:
status = FIGHTER_STATUS_KIND_CLIFF_JUMP1; break; status = FIGHTER_STATUS_KIND_CLIFF_JUMP1; break;
case ATTACK_LEDGE:
status = FIGHTER_STATUS_KIND_CLIFF_ATTACK; break;
} }
StatusModule::change_status_request_from_script(module_accessor, status, 1); StatusModule::change_status_request_from_script(module_accessor, status, 1);
@ -139,13 +143,6 @@ namespace app::lua_bind {
if (category == FIGHTER_PAD_COMMAND_CATEGORY1) if (category == FIGHTER_PAD_COMMAND_CATEGORY1)
flag |= FIGHTER_PAD_CMD_CAT1_FLAG_JUMP_BUTTON; flag |= FIGHTER_PAD_CMD_CAT1_FLAG_JUMP_BUTTON;
} }
if (StatusModule::status_kind(module_accessor) == FIGHTER_STATUS_KIND_CLIFF_WAIT) {
if (TOGGLE_STATE == LEDGE_OPTION) {
if (category == FIGHTER_PAD_COMMAND_CATEGORY1)
flag |= FIGHTER_PAD_CMD_CAT1_FLAG_WALK;
}
}
} }
return flag; return flag;