From 959f789f246bbfa77e1ad5addaa34234f22f5a67 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Tue, 13 Oct 2026 11:51:50 +0000 Subject: [PATCH] =?UTF-8?q?[Eva]=20game.py:=20=D1=84=D0=BE=D1=80=D0=BC?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=20=D0=BE=D1=87=D0=BA=D0=BE=D0=B2=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=81=D0=BB=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/game.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/routers/game.py b/routers/game.py index 17cbfa0..25a48c7 100644 --- a/routers/game.py +++ b/routers/game.py @@ -429,11 +429,16 @@ async def complete_level(request: Request): detail="Hints and word list are disabled on Hard difficulty" ) - # Очки: база 100, −20 за каждую подсказку, −20 за список слов, - # +10 если без подсказок. - # Формула: max(20, min(110, 100 - 20*hints_used - 20*list_opened + bonus)) - bonus = 10 if hints_used == 0 else 0 - points = max(20, min(110, 100 - 20 * hints_used - 20 * (1 if list_opened else 0) + bonus)) + # Очки в зависимости от сложности + if difficulty == "hard": + # Hard: фикс 110 (без подсказок и списка) + points = 110 + else: + # Easy / Medium + bonus = 10 if hints_used == 0 else 0 + penalty_hints = 20 * hints_used + penalty_list = 0 if difficulty == "easy" else 20 * (1 if list_opened else 0) + points = max(20, min(110, 100 - penalty_hints - penalty_list + bonus)) # Начисляем XP через единую функцию from services.xp import award_xp