Skip to content

Commit

Permalink
WHY DID I TUNE BALANCE MOD THIS WAY AAAAAAAAAAAAAAAAAAAAA
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jun 6, 2020
1 parent b4c8f31 commit 87bba4b
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/Etterna/Globals/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,14 @@ div_high_by_low(float a, float b)
if (b > a)
std::swap(a, b);
return a / b;
}

inline float
div_low_by_high(float a, float b)
{
if (b > a)
std::swap(a, b);
return b / a;
}

inline float
Expand Down Expand Up @@ -1652,6 +1660,12 @@ struct ItvHandInfo
{
return div_high_by_low(get_col_taps_nowf(col_left),
get_col_taps_nowf(col_right));
}

inline float get_col_prop_low_by_high() const
{
return div_low_by_high(get_col_taps_nowf(col_left),
get_col_taps_nowf(col_right));
}

inline float get_col_prop_high_by_low_window(const int& window) const
Expand All @@ -1660,6 +1674,12 @@ struct ItvHandInfo
get_col_taps_windowf(col_right, window));
}

inline float get_col_prop_low_by_high_window(const int& window) const
{
return div_low_by_high(get_col_taps_windowf(col_left, window),
get_col_taps_windowf(col_right, window));
}

inline int get_col_diff_high_by_low() const
{
return diff_high_by_low(get_col_taps_nowi(col_left),
Expand Down Expand Up @@ -3354,7 +3374,7 @@ struct BalanceMod
if (handle_case_optimizations(itvhi, doot, i))
return;

pmod = itvhi.get_col_prop_high_by_low();
pmod = itvhi.get_col_prop_low_by_high();
pmod = (mod_base + (buffer + (scaler / pmod)) / other_scaler);
pmod = CalcClamp(pmod, min_mod, max_mod);

Expand Down Expand Up @@ -5497,7 +5517,7 @@ struct WideRangeBalanceMod
if (handle_case_optimizations(itvhi, doot, i))
return;

pmod = itvhi.get_col_prop_high_by_low_window(window);
pmod = itvhi.get_col_prop_low_by_high_window(window);

pmod = (base + (buffer + (scaler / pmod)) / other_scaler);
pmod = CalcClamp(pmod, min_mod, max_mod);
Expand Down

0 comments on commit 87bba4b

Please sign in to comment.