From ffdc8a7e9715aff8a5f83286bcd31a9369344954 Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:20:07 +1300 Subject: [PATCH 1/4] [scripts][common-items] Add flag for full pouch instead of line matching This prevents the case where the pouch is full as we fill it. --- common-items.lic | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common-items.lic b/common-items.lic index 527c55e50c..de9818ae3d 100644 --- a/common-items.lic +++ b/common-items.lic @@ -5,7 +5,7 @@ # This module should be 'bottom-level' and only depend on common. # Any modules that deal with items and should be somewhere else -custom_require.call(%w[common]) +custom_require.call(%w[common events]) module DRCI module_function @@ -63,7 +63,6 @@ module DRCI ] GET_ITEM_SUCCESS_PATTERNS = [ - /you draw/i, /^You get/, /^You pick/, /^You pluck/, @@ -1163,6 +1162,7 @@ module DRCI end def fill_gem_pouch_with_container(gem_pouch_adjective, gem_pouch_noun, source_container, full_pouch_container = nil, spare_gem_pouch_container = nil, should_tie_gem_pouches = false) + Flags.add("pouch-full", /is too full to fit any more/) case DRC.bput("fill my #{gem_pouch_adjective} #{gem_pouch_noun} with my #{source_container}", /^You open/, /is too full to fit/, @@ -1171,13 +1171,6 @@ module DRCI 'What were you referring to', "There aren't any gems", 'You fill your') - when /is too full to fit/ - unless swap_out_full_gempouch?(gem_pouch_adjective, gem_pouch_noun, full_pouch_container, spare_gem_pouch_container, should_tie_gem_pouches) - DRC.message("Could not swap gem pouches.") - return - end - fill_gem_pouch_with_container(gem_pouch_adjective, gem_pouch_noun, source_container, full_pouch_container, spare_gem_pouch_container, should_tie_gem_pouches) - tie_gem_pouch(gem_pouch_adjective, gem_pouch_noun) if should_tie_gem_pouches when /^You'd better tie it up before putting/, /You'll need to tie it up before/ # This is equivalent to a full pouch, unless we should tie pouches, in which case we tie and retry unless should_tie_gem_pouches @@ -1190,5 +1183,14 @@ module DRCI tie_gem_pouch(gem_pouch_adjective, gem_pouch_noun) if should_tie_gem_pouches fill_gem_pouch_with_container(gem_pouch_adjective, gem_pouch_noun, source_container, full_pouch_container, spare_gem_pouch_container, should_tie_gem_pouches) end + if Flags["pouch-full"] + unless swap_out_full_gempouch?(gem_pouch_adjective, gem_pouch_noun, full_pouch_container, spare_gem_pouch_container, should_tie_gem_pouches) + DRC.message("Could not swap gem pouches.") + return + end + fill_gem_pouch_with_container(gem_pouch_adjective, gem_pouch_noun, source_container, full_pouch_container, spare_gem_pouch_container, should_tie_gem_pouches) + tie_gem_pouch(gem_pouch_adjective, gem_pouch_noun) if should_tie_gem_pouches + Flags.reset("pouch-full") + end end end From 2bc864244c57965f83ab27b1f0ec47699c754bba Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:38:18 +1300 Subject: [PATCH 2/4] Update common-items.lic --- common-items.lic | 1 + 1 file changed, 1 insertion(+) diff --git a/common-items.lic b/common-items.lic index de9818ae3d..9e1d9dd0fc 100644 --- a/common-items.lic +++ b/common-items.lic @@ -63,6 +63,7 @@ module DRCI ] GET_ITEM_SUCCESS_PATTERNS = [ + /^You draw/, /^You get/, /^You pick/, /^You pluck/, From 0a2066eba9c561852c7984409ea5193d1a04f5b3 Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:38:50 +1300 Subject: [PATCH 3/4] Update common-items.lic --- common-items.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-items.lic b/common-items.lic index 9e1d9dd0fc..8266791410 100644 --- a/common-items.lic +++ b/common-items.lic @@ -63,7 +63,7 @@ module DRCI ] GET_ITEM_SUCCESS_PATTERNS = [ - /^You draw/, + /you draw/, /^You get/, /^You pick/, /^You pluck/, From 4e62dc88fc4b8b7a9b24f8b4c83e5b3b47585162 Mon Sep 17 00:00:00 2001 From: MahtraDR <93822896+MahtraDR@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:39:07 +1300 Subject: [PATCH 4/4] Update common-items.lic --- common-items.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-items.lic b/common-items.lic index 8266791410..94f26ec1e3 100644 --- a/common-items.lic +++ b/common-items.lic @@ -63,7 +63,7 @@ module DRCI ] GET_ITEM_SUCCESS_PATTERNS = [ - /you draw/, + /you draw/i, /^You get/, /^You pick/, /^You pluck/,