Enhance web interface and item system with user experience improvements
- Fix \!team command to redirect to team builder web page instead of showing IRC list - Add usage commands to inventory items showing "\!use <item name>" for each item - Implement Coin Pouch treasure item with 1-3 coin rewards (rare drop rate) - Fix gym badges leaderboard database query with proper COALESCE and CASE syntax - Improve inventory item display with styled command instructions and monospace code blocks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
915aa00bea
commit
88e352ee79
4 changed files with 450 additions and 51 deletions
|
|
@ -22,51 +22,13 @@ class PetManagement(BaseModule):
|
|||
await self.cmd_nickname(channel, nickname, args)
|
||||
|
||||
async def cmd_team(self, channel, nickname):
|
||||
"""Show active pets (channel display)"""
|
||||
"""Redirect player to their team builder page"""
|
||||
player = await self.require_player(channel, nickname)
|
||||
if not player:
|
||||
return
|
||||
|
||||
pets = await self.database.get_player_pets(player["id"], active_only=False)
|
||||
if not pets:
|
||||
self.send_message(channel, f"{nickname}: You don't have any pets! Use !catch to find some.")
|
||||
return
|
||||
|
||||
# Show active pets first, then others
|
||||
active_pets = [pet for pet in pets if pet.get("is_active")]
|
||||
inactive_pets = [pet for pet in pets if not pet.get("is_active")]
|
||||
|
||||
team_info = []
|
||||
|
||||
# Active pets with star and team position
|
||||
for pet in active_pets:
|
||||
name = pet["nickname"] or pet["species_name"]
|
||||
|
||||
# Calculate EXP progress
|
||||
current_exp = pet.get("experience", 0)
|
||||
next_level_exp = self.database.calculate_exp_for_level(pet["level"] + 1)
|
||||
current_level_exp = self.database.calculate_exp_for_level(pet["level"])
|
||||
exp_needed = next_level_exp - current_exp
|
||||
|
||||
if pet["level"] >= 100:
|
||||
exp_display = "MAX"
|
||||
else:
|
||||
exp_display = f"{exp_needed} to next"
|
||||
|
||||
# Show team position
|
||||
position = pet.get("team_order", "?")
|
||||
team_info.append(f"[{position}]⭐{name} (Lv.{pet['level']}) - {pet['hp']}/{pet['max_hp']} HP | EXP: {exp_display}")
|
||||
|
||||
# Inactive pets
|
||||
for pet in inactive_pets[:5]: # Show max 5 inactive
|
||||
name = pet["nickname"] or pet["species_name"]
|
||||
team_info.append(f"{name} (Lv.{pet['level']}) - {pet['hp']}/{pet['max_hp']} HP")
|
||||
|
||||
if len(inactive_pets) > 5:
|
||||
team_info.append(f"... and {len(inactive_pets) - 5} more in storage")
|
||||
|
||||
self.send_message(channel, f"🐾 {nickname}'s team: " + " | ".join(team_info))
|
||||
self.send_message(channel, f"🌐 View detailed pet collection at: http://petz.rdx4.com/player/{nickname}#pets")
|
||||
# Redirect to web interface for team management
|
||||
self.send_message(channel, f"⚔️ {nickname}: Manage your team at: http://petz.rdx4.com/teambuilder/{nickname}")
|
||||
|
||||
async def cmd_pets(self, channel, nickname):
|
||||
"""Show link to pet collection web page"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue