Commit 1b5018a6 authored by Mahmoud Aglan's avatar Mahmoud Aglan

feat(challenges): sticker tiles, chunky gold bars, English titles

Each challenge shows its game's sticker (ludo_played, chess_played...) and
a ready one glows gold until collected. The all-done panel was never shown;
it now appears once every challenge is claimed. The API's fallback icons
and the stored templates use sticker names instead of emoji.
Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 3df90193
......@@ -38,15 +38,15 @@ function getDailyChallenges($db, string $userId): void {
$allChallenges = [];
if (is_array($templates) && !isset($templates['error'])) {
foreach ($templates as $t) {
$allChallenges[] = ['id' => $t['id'], 'title' => $t['title_ar'] ?? $t['title'], 'title_en' => $t['title'], 'target' => intval($t['target']), 'type' => $t['type'], 'reward_coins' => intval($t['reward_coins']), 'reward_xp' => intval($t['reward_xp']), 'icon' => $t['icon'] ?? '🎮'];
$allChallenges[] = ['id' => $t['id'], 'title' => $t['title_ar'] ?? $t['title'], 'title_en' => $t['title'], 'target' => intval($t['target']), 'type' => $t['type'], 'reward_coins' => intval($t['reward_coins']), 'reward_xp' => intval($t['reward_xp']), 'icon' => $t['icon'] ?? 'cards'];
}
}
if (empty($allChallenges)) {
// Fallback if DB is empty
$allChallenges = [
['id' => 'play_3', 'title' => 'العب 3 مباريات', 'title_en' => 'Play 3 games', 'target' => 3, 'type' => 'games_played', 'reward_coins' => 50, 'reward_xp' => 30, 'icon' => '🎮'],
['id' => 'win_2', 'title' => 'اربح مباراتين', 'title_en' => 'Win 2 games', 'target' => 2, 'type' => 'wins', 'reward_coins' => 80, 'reward_xp' => 50, 'icon' => '🏆'],
['id' => 'beat_bot', 'title' => 'اهزم بوت', 'title_en' => 'Beat a bot', 'target' => 1, 'type' => 'bot_wins', 'reward_coins' => 40, 'reward_xp' => 25, 'icon' => '🤖'],
['id' => 'play_3', 'title' => 'العب 3 مباريات', 'title_en' => 'Play 3 games', 'target' => 3, 'type' => 'games_played', 'reward_coins' => 50, 'reward_xp' => 30, 'icon' => 'cards'],
['id' => 'win_2', 'title' => 'اربح مباراتين', 'title_en' => 'Win 2 games', 'target' => 2, 'type' => 'wins', 'reward_coins' => 80, 'reward_xp' => 50, 'icon' => 'trophy'],
['id' => 'beat_bot', 'title' => 'اهزم بوت', 'title_en' => 'Beat a bot', 'target' => 1, 'type' => 'bot_wins', 'reward_coins' => 40, 'reward_xp' => 25, 'icon' => 'bot'],
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment