2019-07-06 18:53:06 +00:00
|
|
|
#include "common.hpp"
|
|
|
|
|
|
|
|
namespace DirectionalInfluence {
|
2019-07-08 00:47:32 +00:00
|
|
|
float get_float(u64 module_accessor, int var, bool& replace) {
|
2019-07-06 18:53:06 +00:00
|
|
|
if (var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_X ||
|
|
|
|
var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_Y) {
|
|
|
|
if (is_training_mode() && is_operation_cpu(module_accessor) &&
|
|
|
|
is_in_hitstun(module_accessor)) {
|
|
|
|
if (DI_STATE != NONE) {
|
|
|
|
float stick_x = 0.0, stick_y = 0.0;
|
|
|
|
if (DI_STATE == SET_DI) {
|
|
|
|
stick_x = DI_stick_x;
|
|
|
|
stick_y = DI_stick_y;
|
|
|
|
} else if (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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If facing left, reverse stick x
|
|
|
|
if (var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_X) {
|
2019-07-08 00:47:32 +00:00
|
|
|
replace = true;
|
2019-07-06 18:53:06 +00:00
|
|
|
return stick_x * -1 * PostureModule::lr(module_accessor);
|
|
|
|
}
|
|
|
|
if (var == FIGHTER_STATUS_DAMAGE_WORK_FLOAT_VECOR_CORRECT_STICK_Y) {
|
2019-07-08 00:47:32 +00:00
|
|
|
replace = true;
|
2019-07-06 18:53:06 +00:00
|
|
|
return stick_y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-08 00:47:32 +00:00
|
|
|
replace = false;
|
2019-07-06 18:53:06 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|