mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-14 02:16:10 +00:00
fix up random teching so it works
This commit is contained in:
parent
e4bf2e548d
commit
b4a0853625
2 changed files with 27 additions and 17 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "common.hpp"
|
||||
|
||||
namespace Tech {
|
||||
void init_settings(u64 module_accessor, int status_kind) {
|
||||
void init_settings(u64 module_accessor, int status_kind, bool& replace) {
|
||||
if (ESCAPE_STATE == ESCAPE_TECH && is_training_mode() && is_operation_cpu(module_accessor)) {
|
||||
if (status_kind == FIGHTER_STATUS_KIND_DOWN) {
|
||||
const int NUM_TECH_STATUSES = 4;
|
||||
|
@ -13,19 +13,27 @@ void init_settings(u64 module_accessor, int status_kind) {
|
|||
};
|
||||
|
||||
int random_status_index = app::sv_math::rand(hash40("fighter"), NUM_TECH_STATUSES);
|
||||
StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
|
||||
if (random_statuses[random_status_index] != FIGHTER_STATUS_KIND_DOWN) {
|
||||
StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
|
||||
replace = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
else if (status_kind == FIGHTER_STATUS_KIND_PASSIVE) {
|
||||
const int NUM_TECH_STATUSES = 2;
|
||||
int random_statuses[NUM_TECH_STATUSES] = {
|
||||
FIGHTER_STATUS_KIND_PASSIVE,
|
||||
FIGHTER_STATUS_KIND_PASSIVE_FB
|
||||
};
|
||||
// else if (status_kind == FIGHTER_STATUS_KIND_PASSIVE) {
|
||||
// const int NUM_TECH_STATUSES = 2;
|
||||
// int random_statuses[NUM_TECH_STATUSES] = {
|
||||
// FIGHTER_STATUS_KIND_PASSIVE,
|
||||
// FIGHTER_STATUS_KIND_PASSIVE_FB
|
||||
// };
|
||||
|
||||
int random_status_index = app::sv_math::rand(hash40("fighter"), NUM_TECH_STATUSES);
|
||||
StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
|
||||
}
|
||||
// int random_status_index = app::sv_math::rand(hash40("fighter"), NUM_TECH_STATUSES);
|
||||
// if (random_statuses[random_status_index] != FIGHTER_STATUS_KIND_PASSIVE)
|
||||
// StatusModule::change_status_request_from_script(module_accessor, random_statuses[random_status_index], 1);
|
||||
// }
|
||||
}
|
||||
|
||||
replace = false;
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -159,16 +159,18 @@ void clear_command_replace(u64 module_accessor, bool unk1) {
|
|||
} // namespace ControlModule
|
||||
|
||||
namespace StatusModule {
|
||||
void init_settings_replace(u64 module_accessor, int situationKind, int unk1, u64 unk2,int groundCliffCheckKind, bool unk3, int unk4, int unk5, int unk6, int unk7) {
|
||||
Tech::init_settings(module_accessor, StatusModule::status_kind(module_accessor));
|
||||
void init_settings_replace(u64 module_accessor, int situationKind, int unk1, uint unk2, int groundCliffCheckKind, bool unk3, int unk4, int unk5, int unk6, int unk7) {
|
||||
bool replace;
|
||||
Tech::init_settings(module_accessor, StatusModule::status_kind(module_accessor), replace);
|
||||
if (replace) return;
|
||||
|
||||
u64 status_module = load_module(module_accessor, STATUS_MODULE_OFFSET);
|
||||
void (*init_settings)(u64,int,int,u64,int,bool,int,int,int,int) =
|
||||
(void (*)(u64,int,int,u64,int,bool,int,int,int,int)) load_module_impl(status_module, INIT_SETTINGS_OFFSET);
|
||||
u64 status_module = load_module(module_accessor, 0x40);
|
||||
void (*init_settings)(u64,int,int,uint,int,bool,int,int,int,int) =
|
||||
(void (*)(u64,int,int,uint,int,bool,int,int,int,int)) load_module_impl(status_module, 0x1C8);
|
||||
|
||||
init_settings(status_module, situationKind, unk1, unk2, groundCliffCheckKind, unk3, unk4, unk5, unk6, unk7);
|
||||
}
|
||||
} // namespace StatusModule
|
||||
} // namespace StatusModule
|
||||
} // namespace app::lua_bind
|
||||
|
||||
void training_mods_main() {
|
||||
|
|
Loading…
Add table
Reference in a new issue