[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. Валидация # 1. Валидация
stars = max(MIN_STARS, min(MAX_STARS, int(stars)))
if game not in GAME_XP_COEF: if game not in GAME_XP_COEF:
raise ValueError(f"Unknown game: {game}") raise ValueError(f"Unknown game: {game}")
# 2. База # 2. База с коэффициентом игры (для баланса)
base = stars * POINTS_PER_STAR base_points = int(round(points * GAME_XP_COEF.get(game, 1.0)))
base = int(round(base * GAME_XP_COEF.get(game, 1.0)))
# 3. Множитель игры дня # 3. Множитель игры дня
is_featured = (game == featured_game()) is_featured = (game == featured_game())
multiplier = FEATURED_MULTIPLIER if is_featured else 1.0 multiplier = FEATURED_MULTIPLIER if is_featured else 1.0
points = int(round(base * multiplier)) final_points = int(round(base_points * multiplier))
# 4. Читаем текущий total_xp # 4. Читаем текущий total_xp
row = await conn.fetchrow( row = await conn.fetchrow(