Skip to content

Commit 34d7cc6

Browse files
MahtraDRclaude
andauthored
[script][combat-trainer] Fix bundle tap regex for bundling rope (#7377)
## Summary - The `tap my bundle` regex `You tap a \w+ bundle that you are wearing` failed to match bundles using a braided bundling rope, which produce output like `You tap a lumpy bundle bound by a braided bundling rope that you are wearing` - Loosened the regex to `You tap a \w+ bundle\b.*that you are wearing` to bridge any descriptive clause between the adjective and "that you are wearing" - Added spec coverage for the bundling rope variant ## Test plan - [x] Existing `#check_skinning` specs pass (new bundling rope context + all prior contexts) - [ ] In-game verification with a braided bundling rope bundle 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f6954e4 commit 34d7cc6

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

combat-trainer.lic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ class LootProcess
11531153
return unless game_state.skinnable?(mob_noun)
11541154

11551155
if game_state.need_bundle
1156-
case DRC.bput('tap my bundle', 'You tap a \w+ bundle that you are wearing', 'I could not find what you were referring to', 'You tap a tight bundle inside')
1156+
case DRC.bput('tap my bundle', 'You tap a \w+ bundle\b.*that you are wearing', 'I could not find what you were referring to', 'You tap a tight bundle inside')
11571157
when /lumpy/
11581158
if @tie_bundle
11591159
lowered_item = nil

spec/combat_trainer_spec.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,38 @@ def run_execute(instance, game_state)
403403
end
404404
end
405405

406+
context 'when need_bundle is true, bundle is lumpy with bundling rope, and both hands are full' do
407+
let(:game_state) { build_game_state(need_bundle: true) }
408+
409+
before(:each) do
410+
$right_hand = 'bastard sword'
411+
$left_hand = 'javelin'
412+
413+
# tap: lumpy bundle with extra description from bundling rope
414+
allow(DRC).to receive(:bput)
415+
.with('tap my bundle', anything, anything, anything)
416+
.and_return('You tap a lumpy bundle bound by a braided bundling rope that you are wearing')
417+
allow(DRC).to receive(:bput)
418+
.with('tie my bundle', 'TIE the bundle again', 'But this bundle has already been tied off')
419+
.and_return('TIE the bundle again')
420+
allow(DRC).to receive(:bput)
421+
.with('tie my bundle', 'you tie the bundle', 'But this bundle has already been tied off', "You don't seem to be able to do that right now")
422+
.and_return('you tie the bundle')
423+
allow(DRC).to receive(:bput)
424+
.with('adjust my bundle', /^You adjust your .*/, /You'll need a free hand for that/)
425+
.and_return('You adjust your lumpy bundle so that you can more easily')
426+
allow(DRC).to receive(:bput)
427+
.with('skin', anything, anything, anything, anything, anything, anything, anything)
428+
.and_return('roundtime')
429+
430+
instance = build_loot_process(tie_bundle: true, skin: true)
431+
instance.send(:check_skinning, 'kobold', game_state)
432+
end
433+
434+
include_examples 'frees a hand before tying the bundle'
435+
include_examples 'clears need_bundle on game_state'
436+
end
437+
406438
context 'when need_bundle is true and bundle is tight (already tied)' do
407439
let(:game_state) { build_game_state(need_bundle: true) }
408440

0 commit comments

Comments
 (0)