Implement comprehensive pet healing system with revive items and database support

- Add Revive (50% HP) and Max Revive (100% HP) items to config/items.json
- Extend database schema with fainted_at timestamp for pets table
- Add last_heal_time column to players table for heal command cooldown
- Implement comprehensive pet healing database methods:
  - get_fainted_pets(): Retrieve all fainted pets for a player
  - revive_pet(): Restore fainted pet with specified HP
  - faint_pet(): Mark pet as fainted with timestamp
  - get_pets_for_auto_recovery(): Find pets eligible for 30-minute auto-recovery
  - auto_recover_pet(): Automatically restore pet to 1 HP
  - get_active_pets(): Get active pets excluding fainted ones
  - get_player_pets(): Enhanced to filter out fainted pets when active_only=True
- Update inventory module to handle revive and max_revive effects
- Add proper error handling for cases where no fainted pets exist
- Maintain case-insensitive item usage compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
megaproxy 2025-07-16 11:32:01 +00:00
parent fca0423c84
commit 72c1098a22
3 changed files with 440 additions and 3 deletions

View file

@ -48,6 +48,28 @@
"effect_value": 15,
"locations": ["mystic_forest", "enchanted_grove"],
"spawn_rate": 0.03
},
{
"id": 18,
"name": "Revive",
"description": "Revives a fainted pet and restores 50% of its HP",
"rarity": "rare",
"category": "healing",
"effect": "revive",
"effect_value": 50,
"locations": ["all"],
"spawn_rate": 0.005
},
{
"id": 19,
"name": "Max Revive",
"description": "Revives a fainted pet and fully restores its HP",
"rarity": "epic",
"category": "healing",
"effect": "max_revive",
"effect_value": 100,
"locations": ["all"],
"spawn_rate": 0.002
}
],
"battle_items": [