Commit Graph

37 Commits

Author SHA1 Message Date
a17bba215d Update player data with retroactive XP adjustments
- Adjusted XP values for players with recorded misses
- Applied -1 XP per miss to maintain consistency with new mechanic
- Players with 0 XP remain at 0 (no negative XP allowed)
2025-10-01 20:32:33 +01:00
687a57f018 Add XP loss for missing ducks
- Players now lose 1 XP when missing a duck
- Updated miss message to show XP loss
- XP cannot go below 0
2025-10-01 20:27:12 +01:00
7aded2ed83 Implement duck item drop system and remove all emojis
Duck Item Drop System:
- Added configurable drop rates per duck type (15%/25%/50%)
- Created weighted drop tables for different items
- Normal ducks: basic items (bullets, magazines, gun brush, sand)
- Fast ducks: useful items including bucket of water
- Golden ducks: rare items (bread, insurance, gun buyback, dry clothes)
- Items automatically added to player inventory
- Added drop notification messages for each duck type
- Integrated seamlessly with existing combat mechanics

Emoji Removal:
- Removed all emojis from source code files
- Updated logging system to use clean text prefixes
- Replaced trophy/medal emojis with #1/#2/#3 rankings
- Updated README.md to remove all emojis
- Professional clean appearance throughout codebase
2025-09-26 19:59:34 +01:00
5ed2f0fce6 Fix duckstats and rearm targeting issues
- Added target support to duckstats command (duckstats username)
- Disabled problematic channel membership validation for admin commands
- Activity validation is sufficient - if player exists and has game activity, allow targeting
- Fixes persistent not currently in channel errors for rearm command
2025-09-26 19:27:29 +01:00
b1b1d4d65f Fix channel validation by saving activity tracking immediately
- Activity tracking now saves to database immediately when commands are processed
- This ensures validate_target_player can see recent activity for channel membership checks
2025-09-26 19:24:45 +01:00
bf3cd48639 Update database and logs from bot runtime 2025-09-26 19:21:01 +01:00
25226a460b Fix magazine and bullet usage limits
- Fixed bug where players could use magazines beyond their level's maximum limit
- Added validation to prevent using bullets when magazine is already full
- Magazine items now respect level-based limits (e.g., 3 magazines at level 1)
- Items are not consumed from inventory if they can't be used due to limits
- Added proper error messages for when limits are reached
- Updated ShopManager to work with LevelManager for limit validation
2025-09-26 19:13:52 +01:00
f3a9c5b611 Security fixes, UI improvements, and game balance updates
- Fixed critical security vulnerabilities in shop targeting system
- Fixed admin authentication bypass issues
- Fixed auto-rearm feature config path (duck_spawning.rearm_on_duck_shot)
- Updated duck spawn timing to 20-60 minutes for better game balance
- Enhanced inventory display formatting with proper spacing
- Added comprehensive admin security documentation
2025-09-26 19:06:26 +01:00
5484548c30 yeah 2025-09-25 19:47:44 +01:00
eb041477dc Add comprehensive documentation and fix authentication config paths
- Add detailed README.md with installation, usage, and development guide
- Add CONFIG.md with complete configuration documentation
- Update connection and SASL authentication to use nested config paths
- Fix server password and SASL username/password config access
- Add config validation test script (test_config.py)
- Clean up config.json (removed invalid JSON comments)
- Improve error handling for config arrays and null values
2025-09-24 20:33:23 +01:00
74f3afdf4b Restructure config.json with nested hierarchy and dot notation access
- Reorganized config.json into logical sections: connection, duck_spawning, duck_types, player_defaults, gameplay, features, limits
- Enhanced get_config() method to support dot notation (e.g., 'duck_types.normal.xp')
- Added comprehensive configurable parameters for all game mechanics
- Updated player creation to use configurable starting values
- Added individual timeout settings per duck type
- Made XP rewards, accuracy mechanics, and game limits fully configurable
- Fixed syntax errors in duck_spawn_loop function
2025-09-24 20:26:49 +01:00
6ca624bd2f Add hidden duck types: Normal, Golden, and Fast ducks
Features:
- Three duck types spawn randomly with configurable chances
- All duck types use same spawn message - type is hidden until shot/timeout
- Golden ducks: 3-5 HP, 15 XP base, reveal type when hit but still alive
- Fast ducks: 1 HP, 12 XP, fly away in 30s instead of 60s
- Normal ducks: 1 HP, 10 XP, standard 60s timeout

Configuration options:
- golden_duck_chance: 0.15 (15% spawn rate)
- fast_duck_chance: 0.25 (25% spawn rate)
- golden_duck_xp: 15, golden_duck_min/max_hp: 3-5
- fast_duck_xp: 12, fast_duck_timeout: 30s

Duck type is revealed when:
- Shot (different messages for each type)
- Flies away (type-specific fly away messages)
- Golden ducks reveal immediately when hit (before death)

Maintains backward compatibility with existing game mechanics.
2025-09-24 16:35:45 +01:00
f9883758f3 Add configurable auto-rearm feature when duck is shot/befriended
- Add 'rearm_on_duck_shot' config option (defaults to true)
- Automatically rearm all disarmed players when any duck is successfully shot
- Also applies when ducks are successfully befriended
- Includes error handling and logging for the rearm process
- Improves game flow by reducing downtime for players who made wild shots
2025-09-24 16:03:03 +01:00
688aca759f Fix indentation and duplicate function errors in duckhuntbot.py
- Remove duplicate handle_rearm function definition
- Fix indentation in setup_signal_handlers function
- Add missing handle_disarm method
- Remove duplicate send_message in handle_ducklaunch
- All syntax errors resolved, bot should now start properly
2025-09-24 01:56:18 +01:00
78caccd8b4 Fix ASCII encoding issues and add robust error handling
- Add comprehensive UTF-8 decoding error handling for IRC messages
- Implement robust error handling for all command processing
- Add network connection error resilience
- Add database operation error handling
- Ensure bot doesn't crash on any input or network issues
- Maintain original duck hunt functionality without feature additions
2025-09-24 01:51:24 +01:00
73582f7a44 more fixes 2025-09-23 20:20:53 +01:00
d6e64d5eab more fixes 2025-09-23 20:20:06 +01:00
0c8b4f9543 Implement magazine system and inventory management
- Add level-based magazine system (3 mags at L1, 2 at L3-5, 1 at L6-8)
- Replace ammo/chargers with current_ammo/magazines/bullets_per_magazine
- Add inventory system for storing and using shop items
- Add Magazine item to shop (15 XP, adds 1 magazine)
- Auto-migrate existing players from old ammo system
- Auto-update magazines when players level up
- Fix method name bugs (get_player_level -> calculate_player_level)
2025-09-23 20:13:01 +01:00
3aaf0d0bb4 feat: Add shop system, befriend command, and level system
- Added configurable shop system with shop.json
- Created ShopManager class for modular shop handling
- Implemented level system with levels.json for difficulty scaling
- Added multiple duck spawn messages with random selection
- Enhanced message system with color placeholders
- Added ducks_befriended tracking separate from ducks_shot
- Updated help system and admin commands
- All systems tested and working correctly
2025-09-23 18:05:28 +01:00
de64756b6d Simplified DuckHunt bot with customizable messages and colors 2025-09-23 02:57:28 +01:00
9285b1b29d Clean up codebase and add documentation
- Remove all comments from Python source files for cleaner code
- Add comprehensive README.md with installation and usage instructions
- Add .gitignore to exclude runtime files and sensitive configuration
- Preserve all functionality while improving code readability
2025-09-22 18:10:21 +01:00
ba7f082d5c Implement competitive item snatching system
- Add dropped items tracking with timestamps per channel
- Items drop to ground (10% chance on duck kills) for any player to grab
- Add 60-second timeout for unclaimed items
- Background cleanup task removes expired items automatically
- First-come-first-served basis for item collection
- Eggdrop-style messaging for drops and successful snatches
2025-09-19 21:43:25 +01:00
1f5af7ed83 mhm 2025-09-13 16:19:05 +01:00
1f64b6fc82 test 2025-09-13 16:14:46 +01:00
339f32b6a0 Make bread cheaper and add channel limit system
- Reduced bread cost from 50 to 10 in all shop definitions
- Added channel_bread tracking system to track deployed bread per channel
- Added check in buy function to limit maximum 3 bread items per channel
- Initialized bread tracking in bot constructor
- Next step: implement bread deployment in use command
2025-09-13 15:51:46 +01:00
7c0974cfbf Change delignore command to unignore to match help text
- Updated private message handler from delignore to unignore
- Fixed string length calculation for command parsing (10 chars for unignore vs 11 for delignore)
- Updated help text in private message handler to show unignore
2025-09-13 15:44:29 +01:00
5ebe8a8e21 Change stats command to duckstats to avoid conflicts with other bots 2025-09-13 15:41:55 +01:00
746957bc17 Fix help command organization and stats message output
- Added player_stats message type to force_public config
- Stats messages now always appear in public channel instead of as notices
- Non-admin users no longer see ignore/unignore commands in help
2025-09-13 15:39:55 +01:00
b198ef2b9e Remove unknown command handler to avoid interfering with other bots
- Removed the 'Unknown command! Use !duckhelp' message for unrecognized commands
- Bot now only responds to valid duckhunt commands and stays silent for others
- This allows other bots in the channel to handle their own commands without interference
2025-09-13 15:35:50 +01:00
34daa04238 Fix command handling and improve help system 2025-09-13 15:34:05 +01:00
6854e88037 Fix messages being sent as notices instead of public by default
- Changed new player default 'notices' setting from True to False
- Added specific message types for duck_miss and wild_shot events
- Added duck_miss and wild_shot to force_public config settings
- All miss/wild shot messages now go to public channel by default
- Legacy users with notices=True will still get notices, but new users get public messages
2025-09-13 15:10:33 +01:00
2bbc202f8f Fix KeyError: 'fastest_shot' by ensuring complete channel records initialization
- Fixed incomplete channel_records initialization in shoot command
- Fixed incomplete channel_records initialization in wild shot tracking
- All channel records now properly include: fastest_shot, last_duck, total_ducks, total_shots
- Resolves runtime error when update_channel_records tries to access fastest_shot field
2025-09-13 15:07:32 +01:00
62da9d1c28 Major improvements: Remove rate limiting and improve message readability
 Completely removed all rate limiting functionality
 Made messages less compact and more readable
 Removed duck detector and auto shotgun from shop

Changes:
- Removed rate limiting: check_rate_limit(), is_rate_limited(), command_cooldowns
- Improved message formats with natural language
- Hit messages: 'Duck shot in X.Xs!' instead of 'X.Xs'
- Miss messages: 'You missed the duck!' instead of 'MISS'
- Reload messages: 'You reloaded your gun!' instead of 'RELOADED'
- Stats display: Full words instead of abbreviations
- Shop cleanup: Removed items #14 (auto shotgun) and #22 (duck detector)
- Better spacing and punctuation throughout
- Maintained efficiency while improving readability
2025-09-13 15:02:38 +01:00
408a840e94 Fix shop command errors
 Fixed indentation issue in handle_shop function
 Added missing 'magenta' color code for IRC
 Shop command now works without errors

Fixes:
- Removed extra indentation causing syntax error
- Added magenta color (\x0313) to colors dictionary
- Shop display now shows all categories properly
2025-09-13 14:47:50 +01:00
009a851696 Major code cleanup and compact message improvements
 Fixed all syntax errors and indentation issues
 Made all command outputs more compact and readable
 Fixed shop display with full item names
 Improved message formats for better IRC experience

Changes:
- Fixed broken try-except blocks and indentation
- Compacted hit/miss/reload messages
- Fixed color code issues in logging
- All syntax errors resolved - bot fully functional
2025-09-13 14:36:57 +01:00
86bf92c478 Complete inventory system implementation
- Added inventory capacity limits (configurable, default 20 slots)
- Items are stored in inventory before use for strategic gameplay
- Fixed indentation issues and syntax errors
- Inventory system fully configurable via config.json settings
2025-09-12 20:59:52 +01:00
3330f456ef first commit 2025-08-30 19:51:44 +01:00