18 const CalcPatternMod _pmod = RanMan;
19 const std::string name =
"RunningManMod";
26 float min_anchor_len = 5.F;
27 float min_taps_in_rm = 1.F;
28 float min_off_taps_same = 1.F;
30 float offhand_tap_prop_scaler = 1.F;
31 float offhand_tap_prop_min = 0.F;
32 float offhand_tap_prop_max = 1.F;
33 float offhand_tap_prop_base = 1.7F;
35 float offhand_tap_prop_anch_diff_base = 1.7F;
36 float offhand_tap_prop_anch_diff_scaler = 1.1F;
37 float offhand_tap_prop_anch_diff_min = 0.75F;
38 float offhand_tap_prop_anch_diff_max = 1.F;
40 float off_tap_same_prop_scaler = 1.F;
41 float off_tap_same_prop_min = 0.F;
42 float off_tap_same_prop_max = 1.25F;
43 float off_tap_same_prop_base = 0.8F;
45 float anchor_len_divisor = 5.F;
46 float anchor_len_comp_min = 0.F;
47 float anchor_len_comp_max = 1.25F;
49 float min_jack_taps_for_bonus = 1.F;
50 float jack_bonus_base = 0.1F;
52 float min_oht_taps_for_bonus = 1.F;
53 float oht_bonus_base = 0.1F;
57 float max_oht_len = 2.F;
58 float max_off_len = 3.F;
59 float max_ot_sh_len = 2.F;
60 float max_burst_len = 6.F;
61 float max_jack_len = 3.F;
62 float max_anch_len = 5.F;
64 const std::vector<std::pair<std::string, float*>> _params{
66 {
"min_mod", &min_mod },
67 {
"max_mod", &max_mod },
70 {
"min_anchor_len", &min_anchor_len },
71 {
"min_taps_in_rm", &min_taps_in_rm },
72 {
"min_off_taps_same", &min_off_taps_same },
74 {
"offhand_tap_prop_scaler", &offhand_tap_prop_scaler },
75 {
"offhand_tap_prop_min", &offhand_tap_prop_min },
76 {
"offhand_tap_prop_max", &offhand_tap_prop_max },
77 {
"offhand_tap_prop_base", &offhand_tap_prop_base },
79 {
"offhand_tap_prop_anch_diff_base", &offhand_tap_prop_anch_diff_base },
80 {
"offhand_tap_prop_anch_diff_scaler", &offhand_tap_prop_anch_diff_scaler },
81 {
"offhand_tap_prop_anch_diff_min", &offhand_tap_prop_anch_diff_min },
82 {
"offhand_tap_prop_anch_diff_max", &offhand_tap_prop_anch_diff_max },
84 {
"off_tap_same_prop_scaler", &off_tap_same_prop_scaler },
85 {
"off_tap_same_prop_min", &off_tap_same_prop_min },
86 {
"off_tap_same_prop_max", &off_tap_same_prop_max },
87 {
"off_tap_same_prop_base", &off_tap_same_prop_base },
89 {
"anchor_len_divisor", &anchor_len_divisor },
91 {
"min_jack_taps_for_bonus", &min_jack_taps_for_bonus },
92 {
"jack_bonus_base", &jack_bonus_base },
94 {
"min_oht_taps_for_bonus", &min_oht_taps_for_bonus },
95 {
"oht_bonus_base", &oht_bonus_base },
98 {
"max_oht_len", &max_oht_len },
99 {
"max_off_len", &max_off_len },
100 {
"max_ot_sh_len", &max_ot_sh_len },
101 {
"max_burst_len", &max_burst_len },
102 {
"max_jack_len", &max_jack_len },
103 {
"max_anch_len", &max_anch_len },
105#pragma endregion params and param map
108 std::array<RM_Sequencer, num_cols_per_hand> rms;
114 float offhand_tap_prop = 0.F;
115 float off_tap_same_prop = 0.F;
117 float anchor_len_comp = 0.F;
118 float jack_bonus = 0.F;
119 float oht_bonus = 0.F;
121 float pmod = neutral;
125 for (
auto& rm : rms) {
129 offhand_tap_prop = 0.F;
130 off_tap_same_prop = 0.F;
132 anchor_len_comp = 0.F;
144 for (
const auto& c : ct_loop_no_jumps) {
146 rms.at(c).set_params(max_oht_len,
155 void advance_off_hand_sequencing()
157 for (
const auto& c : ct_loop_no_jumps) {
158 rms.at(c).advance_off_hand_sequencing();
162 void advance_sequencing(
const col_type& ct,
167 for (
const auto& c : ct_loop_no_jumps) {
168 rms.at(c)(ct, bt, mt, *as.
anch.at(c));
171 highest_rm = get_active_rm_with_higher_difficulty();
174 [[nodiscard]]
auto get_highest_anchor_difficulty()
const ->
float
184 float oht_p = offhand_tap_prop_anch_diff_base -
186 offhand_tap_prop_anch_diff_scaler);
188 oht_p = std::clamp(oht_p,
189 offhand_tap_prop_anch_diff_min,
190 offhand_tap_prop_anch_diff_max);
192 return highest_rm.get_difficulty() * oht_p;
195 [[nodiscard]]
auto get_active_rm_with_higher_difficulty()
const
198 if (rms.at(col_left)._status == rm_running &&
199 rms.at(col_right)._status == rm_running) {
201 return rms.at(col_left).get_difficulty() >
202 rms.at(col_right).get_difficulty()
207 return rms.at(col_left)._status == rm_running ? rms.at(col_left)
216 void set_pmod(
const int& total_taps)
219 if (total_taps == 0) {
224 const auto& rm = highest_rm._rm;
232 if (rm._len < min_anchor_len || rm.ran_taps < min_taps_in_rm ||
233 rm.off_taps_sh < min_off_taps_same) {
248 offhand_tap_prop = offhand_tap_prop_base - (rm.get_offhand_tap_prop() *
249 offhand_tap_prop_scaler);
250 offhand_tap_prop = std::clamp(
251 offhand_tap_prop, offhand_tap_prop_min, offhand_tap_prop_max);
263 off_tap_same_prop_base +
264 (rm.get_off_tap_same_prop() * off_tap_same_prop_scaler);
266 off_tap_same_prop = std::clamp(
267 off_tap_same_prop, off_tap_same_prop_min, off_tap_same_prop_max);
273 anchor_len_comp =
static_cast<float>(rm._len) / anchor_len_divisor;
275 std::clamp(anchor_len_comp, anchor_len_comp_min, anchor_len_comp_max);
279 rm.jack_taps >= min_jack_taps_for_bonus ? jack_bonus_base : 0.F;
283 rm.oht_taps >= min_oht_taps_for_bonus ? oht_bonus_base : 0.F;
285 pmod = base + anchor_len_comp + jack_bonus + oht_bonus;
286 pmod = std::clamp(fastsqrt(pmod * off_tap_same_prop * offhand_tap_prop),
291 [[nodiscard]]
auto operator()(
const int& total_taps) ->
float
293 set_pmod(total_taps);
299 void interval_end() { highest_rm.full_reset(); }