From 90b604ba72c5d57e64d954546fe440b203fe4823 Mon Sep 17 00:00:00 2001 From: 3nd3r Date: Sun, 28 Dec 2025 16:51:26 -0600 Subject: [PATCH] Add force_spawn_duck for admin ducklaunch - fixes missing method error --- src/game.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/game.py b/src/game.py index f618fd2..ba6cfc2 100644 --- a/src/game.py +++ b/src/game.py @@ -165,6 +165,52 @@ class DuckGame: self.ducks[channel].append(duck) self.bot.send_message(channel, message) + async def force_spawn_duck(self, channel, duck_type='normal'): + """Force spawn a specific duck type (admin command)""" + if channel not in self.ducks: + self.ducks[channel] = [] + + # Validate duck type + duck_type = (duck_type or 'normal').lower() + if duck_type not in ['normal', 'golden', 'fast']: + duck_type = 'normal' + + # Create the specified duck type + if duck_type == 'golden': + min_hp = self.bot.get_config('golden_duck_min_hp', 3) + max_hp = self.bot.get_config('golden_duck_max_hp', 5) + hp = random.randint(min_hp, max_hp) + duck = { + 'id': f"golden_duck_{int(time.time())}_{random.randint(1000, 9999)}", + 'spawn_time': time.time(), + 'channel': channel, + 'duck_type': 'golden', + 'max_hp': hp, + 'current_hp': hp + } + elif duck_type == 'fast': + duck = { + 'id': f"fast_duck_{int(time.time())}_{random.randint(1000, 9999)}", + 'spawn_time': time.time(), + 'channel': channel, + 'duck_type': 'fast', + 'max_hp': 1, + 'current_hp': 1 + } + else: # normal + duck = { + 'id': f"duck_{int(time.time())}_{random.randint(1000, 9999)}", + 'spawn_time': time.time(), + 'channel': channel, + 'duck_type': 'normal', + 'max_hp': 1, + 'current_hp': 1 + } + + self.ducks[channel].append(duck) + message = self.bot.messages.get('duck_spawn') + self.bot.send_message(channel, message) + def shoot_duck(self, nick, channel, player): """Handle shooting at a duck""" # Check if gun is confiscated