Change points balance

This commit is contained in:
2025-12-16 03:06:26 +07:00
parent e32df4d95e
commit a199952383
3 changed files with 24 additions and 14 deletions

View File

@@ -13,12 +13,12 @@ class PointsService:
}
MAX_STREAK_MULTIPLIER = 0.4
DROP_PENALTIES = {
0: 0, # First drop is free
1: 10,
2: 25,
# Drop penalty as percentage of challenge points
DROP_PENALTY_PERCENTAGES = {
0: 0.5, # 1st drop: 50%
1: 0.75, # 2nd drop: 75%
}
MAX_DROP_PENALTY = 50
MAX_DROP_PENALTY_PERCENTAGE = 1.0 # 3rd+ drop: 100%
# Event point multipliers
EVENT_MULTIPLIERS = {
@@ -66,6 +66,7 @@ class PointsService:
def calculate_drop_penalty(
self,
consecutive_drops: int,
challenge_points: int,
event: Event | None = None
) -> int:
"""
@@ -73,6 +74,7 @@ class PointsService:
Args:
consecutive_drops: Number of drops since last completion
challenge_points: Base points of the challenge being dropped
event: Active event (optional)
Returns:
@@ -82,10 +84,11 @@ class PointsService:
if event and event.type == EventType.DOUBLE_RISK.value:
return 0
return self.DROP_PENALTIES.get(
penalty_percentage = self.DROP_PENALTY_PERCENTAGES.get(
consecutive_drops,
self.MAX_DROP_PENALTY
self.MAX_DROP_PENALTY_PERCENTAGE
)
return int(challenge_points * penalty_percentage)
def apply_event_multiplier(self, base_points: int, event: Event | None) -> int:
"""Apply event multiplier to points"""