diff --git a/duckhunt.json b/duckhunt.json index 04a3cd2..a21b702 100644 --- a/duckhunt.json +++ b/duckhunt.json @@ -4,14 +4,15 @@ "nick": "ComputerTech", "xp": 45, "ducks_shot": 4, - "ammo": 2, - "max_ammo": 6, - "chargers": 1, - "max_chargers": 2, - "accuracy": 65, + "accuracy": 61, "gun_confiscated": false, - "ducks_befriended": 1 + "ducks_befriended": 1, + "inventory": {}, + "temporary_effects": [], + "current_ammo": 6, + "magazines": 3, + "bullets_per_magazine": 6 } }, - "last_save": "1758646365.5768785" + "last_save": "1758654759.6627305" } \ No newline at end of file diff --git a/duckhunt.log b/duckhunt.log index d2b81f6..b3178b7 100644 --- a/duckhunt.log +++ b/duckhunt.log @@ -471,3 +471,172 @@ 2025-09-23 18:02:15,867 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct 2025-09-23 18:03:33,887 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct 2025-09-23 18:04:45,906 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:06:15,927 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:07:33,949 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:08:45,964 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:10:13,989 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:11:39,015 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:12:40,432 [INFO ] DuckHuntBot - signal_handler:96: 🛑 Received SIGINT (Ctrl+C), initiating graceful shutdown... +2025-09-23 18:12:55,030 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:14:11,056 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:15:25,077 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:16:46,092 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:18:08,112 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:19:24,142 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:20:28,170 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:21:47,188 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:23:03,221 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:24:16,247 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:25:43,278 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:26:53,306 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:28:11,333 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:29:20,356 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:30:29,378 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:31:37,395 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:32:58,414 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:34:16,428 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:35:32,453 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:36:56,469 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:38:23,506 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:39:39,523 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:40:45,553 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:42:09,571 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:43:21,600 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:44:32,624 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:45:38,657 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:46:16,579 [INFO ] DuckHuntBot - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 18:46:16,581 [INFO ] DuckHuntBot.DB - load_database:28: Loaded 1 players from duckhunt.json +2025-09-23 18:46:16,584 [INFO ] SASL - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 18:46:16,585 [INFO ] DuckHuntBot.Shop - load_items:29: Loaded 3 shop items from /home/colby/duckhunt/shop.json +2025-09-23 18:46:16,586 [INFO ] DuckHuntBot.Levels - load_levels:28: Loaded 8 levels from /home/colby/duckhunt/levels.json +2025-09-23 18:47:02,687 [INFO ] DuckHuntBot.Game - spawn_duck:105: Duck spawned in #ct +2025-09-23 18:47:06,705 [INFO ] DuckHuntBot - signal_handler:96: 🛑 Received SIGINT (Ctrl+C), initiating graceful shutdown... +2025-09-23 18:49:01,325 [INFO ] DuckHuntBot - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 18:49:01,326 [INFO ] DuckHuntBot.DB - load_database:28: Loaded 1 players from duckhunt.json +2025-09-23 18:49:01,327 [INFO ] SASL - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 18:49:01,328 [INFO ] DuckHuntBot.Shop - load_items:29: Loaded 3 shop items from /home/colby/duckhunt/shop.json +2025-09-23 18:49:01,328 [INFO ] DuckHuntBot.Levels - load_levels:28: Loaded 8 levels from /home/colby/duckhunt/levels.json +2025-09-23 18:49:01,329 [INFO ] DuckHuntBot - main:28: 🦆 Starting DuckHunt Bot... +2025-09-23 18:49:01,566 [INFO ] DuckHuntBot - connect:112: Connected to irc.rizon.net:6697 +2025-09-23 18:49:01,566 [INFO ] DuckHuntBot - run:386: 🦆 Bot is now running! Press Ctrl+C to stop. +2025-09-23 18:49:02,098 [INFO ] DuckHuntBot - handle_message:138: Successfully registered with IRC server +2025-09-23 18:49:17,578 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:50:44,652 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:51:58,719 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:53:10,789 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:54:09,846 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:55:16,912 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:56:31,982 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:57:36,040 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 18:57:45,432 [INFO ] DuckHuntBot - signal_handler:86: 🛑 Received SIGINT (Ctrl+C), shutting down immediately... +2025-09-23 18:57:45,434 [INFO ] DuckHuntBot - signal_handler:96: 🔄 Cancelled 5 running tasks +2025-09-23 18:57:45,455 [INFO ] DuckHuntBot.Game - duck_spawn_loop:53: Duck spawning loop cancelled +2025-09-23 18:57:45,455 [INFO ] DuckHuntBot.Game - duck_timeout_loop:85: Duck timeout loop cancelled +2025-09-23 18:57:45,456 [INFO ] DuckHuntBot - message_loop:365: Message loop cancelled +2025-09-23 18:57:45,456 [INFO ] DuckHuntBot - message_loop:369: Message loop ended +2025-09-23 18:57:45,457 [INFO ] DuckHuntBot - run:403: 🛑 Main loop cancelled +2025-09-23 18:57:45,458 [INFO ] DuckHuntBot.Game - start_game_loops:31: Game loops cancelled +2025-09-23 18:57:45,462 [INFO ] DuckHuntBot - run:425: 💾 Database saved +2025-09-23 18:57:45,567 [INFO ] DuckHuntBot - _close_connection:449: 🔌 IRC connection closed +2025-09-23 18:57:45,568 [INFO ] DuckHuntBot - run:432: ✅ Bot shutdown complete +2025-09-23 19:24:12,604 [INFO ] DuckHuntBot - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 19:24:12,607 [INFO ] DuckHuntBot.DB - load_database:28: Loaded 1 players from duckhunt.json +2025-09-23 19:24:12,608 [INFO ] SASL - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 19:24:12,608 [INFO ] DuckHuntBot.Shop - load_items:30: Loaded 2 shop items from /home/colby/duckhunt/shop.json +2025-09-23 19:24:12,609 [INFO ] DuckHuntBot.Levels - load_levels:28: Loaded 8 levels from /home/colby/duckhunt/levels.json +2025-09-23 19:24:12,609 [INFO ] DuckHuntBot - main:28: 🦆 Starting DuckHunt Bot... +2025-09-23 19:24:12,867 [INFO ] DuckHuntBot - connect:112: Connected to irc.rizon.net:6697 +2025-09-23 19:24:12,867 [INFO ] DuckHuntBot - run:482: 🦆 Bot is now running! Press Ctrl+C to stop. +2025-09-23 19:24:13,288 [INFO ] DuckHuntBot - handle_message:138: Successfully registered with IRC server +2025-09-23 19:24:29,882 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:25:38,947 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:26:55,022 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:28:13,096 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:29:39,179 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:31:00,250 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:32:02,065 [INFO ] DuckHuntBot - signal_handler:86: 🛑 Received SIGINT (Ctrl+C), shutting down immediately... +2025-09-23 19:32:02,067 [INFO ] DuckHuntBot - signal_handler:96: 🔄 Cancelled 5 running tasks +2025-09-23 19:32:02,117 [INFO ] DuckHuntBot - run:499: 🛑 Main loop cancelled +2025-09-23 19:32:02,118 [INFO ] DuckHuntBot.Game - duck_spawn_loop:53: Duck spawning loop cancelled +2025-09-23 19:32:02,119 [INFO ] DuckHuntBot.Game - duck_timeout_loop:85: Duck timeout loop cancelled +2025-09-23 19:32:02,119 [INFO ] DuckHuntBot - message_loop:461: Message loop cancelled +2025-09-23 19:32:02,120 [INFO ] DuckHuntBot - message_loop:465: Message loop ended +2025-09-23 19:32:02,120 [INFO ] DuckHuntBot.Game - start_game_loops:31: Game loops cancelled +2025-09-23 19:32:02,124 [INFO ] DuckHuntBot - run:521: 💾 Database saved +2025-09-23 19:32:02,271 [INFO ] DuckHuntBot - _close_connection:545: 🔌 IRC connection closed +2025-09-23 19:32:02,276 [INFO ] DuckHuntBot - run:528: ✅ Bot shutdown complete +2025-09-23 19:32:03,115 [INFO ] DuckHuntBot - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 19:32:03,116 [INFO ] DuckHuntBot.DB - load_database:28: Loaded 1 players from duckhunt.json +2025-09-23 19:32:03,116 [INFO ] SASL - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 19:32:03,117 [INFO ] DuckHuntBot.Shop - load_items:30: Loaded 2 shop items from /home/colby/duckhunt/shop.json +2025-09-23 19:32:03,118 [INFO ] DuckHuntBot.Levels - load_levels:28: Loaded 8 levels from /home/colby/duckhunt/levels.json +2025-09-23 19:32:03,118 [INFO ] DuckHuntBot - main:28: 🦆 Starting DuckHunt Bot... +2025-09-23 19:32:03,381 [INFO ] DuckHuntBot - connect:112: Connected to irc.rizon.net:6697 +2025-09-23 19:32:03,382 [INFO ] DuckHuntBot - run:482: 🦆 Bot is now running! Press Ctrl+C to stop. +2025-09-23 19:32:03,875 [INFO ] DuckHuntBot - handle_message:138: Successfully registered with IRC server +2025-09-23 19:32:24,397 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:33:39,462 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:34:54,527 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:36:06,590 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:37:11,647 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:38:29,711 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:39:41,776 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:40:38,247 [ERROR ] DuckHuntBot - message_loop:458: Error processing message ':ComputerTech!ComputerTe@ComputerTech.Network PRIVMSG #ct :!bang': 'LevelManager' object has no attribute 'get_player_level' +2025-09-23 19:40:38,829 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:41:44,889 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:42:46,938 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:43:54,005 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:44:56,059 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:46:05,126 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:47:09,183 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:48:32,260 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:49:56,329 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:51:00,396 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:52:10,460 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:53:17,528 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:54:26,587 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:55:36,650 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:56:46,729 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:58:08,814 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 19:59:17,882 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:00:30,947 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:01:46,017 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:02:54,074 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:04:09,139 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:05:30,209 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:06:35,262 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:07:47,326 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:08:52,387 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:10:13,461 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:11:28,536 [INFO ] DuckHuntBot.Game - spawn_duck:108: Duck spawned in #ct +2025-09-23 20:11:38,121 [INFO ] DuckHuntBot - signal_handler:86: 🛑 Received SIGINT (Ctrl+C), shutting down immediately... +2025-09-23 20:11:38,125 [INFO ] DuckHuntBot - signal_handler:96: 🔄 Cancelled 5 running tasks +2025-09-23 20:11:38,159 [INFO ] DuckHuntBot.Game - duck_timeout_loop:85: Duck timeout loop cancelled +2025-09-23 20:11:38,160 [INFO ] DuckHuntBot.Game - duck_spawn_loop:53: Duck spawning loop cancelled +2025-09-23 20:11:38,160 [INFO ] DuckHuntBot - message_loop:461: Message loop cancelled +2025-09-23 20:11:38,160 [INFO ] DuckHuntBot - message_loop:465: Message loop ended +2025-09-23 20:11:38,161 [INFO ] DuckHuntBot - run:499: 🛑 Main loop cancelled +2025-09-23 20:11:38,161 [INFO ] DuckHuntBot.Game - start_game_loops:31: Game loops cancelled +2025-09-23 20:11:38,172 [INFO ] DuckHuntBot - run:521: 💾 Database saved +2025-09-23 20:11:38,280 [INFO ] DuckHuntBot - _close_connection:545: 🔌 IRC connection closed +2025-09-23 20:11:38,281 [INFO ] DuckHuntBot - run:528: ✅ Bot shutdown complete +2025-09-23 20:11:39,007 [INFO ] DuckHuntBot - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 20:11:39,007 [INFO ] DuckHuntBot.DB - load_database:28: Loaded 1 players from duckhunt.json +2025-09-23 20:11:39,008 [INFO ] SASL - setup_logger:61: Enhanced logging system initialized with file rotation +2025-09-23 20:11:39,009 [INFO ] DuckHuntBot.Shop - load_items:30: Loaded 2 shop items from /home/colby/duckhunt/shop.json +2025-09-23 20:11:39,009 [INFO ] DuckHuntBot.Levels - load_levels:28: Loaded 8 levels from /home/colby/duckhunt/levels.json +2025-09-23 20:11:39,010 [INFO ] DuckHuntBot - main:28: 🦆 Starting DuckHunt Bot... +2025-09-23 20:11:39,306 [INFO ] DuckHuntBot - connect:112: Connected to irc.rizon.net:6697 +2025-09-23 20:11:39,306 [INFO ] DuckHuntBot - run:496: 🦆 Bot is now running! Press Ctrl+C to stop. +2025-09-23 20:11:39,797 [INFO ] DuckHuntBot - handle_message:138: Successfully registered with IRC server +2025-09-23 20:12:39,564 [INFO ] DuckHuntBot - signal_handler:86: 🛑 Received SIGINT (Ctrl+C), shutting down immediately... +2025-09-23 20:12:39,565 [INFO ] DuckHuntBot - signal_handler:96: 🔄 Cancelled 5 running tasks +2025-09-23 20:12:39,660 [INFO ] DuckHuntBot.Game - duck_timeout_loop:85: Duck timeout loop cancelled +2025-09-23 20:12:39,660 [INFO ] DuckHuntBot.Game - duck_spawn_loop:53: Duck spawning loop cancelled +2025-09-23 20:12:39,661 [INFO ] DuckHuntBot - message_loop:475: Message loop cancelled +2025-09-23 20:12:39,661 [INFO ] DuckHuntBot - message_loop:479: Message loop ended +2025-09-23 20:12:39,661 [INFO ] DuckHuntBot - run:513: 🛑 Main loop cancelled +2025-09-23 20:12:39,662 [INFO ] DuckHuntBot.Game - start_game_loops:31: Game loops cancelled +2025-09-23 20:12:39,664 [INFO ] DuckHuntBot - run:535: 💾 Database saved +2025-09-23 20:12:39,766 [INFO ] DuckHuntBot - _close_connection:559: 🔌 IRC connection closed +2025-09-23 20:12:39,766 [INFO ] DuckHuntBot - run:542: ✅ Bot shutdown complete diff --git a/messages.json b/messages.json index c0fda3e..90a296f 100644 --- a/messages.json +++ b/messages.json @@ -9,6 +9,7 @@ "bang_miss": "{nick} > {red}*BANG*{reset} You missed the {cyan}duck{reset}!", "bang_no_duck": "{nick} > {red}*BANG*{reset} What did you shoot at? There is {red}no duck{reset} in the area... [{red}GUN CONFISCATED{reset}]", "bang_no_ammo": "{nick} > {orange}*click*{reset} You're out of ammo! Use {blue}!reload{reset}", + "bang_gun_jammed": "{nick} > {red}*click*{reset} Your gun jammed! [{red}AMMO WASTED{reset}]", "bang_not_armed": "{nick} > You are {red}not armed{reset}.", "bef_success": "{nick} > {orange}*befriend*{reset} You befriended the duck! [{green}+{xp_gained} xp{reset}] [Ducks befriended: {bold}{ducks_befriended}{reset}]", "bef_failed": "{nick} > {pink}*gentle approach*{reset} The {cyan}duck{reset} doesn't trust you and {yellow}flies away{reset}...", diff --git a/shop.json b/shop.json index 251501c..75facc3 100644 --- a/shop.json +++ b/shop.json @@ -13,6 +13,21 @@ "description": "1 extra magazine", "type": "magazine", "amount": 1 + }, + "3": { + "name": "Sand", + "price": 10, + "description": "Throw sand in target's gun - increases jam chance by 15%", + "type": "sabotage_jam", + "amount": 15, + "target_required": true + }, + "4": { + "name": "Gun Brush", + "price": 20, + "description": "Clean your gun - decreases jam chance by 10%", + "type": "clean_gun", + "amount": -10 } } } \ No newline at end of file diff --git a/src/__pycache__/db.cpython-312.pyc b/src/__pycache__/db.cpython-312.pyc index 0a3ab5e..6dd9be3 100644 Binary files a/src/__pycache__/db.cpython-312.pyc and b/src/__pycache__/db.cpython-312.pyc differ diff --git a/src/__pycache__/duckhuntbot.cpython-312.pyc b/src/__pycache__/duckhuntbot.cpython-312.pyc index a69bc08..b7c3112 100644 Binary files a/src/__pycache__/duckhuntbot.cpython-312.pyc and b/src/__pycache__/duckhuntbot.cpython-312.pyc differ diff --git a/src/__pycache__/game.cpython-312.pyc b/src/__pycache__/game.cpython-312.pyc index 00635f8..bc0d237 100644 Binary files a/src/__pycache__/game.cpython-312.pyc and b/src/__pycache__/game.cpython-312.pyc differ diff --git a/src/db.py b/src/db.py index 821e600..94c9c9c 100644 --- a/src/db.py +++ b/src/db.py @@ -72,6 +72,8 @@ class DuckDB: player['inventory'] = {} if 'temporary_effects' not in player: player['temporary_effects'] = [] + if 'jam_chance' not in player: + player['jam_chance'] = 5 # Default 5% jam chance # Migrate from old ammo/chargers system to magazine system if 'magazines' not in player: @@ -106,6 +108,7 @@ class DuckDB: 'magazines': 3, # Total magazines (including current) 'bullets_per_magazine': 6, # Bullets per magazine 'accuracy': 65, + 'jam_chance': 5, # 5% base gun jamming chance 'gun_confiscated': False, 'inventory': {}, # {item_id: quantity} 'temporary_effects': [] # List of temporary effects diff --git a/src/duckhuntbot.py b/src/duckhuntbot.py index c86ca16..4ab37b5 100644 --- a/src/duckhuntbot.py +++ b/src/duckhuntbot.py @@ -133,7 +133,20 @@ class DuckHuntBot: async def handle_message(self, prefix, command, params, trailing): """Handle incoming IRC messages""" - if command == "001": # Welcome message + # Handle SASL-related messages + if command == "CAP": + await self.sasl_handler.handle_cap_response(params, trailing) + return + + elif command == "AUTHENTICATE": + await self.sasl_handler.handle_authenticate_response(params) + return + + elif command in ["903", "904", "905", "906", "907", "908"]: + await self.sasl_handler.handle_sasl_result(command, params, trailing) + return + + elif command == "001": # Welcome message self.registered = True self.logger.info("Successfully registered with IRC server") @@ -487,7 +500,12 @@ class DuckHuntBot: try: await self.connect() - await self.register_user() + + # Check if SASL should be used + if self.sasl_handler.should_authenticate(): + await self.sasl_handler.start_negotiation() + else: + await self.register_user() # Start game loops game_task = asyncio.create_task(self.game.start_game_loops()) diff --git a/src/game.py b/src/game.py index b1592de..0325207 100644 --- a/src/game.py +++ b/src/game.py @@ -125,6 +125,18 @@ class DuckGame: 'message_args': {'nick': nick} } + # Check for gun jamming + jam_chance = player.get('jam_chance', 5) / 100.0 # Convert percentage to decimal + if random.random() < jam_chance: + # Gun jammed! Use ammo but don't shoot + player['current_ammo'] = player.get('current_ammo', 1) - 1 + self.db.save_database() + return { + 'success': False, + 'message_key': 'bang_gun_jammed', + 'message_args': {'nick': nick} + } + # Check for duck if channel not in self.ducks or not self.ducks[channel]: # Wild shot - gun confiscated diff --git a/src/shop.py b/src/shop.py index 3169631..a6163c5 100644 --- a/src/shop.py +++ b/src/shop.py @@ -313,6 +313,18 @@ class ShopManager: "remaining": player['ammo'] } + elif item_type == 'clean_gun': + # Clean gun to reduce jamming chance (positive amount reduces jam chance) + current_jam = player.get('jam_chance', 5) # Default 5% jam chance + new_jam = max(current_jam + amount, 0) # amount is negative for cleaning + player['jam_chance'] = new_jam + + return { + "type": "clean_gun", + "reduced": current_jam - new_jam, + "new_total": new_jam + } + else: self.logger.warning(f"Unknown item type: {item_type}") return {"type": "unknown", "message": f"Unknown effect type: {item_type}"}