[Eva] Расчёт очков: base_points из points, final_points с множителем

This commit is contained in:
2026-10-13 11:20:37 +00:00
parent df3d32ecd5
commit 9c975dde79
+3 -5
View File
@@ -209,18 +209,16 @@ async def award_xp(
}
"""
# 1. Валидация
stars = max(MIN_STARS, min(MAX_STARS, int(stars)))
if game not in GAME_XP_COEF:
raise ValueError(f"Unknown game: {game}")
# 2. База
base = stars * POINTS_PER_STAR
base = int(round(base * GAME_XP_COEF.get(game, 1.0)))
# 2. База с коэффициентом игры (для баланса)
base_points = int(round(points * GAME_XP_COEF.get(game, 1.0)))
# 3. Множитель игры дня
is_featured = (game == featured_game())
multiplier = FEATURED_MULTIPLIER if is_featured else 1.0
points = int(round(base * multiplier))
final_points = int(round(base_points * multiplier))
# 4. Читаем текущий total_xp
row = await conn.fetchrow(