Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick updated to support towns other than hometown/fang cove settings #6729

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions pick.lic
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class Pick
@has_pick_waggle = @settings.waggle_sets['pick']

picking_data = get_data('picking').picking
@lockpick_costs = picking_data['lockpick_costs'][@settings.fang_cove_override_town || @settings.hometown]

@pick_identify_messages = picking_data['pick_messages_by_difficulty'];
@pick_retry = picking_data['pick_retry']
Expand Down Expand Up @@ -103,6 +102,8 @@ class Pick

@picking_room_id = Room.current.id

@refill_town = @settings.refill_town

if @debug
echo "Settings..."
echo "- Sources: #{@sources}"
Expand Down Expand Up @@ -133,6 +134,12 @@ class Pick
echo "- assumed_difficulty: #{@assumed_difficulty}"
end

if @settings.refill_town
@lockpick_costs = picking_data['lockpick_costs'][@settings.refill_town]
else
@lockpick_costs = picking_data['lockpick_costs'][@settings.fang_cove_override_town || @settings.hometown]
end
MahtraDR marked this conversation as resolved.
Show resolved Hide resolved
Nyt3 marked this conversation as resolved.
Show resolved Hide resolved

if args.refill
refill_ring
elsif stop_picking?
Expand Down Expand Up @@ -318,8 +325,17 @@ class Pick
return
end

DRCM.ensure_copper_on_hand(cost * lockpicks_needed, @settings)
DRCT.refill_lockpick_container(@settings.lockpick_type, @settings.fang_cove_override_town || @settings.hometown, @lockpick_container, lockpicks_needed)
if @refill_town
DRCM.ensure_copper_on_hand(cost * lockpicks_needed, @settings, @refill_town)
else
DRCM.ensure_copper_on_hand(cost * lockpicks_needed, @settings)
end

if @refill_town
DRCT.refill_lockpick_container(@settings.lockpick_type, @refill_town, @lockpick_container, lockpicks_needed)
else
DRCT.refill_lockpick_container(@settings.lockpick_type, @settings.fang_cove_override_town || @settings.hometown, @lockpick_container, lockpicks_needed)
end
end

def attempt_open(box_noun)
Expand Down
Loading