Add comprehensive web interface enhancements and encounter tracking

Major Features Added:
- Complete petdex page showing all available pets with stats, types, evolution info
- Encounter tracking system recording pet discoveries and catch statistics
- Gym badges display on player profiles with victory counts and dates
- Enhanced player profiles with discovery progress and completion percentages

Technical Implementation:
- New /petdex route with rarity-organized pet encyclopedia
- Database encounter tracking with automatic integration into exploration/catch
- Updated webserver.py with encounter data fetching and display
- Fixed battle_system.py syntax error in gym battle completion logic
- Organized project by moving unused bot files to backup_bots/ folder

Database Changes:
- Added player_encounters table for tracking discoveries
- Added methods: record_encounter, get_player_encounters, get_encounter_stats
- Enhanced player profile queries to include gym badges and encounters

Web Interface Updates:
- Petdex page with search stats, rarity grouping, and spawn location info
- Player profiles now show species seen, completion %, gym badges earned
- Encounter section displaying discovered pets with catch statistics
- Updated navigation to include petdex link on main game hub

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
megaproxy 2025-07-14 16:32:25 +01:00
parent bd455f1be5
commit 1ce7158200
7 changed files with 684 additions and 63 deletions

View file

@ -46,6 +46,9 @@ class Exploration(BaseModule):
if pet["type2"]:
type_str += f"/{pet['type2']}"
# Record the encounter
await self.database.record_encounter(player["id"], pet["species_name"])
self.send_message(channel,
f"🐾 {nickname}: A wild Level {pet['level']} {pet['species_name']} ({type_str}) appeared in {encounter['location']}!")
self.send_message(channel, f"Choose your action: !battle to fight it, or !catch to try catching it directly!")
@ -200,6 +203,9 @@ class Exploration(BaseModule):
# Successful catch during battle
result = await self.game_engine.attempt_catch_current_location(player["id"], wild_pet)
# Record the successful catch
await self.database.record_encounter(player["id"], wild_pet["species_name"], was_caught=True)
# End the battle
await_result = await self.game_engine.battle_engine.end_battle(player["id"], "caught")
@ -236,6 +242,9 @@ class Exploration(BaseModule):
# Check for achievements after successful catch
if "Success!" in result:
# Record the successful catch
await self.database.record_encounter(player["id"], target_pet["species_name"], was_caught=True)
# Award experience for successful catch
await self.award_catch_experience(channel, nickname, player, target_pet)