diff --git a/alchemy.lic b/alchemy.lic index e9dd8a5ba6..7f6b8d60de 100644 --- a/alchemy.lic +++ b/alchemy.lic @@ -23,7 +23,7 @@ class Alchemy exit if args.craft && (args.forage || args.prepare) settings = get_settings - @hometown = settings.hometown + hometown = settings.force_crafting_town || settings.hometown @alchemy_herb_quantity = settings.alchemy_herb_quantity @alchemy_herb_storage = settings.alchemy_herb_storage @herb_container = settings.herb_container @@ -36,10 +36,10 @@ class Alchemy ingredient = get_data('ingredients').ingredients.find { |each_ingredient| each_ingredient['name'] =~ /#{args.target}/i } unless args.craft # Set town for foraging - @forage_location = ingredient[@forage_override_room] || @forage_override_room || ingredient[@hometown] + @forage_location = ingredient[@forage_override_room] || @forage_override_room || ingredient[hometown] echo("@forage_location = #{@forage_location}") if @debug # Set press and grinder location - @press_location = @forage_override_town || @hometown + @press_location = @forage_override_town || hometown echo("@press_location = #{@press_location}") if @debug # Forage call section forage_ingredient(ingredient) if args.forage diff --git a/arrows.lic b/arrows.lic index 72bde06faa..0d38449fa6 100644 --- a/arrows.lic +++ b/arrows.lic @@ -10,7 +10,7 @@ class Arrows @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container @belt = @settings.engineering_belt - @hometown = @settings.hometown + @hometown = @settings.force_crafting_town || @settings.hometown @engineering_room = @settings.engineering_room @hometown_data = get_data('crafting')['shaping'][@hometown] @@ -48,7 +48,7 @@ class Arrows @lumber = args.lumber @tools = args.tools - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) get_tools if @tools order_lumber check_flights diff --git a/bolts.lic b/bolts.lic index 11eb9b4b77..b884b7609e 100644 --- a/bolts.lic +++ b/bolts.lic @@ -12,7 +12,7 @@ class Bolts @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container @belt = @settings.engineering_belt - @hometown = @settings.hometown + @hometown = @settings.force_crafting_town || @settings.hometown @engineering_room = @settings.engineering_room @hometown_data = get_data('crafting')['shaping'][@hometown] @@ -50,7 +50,7 @@ class Bolts @lumber = args.lumber @tools = args.tools - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) DRC.wait_for_script_to_complete('clerk-tools', ['engineering', 'get']) unless DRCI.exists?('shaper') if @tools order_lumber check_flights diff --git a/clean-leather.lic b/clean-leather.lic index 0a5c528599..18eb17fb11 100644 --- a/clean-leather.lic +++ b/clean-leather.lic @@ -26,6 +26,7 @@ class CleanLeather @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container @belt = @settings.outfitting_belt + @hometown = @settings.force_crafting_town || @settings.hometown engineering_room = @settings.engineering_room outfitting_room = @settings.outfitting_room @@ -38,12 +39,12 @@ class CleanLeather # Set the proper stock rooms, preservative, and order number depending on whether we're # cleaning hides or bones. if args.hide =~ /^bones?$/i - @stock_room = get_data('crafting')['shaping'][@settings.hometown]['tool-room'] + @stock_room = get_data('crafting')['shaping'][@hometown]['tool-room'] @room = engineering_room @preservative = 'bleaching solution' @order_number = '7' else - @stock_room = get_data('crafting')['tailoring'][@settings.hometown]['tool-room'] + @stock_room = get_data('crafting')['tailoring'][@hometown]['tool-room'] @room = outfitting_room @preservative = 'tanning lotion' @order_number = '8' @@ -100,7 +101,7 @@ class CleanLeather # If we lack doses to complete the job, purchase what is required before starting our project bottles_to_purchase = ((required_doses - on_hand.to_f) / 30).ceil - DRCM.ensure_copper_on_hand(625 * bottles_to_purchase, @settings) + DRCM.ensure_copper_on_hand(625 * bottles_to_purchase, @settings, @hometown) bottles_to_purchase.times do DRCT.order_item(@stock_room, @order_number) DRCI.put_away_item?(@preservative, @bag) diff --git a/clerk-tools.lic b/clerk-tools.lic index 16ee356faa..4c006d701a 100644 --- a/clerk-tools.lic +++ b/clerk-tools.lic @@ -12,7 +12,7 @@ class Clerk action = args.action settings = get_settings - hometown = settings.hometown + hometown = settings.force_crafting_town || settings.hometown @bag = settings.crafting_container crafting_data = get_data('crafting') diff --git a/craft.lic b/craft.lic index 481dd866e3..371802cf23 100644 --- a/craft.lic +++ b/craft.lic @@ -14,7 +14,7 @@ class Craft args = parse_args(arg_definitions) @settings = get_settings - @hometown = @settings.hometown + @hometown = @settings.force_crafting_town || @settings.hometown @worn_trashcan = @settings.worn_trashcan @worn_trashcan_verb = @settings.worn_trashcan_verb @training_room = (@settings.training_rooms || [@settings.safe_room]).sample @@ -163,7 +163,7 @@ class Craft if rank <= 25 # Tier 1 Extremely Easy # Buy red flowers and nemoih root recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some blister cream/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb2_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) @@ -174,7 +174,7 @@ class Craft elsif rank <= 50 # Tier 2 - Very Easy # Buy red flowers and plovik leaf recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some moisturizing ointment/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb2_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) @@ -185,7 +185,7 @@ class Craft elsif rank <= 100 # Tier 3 - Easy # Buy plovik leaves recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some chest salve/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -195,7 +195,7 @@ class Craft elsif rank <= 175 # Tier 4 - Simple # Buy riolur leaves recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a neck potion/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -205,7 +205,7 @@ class Craft elsif rank <= 300 # Tier 5 - Basic # Buy jadice flower recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some limb salve/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -215,7 +215,7 @@ class Craft elsif rank <= 425 # Tier 6 - Somewhat Challenging # Buy plovik leaves recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some chest unguent/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -225,7 +225,7 @@ class Craft elsif rank <= 550 # Tier 7 - Challenging # Buy riolur leaves recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some neck tonic/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -235,7 +235,7 @@ class Craft elsif rank <= 700 # Tier 8 - Complicated # Buy aevaes leaves recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some eye tonic/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -245,7 +245,7 @@ class Craft elsif rank <= 850 # Tier 9 - Intricate # Buy ojhenik root recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a body elixir/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) DRCC.stow_crafting_item(DRC.left_hand, @bag, @belt) @@ -255,7 +255,7 @@ class Craft elsif rank <= 1175 # Tier 10 - Difficult # Forage belradi moss recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a general elixir/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRC.wait_for_script_to_complete('alchemy', ['belradi', 'forage', '25']) DRC.wait_for_script_to_complete('alchemy', ['belradi', 'prepare']) DRCC.stow_crafting_item(DRC.right_hand, @bag, @belt) @@ -266,7 +266,7 @@ class Craft elsif rank <= 1400 # Tier 11 Very Difficult # Forage blue flowers and belradi moss recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some refreshment elixir/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRC.wait_for_script_to_complete('alchemy', ['blue', 'forage', '25']) DRC.wait_for_script_to_complete('alchemy', ['belradi', 'forage', '5']) DRC.wait_for_script_to_complete('alchemy', ['blue', 'prepare']) @@ -279,7 +279,7 @@ class Craft else # Tier 12 - Extremely Difficult # Buy red flowers and forage dioica sap recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /some vigor poultices/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) DRCT.order_item(crafting_data['remedies'][@hometown]['stock-room'], recipe['herb1_stock']) DRC.wait_for_script_to_complete('alchemy', ['dioica', 'forage', '5']) DRC.wait_for_script_to_complete('alchemy', ['dioica', 'prepare']) @@ -301,7 +301,7 @@ class Craft if rank <= 25 # Tier 1 Extremely Easy # Buy an abolition sigil and bone totem for Radiant Trinket recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a radiant trinket/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -328,7 +328,7 @@ class Craft elsif rank <= 50 # Tier 2 - Very Easy # Buy an induction sigil and bone totem for Flash Trinket recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a flash trinket/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -355,7 +355,7 @@ class Craft elsif rank <= 100 # Tier 3 - Easy # Buy an rarefaction sigil and bone totem for Wind Trinket recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a wind trinket/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -382,7 +382,7 @@ class Craft elsif rank <= 175 # Tier 4 - Simple # Buy an permutation sigil and bone totem fo Earth Trinket recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /an earth trinket/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -409,7 +409,7 @@ class Craft elsif rank <= 300 # Tier 5 - Basic # Buy an abolition and congruence sigils and bone totem for Basic Holy Ritual focus recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /basic holy ritual focus/ } - DRCM.ensure_copper_on_hand(2000, @settings) + DRCM.ensure_copper_on_hand(2000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -441,7 +441,7 @@ class Craft elsif rank <= 425 # Tier 6 - Somewhat Challenging # Buy a permutation and rarefaction sigils and basic runestone for Strange Arrow recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /strange arrow runestone/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -473,7 +473,7 @@ class Craft elsif rank <= 550 # Tier 7 - Challenging # Buy a abolition and induction sigils and basic runestone for Gauge Flow recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /gauge flow runestone/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) # Check for first sigil. Purcahse if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -505,7 +505,7 @@ class Craft elsif rank <= 700 # Tier 8 - Complicated # Buy a rarefaction and induction sigils and basic runestone for Dispel recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /dispel runestone/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -537,7 +537,7 @@ class Craft elsif rank <= 850 # Tier 9 - Intricate # Buy a induction and rarefaction sigils and basic runestone for Lay Ward recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /lay ward runestone/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -568,7 +568,7 @@ class Craft DRCI.dispose_trash('runestone', @worn_trashcan, @worn_trashcan_verb) elsif rank <= 1175 # Tier 10 - Difficult - Need to use sigilhunter or similar to gather the sigils for Frost Focus recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /a frost focus/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -608,7 +608,7 @@ class Craft DRCI.dispose_trash('totem', @worn_trashcan, @worn_trashcan_verb) else # Tier 11 Very Difficult - Need to use sigilhunter or similar to gather the sigils for Electric Focus recipe = get_data('recipes').crafting_recipes.find { |each_recipe| each_recipe['name'] =~ /an electric focus/ } - DRCM.ensure_copper_on_hand(4000, @settings) + DRCM.ensure_copper_on_hand(4000, @settings, @hometown) # Check for first sigil. Purchase if required. tally += 1 if !DRCC.check_for_existing_sigil?(recipe['enchant_stock1_name'], recipe['enchant_stock1'], quantity, @bag, @belt, stock_room) @@ -650,7 +650,7 @@ class Craft end def money_for_training?(amount, skill) - if DRCM.ensure_copper_on_hand(amount, @settings) + if DRCM.ensure_copper_on_hand(amount, @settings, @hometown) true else echo("Low on funds, removing #{skill} from training") @@ -712,7 +712,7 @@ class Craft def buy_yarn(skipcoin = false) crafting_data = get_data('crafting') - DRCM.ensure_copper_on_hand(3000, @settings) unless skipcoin + DRCM.ensure_copper_on_hand(3000, @settings, @hometown) unless skipcoin DRCT.order_item(crafting_data['tailoring'][@hometown]['stock-room'], 13) DRC.bput('combine my yarn', 'You combine', 'You must be holding both') count = DRC.bput('count my yarn', 'You count out \d+ yards').scan(/\d+/).first.to_i @@ -722,7 +722,7 @@ class Craft def buy_thread(skipcoin = false) crafting_data = get_data('crafting') - DRCM.ensure_copper_on_hand(1000, @settings) unless skipcoin + DRCM.ensure_copper_on_hand(1000, @settings, @hometown) unless skipcoin DRCT.order_item(crafting_data['tailoring'][@hometown]['stock-room'], 6) DRCC.stow_crafting_item('thread', @bag, @belt) end diff --git a/makesteel.lic b/makesteel.lic index e1b3b266c0..795455d79a 100644 --- a/makesteel.lic +++ b/makesteel.lic @@ -18,9 +18,10 @@ class MakeSteel total_count = args.count.to_i type = args.type || 'h' @settings = get_settings - @stock_room = get_data('crafting')['blacksmithing'][@settings.hometown]['stock-room'] + @hometown = @settings.force_crafting_town || @settings.hometown + @stock_room = get_data('crafting')['blacksmithing'][@hometown]['stock-room'] - DRCM.ensure_copper_on_hand(2000 * total_count, @settings) + DRCM.ensure_copper_on_hand(2000 * total_count, @settings, @hometown) smelt_ingot(total_count, type) @@ -28,8 +29,8 @@ class MakeSteel end def refine - DRCT.order_item(get_data('crafting')['blacksmithing'][@settings.hometown]['finisher-room'], 9) unless DRCI.exists?('flux') - DRCC.find_empty_crucible(@settings.hometown) + DRCT.order_item(get_data('crafting')['blacksmithing'][@hometown]['finisher-room'], 9) unless DRCI.exists?('flux') + DRCC.find_empty_crucible(@hometown) DRCI.get_item('steel ingot') DRC.bput('put my steel ingot in crucible', /You put your.*in the.*crucible\./) DRC.wait_for_script_to_complete('smelt', ['refine']) @@ -44,7 +45,7 @@ class MakeSteel order_stow(2) if type == 'h' end - DRCC.find_empty_crucible(@settings.hometown) + DRCC.find_empty_crucible(@hometown) multiplier = case type when 'l' diff --git a/sew.lic b/sew.lic index e51d3180c3..0e7afec7d3 100644 --- a/sew.lic +++ b/sew.lic @@ -7,6 +7,7 @@ custom_require.call(%w[common common-arcana common-crafting common-items common- class Sew def initialize @settings = get_settings + @hometown = @settings.force_crafting_town || @settings.hometown @worn_trashcan = @settings.worn_trashcan @worn_trashcan_verb = @settings.worn_trashcan_verb @bag = @settings.crafting_container @@ -54,7 +55,7 @@ class Sew @knit = args.knit @mat_type = args.material @chapter = args.chapter.nil? ? 1 : args.chapter.to_i # chapter 5 for enhancements - @info = get_data('crafting')['tailoring'][@settings.hometown] + @info = get_data('crafting')['tailoring'][@hometown] @instructions = args.instructions @cloth = %w[silk wool burlap cotton felt linen electroweave steelsilk arzumodine bourde dergatine dragonar faeweave farandine imperial jaspe khaddar ruazin titanese zenganne] diff --git a/shape.lic b/shape.lic index 3cf6ae1b6a..21a39ca883 100644 --- a/shape.lic +++ b/shape.lic @@ -7,6 +7,7 @@ custom_require.call(%w[common common-arcana common-crafting common-items events] class Shape def initialize @settings = get_settings + @hometown = @settings.force_crafting_town || @settings.hometown @worn_trashcan = @settings.worn_trashcan @worn_trashcan_verb = @settings.worn_trashcan_verb @bag = @settings.crafting_container @@ -52,7 +53,7 @@ class Shape @instruction = args.instructions @material = args.material @chapter = args.chapter == nil ? 6 : args.chapter.to_i - @info = get_data('crafting')['shaping'][@settings.hometown] + @info = get_data('crafting')['shaping'][@hometown] DRC.wait_for_script_to_complete('buff', ['shape']) Flags.add('shaping-assembly', 'appears ready to be reinforced with some (backer)', 'appears ready to be strengthened with some leather (strips)', 'assembly with the (backing) material can begin', 'You need another bone, wood or horn (backing) material', 'another finished bow (string)', 'another finished (long|short) wooden (pole)', 'another finished (leather strips)', 'another .* (long|short) leather (cord)', 'You must assemble the (backer)', 'You must assemble the (strips)', 'another (arrow flights)', 'another (.* arrowheads)') diff --git a/smith.lic b/smith.lic index 7e22ad9426..365c78466f 100644 --- a/smith.lic +++ b/smith.lic @@ -24,19 +24,19 @@ class Smith args = parse_args(arg_definitions) @settings = get_settings + @hometown = @settings.force_crafting_town || @settings.hometown @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container @belt = @settings.forging_belt - discipline = get_data('crafting')['blacksmithing'][@settings.hometown] + discipline = get_data('crafting')['blacksmithing'][@hometown] workorders_materials = @settings.workorders_materials @materials_info = get_data('crafting')['stock'][workorders_materials['metal_type']] - @hometown = @settings.hometown @container = get_settings.crafting_container recipes = get_data('recipes').crafting_recipes.select { |recipe| recipe['type'] =~ /blacksmithing|weaponsmithing|armorsmithing/i } recipe = DRCC.recipe_lookup(recipes, args.item_name) return unless recipe - DRCM.ensure_copper_on_hand(3000, @settings) unless args.here + DRCM.ensure_copper_on_hand(3000, @settings, @hometown) unless args.here parts = recipe['part'] || [] parts << "leather strip" if args.reinforce # adds part to the list for reinforce diff --git a/spin.lic b/spin.lic index 794b1dc71f..be1aca1e13 100644 --- a/spin.lic +++ b/spin.lic @@ -24,13 +24,14 @@ class Spin data = mat_data[args.material] @settings = get_settings + @hometown = @settings.force_crafting_town || @settings.hometown @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container @belt = @settings.outfitting_belt - DRCM.ensure_copper_on_hand(data[:cost] * data[:count], @settings) + DRCM.ensure_copper_on_hand(data[:cost] * data[:count], @settings, @hometown) data[:count].times do |index| - stock_room = get_data('crafting')['tailoring'][@settings.hometown]['stock-room'] + stock_room = get_data('crafting')['tailoring'][@hometown]['stock-room'] DRCT.order_item(stock_room, data[:index]) if index == 0 && data[:name] == 'silk' DRC.bput('mark my fibers at 10', /mark it for cutting/) @@ -44,7 +45,7 @@ class Spin end end - until DRCC.find_wheel(@settings.hometown) + until DRCC.find_wheel(@hometown) move('go door') pause 30 end diff --git a/tinker.lic b/tinker.lic index d8d5cc4dee..ec124b5f45 100644 --- a/tinker.lic +++ b/tinker.lic @@ -7,12 +7,12 @@ custom_require.call(%w[common common-arcana common-crafting common-items]) class Tinker def initialize @settings = get_settings + @hometown = @settings.force_crafting_town || @settings.hometown @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container @belt = @settings.engineering_belt @cube = @settings.cube_armor_piece @engineering_belt = @settings.engineering_belt - @hometown = @settings.hometown @stamp = @settings.mark_crafted_goods @adjustable_tongs = @settings.adjustable_tongs diff --git a/workorders.lic b/workorders.lic index c7011cea86..bb55721430 100644 --- a/workorders.lic +++ b/workorders.lic @@ -26,7 +26,7 @@ class WorkOrders @recipe_parts = crafting_data['recipe_parts'] @bag = @settings.crafting_container @bag_items = @settings.crafting_items_in_container - @hometown = @settings.hometown + @hometown = @settings.force_crafting_town || @settings.hometown @use_own_ingot_type = @settings.use_own_ingot_type @deed_own_ingot = @settings.deed_own_ingot deeds_data = get_data('crafting').deeds[@hometown] @@ -182,7 +182,7 @@ class WorkOrders def repair_items(info, tools) if @settings.workorders_repair_own_tools current = Room.current.id - DRCM.ensure_copper_on_hand(1500, @settings) + DRCM.ensure_copper_on_hand(1500, @settings, @hometown) DRCT.walk_to(current) DRCC.repair_own_tools(get_data('crafting')['blacksmithing'][@hometown], tools, @bag, @bag_items, @belt) return @@ -226,7 +226,7 @@ class WorkOrders end def carve_items(info, materials_info, item, quantity) - DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings, @hometown) recipe, items_per_stock, spare_stock, scrap = find_recipe(materials_info, item, quantity) material_noun = %w[deed pebble stone rock rock boulder] material_volume = 0 @@ -300,7 +300,7 @@ class WorkOrders end def shape_items(info, materials_info, item, quantity) - DRCM.ensure_copper_on_hand(@cash_on_hand || 10_000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 10_000, @settings, @hometown) recipe, items_per_stock, spare_stock, scrap = find_recipe(materials_info, item, quantity) quantity.times do |count| @@ -388,7 +388,7 @@ class WorkOrders end def sew_items(info, materials_info, recipe, quantity) - DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings, @hometown) existing = if DRC.bput("get #{materials_info['stock-name']} cloth from my #{@bag}", 'What were', 'You get') == 'What were' 0 @@ -417,7 +417,7 @@ class WorkOrders end def knit_items(info, materials_info, recipe, quantity) - DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings, @hometown) existing = if DRC.bput("get yarn from my #{@bag}", 'What were', 'You get') == 'What were' 0 @@ -540,7 +540,7 @@ class WorkOrders end def remedy_items(info, _materials_info, recipe, quantity) - DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings, @hometown) herb2_needed = '' # Herb #1 @@ -602,7 +602,7 @@ class WorkOrders info['trash-room'] = nil if @worn_trashcan && @worn_trashcan_verb - DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 5000, @settings, @hometown) quantity.times do if remaining_volume < recipe['volume'] @@ -690,7 +690,7 @@ class WorkOrders return unless @deed_own_ingot unless DRC.bput('look my deed packet', /You count \d+ deed claim forms remaining/, /I could not find what you were referring to/) =~ /You count \d+ deed claim forms remaining/ - DRCM.ensure_copper_on_hand(@cash_on_hand || 10_000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 10_000, @settings, @hometown) DRCT.order_item(@deeds_room, @deeds_number) fput('stow my packet') end @@ -706,7 +706,7 @@ class WorkOrders sigil_quantity = quantity - DRCM.ensure_copper_on_hand(@cash_on_hand || 20_000, @settings) + DRCM.ensure_copper_on_hand(@cash_on_hand || 20_000, @settings, @hometown) # Enchant Sigil #1 # Need to check if nil so we can check for all sigils. Some recipes only use ones # Tally is used to exit if 1 exists but will allow user to see which sigils they need to hunt.