""" Définitions des badges Contient la liste de tous les badges avec leurs critères de déblocage """ BADGES = [ # ===== BADGES PRÉDICTIONS ===== { "id": "debutant-prophete", "name": "Débutant Prophète", "description": "Consultez vos 10 premières prédictions", "icon": "🔮", "category": "predictions", "criteria": { "type": "predictions_count", "value": 10, "description": "10 prédictions consultées" }, "rarity": "common", "points": 10 }, { "id": "observateur-augure", "name": "Observateur Augure", "description": "Consultez 50 prédictions", "icon": "👁️", "category": "predictions", "criteria": { "type": "predictions_count", "value": 50, "description": "50 prédictions consultées" }, "rarity": "common", "points": 25 }, { "id": "oracle-averti", "name": "Oracle Averti", "description": "Consultez 100 prédictions", "icon": "🏛️", "category": "predictions", "criteria": { "type": "predictions_count", "value": 100, "description": "100 prédictions consultées" }, "rarity": "rare", "points": 50 }, { "id": "maitre-des-destins", "name": "Maître des Destins", "description": "Consultez 500 prédictions", "icon": "🌟", "category": "predictions", "criteria": { "type": "predictions_count", "value": 500, "description": "500 prédictions consultées" }, "rarity": "epic", "points": 150 }, # ===== BADGES PRÉCISION ===== { "id": "premiere-prediction", "name": "Première Prédiction", "description": "Obtenez votre première prédiction correcte", "icon": "✨", "category": "accuracy", "criteria": { "type": "correct_predictions", "value": 1, "description": "1 prédiction correcte" }, "rarity": "common", "points": 15 }, { "id": "voyant-debrouille", "name": "Voyant Debrouillé", "description": "Obtenez 5 prédictions correctes", "icon": "🎯", "category": "accuracy", "criteria": { "type": "correct_predictions", "value": 5, "description": "5 prédictions correctes" }, "rarity": "common", "points": 30 }, { "id": "expert-energie", "name": "Expert Énergie", "description": "Obtenez 20 prédictions correctes", "icon": "⚡", "category": "accuracy", "criteria": { "type": "correct_predictions", "value": 20, "description": "20 prédictions correctes" }, "rarity": "rare", "points": 75 }, { "id": "sage-infaillible", "name": "Sage Infaillible", "description": "Obtenez 50 prédictions correctes", "icon": "👑", "category": "accuracy", "criteria": { "type": "correct_predictions", "value": 50, "description": "50 prédictions correctes" }, "rarity": "epic", "points": 200 }, { "id": "legendaire-prophete", "name": "Légendaire Prophète", "description": "Obtenez 100 prédictions correctes", "icon": "🏆", "category": "accuracy", "criteria": { "type": "correct_predictions", "value": 100, "description": "100 prédictions correctes" }, "rarity": "legendary", "points": 500 }, # ===== BADGES ENGAGEMENT ===== { "id": "habitude-journalier", "name": "Habitué Journalier", "description": "Visitez l'app pendant 7 jours consécutifs", "icon": "📅", "category": "engagement", "criteria": { "type": "streak_days", "value": 7, "description": "7 jours consécutifs" }, "rarity": "common", "points": 35 }, { "id": "fidele-devoue", "name": "Fidèle Dévoué", "description": "Visitez l'app pendant 30 jours consécutifs", "icon": "💎", "category": "engagement", "criteria": { "type": "streak_days", "value": 30, "description": "30 jours consécutifs" }, "rarity": "rare", "points": 100 }, { "id": "pilier-communaute", "name": "Pilier de la Communauté", "description": "Visitez l'app pendant 90 jours consécutifs", "icon": "🏛️", "category": "engagement", "criteria": { "type": "streak_days", "value": 90, "description": "90 jours consécutifs" }, "rarity": "epic", "points": 300 }, # ===== BADGES SOCIAL ===== { "id": "partageur-ambitieux", "name": "Partageur Ambitieux", "description": "Partagez 5 de vos réussites", "icon": "📤", "category": "social", "criteria": { "type": "share_count", "value": 5, "description": "5 partages de réussites" }, "rarity": "common", "points": 20 }, { "id": "influenceur-montant", "name": "Influenceur Montant", "description": "Partagez 20 de vos réussites", "icon": "📢", "category": "social", "criteria": { "type": "share_count", "value": 20, "description": "20 partages de réussites" }, "rarity": "rare", "points": 80 }, { "id": "parrain-bienveillant", "name": "Parrain Bienveillant", "description": "Parrainez 1 utilisateur", "icon": "🤝", "category": "social", "criteria": { "type": "referral_count", "value": 1, "description": "1 utilisateur parrainé" }, "rarity": "common", "points": 40 }, { "id": "ambassadeur-charmant", "name": "Ambassadeur Charmant", "description": "Parrainez 5 utilisateurs", "icon": "🎊", "category": "social", "criteria": { "type": "referral_count", "value": 5, "description": "5 utilisateurs parrainés" }, "rarity": "rare", "points": 150 }, { "id": "grand-seigneur", "name": "Grand Seigneur", "description": "Parrainez 10 utilisateurs", "icon": "👔", "category": "social", "criteria": { "type": "referral_count", "value": 10, "description": "10 utilisateurs parrainés" }, "rarity": "epic", "points": 350 }, { "id": "mecene-generaux", "name": "Mécène Généreux", "description": "Parrainez 25 utilisateurs", "icon": "🎖️", "category": "social", "criteria": { "type": "referral_count", "value": 25, "description": "25 utilisateurs parrainés" }, "rarity": "legendary", "points": 750 } ] def isBadgeUnlocked(badge: dict, user_criteria: dict) -> bool: """ Vérifie si un badge peut être débloqué selon les critères de l'utilisateur """ criteria_type = badge["criteria"]["type"] criteria_value = badge["criteria"]["value"] current_value = user_criteria.get(criteria_type, 0) return current_value >= criteria_value def getBadgeById(badge_id: str) -> dict | None: """ Récupère un badge par son ID """ for badge in BADGES: if badge["id"] == badge_id: return badge return None def getBadgesByCategory(category: str) -> list: """ Récupère tous les badges d'une catégorie """ return [badge for badge in BADGES if badge["category"] == category] def getBadgesByRarity(rarity: str) -> list: """ Récupère tous les badges d'une rareté """ return [badge for badge in BADGES if badge["rarity"] == rarity]