[Eva] Ева, прочитай .gitignore #33

Merged
Drobysh merged 7 commits from eva/chat-c3088d-backend into main 2026-10-13 11:23:16 +00:00
Showing only changes of commit 9c975dde79 - Show all commits
+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(