1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-01-21 01:40:14 +00:00
UltimateTrainingModpack/source/training/shield.hpp

57 lines
1.8 KiB
C++
Raw Normal View History

#include "common.hpp"
2019-07-25 20:00:13 +00:00
#include "useful/crc32.h"
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) {
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) {
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) {
replace = true;
return false;
}
}
}
replace = false;
return false;
}
}