From 6632d67da4ce6e92a7637821c5651deb299b4dbe Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Thu, 2 Apr 2026 22:39:07 -0700 Subject: [PATCH] nerf: probability gates on wound and flee transitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Healthy → wounded: 50% per clean run (avg ~2 runs, was instant) Wounded → fled: 35% per clean run (avg ~3 runs, was instant) Combined expected clean runs before auto-resolve: ~5, giving the user a realistic window to type /buddymon catch between tool calls. --- hooks-handlers/post-tool-use.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hooks-handlers/post-tool-use.py b/hooks-handlers/post-tool-use.py index ae2bd1d..ad48c04 100755 --- a/hooks-handlers/post-tool-use.py +++ b/hooks-handlers/post-tool-use.py @@ -432,20 +432,24 @@ def main(): if existing: # On a clean Bash run (monster patterns gone), respect catch_pending, # wound a healthy monster, or auto-resolve a wounded one. + # Probability gates prevent back-to-back Bash runs from instantly + # resolving encounters before the user can react. if output and not encounter_still_present(existing, output, catalog): if existing.get("catch_pending"): # User invoked /buddymon catch — hold the monster for them pass elif existing.get("wounded"): - # Already wounded on last clean run — auto-resolve (it fled) - xp, display = auto_resolve_encounter(existing, buddy_id) - messages.append( - f"\nšŸ’Ø **{display} fled!** (escaped while wounded)\n" - f" {buddy_display} gets partial XP: +{xp}\n" - ) + # Wounded: 35% chance to flee per clean run (avg ~3 runs to escape) + if random.random() < 0.35: + xp, display = auto_resolve_encounter(existing, buddy_id) + messages.append( + f"\nšŸ’Ø **{display} fled!** (escaped while wounded)\n" + f" {buddy_display} gets partial XP: +{xp}\n" + ) else: - # First clean run — wound it and re-announce so user can catch - wound_encounter() + # Healthy: 50% chance to wound per clean run (avg ~2 runs to wound) + if random.random() < 0.50: + wound_encounter() # else: monster still present, no message — don't spam every tool call elif output or command: # No active encounter — check for bug monster first, then event encounters