diff --git a/common-items.lic b/common-items.lic index 527c55e50c..94f26ec1e3 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 @@ -1163,6 +1163,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 +1172,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 +1184,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