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

@@ -40,7 +40,7 @@ class GPTService:
- description: что нужно сделать на русском (1-2 предложения)
- type: один из [completion, no_death, speedrun, collection, achievement, challenge_run]
- difficulty: easy/medium/hard
- points: очки (easy: 30-50, medium: 60-100, hard: 120-200)
- points: очки (easy: 20-40, medium: 45-75, hard: 90-150)
- estimated_time: примерное время в минутах
- proof_type: screenshot/video/steam (что лучше подойдёт для проверки)
- proof_hint: что должно быть на скриншоте/видео для подтверждения на русском
@@ -77,10 +77,17 @@ class GPTService:
if proof_type not in ["screenshot", "video", "steam"]:
proof_type = "screenshot"
# Validate points
points = ch.get("points", 50)
# Validate points based on difficulty
points = ch.get("points", 30)
if not isinstance(points, int) or points < 1:
points = 50
points = 30
# Clamp points to expected ranges
if difficulty == "easy":
points = max(20, min(40, points))
elif difficulty == "medium":
points = max(45, min(75, points))
elif difficulty == "hard":
points = max(90, min(150, points))
challenges.append(ChallengeGenerated(
title=ch.get("title", "Unnamed Challenge")[:100],