diff --git a/src/arcaea_offline/calculate/__init__.py b/src/arcaea_offline/calculate/__init__.py index 29356f7..6ac8f2e 100644 --- a/src/arcaea_offline/calculate/__init__.py +++ b/src/arcaea_offline/calculate/__init__.py @@ -1,2 +1,2 @@ from .b30 import calculate_b30, get_b30_calculated_list -from .score import calculate_potential, calculate_score_range, calculate_shiny_pure +from .score import calculate_play_rating, calculate_score_range, calculate_shiny_pure diff --git a/src/arcaea_offline/calculate/score.py b/src/arcaea_offline/calculate/score.py index 03e9afc..e9b05a2 100644 --- a/src/arcaea_offline/calculate/score.py +++ b/src/arcaea_offline/calculate/score.py @@ -22,8 +22,10 @@ def calculate_score_modifier(score: int) -> Decimal: return Decimal(score - 9500000) / 300000 -def calculate_potential(_constant: float, score: int) -> Decimal: - constant = Decimal(_constant) +def calculate_play_rating( + constant: Union[Decimal, str, float, int], score: int +) -> Decimal: + constant = Decimal(constant) score_modifier = calculate_score_modifier(score) return max(Decimal(0), constant + score_modifier) @@ -35,7 +37,7 @@ def calculate_shiny_pure(notes: int, score: int, pure: int, far: int) -> int: @dataclass -class ConstantsFromPotentialResult: +class ConstantsFromPlayRatingResult: EXPlus: Tuple[Decimal, Decimal] EX: Tuple[Decimal, Decimal] AA: Tuple[Decimal, Decimal] @@ -44,8 +46,8 @@ class ConstantsFromPotentialResult: C: Tuple[Decimal, Decimal] -def calculate_constants_from_potential(potential: Union[Decimal, str, float, int]): - potential = Decimal(potential) +def calculate_constants_from_play_rating(play_rating: Union[Decimal, str, float, int]): + play_rating = Decimal(play_rating) ranges = [] for upperScore, lowerScore in [ @@ -58,6 +60,8 @@ def calculate_constants_from_potential(potential: Union[Decimal, str, float, int ]: upperScoreModifier = calculate_score_modifier(upperScore) lowerScoreModifier = calculate_score_modifier(lowerScore) - ranges.append((potential - upperScoreModifier, potential - lowerScoreModifier)) + ranges.append( + (play_rating - upperScoreModifier, play_rating - lowerScoreModifier) + ) - return ConstantsFromPotentialResult(*ranges) + return ConstantsFromPlayRatingResult(*ranges) diff --git a/src/arcaea_offline/calculate/world_step.py b/src/arcaea_offline/calculate/world_step.py index ee28fc8..8c64179 100644 --- a/src/arcaea_offline/calculate/world_step.py +++ b/src/arcaea_offline/calculate/world_step.py @@ -6,15 +6,15 @@ class PlayResults: def __init__( self, *, - potential: Union[Decimal, str, float, int], + play_rating: Union[Decimal, str, float, int], partner_step: Union[Decimal, str, float, int], ): - self.__potential = potential + self.__play_rating = play_rating self.__partner_step = partner_step @property - def potential(self): - return Decimal(self.__potential) + def play_rating(self): + return Decimal(self.__play_rating) @property def partner_step(self): @@ -119,7 +119,7 @@ def calculate_step_original( partner_bonus: Optional[PartnerBonus] = None, booster: Optional[StepBooster] = None, ): - ptt = play_results.potential + ptt = play_results.play_rating step = play_results.partner_step if partner_bonus: partner_bonus_step = partner_bonus.step_bonus @@ -150,7 +150,7 @@ def calculate_step( return round(play_result_original, 1) -def calculate_potential_from_step( +def calculate_play_rating_from_step( step: Union[Decimal, str, int, float], partner_step_value: Union[Decimal, str, int, float], *, @@ -169,7 +169,7 @@ def calculate_potential_from_step( if partner_bonus and partner_bonus.step_bonus: step -= partner_bonus.step_bonus - potential_sqrt = (Decimal(50) * step - Decimal("2.5") * partner_step_value) / ( + play_rating_sqrt = (Decimal(50) * step - Decimal("2.5") * partner_step_value) / ( Decimal("2.45") * partner_step_value ) - return potential_sqrt**2 + return play_rating_sqrt**2