mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-14 18:36:11 +00:00
update layoff support for DI
This commit is contained in:
parent
e244f9d29c
commit
590e82fe85
4 changed files with 26 additions and 19 deletions
Binary file not shown.
Binary file not shown.
|
@ -6,9 +6,15 @@
|
|||
// Side Taunt
|
||||
|
||||
// DI
|
||||
#define SET_DI 1
|
||||
#define DI_RANDOM_IN_AWAY 2
|
||||
#define NUM_DI_STATES 3
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
/* DI */
|
||||
int DI_STATE = NONE;
|
||||
#define DI_RANDOM_IN_AWAY 9
|
||||
const char* di_items[] = { "None", "Away", "Up Away", "Up", "Up In", "In", "Down In", "Down", "Down In", "Random In/Away"};
|
||||
|
||||
// Attack Option
|
||||
#define MASH_NAIR 0
|
||||
|
@ -28,14 +34,14 @@ const char* attack_items[] = { "Neutral Air", "Forward Air", "Back Air", "Up Air
|
|||
#define ROLL_LEDGE 3
|
||||
#define JUMP_LEDGE 4
|
||||
#define ATTACK_LEDGE 5
|
||||
const char* ledge_items[] = { "Random", "Neutral Getup", "Roll", "Jump", "Attack" };
|
||||
const char* ledge_items[] = { "None", "Random", "Neutral Getup", "Roll", "Jump", "Attack" };
|
||||
|
||||
// Tech Option
|
||||
#define RANDOM_TECH 1
|
||||
#define TECH_IN_PLACE 2
|
||||
#define TECH_ROLL 3
|
||||
#define TECH_MISS 4
|
||||
const char* tech_items[] = { "Random", "In-Place", "Roll", "Miss Tech" };
|
||||
const char* tech_items[] = { "None", "Random", "In-Place", "Roll", "Miss Tech" };
|
||||
|
||||
// Mash States
|
||||
#define MASH_AIRDODGE 1
|
||||
|
@ -51,8 +57,6 @@ const char* shield_items[] = { "None", "Infinite", "Hold" };
|
|||
|
||||
struct TrainingModpackMenu {
|
||||
bool HITBOX_VIS = 1;
|
||||
float DI_stick_x = 0;
|
||||
float DI_stick_y = 0;
|
||||
int DI_STATE = NONE;
|
||||
int ATTACK_STATE = MASH_NAIR;
|
||||
int LEDGE_STATE = RANDOM_LEDGE;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include "common.hpp"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
namespace DirectionalInfluence {
|
||||
float get_float(u64 module_accessor, int var, bool& replace) {
|
||||
if (var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_X ||
|
||||
|
@ -7,24 +11,23 @@ float get_float(u64 module_accessor, int var, bool& replace) {
|
|||
if (is_training_mode() && is_operation_cpu(module_accessor) &&
|
||||
is_in_hitstun(module_accessor)) {
|
||||
if (menu.DI_STATE != NONE) {
|
||||
float stick_x = 0.0, stick_y = 0.0;
|
||||
if (menu.DI_STATE == SET_DI) {
|
||||
stick_x = menu.DI_stick_x;
|
||||
stick_y = menu.DI_stick_y;
|
||||
} else if (menu.DI_STATE == DI_RANDOM_IN_AWAY) {
|
||||
// either 1.0 or -1.0
|
||||
stick_x = (float)(app::sv_math::rand(hash40("fighter"), 2) * 2.0) - 1;
|
||||
stick_y = 0.0;
|
||||
}
|
||||
float angle = (menu.DI_STATE - 1) * M_PI / 4.0;
|
||||
|
||||
// Either 0 (right) or PI (left)
|
||||
if (menu.DI_STATE == DI_RANDOM_IN_AWAY) {
|
||||
angle = app::sv_math::rand(hash40("fighter"), 2) * M_PI;
|
||||
}
|
||||
// If facing left, reverse angle
|
||||
if (PostureModule::lr(module_accessor) != -1.0) angle -= M_PI;
|
||||
|
||||
// If facing left, reverse stick x
|
||||
if (var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_X) {
|
||||
replace = true;
|
||||
return stick_x * -1 * PostureModule::lr(module_accessor);
|
||||
return cos(angle);
|
||||
}
|
||||
|
||||
if (var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_Y) {
|
||||
replace = true;
|
||||
return stick_y;
|
||||
return sin(angle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue