From dd0f1fa9ed4c05f33a96612d3568a63c1c41b0f9 Mon Sep 17 00:00:00 2001 From: mikejc Date: Wed, 31 Jul 2024 09:50:22 -0400 Subject: [PATCH] pilgrimage.lic only --- pilgrimage.lic | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pilgrimage.lic b/pilgrimage.lic index 608516a27f..5fa25c1d31 100644 --- a/pilgrimage.lic +++ b/pilgrimage.lic @@ -6,8 +6,24 @@ custom_require.call(%w[common common-items common-money common-travel]) class Pilgrimage def initialize + arg_definitions = [ + [ + { name: 'town', options: $HOMETOWN_LIST, optional: true, description: 'Town to look for shrines in.' } + ] + ] + args = parse_args(arg_definitions) + + town_override = DRC.get_town_name(args.town) + + if args.town && !town_override + DRC.message("Could not identify town for argument: #{args.town}") + DRC.message("To avoid ambiguity, please use the town's full name: https://elanthipedia.play.net/Category:Cities") + exit + end + @settings = get_settings - hometown = @settings.hometown + hometown = town_override || @settings.hometown + buy_badge(hometown) visited = visited_shrines