🎮 Features implemented: - Pokemon-style pet collection and battles - Multi-location exploration system - Dynamic weather with background updates - Achievement system with location unlocks - Web dashboard for player stats - Modular command system - Async database with SQLite - PM flood prevention - Persistent player data 🌤️ Weather System: - 6 weather types with spawn modifiers - 30min-3hour dynamic durations - Background task for automatic updates - Location-specific weather patterns 🐛 Recent Bug Fixes: - Database persistence on restart - Player page SQLite row conversion - Achievement count calculations - Travel requirement messages - Battle move color coding - Locations page display 🔧 Generated with Claude Code 🤖 Co-Authored-By: Claude <noreply@anthropic.com>
32 lines
No EOL
1.3 KiB
Python
32 lines
No EOL
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Achievements commands module for PetBot"""
|
|
|
|
from .base_module import BaseModule
|
|
|
|
class Achievements(BaseModule):
|
|
"""Handles achievements display and tracking"""
|
|
|
|
def get_commands(self):
|
|
return ["achievements"]
|
|
|
|
async def handle_command(self, channel, nickname, command, args):
|
|
if command == "achievements":
|
|
await self.cmd_achievements(channel, nickname)
|
|
|
|
async def cmd_achievements(self, channel, nickname):
|
|
"""Show player achievements"""
|
|
player = await self.require_player(channel, nickname)
|
|
if not player:
|
|
return
|
|
|
|
achievements = await self.database.get_player_achievements(player["id"])
|
|
|
|
if achievements:
|
|
self.send_message(channel, f"🏆 {nickname}'s Achievements:")
|
|
for achievement in achievements[:5]: # Show last 5 achievements
|
|
self.send_message(channel, f"• {achievement['name']}: {achievement['description']}")
|
|
|
|
if len(achievements) > 5:
|
|
self.send_message(channel, f"... and {len(achievements) - 5} more!")
|
|
else:
|
|
self.send_message(channel, f"{nickname}: No achievements yet! Keep exploring and catching pets to unlock new areas!") |