more fixes

This commit is contained in:
2025-09-23 20:20:06 +01:00
parent 0c8b4f9543
commit d6e64d5eab
11 changed files with 240 additions and 9 deletions

View File

@@ -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