2019-07-08 00:47:32 +00:00
|
|
|
#include "common.hpp"
|
2019-07-25 20:00:13 +00:00
|
|
|
#include "useful/crc32.h"
|
2019-07-08 00:47:32 +00:00
|
|
|
|
|
|
|
namespace Shield {
|
|
|
|
float get_param_float(u64 module_accessor, u64 param_type, u64 param_hash, bool& replace) {
|
|
|
|
if (is_training_mode()) {
|
2019-10-26 21:09:18 +00:00
|
|
|
if (menu.SHIELD_STATE == SHIELD_INFINITE) {
|
2019-07-08 00:47:32 +00:00
|
|
|
if (param_type == hash40("common")) {
|
|
|
|
if (param_hash == hash40("shield_dec1")) {
|
|
|
|
replace = true;
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
if (param_hash == hash40("shield_recovery1")) {
|
|
|
|
replace = true;
|
|
|
|
return 999.0;
|
|
|
|
}
|
|
|
|
// doesn't work, somehow. This parameter isn't checked?
|
|
|
|
if (param_hash == hash40("shield_damage_mul")) {
|
|
|
|
replace = true;
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
replace = false;
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool check_button_on(u64 module_accessor, int button, bool& replace) {
|
|
|
|
if (button == CONTROL_PAD_BUTTON_GUARD_HOLD || button == CONTROL_PAD_BUTTON_GUARD) {
|
|
|
|
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
2019-10-26 21:09:18 +00:00
|
|
|
if (menu.SHIELD_STATE == SHIELD_HOLD || menu.SHIELD_STATE == SHIELD_INFINITE) {
|
2019-07-08 00:47:32 +00:00
|
|
|
replace = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
replace = false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool check_button_off(u64 module_accessor, int button, bool& replace) {
|
|
|
|
if (button == CONTROL_PAD_BUTTON_GUARD_HOLD || button == CONTROL_PAD_BUTTON_GUARD) {
|
|
|
|
if (is_training_mode() && is_operation_cpu(module_accessor)) {
|
2019-10-26 21:09:18 +00:00
|
|
|
if (menu.SHIELD_STATE == SHIELD_HOLD || menu.SHIELD_STATE == SHIELD_INFINITE) {
|
2019-07-08 00:47:32 +00:00
|
|
|
replace = true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
replace = false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|