mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-14 02:16:10 +00:00
fix non-tumble AD+jump
This commit is contained in:
parent
a43275b984
commit
daa3661d05
2 changed files with 37 additions and 26 deletions
|
@ -25,25 +25,21 @@ namespace app::sv_system
|
|||
u64 battle_object_module_accessor(u64) asm("_ZN3app9sv_system29battle_object_module_accessorEP9lua_State") LINKABLE;
|
||||
}
|
||||
|
||||
namespace app::sv_math
|
||||
{
|
||||
namespace app::sv_math {
|
||||
int rand(u64 hash, int endIndex) asm("_ZN3app7sv_math4randEN3phx6Hash40Ei") LINKABLE;
|
||||
}
|
||||
|
||||
namespace app::lua_bind
|
||||
{
|
||||
namespace AttackModule
|
||||
{
|
||||
namespace AttackModule {
|
||||
void clear_all(u64) asm("_ZN3app8lua_bind28AttackModule__clear_all_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
}
|
||||
|
||||
namespace ControlModule
|
||||
{
|
||||
namespace ControlModule {
|
||||
bool check_button_on(u64, int) asm("_ZN3app8lua_bind35ControlModule__check_button_on_implEPNS_26BattleObjectModuleAccessorEi") LINKABLE;
|
||||
}
|
||||
|
||||
namespace EffectModule
|
||||
{
|
||||
namespace EffectModule {
|
||||
// boma, effect, joint, pos, rot, size, random_pos, random_rot, NO_SCALE?, attr?, unkint1, unkint2
|
||||
uint req_on_joint(u64, u64, u64, const Vector3f*, const Vector3f*, float a6, const Vector3f*, const Vector3f*, bool, uint, int, int)
|
||||
asm("_ZN3app8lua_bind31EffectModule__req_on_joint_implEPNS_26BattleObjectModuleAccessorEN3phx6Hash40ES4_RKNS3_8Vector3fES7_fS7_S7_bjii") LINKABLE;
|
||||
|
@ -52,39 +48,37 @@ namespace app::lua_bind
|
|||
asm("_ZN3app8lua_bind28EffectModule__kill_kind_implEPNS_26BattleObjectModuleAccessorEN3phx6Hash40Ebb") LINKABLE;
|
||||
}
|
||||
|
||||
namespace FighterManager
|
||||
{
|
||||
namespace FighterManager {
|
||||
u64 get_fighter_information(u64, int) asm("_ZN3app8lua_bind44FighterManager__get_fighter_information_implEPNS_14FighterManagerENS_14FighterEntryIDE") LINKABLE;
|
||||
}
|
||||
|
||||
namespace FighterInformation
|
||||
{
|
||||
namespace FighterInformation {
|
||||
bool is_operation_cpu(u64) asm("_ZN3app8lua_bind41FighterInformation__is_operation_cpu_implEPNS_18FighterInformationE") LINKABLE;
|
||||
}
|
||||
|
||||
namespace MotionModule
|
||||
{
|
||||
namespace MotionModule {
|
||||
float frame(u64) asm("_ZN3app8lua_bind24MotionModule__frame_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
u64 motion_kind(u64) asm("_ZN3app8lua_bind30MotionModule__motion_kind_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
}
|
||||
|
||||
namespace PostureModule
|
||||
{
|
||||
namespace PostureModule {
|
||||
float lr(u64) asm("_ZN3app8lua_bind22PostureModule__lr_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
float pos_x(u64) asm("_ZN3app8lua_bind25PostureModule__pos_x_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
float pos_y(u64) asm("_ZN3app8lua_bind25PostureModule__pos_y_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
float set_pos(u64, const Vector3f*) asm("_ZN3app8lua_bind27PostureModule__set_pos_implEPNS_26BattleObjectModuleAccessorERKN3phx8Vector3fE") LINKABLE;
|
||||
}
|
||||
|
||||
namespace StatusModule
|
||||
{
|
||||
namespace StatusModule {
|
||||
u64 change_status_request_from_script(u64, int, bool) asm("_ZN3app8lua_bind52StatusModule__change_status_request_from_script_implEPNS_26BattleObjectModuleAccessorEib") LINKABLE;
|
||||
int status_kind(u64) asm("_ZN3app8lua_bind30StatusModule__status_kind_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
int situation_kind(u64) asm("_ZN3app8lua_bind33StatusModule__situation_kind_implEPNS_26BattleObjectModuleAccessorE") LINKABLE;
|
||||
}
|
||||
|
||||
namespace WorkModule
|
||||
{
|
||||
namespace WorkModule {
|
||||
// PT crashes if this doesn't return a bool?
|
||||
bool get_int(u64, int) asm("_ZN3app8lua_bind24WorkModule__get_int_implEPNS_26BattleObjectModuleAccessorEi") LINKABLE;
|
||||
int get_param_int(u64, u64, u64) asm("_ZN3app8lua_bind30WorkModule__get_param_int_implEPNS_26BattleObjectModuleAccessorEmm") LINKABLE;
|
||||
void inc_int(u64, int) asm("_ZN3app8lua_bind24WorkModule__inc_int_implEPNS_26BattleObjectModuleAccessorEi") LINKABLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,21 @@ bool is_in_hitstun(u64 module_accessor) {
|
|||
return status_kind >= FIGHTER_STATUS_KIND_DAMAGE && status_kind <= FIGHTER_STATUS_KIND_DAMAGE_FALL;
|
||||
}
|
||||
|
||||
void perform_jump(u64 module_accessor) {
|
||||
int jump_count = WorkModule::get_int(module_accessor, FIGHTER_INSTANCE_WORK_ID_INT_JUMP_COUNT);
|
||||
int max_jump_count = WorkModule::get_int(module_accessor, FIGHTER_INSTANCE_WORK_ID_INT_JUMP_COUNT_MAX);
|
||||
if (jump_count < max_jump_count) {
|
||||
if (StatusModule::situation_kind(module_accessor) == SITUATION_KIND_AIR) {
|
||||
if (WorkModule::get_param_int(module_accessor, 0xB99CC3FBCLL, 0) == FIGHTER_JUMP_AERIAL_TYPE_NORMAL)
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_JUMP_AERIAL, 1);
|
||||
else
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_FLY, 1);
|
||||
} else if (StatusModule::situation_kind(module_accessor) == SITUATION_KIND_GROUND)
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_JUMP_SQUAT, 1);
|
||||
WorkModule::inc_int(module_accessor, FIGHTER_INSTANCE_WORK_ID_INT_JUMP_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
namespace app::lua_bind::WorkModule {
|
||||
// Force option out of hitstun
|
||||
u64 enable_transition_term_group_replace(u64 module_accessor, int transition_group) {
|
||||
|
@ -36,9 +51,9 @@ namespace app::lua_bind::WorkModule {
|
|||
// Jump
|
||||
else if (TOGGLE_STATE == MASH_JUMP) {
|
||||
if (transition_group == FIGHTER_STATUS_TRANSITION_GROUP_CHK_AIR_JUMP_AERIAL)
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_JUMP_AERIAL, 1);
|
||||
perform_jump(module_accessor);
|
||||
else if (transition_group == FIGHTER_STATUS_TRANSITION_GROUP_CHK_GROUND_JUMP)
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_JUMP_SQUAT, 1);
|
||||
perform_jump(module_accessor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,23 +100,25 @@ namespace app::lua_bind::WorkModule {
|
|||
|
||||
namespace app::lua_bind::MotionModule {
|
||||
void change_motion_replace(u64 module_accessor, u64 motion_kind, float start_frame, float frame_speed_mult, bool unk1, float unk2, bool unk3, bool unk4) {
|
||||
|
||||
|
||||
u64 curr_motion_kind = MotionModule::motion_kind(module_accessor);
|
||||
if (curr_motion_kind == hash40("damage_air") && motion_kind == hash40("fall")) {
|
||||
if ((curr_motion_kind == hash40("damage_air_1") ||
|
||||
curr_motion_kind == hash40("damage_air_2") ||
|
||||
curr_motion_kind == hash40("damage_air_3")) && motion_kind == hash40("fall")) {
|
||||
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
||||
// Airdodge
|
||||
if (TOGGLE_STATE == MASH_AIRDODGE)
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_ESCAPE_AIR, 1);
|
||||
// Jump
|
||||
else if (TOGGLE_STATE == MASH_JUMP)
|
||||
StatusModule::change_status_request_from_script(module_accessor, FIGHTER_STATUS_KIND_JUMP_AERIAL, 1);
|
||||
perform_jump(module_accessor);
|
||||
}
|
||||
}
|
||||
|
||||
// call original
|
||||
u64 motion_module = load_module(module_accessor, 0x88);
|
||||
void (*change_motion)(u64, u64, float, float, bool, float, bool, bool) =
|
||||
(void (*)(u64, u64, float, float, bool, float, bool, bool)) load_module(motion_module, 0xD8);
|
||||
(void (*)(u64, u64, float, float, bool, float, bool, bool)) load_module_impl(motion_module, 0xD8);
|
||||
|
||||
change_motion(motion_module, motion_kind, start_frame, frame_speed_mult, unk1, unk2, unk3, unk4);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue